예제 #1
0
        /// <summary>
        /// File > Import Plan from Character....
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void miImportPlanFromCharacter_Click(object sender, EventArgs e)
        {
            // Prompt the user to choose the source character and plan.
            using (PlanImportationFromCharacterWindow cps = new PlanImportationFromCharacterWindow(m_character))
            {
                DialogResult dr = cps.ShowDialog();
                if (dr == DialogResult.Cancel)
                {
                    return;
                }

                // Retrieves the cloned plan
                Plan plan = cps.TargetPlan;

                // Adds and fixes the prerequisites order
                plan.FixPrerequisites();

                // Prompt the user for the new plan's name
                using (NewPlanWindow f = new NewPlanWindow())
                {
                    f.PlanName = $"{m_character.Name}-{plan.Name}";
                    f.Text     = @"Save Plan As";

                    dr = f.ShowDialog();
                    if (dr == DialogResult.Cancel)
                    {
                        return;
                    }

                    plan.Name        = f.PlanName;
                    plan.Description = f.PlanDescription;
                }

                // Add the plan to the character's list
                m_character.Plans.Add(plan);
            }
        }
예제 #2
0
        /// <summary>
        /// File > Import Plan from Character....
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void miImportPlanFromCharacter_Click(object sender, EventArgs e)
        {
            // Prompt the user to choose the source character and plan.
            using (PlanImportationFromCharacterWindow cps = new PlanImportationFromCharacterWindow(m_character))
            {
                DialogResult dr = cps.ShowDialog();
                if (dr == DialogResult.Cancel)
                    return;

                // Retrieves the cloned plan
                Plan plan = cps.TargetPlan;

                // Adds and fixes the prerequisites order
                plan.FixPrerequisites();

                // Prompt the user for the new plan's name
                using (NewPlanWindow f = new NewPlanWindow())
                {
                    f.PlanName = $"{m_character.Name}-{plan.Name}";
                    f.Text = @"Save Plan As";

                    dr = f.ShowDialog();
                    if (dr == DialogResult.Cancel)
                        return;

                    plan.Name = f.PlanName;
                    plan.Description = f.PlanDescription;
                }

                // Add the plan to the character's list
                m_character.Plans.Add(plan);
            }
        }