Fix evo rows not clearing (#250)

This commit is contained in:
JelleInfinity
2022-09-25 02:39:27 +02:00
committed by GitHub
parent 7d5a8b0450
commit 5df700a136

View File

@@ -76,6 +76,7 @@ public PokeDataUI8a(PokeEditor8a editor, GameManager rom, GameData8a data)
InitPersonal();
InitLearn();
InitEvo();
CB_HatchSpecies.Items.AddRange(species.ToArray());
@@ -152,21 +153,12 @@ public void InitLearn()
dgv.Columns.Add(dgvMove);
}
public void InitEvo(int rows)
public void InitEvo()
{
EvoRows = new EvolutionRow8a[rows];
EvolutionRow8a.species = species;
EvolutionRow8a.items = items;
EvolutionRow8a.movelist = movelist;
EvolutionRow8a.types = types;
for (int i = 0; i < rows; i++)
{
var row = new EvolutionRow8a();
flowLayoutPanel1.Controls.Add(row);
flowLayoutPanel1.SetFlowBreak(row, true);
EvoRows[i] = row;
}
}
public void UpdateIndex(object sender, EventArgs e)
@@ -456,11 +448,17 @@ public void LoadEvolutions(EvolutionSet8a s)
return;
var numPossibleEvos = cEvos.Table.Length;
InitEvo(numPossibleEvos);
flowLayoutPanel1.Controls.Clear();
EvoRows = new EvolutionRow8a[numPossibleEvos];
for (int i = 0; i < numPossibleEvos; i++)
{
var row = EvoRows[i];
var row = new EvolutionRow8a();
flowLayoutPanel1.Controls.Add(row);
flowLayoutPanel1.SetFlowBreak(row, true);
EvoRows[i] = row;
row.LoadEvolution(cEvos.Table[i]);
}
}