private void NormalMode_Remove(Skill sk) { if (!Settings.SettingsHolder.CooldownWindowSettings.Enabled) { return; } try { var longSkill = LongSkills.ToSyncArray().FirstOrDefault(x => x.Skill.Name == sk.Name); if (longSkill != null) { LongSkills.Remove(longSkill); longSkill.Dispose(); } var shortSkill = ShortSkills.ToSyncArray().FirstOrDefault(x => x.Skill.Name == sk.Name); if (shortSkill != null) { ShortSkills.Remove(shortSkill); shortSkill.Dispose(); } var itemSkill = ItemSkills.ToSyncArray().FirstOrDefault(x => x.Skill.Name == sk.Name); if (itemSkill != null) { ItemSkills.Remove(itemSkill); itemSkill.Dispose(); } } catch { // ignored } }
private void FixedMode_Remove(Skill sk) { //sk.SetDispatcher(Dispatcher); if (!Settings.SettingsHolder.CooldownWindowSettings.Enabled) { return; } var skill = MainSkills.ToSyncArray().FirstOrDefault(x => x.Skill.IconName == sk.IconName); if (skill != null) { skill.Refresh(sk.Id, 0, CooldownMode.Normal); return; } skill = SecondarySkills.ToSyncArray().FirstOrDefault(x => x.Skill.IconName == sk.IconName); if (skill != null) { skill.Refresh(sk.Id, 0, CooldownMode.Normal); return; } var item = ItemSkills.ToSyncArray().FirstOrDefault(x => x.Skill.IconName == sk.IconName); if (item != null) { ItemSkills.Remove(item); item.Dispose(); return; } try { var otherSkill = OtherSkills.ToSyncArray().FirstOrDefault(x => x.Skill.Name == sk.Name); if (otherSkill != null) { OtherSkills.Remove(otherSkill); otherSkill.Dispose(); } } catch { // ignored } }