Filter out z-moves for move datasource

Not valid moves to choose from
This commit is contained in:
Kurt 2016-11-10 21:49:08 -08:00
parent bcb551af31
commit 1fffd4eab5
3 changed files with 11 additions and 2 deletions

View File

@ -250,6 +250,7 @@ public string[] getItemStrings(int generation, GameVersion game)
// DataSource providing
public static List<ComboItem> MoveDataSource, ItemDataSource, SpeciesDataSource, BallDataSource, NatureDataSource, AbilityDataSource, VersionDataSource;
public static List<ComboItem> HaXMoveDataSource;
private static List<ComboItem> metGen2, metGen3, metGen3CXD, metGen4, metGen5, metGen6, metGen7;
public static void InitializeDataSources(GameStrings s)
{
@ -261,7 +262,8 @@ public static void InitializeDataSources(GameStrings s)
AbilityDataSource = Util.getCBList(s.abilitylist, null);
VersionDataSource = Util.getCBList(s.gamelist, Legal.Games_7sm, Legal.Games_6oras, Legal.Games_6xy, Legal.Games_5, Legal.Games_4, Legal.Games_4e, Legal.Games_4r, Legal.Games_3, Legal.Games_3e, Legal.Games_3r, Legal.Games_3s);
MoveDataSource = Util.getCBList(s.movelist, null);
HaXMoveDataSource = Util.getCBList(s.movelist, null);
MoveDataSource = HaXMoveDataSource.Where(m => !Legal.Z_Moves.Contains(m.Value)).ToList();
#region Met Locations
// Gen 2
{

View File

@ -191,6 +191,13 @@ public static partial class Legal
};
internal static readonly int[] BattlePrimals = { 382, 383 };
internal static readonly int[] Z_Moves =
{
622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658,
695, 696, 697, 698, 699, 700, 701, 702, 703,
719,
};
#region Games
internal static readonly int[] Games_7sm = { 30, 31 };

View File

@ -1308,7 +1308,7 @@ private void populateFilteredDataSources()
CB_GameOrigin.DataSource = new BindingSource(GameInfo.VersionDataSource.Where(g => g.Value <= SAV.MaxGameID || SAV.Generation >= 3 && g.Value == 15).ToList(), null);
// Set the Move ComboBoxes too..
var moves = GameInfo.MoveDataSource.Where(m => m.Value <= SAV.MaxMoveID).ToList();
var moves = (HaX ? GameInfo.HaXMoveDataSource : GameInfo.MoveDataSource).Where(m => m.Value <= SAV.MaxMoveID).ToList(); // Filter Z-Moves if appropriate
foreach (ComboBox cb in new[] { CB_Move1, CB_Move2, CB_Move3, CB_Move4, CB_RelearnMove1, CB_RelearnMove2, CB_RelearnMove3, CB_RelearnMove4 })
{
cb.DisplayMember = "Text"; cb.ValueMember = "Value";