public void MakeValid(PokemonBoxViewer viewer, PokemonBoxViewer check1, PokemonBoxViewer check2 = null) { if (!IsValid(viewer, check1, check2)) { if (GetNumRows(viewer) > 1) { for (int newRow = 0; newRow < GetNumRows(viewer); newRow++) { if (IsValid(GetGameIndex(viewer), newRow, check1, check2)) { //viewer.ComboBoxRows.SelectedIndex = newRow; viewer.LoadUI(-2, newRow); return; } } } for (int newGameIndex = -1; newGameIndex < PokeManager.NumGameSaves; newGameIndex++) { if (GetNumRows(newGameIndex) > 1) { for (int newRow = 0; newRow < GetNumRows(newGameIndex); newRow++) { if (IsValid(newGameIndex, newRow, check1, check2)) { //viewer.ComboBoxGames.SelectedGameIndex = newGameIndex; //viewer.ComboBoxRows.SelectedIndex = newRow; viewer.LoadUI(newGameIndex, newRow); return; } } } else if (IsValid(newGameIndex, 0, check1, check2)) { //viewer.ComboBoxGames.SelectedGameIndex = newGameIndex; viewer.LoadUI(newGameIndex); return; } } } }
public void FindAvailableRow(PokemonBoxViewer viewer, PokemonBoxViewer check1, PokemonBoxViewer check2 = null) { if (!IsValid(viewer, check1, check2)) { if (GetNumRows(viewer) > 1) { for (int newRow = 0; newRow < GetNumRows(viewer); newRow++) { if (IsValid(GetGameIndex(viewer), newRow, check1, check2)) { //viewer.ComboBoxRows.SelectedIndex = newRow; viewer.LoadUI(-2, newRow); return; } } } } }