From 5d7ef55f83f5c86cab46ad271590823968857a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CLukasBrauschHFU=E2=80=9D?= Date: Mon, 10 Jul 2023 21:38:25 +0200 Subject: [PATCH] Cleanup --- DataParser.cs | 4 ---- Forms/BattleTowerPokemonForm.cs | 19 ------------------- Forms/BattleTowerTrainerEditorForm.cs | 12 ------------ 3 files changed, 35 deletions(-) diff --git a/DataParser.cs b/DataParser.cs index 882dc66..96c2d81 100644 --- a/DataParser.cs +++ b/DataParser.cs @@ -392,7 +392,6 @@ private static async Task ParseBattleTowerTrainers() AssetTypeValueField[] nameFields = nameData.children[8].children[0].children; Dictionary trainerNames = new(); gameData.trainerNames = trainerNames; - //Test foreach (AssetTypeValueField label in nameFields) if (label.children[6].children[0].childrenCount > 0) trainerNames[label.children[2].GetValue().AsString()] = label.children[6].children[0].children[0].children[4].GetValue().AsString(); @@ -447,7 +446,6 @@ private static async Task ParseBattleTowerTrainers() trainer.isDouble = true; gameData.battleTowerTrainersDouble.Add(trainer); } - //Parse BattleTowerTrainer Names //Parse battle tower trainer pokemon for (int pokemonIdx = 0; pokemonIdx < pokemonFields.Length && pokemonFields[pokemonIdx].children[0].value.value.asUInt32 != 0; pokemonIdx+=1) @@ -455,7 +453,6 @@ private static async Task ParseBattleTowerTrainers() BattleTowerTrainerPokemon pokemon = new(); pokemon.pokemonID = pokemonFields[pokemonIdx].children[0].value.value.asUInt32; pokemon.dexID = pokemonFields[pokemonIdx].children[1].value.value.asInt32; - //Debug.WriteLine(pokemon.dexID); pokemon.formID = pokemonFields[pokemonIdx].children[2].value.value.asUInt16; pokemon.isRare = pokemonFields[pokemonIdx].children[3].value.value.asUInt8; pokemon.level = pokemonFields[pokemonIdx].children[4].value.value.asUInt8; @@ -483,7 +480,6 @@ private static async Task ParseBattleTowerTrainers() pokemon.spdEV = pokemonFields[pokemonIdx].children[26].value.value.asUInt8; gameData.battleTowerTrainerPokemons.Add(pokemon); } - //trainer.trainerPokemon.Add(pokemon);, } diff --git a/Forms/BattleTowerPokemonForm.cs b/Forms/BattleTowerPokemonForm.cs index 09eca52..4836c06 100644 --- a/Forms/BattleTowerPokemonForm.cs +++ b/Forms/BattleTowerPokemonForm.cs @@ -55,8 +55,6 @@ public BattleTowerPokemonForm() moves = gameData.moves.Select(m => m.GetName()).ToList(); items = gameData.items.Select(m => m.GetName()).ToList(); tp = gameData.battleTowerTrainerPokemons[0]; - // gameData.battleTowerTrainerPokemons[1].dexID = 2; - InitializeComponent(); pokemonName = gameData.dexEntries[2].GetName(); Debug.WriteLine(tp.itemID); @@ -127,13 +125,11 @@ private void CommitSpeciesEdit(object sender, EventArgs e) DeactivateControls(); tp.dexID = (ushort)(speciesComboBox.SelectedIndex == -1 ? 0 : speciesComboBox.SelectedIndex); - // tp.formID = 0; ResetFormComboBox(); PopulateListBox(); CommitEdit(sender, e); ActivateControls(); } - //Updater private void PokemonChanged(object sender, EventArgs e) { DeactivateControls(); @@ -148,8 +144,6 @@ private void RefreshPokemonDisplay() RefreshTextBoxDisplay(); PopulatePartyDataGridView(); - - //OnLoad(); } private void RefreshTextBoxDisplay() @@ -160,11 +154,6 @@ private void RefreshTextBoxDisplay() private void PopulatePartyDataGridView() { - /*partyDataGridView.Rows.Clear(); - - partyDataGridView.Rows.Add(new object[] { t.battleTowerPokemonID1, "Configure" }); - partyDataGridView.Rows.Add(new object[] { t.battleTowerPokemonID2, "Configure" }); - partyDataGridView.Rows.Add(new object[] { t.battleTowerPokemonID3, "Configure" });*/ speciesComboBox.SelectedIndex = tp.dexID; ResetFormComboBox(); levelNumericUpDown.Value = tp.level; @@ -196,9 +185,6 @@ private void PopulatePartyDataGridView() comboBox8.SelectedIndex = tp.moveID2; comboBox9.SelectedIndex = tp.moveID3; comboBox10.SelectedIndex = tp.moveID4; - - - // ActivateControls(); } private void CommitEdit(object sender, EventArgs e) @@ -233,11 +219,6 @@ private void CommitEdit(object sender, EventArgs e) tp.moveID2 = (ushort)(comboBox8.SelectedIndex == -1 ? 0 : comboBox8.SelectedIndex); tp.moveID3 = (ushort)(comboBox9.SelectedIndex == -1 ? 0 : comboBox9.SelectedIndex); tp.moveID4 = (ushort)(comboBox10.SelectedIndex == -1 ? 0 : comboBox10.SelectedIndex); - // DeactivateControls(); - // PopulateListBox(); - // RefreshTextBoxDisplay(); - - // ActivateControls(); } private void ActivateControls() diff --git a/Forms/BattleTowerTrainerEditorForm.cs b/Forms/BattleTowerTrainerEditorForm.cs index 680ba15..8d73a87 100644 --- a/Forms/BattleTowerTrainerEditorForm.cs +++ b/Forms/BattleTowerTrainerEditorForm.cs @@ -76,18 +76,11 @@ public BattleTowerTrainerEditorForm() battleTowertrainers.AddRange(gameData.battleTowerTrainers); battleTowertrainersDoubles = new(); battleTowertrainersDoubles.AddRange(gameData.battleTowerTrainersDouble); - sortByComboBox.DataSource = sortNames; sortByComboBox.SelectedIndex = 0; pokemonSelector.DataSource = gameData.battleTowerTrainerPokemons.Select(o => o.GetID() + " - " + String.Join(", ", gameData.dexEntries[o.dexID].GetName())).ToArray(); - - battleTowertrainers.Sort(sortComparisons[sortByComboBox.SelectedIndex]); battleTowertrainersDoubles.Sort(sortComparisons[sortByComboBox.SelectedIndex]); - - // Debug.WriteLine(labelToTrainerName.Values.ToString()); - // Debug.WriteLine("Name is" + gameData.battleTowerTrainersDouble[991].name2); - partyDataGridView.AllowUserToAddRows = false; partyDataGridView.EditMode = DataGridViewEditMode.EditOnKeystrokeOrF2; PopulateListBox(false); @@ -146,7 +139,6 @@ private void CommitEdit(object sender, EventArgs e) string selectedValue = comboBoxCell1.Value.ToString(); string numericValue = Regex.Replace(selectedValue, @"[^0-9]", ""); int pokemonNumber = int.Parse(numericValue); - // Debug.WriteLine(numericValue + pokemonNumber); switch (rowIndex) { case 0: @@ -270,12 +262,8 @@ private void button1_Click(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e) { - // listBox.DataSource = null; - // listBox.Items.Clear(); doubleTrainerMode = false; - // RefreshTextBoxDisplay(); //Todo - //Add index to 1 here //Add trainer type to editor PopulateListBox(true); }