void btnAddItem_Click(object sender, MouseButtonEventArgs e) { Logic.Editors.Missions.EditableMissionReward reward = new Logic.Editors.Missions.EditableMissionReward(); reward.ItemNum = nudItemNum.Value; reward.ItemAmount = nudItemAmount.Value; reward.ItemTag = txtItemTag.Text; missionPool.Rewards.Add(reward); ListBoxTextItem lbiReward = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), missionPool.Rewards.Count + ": " + Items.ItemHelper.Items[reward.ItemNum].Name + " x" + reward.ItemAmount + " (Tag: " + reward.ItemTag + ")"); lbxMissionRewards.Items.Add(lbiReward); }
public void LoadMission(string[] parse) { this.Size = pnlMissionEditor.Size; pnlMissionList.Visible = false; pnlMissionEditor.Visible = true; btnGeneral_Click(null, null); lbxMissionRewards.Items.Clear(); lbxMissionEnemies.Items.Clear(); lbxMissionClients.Items.Clear(); //this.Size = new System.Drawing.Size(pnlDungeonGeneral.Width, pnlDungeonGeneral.Height); missionPool = new Logic.Editors.Missions.EditableMissionPool(); int clientCount = parse[2].ToInt(); int n = 3; for (int i = 0; i < clientCount; i++) { Logic.Editors.Missions.EditableMissionClient missionClient = new Logic.Editors.Missions.EditableMissionClient(); missionClient.DexNum = parse[n].ToInt(); missionClient.FormNum = parse[n + 1].ToInt(); missionPool.Clients.Add(missionClient); n += 2; ListBoxTextItem lbiClient = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), (i + 1) + ": #" + missionClient.DexNum + " " + Pokedex.PokemonHelper.Pokemon[missionClient.DexNum - 1].Name + " (Form: " + missionClient.FormNum + ")"); lbxMissionClients.Items.Add(lbiClient); } int enemyCount = parse[n].ToInt(); n++; for (int i = 0; i < enemyCount; i++) { missionPool.Enemies.Add(parse[n].ToInt()); ListBoxTextItem lbiEnemy = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), (i + 1) + ": NPC #" + missionPool.Enemies[i] + ", " + Npc.NpcHelper.Npcs[missionPool.Enemies[i]].Name); lbxMissionEnemies.Items.Add(lbiEnemy); n++; } int rewardCount = parse[n].ToInt(); n++; for (int i = 0; i < rewardCount; i++) { Logic.Editors.Missions.EditableMissionReward missionReward = new Logic.Editors.Missions.EditableMissionReward(); missionReward.ItemNum = parse[n].ToInt(); missionReward.ItemAmount = parse[n + 1].ToInt(); missionReward.ItemTag = parse[n + 2]; missionPool.Rewards.Add(missionReward); n += 3; ListBoxTextItem lbiReward = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), (i + 1) + ": " + Items.ItemHelper.Items[missionReward.ItemNum].Name + " x" + missionReward.ItemAmount + " (Tag: " + missionReward.ItemTag + ")"); lbxMissionRewards.Items.Add(lbiReward); } btnEdit.Text = "Edit"; }
public void LoadMission(string[] parse) { this.Size = pnlMissionEditor.Size; pnlMissionList.Visible = false; pnlMissionEditor.Visible = true; btnGeneral_Click(null, null); lbxMissionRewards.Items.Clear(); lbxMissionEnemies.Items.Clear(); lbxMissionClients.Items.Clear(); //this.Size = new System.Drawing.Size(pnlDungeonGeneral.Width, pnlDungeonGeneral.Height); missionPool = new Logic.Editors.Missions.EditableMissionPool(); int clientCount = parse[2].ToInt(); int n = 3; for (int i = 0; i < clientCount; i++) { Logic.Editors.Missions.EditableMissionClient missionClient = new Logic.Editors.Missions.EditableMissionClient(); missionClient.DexNum = parse[n].ToInt(); missionClient.FormNum = parse[n+1].ToInt(); missionPool.Clients.Add(missionClient); n += 2; ListBoxTextItem lbiClient = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), (i + 1) + ": #" + missionClient.DexNum + " " + Pokedex.PokemonHelper.Pokemon[missionClient.DexNum-1].Name + " (Form: " + missionClient.FormNum + ")"); lbxMissionClients.Items.Add(lbiClient); } int enemyCount = parse[n].ToInt(); n++; for (int i = 0; i < enemyCount; i++) { missionPool.Enemies.Add(parse[n].ToInt()); ListBoxTextItem lbiEnemy = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), (i + 1) + ": NPC #" + missionPool.Enemies[i] + ", " + Npc.NpcHelper.Npcs[missionPool.Enemies[i]].Name); lbxMissionEnemies.Items.Add(lbiEnemy); n++; } int rewardCount = parse[n].ToInt(); n++; for (int i = 0; i < rewardCount; i++) { Logic.Editors.Missions.EditableMissionReward missionReward = new Logic.Editors.Missions.EditableMissionReward(); missionReward.ItemNum = parse[n].ToInt(); missionReward.ItemAmount = parse[n + 1].ToInt(); missionReward.ItemTag = parse[n + 2]; missionPool.Rewards.Add(missionReward); n += 3; ListBoxTextItem lbiReward = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), (i + 1) + ": " + Items.ItemHelper.Items[missionReward.ItemNum].Name + " x" + missionReward.ItemAmount + " (Tag: " + missionReward.ItemTag + ")"); lbxMissionRewards.Items.Add(lbiReward); } btnEdit.Text = "Edit"; }