void StartScytheCooldown(int cd) { Dispatcher.BeginInvoke(new Action(() => { scytheCd.Stroke.BeginAnimation(SolidColorBrush.ColorProperty, EdgeAnimations.GetColorAnimation(Colors.Red, Colors.White, Convert.ToInt32(cd * .1))); scytheCd.BeginAnimation(Arc.EndAngleProperty, EdgeAnimations.GetArcAnimation(cd)); })); }
public static void SetEdge(int edge) { EdgeGaugeWindow.Instance.Dispatcher.Invoke(() => { Instance.ExpireEdge.Stop(); if (edge == 0) { foreach (var item in Instance.edgeArcs) { item.IsBuilt = false; } if (Instance.oldEdge == 10) { Instance.NormalEdge?.Invoke(); } Instance.baseEll.Stroke.BeginAnimation(SolidColorBrush.ColorProperty, EdgeAnimations.GetColorAnimation(Color.FromArgb(0x00, 0, 0, 0))); Instance.glow.BeginAnimation(DropShadowEffect.OpacityProperty, EdgeAnimations.ShadowOpacityAnimationDown); } else if (edge == 10) { foreach (var item in Instance.edgeArcs) { if (!item.IsBuilt) { item.IsBuilt = true; } Instance.MaxedEdge?.Invoke(); } Instance.glow.BeginAnimation(DropShadowEffect.OpacityProperty, EdgeAnimations.ShadowOpacityAnimationUp); Instance.baseEll.Stroke.BeginAnimation(SolidColorBrush.ColorProperty, EdgeAnimations.GetColorAnimation(Colors.Red)); } else { for (int i = 0; i < edge; i++) { if (!Instance.edgeArcs[i].IsBuilt) { Instance.edgeArcs[i].IsBuilt = true; } } } Instance.CurrentEdge = edge; Instance.ExpireEdge = new Timer(8000); Instance.ExpireEdge.Elapsed += (s, o) => { SetEdge(0); }; Instance.ExpireEdge.Enabled = true; }); Instance.oldEdge = edge; }