private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(StatTracker.Factor))
     {
         _anim.To = _dc.Factor * 359.9;
         ExternalArc.BeginAnimation(Arc.EndAngleProperty, _anim);
         _isAnimating = true;
     }
 }
        private void OnRagnarokStarted(CooldownMode mode)
        {
            Running = true;
            var an = new DoubleAnimation(359.9, 0, TimeSpan.FromMilliseconds(_context.Buff.Duration));

            an.Completed += (s, ev) =>
            {
                Running = false;
            };
            ExternalArc.BeginAnimation(Arc.EndAngleProperty, an);
        }
 private void OnPropertyChanged(object?sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName != nameof(StatTracker.Factor))
     {
         return;
     }
     if (_dc != null)
     {
         _anim.To = _dc.Factor * 359.9;
         ExternalArc.BeginAnimation(Nostrum.Controls.Arc.EndAngleProperty, _anim);
     }
     _isAnimating = true;
 }
Пример #4
0
 private void OnHpChanged()
 {
     if (VM.Compact)
     {
         _hpAnim.To = VM.NPC.HPFactor * 359.9;
         ExternalArc.BeginAnimation(Arc.EndAngleProperty, _hpAnim);
     }
     else
     {
         _hpAnim.To = VM.NPC.HPFactor;
         HpBarGovernor.LayoutTransform.BeginAnimation(ScaleTransform.ScaleXProperty, _hpAnim);
     }
 }
 private void OnToZero(uint duration)
 {
     if (_isAnimating)
     {
         _lastDuration = duration;
         _delay.Start();
         return;
     }
     Dispatcher.Invoke(() =>
     {
         //var delay = _anim.Duration.TimeSpan.Milliseconds + 10;
         //_toZeroAnimation.BeginTime = TimeSpan.FromMilliseconds(_isAnimating ? delay : 0);
         _toZeroAnimation.Duration = TimeSpan.FromMilliseconds(duration);
         _toZeroAnimation.From     = _dc.Factor * 359.9;
         ExternalArc.BeginAnimation(Arc.EndAngleProperty, _toZeroAnimation);
     });
 }
Пример #6
0
 private void OnDcPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName != nameof(Npc.CurrentFactor))
     {
         return;
     }
     if (Compact)
     {
         _hpAnim.To = _dc.CurrentFactor * 359.9;
         ExternalArc.BeginAnimation(Arc.EndAngleProperty, _hpAnim);
     }
     else
     {
         _hpAnim.To = _dc.CurrentFactor;
         HpBarGovernor.LayoutTransform.BeginAnimation(ScaleTransform.ScaleXProperty, _hpAnim);
     }
 }
        private void OnToZero(uint duration)
        {
            if (_isAnimating)
            {
                _lastDuration = duration;
                _delay.Start();
                return;
            }

            Dispatcher?.Invoke(() =>
            {
                _toZeroAnimation.Duration = TimeSpan.FromMilliseconds(duration);
                if (_dc != null)
                {
                    _toZeroAnimation.From = _dc.Factor * 359.9;
                }
                ExternalArc.BeginAnimation(Nostrum.Controls.Arc.EndAngleProperty, _toZeroAnimation);
            });
        }
 private void Buff_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     Dispatcher.InvokeIfRequired(() =>
     {
         if (e.PropertyName == "Start")
         {
             _anim.Duration = TimeSpan.FromMilliseconds(_context.Buff.Cooldown);
             ExternalArc.BeginAnimation(Arc.EndAngleProperty, _anim);
             return;
         }
         if (e.PropertyName == "Refresh")
         {
             _anim.Duration = TimeSpan.FromMilliseconds(_context.Buff.Cooldown);
             ExternalArc.BeginAnimation(Arc.EndAngleProperty, _anim);
             return;
         }
         if (e.PropertyName == nameof(_context.Buff.Seconds))
         {
             OnPropertyChanged(nameof(DurationLabel));
         }
     }, System.Windows.Threading.DispatcherPriority.DataBind);
 }
Пример #9
0
 private void OnBuffStarted(ulong duration, Data.CooldownMode mode)
 {
     _anim.Duration = TimeSpan.FromMilliseconds(duration);
     ExternalArc.BeginAnimation(Arc.EndAngleProperty, _anim);
 }
Пример #10
0
 private void OnBuffEnded(Data.CooldownMode obj)
 {
     ExternalArc.BeginAnimation(Arc.EndAngleProperty, null);
     ExternalArc.EndAngle = 0;
 }
Пример #11
0
 private void OnBuffStarted(Data.CooldownMode obj)
 {
     _anim.Duration = TimeSpan.FromMilliseconds(_context.Buff.Duration);
     ExternalArc.BeginAnimation(Arc.EndAngleProperty, _anim);
 }
 private void AnimateArc()
 {
     ExternalArc.BeginAnimation(Arc.EndAngleProperty, new DoubleAnimation(359.9, 0, TimeSpan.FromMilliseconds(_context.Duration)));
 }