private bool UpdateOther(Cooldown sk)
        {
            if (!SettingsHolder.CooldownWindowSettings.Enabled)
            {
                return(false);
            }
            //create it again with cd window dispatcher
            var other = new Cooldown(sk.Skill, sk.CooldownType == CooldownType.Item ? sk.OriginalDuration / 1000 : sk.OriginalDuration, sk.CooldownType, sk.Mode, Dispatcher);

            sk.Dispose();

            try
            {
                if (other.CooldownType != CooldownType.Item)
                {
                    return(FindAndUpdate(OtherSkills, other));
                }
                return(FindAndUpdate(ItemSkills, other) || FindAndUpdate(OtherSkills, other));
            }
            catch
            {
                Log.All("Error while refreshing skill");
                return(false);
            }
        }
        public void AddOrRefresh(Cooldown sk)
        {
            switch (Settings.SettingsHolder.CooldownBarMode)
            {
            case CooldownBarMode.Fixed:
                if (!FixedMode_Update(sk))
                {
                    sk.Dispose();
                }
                break;

            default:
                if (!NormalMode_Update(sk))
                {
                    sk.Dispose();
                }
                break;
            }
        }
 private static void RouteSkill(Cooldown skillCooldown)
 {
     if (skillCooldown.Duration == 0)
     {
         skillCooldown.Dispose();
         CooldownWindowViewModel.Instance.Remove(skillCooldown.Skill);
     }
     else
     {
         CooldownWindowViewModel.Instance.AddOrRefresh(skillCooldown);
     }
     App.BaseDispatcher.Invoke(() => SkillStarted?.Invoke());
 }
        public void AddOrRefresh(Cooldown sk)
        {
            Dispatcher.BeginInvoke(new Action(() =>
            {
                switch (SettingsHolder.CooldownBarMode)
                {
                case CooldownBarMode.Fixed:
                    if (!FixedMode_Update(sk))
                    {
                        sk.Dispose();
                    }
                    break;

                default:
                    if (!NormalMode_Update(sk))
                    {
                        sk.Dispose();
                    }
                    break;
                }
            }));
        }
 private static void RouteSkill(Cooldown skillCooldown)
 {
     if (skillCooldown.Duration == 0)
     {
         skillCooldown.Dispose();
         WindowManager.CooldownWindow.VM.Remove(skillCooldown.Skill);
     }
     else
     {
         WindowManager.CooldownWindow.VM.AddOrRefresh(skillCooldown);
     }
     App.BaseDispatcher.BeginInvoke(new Action(() => SkillStarted?.Invoke()));
 }
Beispiel #6
0
 public void Dispose()
 {
     Cooldown.Dispose();
     Effect.Dispose();
 }
 internal void AddHiddenSkill(Cooldown context)
 {
     context.Dispose();
     HiddenSkills.Add(context);
     Save();
 }
Beispiel #8
0
 public void Dispose()
 {
     spellCooldown.Dispose();
     spellCooldown = null;
 }