/* * private void Instance_OnTargetListUpdateFinished(object context) * { * if (InvokeRequired) * { * Invoke(new TargetListUpdateFinishedDelegate(Instance_OnTargetListUpdateFinished), context); * return; * } * * int i = 0; * var sb = new StringBuilder(); * foreach (WoWUnit u in Targeting.Instance.TargetList) * { * sb.AppendLine(u.SafeName() + " - " + u.HealthPercent.ToString("F1") + "% - " + u.Distance.ToString("F1") + " yds"); * if (++i == 5) * break; * } * lblTargets.Text = sb.ToString(); * * if (HealerManager.Instance.t * i = 0; * sb = new StringBuilder(); * foreach (WoWUnit u in HealerManager.Instance.TargetList) * { * sb.AppendLine(u.SafeName() + " - " + u.HealthPercent.ToString("F1") + "% - " + u.Distance.ToString("F1") + " yds"); * if (++i == 5) * break; * } * lblHealTargets.Text = sb.ToString(); * } */ #pragma warning disable 168 // for ex below private void btnSaveAndClose_Click(object sender, EventArgs e) { // prevent an exception from closing HB. try { // avoid possible timer callback issues timerTargeting.Stop(); // deal with Debug tab controls individually SingularSettings.Instance.DebugOutput = (DebugOutputDest)GetComboBoxEnum(cboDebugOutput); SingularSettings.Instance.EnableDebugSpellCasting = chkDebugCasting.Checked; SingularSettings.Instance.EnableShowBehaviorFlagChanges = chkShowBehaviorFlags.Checked; SingularSettings.Instance.EnableDebugTrace = chkDebugTrace.Checked; SingularSettings.Instance.EnableDebugHealTrace = chkDebugTraceHeal.Checked; SingularSettings.Instance.EnableDebugTraceBuffPresence = chkTraceBuffs.Checked; // Extensions.ShowPlayerNames = ShowPlayerNames.Checked; SingularRoutine.TrainingDummyBehaviors = (WoWContext)GetComboBoxEnum(cboForceUseOf); // save form position SingularSettings.Instance.FormHeight = this.Height; SingularSettings.Instance.FormWidth = this.Width; SingularSettings.Instance.FormTabIndex = tabControl1.SelectedIndex;; // save property group settings from each tab ((SingularSettings)pgGeneral.SelectedObject).Save(); if (pgClass.SelectedObject != null) { ((Styx.Helpers.Settings)pgClass.SelectedObject).Save(); } if (pgHotkeys.SelectedObject != null) { ((Styx.Helpers.Settings)pgHotkeys.SelectedObject).Save(); } foreach (var obj in cboHealContext.Items) { HealContextItem ctx = (HealContextItem)obj; ctx.Settings.Save(); } // CleanseBlacklist.Instance.SpellList.Save(); // PurgeWhitelist.Instance.SpellList.Save(); // MageSteallist.Instance.SpellList.Save(); Close(); } catch (Exception ex) { Logger.Write("ERROR saving settings: {0}", ex.ToString()); } }
private void cboHealContext_SelectedIndexChanged(object sender, EventArgs e) { HealContextItem ctx = (HealContextItem)cboHealContext.SelectedItem; pgHeal.SelectedObject = ctx.Settings; }
/// <summary> /// populates the cboHealContext dropdown with an object list of all healing context setups /// that apply to current character. will initially clear the list, then populate, and /// finally set the current context as selected (or first in list if not applicable) /// </summary> /// <param name="cls"></param> private void InitializeHealContextDropdown(WoWClass cls) { cboHealContext.Items.Clear(); if (cls == WoWClass.Shaman) { cboHealContext.Items.Add(new HealContextItem(HealingContext.Battlegrounds, WoWSpec.ShamanRestoration, SingularSettings.Instance.Shaman().RestoBattleground)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Instances, WoWSpec.ShamanRestoration, SingularSettings.Instance.Shaman().RestoInstance)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Raids, WoWSpec.ShamanRestoration, SingularSettings.Instance.Shaman().RestoRaid)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Battlegrounds, WoWSpec.None, SingularSettings.Instance.Shaman().OffhealBattleground)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Instances, WoWSpec.None, SingularSettings.Instance.Shaman().OffhealPVE)); } if (cls == WoWClass.Druid) { cboHealContext.Items.Add(new HealContextItem(HealingContext.Battlegrounds, WoWSpec.DruidRestoration, SingularSettings.Instance.Druid().Battleground)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Instances, WoWSpec.DruidRestoration, SingularSettings.Instance.Druid().Instance)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Raids, WoWSpec.DruidRestoration, SingularSettings.Instance.Druid().Raid)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Battlegrounds, WoWSpec.None, SingularSettings.Instance.Druid().OffhealBattleground)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Instances, WoWSpec.None, SingularSettings.Instance.Druid().OffhealPVE)); } if (cls == WoWClass.Monk) { cboHealContext.Items.Add(new HealContextItem(HealingContext.Battlegrounds, WoWSpec.MonkMistweaver, SingularSettings.Instance.Monk().MistBattleground)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Instances, WoWSpec.MonkMistweaver, SingularSettings.Instance.Monk().MistInstance)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Raids, WoWSpec.MonkMistweaver, SingularSettings.Instance.Monk().MistRaid)); } if (cls == WoWClass.Priest) { /* * cboHealContext.Items.Add(new HealContextItem(HealingContext.Battlegrounds, WoWSpec.PriestDiscipline, SingularSettings.Instance.Priest().DiscBattleground)); * cboHealContext.Items.Add(new HealContextItem(HealingContext.Instances, WoWSpec.PriestDiscipline, SingularSettings.Instance.Priest().DiscInstance)); * cboHealContext.Items.Add(new HealContextItem(HealingContext.Raids, WoWSpec.PriestDiscipline, SingularSettings.Instance.Priest().DiscRaid)); */ cboHealContext.Items.Add(new HealContextItem(HealingContext.Battlegrounds, WoWSpec.PriestHoly, SingularSettings.Instance.Priest().HolyBattleground)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Instances, WoWSpec.PriestHoly, SingularSettings.Instance.Priest().HolyInstance)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Raids, WoWSpec.PriestHoly, SingularSettings.Instance.Priest().HolyRaid)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Battlegrounds, WoWSpec.PriestDiscipline, SingularSettings.Instance.Priest().DiscBattleground)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Instances, WoWSpec.PriestDiscipline, SingularSettings.Instance.Priest().DiscInstance)); cboHealContext.Items.Add(new HealContextItem(HealingContext.Raids, WoWSpec.PriestDiscipline, SingularSettings.Instance.Priest().DiscRaid)); } bool needHealPage = cboHealContext.Items.Count > 0; cboHealContext.Enabled = needHealPage; if (needHealPage && !tabControl1.TabPages.Contains(tabGroupHeal)) { tabControl1.TabPages.Insert(2, tabGroupHeal); } else if (!needHealPage && tabControl1.TabPages.Contains(tabGroupHeal)) { tabControl1.TabPages.Remove(tabGroupHeal); } foreach (var obj in cboHealContext.Items) { HealContextItem ctx = (HealContextItem)obj; if (ctx.Spec == TalentManager.CurrentSpec) { if (ctx.Context == SingularRoutine.CurrentHealContext) { cboHealContext.SelectedItem = ctx; break; } if (SingularRoutine.CurrentHealContext == HealingContext.Normal && ctx.Spec == WoWSpec.PriestHoly && ctx.Context == HealingContext.Instances) { cboHealContext.SelectedItem = ctx; break; } if (SingularRoutine.CurrentHealContext == HealingContext.Normal && ctx.Spec == WoWSpec.PriestDiscipline && ctx.Context == HealingContext.Instances) { cboHealContext.SelectedItem = ctx; break; } } } if (cboHealContext.SelectedItem == null && cboHealContext.Items.Count > 0) { foreach (var obj in cboHealContext.Items) { HealContextItem ctx = (HealContextItem)obj; if (ctx.Spec == WoWSpec.None) { if (ctx.Context == SingularRoutine.CurrentHealContext) { cboHealContext.SelectedItem = ctx; break; } if (ctx.Context != HealingContext.Battlegrounds && HealingContext.Battlegrounds != SingularRoutine.CurrentHealContext) { cboHealContext.SelectedItem = ctx; break; } if (SingularRoutine.CurrentHealContext == HealingContext.Normal && ctx.Spec == WoWSpec.PriestDiscipline && ctx.Context == HealingContext.Instances) { cboHealContext.SelectedItem = ctx; break; } } } } if (cboHealContext.SelectedItem == null && cboHealContext.Items.Count > 0) { cboHealContext.SelectedIndex = 0; } }