public SendPokemonToWindow(SendPokemonModes mode, int gameIndex, IPokemon pokemon, IPokeContainer container, int containerIndex, Item giveItem, bool noEggs = false) { InitializeComponent(); loaded2 = false; loaded = false; this.pokemon = pokemon; this.pokeBoxControl.MouseMoveTarget = this; this.pokeBoxControlParty.MouseMoveTarget = this; this.pokeBoxControl.AddSlave(this.pokeBoxControlParty); this.pokeBoxControlParty.Visibility = Visibility.Hidden; this.mode = mode; this.giveItem = giveItem; this.gameIndex = -2; this.noEggs = noEggs; this.pokeBoxControl.PokemonViewer = pokemonViewer; this.pokeBoxControlParty.PokemonViewer = pokemonViewer; this.pokeBoxControl.PokemonSelected += OnPokemonSelected; this.pokeBoxControlParty.PokemonSelected += OnPokemonSelected; if (mode == SendPokemonModes.SendFrom) { this.container = container; this.containerIndex = containerIndex; } else if (mode == SendPokemonModes.GiveItem) { this.Title = "Give Item"; } for (int i = -1; i < PokeManager.NumGameSaves; i++) { IGameSave game = PokeManager.GetGameSaveAt(i); if (i == gameIndex && (!(game is ManagerGameSave) || (game as ManagerGameSave).NumPokePCRows == 1)) { comboBoxGame.SetGameSaveVisible(i, false); continue; } if (pokemon != null && (mode != SendPokemonModes.GiveItem && (pokemon.IsEgg && (game.GameType == GameTypes.Colosseum || game.GameType == GameTypes.XD)))) { comboBoxGame.SetGameSaveVisible(i, false); continue; } else if (mode == SendPokemonModes.SendMulti && PokeManager.SelectionHasEgg && (game.GameType == GameTypes.Colosseum || game.GameType == GameTypes.XD)) { comboBoxGame.SetGameSaveVisible(i, false); continue; } } this.gameIndex = PokeManager.LastGameInDialogIndex; if (this.gameIndex == -2 || !comboBoxGame.IsGameSaveVisible(this.gameIndex)) { comboBoxGame.SelectedIndex = 0; this.gameIndex = comboBoxGame.SelectedGameIndex; } else { comboBoxGame.SelectedGameIndex = this.gameIndex; } loaded = true; if (this.gameIndex != -2) { boxIndex = comboBoxGame.SelectedGameSave.PokePC.CurrentBox; pokePC = PokeManager.GetGameSaveAt(this.gameIndex).PokePC; if (pokePC.Party == null) { partyMode = false; buttonParty.Content = "Show Party"; buttonParty.IsEnabled = false; pokeBoxControlParty.Visibility = Visibility.Hidden; } else { buttonParty.IsEnabled = true; } pokeBoxControl.LoadBox(pokePC[boxIndex], gameIndex); } GameChanged(null, null); }