private void NormalMode_Remove(Skill sk) { if (!SettingsHolder.CooldownWindowSettings.Enabled) { return; } try { var longSkill = LongSkills.ToSyncList().FirstOrDefault(x => x.Skill.IconName == sk.IconName); if (longSkill != null) { LongSkills.Remove(longSkill); longSkill.Dispose(); } var shortSkill = ShortSkills.ToSyncList().FirstOrDefault(x => x.Skill.IconName == sk.IconName); if (shortSkill != null) { ShortSkills.Remove(shortSkill); shortSkill.Dispose(); } var itemSkill = ItemSkills.ToSyncList().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 (!SettingsHolder.CooldownWindowSettings.Enabled) { return; } var skill = MainSkills.ToSyncList().FirstOrDefault(x => x.Skill.IconName == sk.IconName); if (skill != null) { skill.Refresh(sk.Id, 0, CooldownMode.Normal); return; } skill = SecondarySkills.ToSyncList().FirstOrDefault(x => x.Skill.IconName == sk.IconName); if (skill != null) { skill.Refresh(sk.Id, 0, CooldownMode.Normal); return; } var item = ItemSkills.ToSyncList().FirstOrDefault(x => x.Skill.IconName == sk.IconName); if (item != null) { ItemSkills.Remove(item); item.Dispose(); return; } try { var otherSkill = OtherSkills.ToSyncList().FirstOrDefault(x => x.Skill.Name == sk.Name); if (otherSkill != null) { OtherSkills.Remove(otherSkill); otherSkill.Dispose(); } } catch { // ignored } }