Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
TheZoroark007 committed Jul 10, 2023
1 parent 55b6be5 commit 5d7ef55
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 35 deletions.
4 changes: 0 additions & 4 deletions DataParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ private static async Task ParseBattleTowerTrainers()
AssetTypeValueField[] nameFields = nameData.children[8].children[0].children;
Dictionary<string, string> 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();
Expand Down Expand Up @@ -447,15 +446,13 @@ 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)
{
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;
Expand Down Expand Up @@ -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);,

}

Expand Down
19 changes: 0 additions & 19 deletions Forms/BattleTowerPokemonForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -148,8 +144,6 @@ private void RefreshPokemonDisplay()
RefreshTextBoxDisplay();

PopulatePartyDataGridView();

//OnLoad();
}

private void RefreshTextBoxDisplay()
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
12 changes: 0 additions & 12 deletions Forms/BattleTowerTrainerEditorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 5d7ef55

Please sign in to comment.