//Editing Mission Values public void addGoal() { missionList[activeMissionID].addGoal(); MissionInfoPanel MIP = (MissionInfoPanel)MF.Controls[GV.missionInfoPanelName]; GoalPanel subPanel = new GoalPanel(MIP); MIP.Controls.Add(subPanel); subPanel.Location = new Point(12, MIP.panelStartingLocation.Y + (missionList[activeMissionID].goalList.Count - 1) * GV.goalBoxIncrement); //if the y here is changed it must also my changed in missionPackagePanel subPanel.panelID = missionList[activeMissionID].goalList.Count - 1; changeActiveGoal(missionList[activeMissionID].activeGoalID); }
//Changing Panel Stuff public void populateGoalPanels() { MissionInfoPanel MIP = (MissionInfoPanel)MF.Controls[GV.missionInfoPanelName]; int currentGoalPanelY = MIP.panelStartingLocation.Y; int goalCount = 0; foreach (AllGoals goal in missionList[activeMissionID].goalList) { GoalPanel subPanel = new GoalPanel(MIP); MIP.Controls.Add(subPanel); subPanel.Location = new Point(12, currentGoalPanelY); //if the y here is changed it must also my changed in missionPackagePanel subPanel.panelID = goalCount++; currentGoalPanelY += GV.goalBoxIncrement; subPanel.rewardAmountChanged(goal.getAllGoal("reward")); //These two lines ensure labels remain proper subPanel.goalTypeChanged(goal.getAllGoal("goalType")); //These two lines ensure labels remain proper } changeActiveGoal(0); }