/// <summary> /// Toolbar > Attributes optimizer. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsbAttributesOptimization_Click(object sender, EventArgs e) { if (m_attributesOptimizerWindow == null) { // Display the settings window using (var settingsForm = new AttributesOptimizationSettingsForm(m_plan)) { settingsForm.ShowDialog(this); if (settingsForm.DialogResult == DialogResult.OK) { // Now displays the computation window m_attributesOptimizerWindow = settingsForm.OptimizationForm; m_attributesOptimizerWindow.PlanEditor = (tabControl.SelectedIndex == 0) ? planEditor : null; m_attributesOptimizerWindow.FormClosed += (form, args) => m_attributesOptimizerWindow = null; m_attributesOptimizerWindow.Show(this); } } } else { // Bring the window to front m_attributesOptimizerWindow.Visible = true; m_attributesOptimizerWindow.BringToFront(); m_attributesOptimizerWindow.PlanEditor = (tabControl.SelectedIndex == 0) ? planEditor : null; } }
private void buttonWholePlan_Click(object sender, EventArgs e) { string title = "Attributes optimization (" + m_plan.Name + ", first year)"; string description = "Based on " + m_plan.Name + "; best attributes for the first year."; m_optimizationForm = new AttributesOptimizationForm(m_character, m_plan, AttributesOptimizationForm.Strategy.OneYearPlan, title, description); }
private void buttonRemappingPoints_Click(object sender, EventArgs e) { string title = "Attributes optimization (" + m_plan.Name + ", remapping points)"; string description = "Based on " + m_plan.Name + "; using the remapping points you defined."; m_optimizationForm = new AttributesOptimizationForm(m_character, m_plan, AttributesOptimizationForm.Strategy.RemappingPoints, title, description); }
private void buttonCharacter_Click(object sender, EventArgs e) { string title = "Attributes optimization (" + m_character.Name + ")"; string description = "Based on " + m_character.Name; description += (description.EndsWith("s") ? "' skills" : "'s skills"); m_optimizationForm = new AttributesOptimizationForm(m_character, m_plan, AttributesOptimizationForm.Strategy.Character, title, description); }
/// <summary> /// On closing, we unsubscribe the global events to help the GC. /// </summary> /// <param name="e"></param> protected override void OnFormClosing(FormClosingEventArgs e) { // Save settings if this one is the last activated and up-to-date if (s_lastActivated == this) { Settings.UI.PlanWindow.Columns = planEditor.ExportColumnSettings().ToArray(); s_lastActivated = null; } // Unsubscribe global events EveClient.PlanChanged -= new EventHandler <PlanChangedEventArgs>(EveClient_PlanChanged); Settings.Save(); // Tell the skill explorer we're closing down if (!(e.CloseReason == CloseReason.ApplicationExitCall) && // and Application.Exit() was not called !(e.CloseReason == CloseReason.TaskManagerClosing) && // and the user isn't trying to shut the program down for some reason !(e.CloseReason == CloseReason.WindowsShutDown)) // and Windows is not shutting down { WindowsFactory <SkillExplorerWindow> .CloseByTag(this); } // Tell the attributes optimization window we're closing if (m_attributesOptimizerWindow != null) { m_attributesOptimizerWindow.Close(); m_attributesOptimizerWindow = null; } // Tell the implant window we're closing if (m_implantCalcWindow != null) { m_implantCalcWindow.Close(); m_implantCalcWindow = null; } // Tells the loadout browser we're closing if (m_loadoutForm != null) { m_loadoutForm.Close(); m_loadoutForm = null; } base.OnFormClosing(e); }
/// <summary> /// On a doube-click on one of the list items, we open the skill browser. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void lvSkills_MouseDoubleClick(object sender, MouseEventArgs e) { if (lvSkills.SelectedItems.Count == 1) { // When the first entry is a skill, shows it in the skill browser. if (GetFirstSelectedEntry() != null) { miShowInSkillBrowser_Click(sender, e); } // When it is a remapping point, edit it else { // Retrieves the point var nextItem = lvSkills.Items[lvSkills.SelectedIndices[0] + 1]; var entry = GetPlanEntry(nextItem); var point = entry.Remapping; // Display the attributes optimization form // if it's not already shown if (point != m_formTag) { // When we click on another point the previous form closes if (m_oldForm != null) m_oldForm.Close(); // Creates the form and displays it var form = new AttributesOptimizationForm(m_character, m_plan, point); form.FormClosed += (AttributesOptimizationForm, args) => m_formTag = null; form.PlanEditor = this; form.Show(this); // Update variables for forms display control m_formTag = point; m_oldForm = form; } } } }