Skip to content

Commit

Permalink
Fixed bugged trainer types
Browse files Browse the repository at this point in the history
  • Loading branch information
Nifyr committed Apr 9, 2022
1 parent 3149277 commit fd2a322
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Forms/TrainerEditorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@ public partial class TrainerEditorForm : Form
{
public List<Trainer> trainers;
public Dictionary<int, string> trainerTypeLabels;
public Dictionary<int, int> trainerTypeToCC;
public List<string> items;
public Trainer t;
private TrainerPokemonEditorForm tpef;

public TrainerEditorForm()
{
trainerTypeLabels = new();
trainerTypeToCC = new();
trainerTypeLabels.Add(-1, "None");
foreach (TrainerType tt in gameData.trainerTypes)
trainerTypeToCC.Add(-1, 0);
for (int i = 0; i < gameData.trainerTypes.Count; i++)
{
TrainerType tt = gameData.trainerTypes[i];
trainerTypeLabels.Add(tt.GetID(), tt.GetName());
trainerTypeToCC.Add(tt.GetID(), i + 1);
}
items = gameData.items.Select(o => o.GetName()).ToList();

InitializeComponent();
Expand Down Expand Up @@ -65,7 +72,7 @@ private void RefreshTrainerDisplay()
{
RefreshTextBoxDisplay();

trainerTypeComboBox.SelectedItem = trainerTypeLabels[t.trainerTypeID];
trainerTypeComboBox.SelectedIndex = trainerTypeToCC[t.trainerTypeID];
arenaIDNumericUpDown.Value = t.arenaID;
effectIDNumericUpDown.Value = t.effectID;

Expand Down

0 comments on commit fd2a322

Please sign in to comment.