public void LoadDungeon(string[] parse) { this.Size = pnlDungeonEditor.Size; pnlDungeonList.Visible = false; pnlDungeonEditor.Visible = true; btnGeneral_Click(null, null); lbxDungeonSMaps.Items.Clear(); lbxDungeonRMaps.Items.Clear(); lbxDungeonScripts.Items.Clear(); //this.Size = new System.Drawing.Size(pnlDungeonGeneral.Width, pnlDungeonGeneral.Height); dungeon = new Logic.Editors.Dungeons.EditableDungeon(); dungeon.Name = parse[2]; txtName.Text = dungeon.Name; dungeon.AllowsRescue = parse[3].ToBool(); chkRescue.Checked = dungeon.AllowsRescue; int scriptCount = parse[4].ToInt(); int n = 5; for (int i = 0; i < scriptCount; i++) { dungeon.ScriptList.Add(parse[n].ToInt(), parse[n + 1]); n += 2; ListBoxTextItem lbiScript = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), dungeon.ScriptList.KeyByIndex(i) + ": " + dungeon.ScriptList.ValueByIndex(i)); lbxDungeonScripts.Items.Add(lbiScript); } int mapCount = parse[n].ToInt(); n++; for (int i = 0; i < mapCount; i++) { Logic.Editors.Dungeons.EditableStandardDungeonMap map = new Logic.Editors.Dungeons.EditableStandardDungeonMap(); map.Difficulty = (Enums.JobDifficulty)parse[n].ToInt(); map.IsBadGoalMap = parse[n + 1].ToBool(); map.MapNum = parse[n + 2].ToInt(); dungeon.StandardMaps.Add(map); string mapText; if (map.IsBadGoalMap) { mapText = (i + 1) + ": (Boss)[" + Missions.MissionManager.DifficultyToString(map.Difficulty) + "] Map #" + map.MapNum; } else { mapText = (i + 1) + ": [" + Missions.MissionManager.DifficultyToString(map.Difficulty) + "] Map #" + map.MapNum; } ListBoxTextItem lbiMap = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), mapText); lbxDungeonSMaps.Items.Add(lbiMap); n += 3; } mapCount = parse[n].ToInt(); n++; for (int i = 0; i < mapCount; i++) { Logic.Editors.Dungeons.EditableRandomDungeonMap map = new Logic.Editors.Dungeons.EditableRandomDungeonMap(); map.Difficulty = (Enums.JobDifficulty)parse[n].ToInt(); map.IsBadGoalMap = parse[n + 1].ToBool(); map.RDungeonIndex = parse[n + 2].ToInt(); map.RDungeonFloor = parse[n + 3].ToInt(); dungeon.RandomMaps.Add(map); n += 4; string mapText; if (map.IsBadGoalMap) { mapText = (i + 1) + ": (Boss)[" + Missions.MissionManager.DifficultyToString(map.Difficulty) + "] Dun #" + (map.RDungeonIndex + 1) + " (" + RDungeons.RDungeonHelper.RDungeons[map.RDungeonIndex].Name + ") " + (map.RDungeonFloor + 1) + "F"; } else { mapText = (i + 1) + ": [" + Missions.MissionManager.DifficultyToString(map.Difficulty) + "] Dun #" + (map.RDungeonIndex + 1) + " (" + RDungeons.RDungeonHelper.RDungeons[map.RDungeonIndex].Name + ") " + (map.RDungeonFloor + 1) + "F"; } ListBoxTextItem lbiMap = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), mapText); lbxDungeonRMaps.Items.Add(lbiMap); } dungeon.LegendaryId = parse[n++].ToInt(); btnEdit.Text = "Edit"; }
public void LoadDungeon(string[] parse) { this.Size = pnlDungeonEditor.Size; pnlDungeonList.Visible = false; pnlDungeonEditor.Visible = true; btnGeneral_Click(null, null); lbxDungeonSMaps.Items.Clear(); lbxDungeonRMaps.Items.Clear(); lbxDungeonScripts.Items.Clear(); //this.Size = new System.Drawing.Size(pnlDungeonGeneral.Width, pnlDungeonGeneral.Height); dungeon = new Logic.Editors.Dungeons.EditableDungeon(); dungeon.Name = parse[2]; txtName.Text = dungeon.Name; dungeon.AllowsRescue = parse[3].ToBool(); chkRescue.Checked = dungeon.AllowsRescue; int scriptCount = parse[4].ToInt(); int n = 5; for (int i = 0; i < scriptCount; i++) { dungeon.ScriptList.Add(parse[n].ToInt(), parse[n + 1]); n += 2; ListBoxTextItem lbiScript = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), dungeon.ScriptList.KeyByIndex(i) + ": " + dungeon.ScriptList.ValueByIndex(i)); lbxDungeonScripts.Items.Add(lbiScript); } int mapCount = parse[n].ToInt(); n++; for (int i = 0; i < mapCount; i++) { Logic.Editors.Dungeons.EditableStandardDungeonMap map = new Logic.Editors.Dungeons.EditableStandardDungeonMap(); map.Difficulty = (Enums.JobDifficulty)parse[n].ToInt(); map.IsBadGoalMap = parse[n + 1].ToBool(); map.MapNum = parse[n + 2].ToInt(); dungeon.StandardMaps.Add(map); string mapText; if (map.IsBadGoalMap) { mapText = (i + 1) + ": (Boss)[" + Missions.MissionManager.DifficultyToString(map.Difficulty) + "] Map #" + map.MapNum; } else { mapText = (i + 1) + ": [" + Missions.MissionManager.DifficultyToString(map.Difficulty) + "] Map #" + map.MapNum; } ListBoxTextItem lbiMap = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), mapText); lbxDungeonSMaps.Items.Add(lbiMap); n += 3; } mapCount = parse[n].ToInt(); n++; for (int i = 0; i < mapCount; i++) { Logic.Editors.Dungeons.EditableRandomDungeonMap map = new Logic.Editors.Dungeons.EditableRandomDungeonMap(); map.Difficulty = (Enums.JobDifficulty)parse[n].ToInt(); map.IsBadGoalMap = parse[n + 1].ToBool(); map.RDungeonIndex = parse[n + 2].ToInt(); map.RDungeonFloor = parse[n + 3].ToInt(); dungeon.RandomMaps.Add(map); n += 4; string mapText; if (map.IsBadGoalMap) { mapText = (i + 1) + ": (Boss)[" + Missions.MissionManager.DifficultyToString(map.Difficulty) + "] Dun #" + (map.RDungeonIndex + 1) + " (" + RDungeons.RDungeonHelper.RDungeons[map.RDungeonIndex].Name + ") " + (map.RDungeonFloor + 1) + "F"; } else { mapText = (i + 1) + ": [" + Missions.MissionManager.DifficultyToString(map.Difficulty) + "] Dun #" + (map.RDungeonIndex + 1) + " (" + RDungeons.RDungeonHelper.RDungeons[map.RDungeonIndex].Name + ") " + (map.RDungeonFloor + 1) + "F"; } ListBoxTextItem lbiMap = new ListBoxTextItem(Logic.Graphics.FontManager.LoadFont("tahoma", 10), mapText); lbxDungeonRMaps.Items.Add(lbiMap); } btnEdit.Text = "Edit"; }