public void Update(HotDot hotdot, AbnormalityDuration abnormalityDuration, long firstHit, long lastHit) { LabelClass.Content = abnormalityDuration.InitialPlayerClass; var intervalEntity = lastHit - firstHit; // Console.WriteLine("f:"+firstHit+";l:"+lastHit+";i:"+intervalEntity); var second = abnormalityDuration.Duration(firstHit, lastHit); // Console.WriteLine(second); var interval = TimeSpan.FromSeconds(second); LabelAbnormalityDuration.Content = interval.ToString(@"mm\:ss"); if (intervalEntity == 0) { LabelAbnormalityDurationPercentage.Content = "0%"; } else { LabelAbnormalityDurationPercentage.Content = abnormalityDuration.Duration(firstHit, lastHit) * 100 / intervalEntity + "%"; } interval = TimeSpan.FromSeconds(intervalEntity); LabelInterval.Content = interval.ToString(@"mm\:ss"); LabelName.Content = hotdot.Name; LabelId.Content = hotdot.Id; }
public void Update(HotDot hotdot, AbnormalityDuration abnormalityDuration, long firstHit, long lastHit) { SkillIcon.Source = BasicTeraData.Instance.Icons.GetImage(hotdot.IconName); SkillIcon.ToolTip = string.IsNullOrEmpty(hotdot.ItemName) ? null : hotdot.ItemName; LabelClass.Content = LP.ResourceManager.GetString(abnormalityDuration.InitialPlayerClass.ToString(), LP.Culture); var intervalEntity = lastHit - firstHit; var ticks = abnormalityDuration.Duration(firstHit, lastHit); var interval = TimeSpan.FromTicks(ticks); LabelAbnormalityDuration.Content = interval.ToString(@"mm\:ss"); if (intervalEntity == 0) { LabelAbnormalityDurationPercentage.Content = "0%"; } else { LabelAbnormalityDurationPercentage.Content = abnormalityDuration.Duration(firstHit, lastHit) * 100 / intervalEntity + "%"; } interval = TimeSpan.FromTicks(intervalEntity); LabelInterval.Content = interval.ToString(@"mm\:ss"); LabelName.Content = hotdot.Name; LabelName.ToolTip = string.IsNullOrEmpty(hotdot.Tooltip) ? null : hotdot.Tooltip; LabelAbnormalityDurationPercentage.ToolTip = hotdot.Id; }
public void Update(HotDot hotdot, AbnormalityDuration abnormalityDuration, long firstHit, long lastHit) { SkillIcon.Source = BasicTeraData.Instance.Icons.GetImage(hotdot.IconName); SkillIcon.ToolTip = string.IsNullOrEmpty(hotdot.ItemName) ? null : hotdot.ItemName; LabelClass.Content = LP.ResourceManager.GetString(abnormalityDuration.InitialPlayerClass.ToString(),LP.Culture); var intervalEntity = lastHit - firstHit; var ticks = abnormalityDuration.Duration(firstHit, lastHit); var interval = TimeSpan.FromTicks(ticks); LabelAbnormalityDuration.Content = interval.ToString(@"mm\:ss"); if (intervalEntity == 0) { LabelAbnormalityDurationPercentage.Content = "0%"; } else { LabelAbnormalityDurationPercentage.Content = abnormalityDuration.Duration(firstHit, lastHit)*100/ intervalEntity + "%"; } interval = TimeSpan.FromTicks(intervalEntity); LabelInterval.Content = interval.ToString(@"mm\:ss"); LabelName.Content = hotdot.Name; LabelName.ToolTip = string.IsNullOrEmpty(hotdot.Tooltip) ? null : hotdot.Tooltip; LabelAbnormalityDurationPercentage.ToolTip = hotdot.Id; StacksDetailList.Items.Clear(); foreach (var stack in abnormalityDuration.Stacks(firstHit, lastHit)) { StacksDetailList.Items.Add(new EnduranceDebuffDetail(hotdot, stack, abnormalityDuration, firstHit, lastHit)); } }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (DesignerProperties.GetIsInDesignMode(this)) { return; } try { _context = (AbnormalityDuration)DataContext; } catch { return; } _context.PropertyChanged += buff_PropertyChanged; RenderTransform = new ScaleTransform(1, 1, .5, .5); BeginAnimation(OpacityProperty, new DoubleAnimation(0, 1, TimeSpan.FromMilliseconds(85))); if (_context.Abnormality.Infinity || _context.Duration == uint.MaxValue) { DurationLabel.Visibility = Visibility.Hidden; } if (_context.Duration != uint.MaxValue && _context.Animated) { AnimateCooldown(); } }
private void UserControl_Unloaded(object sender, RoutedEventArgs e) { if (_context == null) { return; } _context.Refreshed -= OnRefreshed; _context = null; }
private void UserControl_Unloaded(object sender, RoutedEventArgs e) { if (_context == null) { return; } _context.PropertyChanged -= buff_PropertyChanged; _context = null; }
public void Update(HotDot hotdot, AbnormalityDuration abnormalityDuration, long firstHit, long lastHit) { SkillIcon.ImageSource = BasicTeraData.Instance.Icons.GetImage(hotdot.IconName); SkillIconWrapper.ToolTip = string.IsNullOrEmpty(hotdot.ItemName) ? null : hotdot.ItemName; LabelClass.Content = LP.ResourceManager.GetString(abnormalityDuration.InitialPlayerClass.ToString(), LP.Culture); var intervalEntity = lastHit - firstHit; var ticks = abnormalityDuration.Duration(firstHit, lastHit); var interval = TimeSpan.FromTicks(ticks); LabelAbnormalityDuration.Content = interval.ToString(@"mm\:ss"); if (intervalEntity == 0) { LabelAbnormalityDurationPercentage.Content = "0%"; } else { LabelAbnormalityDurationPercentage.Content = abnormalityDuration.Duration(firstHit, lastHit) * 100 / intervalEntity + "%"; } interval = TimeSpan.FromTicks(intervalEntity); LabelInterval.Content = interval.ToString(@"mm\:ss"); LabelName.Content = hotdot.Name; LabelName.ToolTip = string.IsNullOrEmpty(hotdot.Tooltip) ? null : hotdot.Tooltip; LabelAbnormalityDurationPercentage.ToolTip = hotdot.Id; var count = 0; foreach (var stack in abnormalityDuration.Stacks(firstHit, lastHit)) { if (StacksDetailList.Items.Count > count) { ((EnduranceDebuffDetail)StacksDetailList.Items[count]).Update(hotdot, stack, abnormalityDuration, firstHit, lastHit); } else { StacksDetailList.Items.Add(new EnduranceDebuffDetail(hotdot, stack, abnormalityDuration, firstHit, lastHit)); } count++; } while (StacksDetailList.Items.Count > count + 1) { StacksDetailList.Items.RemoveAt(count + 1); } }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (DesignerProperties.GetIsInDesignMode(this)) { return; } if (!(DataContext is AbnormalityDuration ab)) { return; } _context = ab; _context.Refreshed += OnRefreshed; if (_context.Abnormality.Infinity || _context.Duration == uint.MaxValue) { DurationLabelRef.Visibility = Visibility.Hidden; } if (_context.Duration != uint.MaxValue && _context.Animated) { AnimateCooldown(); } BeginAnimation(OpacityProperty, new DoubleAnimation(0, 1, TimeSpan.FromMilliseconds(100))); }
public EnduranceDebuffDetail(HotDot hotdot, int stack, AbnormalityDuration abnormalityDuration, long firstHit, long lastHit) { InitializeComponent(); Update(hotdot, stack, abnormalityDuration, firstHit, lastHit); }
public EnduranceDebuffDetail(HotDot hotdot, int stack, AbnormalityDuration abnormalityDuration, long firstHit, long lastHit) { InitializeComponent(); Update(hotdot, stack, abnormalityDuration, firstHit, lastHit); }
public AbnormalityViewModel(AbnormalityDuration ab) { _ab = ab; }