public static bool?ShowSendMultiDialog(Window owner, int gameIndex) { SendPokemonToWindow window = new SendPokemonToWindow(SendPokemonModes.SendMulti, gameIndex, null, null, 0, null); window.Owner = owner; return(window.ShowDialog()); }
public static bool?ShowGiveItemDialog(Window owner, Item item) { SendPokemonToWindow window = new SendPokemonToWindow(SendPokemonModes.GiveItem, -2, null, null, 0, item); window.Owner = owner; return(window.ShowDialog()); }
public static bool?ShowSendToDialog(Window owner, int gameIndex, IPokemon pokemon) { SendPokemonToWindow window = new SendPokemonToWindow(SendPokemonModes.SendTo, gameIndex, pokemon, null, 0, null); window.Owner = owner; return(window.ShowDialog()); }
public static bool?ShowSendFromDialog(Window owner, int gameIndex, IPokeContainer container, int containerIndex) { SendPokemonToWindow window = new SendPokemonToWindow(SendPokemonModes.SendFrom, gameIndex, null, container, containerIndex, null); window.Owner = owner; return(window.ShowDialog()); }
private void OnSetPokemon(object sender, RoutedEventArgs e) { IPokemon pokemon = SendPokemonToWindow.ShowSelectDialog(this, true); if (pokemon != null) { for (int i = 0; i < newPokemonTeam.Count; i++) { if (i == teamIndex) { continue; } if (pokemon.Personality == newPokemonTeam[i].Personality && PokemonDatabase.GetStartingEvolutionDexID(pokemon.DexID) == PokemonDatabase.GetStartingEvolutionDexID(newPokemonTeam[i].DexID)) { TriggerMessageBox.Show(this, "Cannot use more than one Pokémon with the same personality and family.", "Duplicate Pokémon Detected"); return; } } if (teamIndex < newPokemonTeam.Count) { newPokemonTeam[teamIndex] = pokemon.CreateGBAPokemon(GameTypes.Any, false); } else { newPokemonTeam.Add(pokemon.CreateGBAPokemon(GameTypes.Any, false)); } RefreshTeam(); } }
private void OnContextMenuSendToClicked(object sender, RoutedEventArgs e) { //PokeManager.PickupPokemon(pokeBox, selectedIndex); var result = SendPokemonToWindow.ShowDialog(Window.GetWindow(this), pokeContainer[selectedIndex], pokeContainer, selectedIndex, -2); if (!result.HasValue && !result.Value) { PokeManager.DropPokemon(); } RefreshUI(); }
public static IPokemon ShowSelectDialog(Window owner, bool noEggs) { SendPokemonToWindow window = new SendPokemonToWindow(SendPokemonModes.SelectPokemon, -2, null, null, 0, null, noEggs); window.Owner = owner; var result = window.ShowDialog(); if (result.HasValue && result.Value) { return(window.pokemon); } return(null); }
private void OnSendToClicked(object sender, RoutedEventArgs e) { IPokemon pokemon = clickSelection.Tag as IPokemon; if (pokemon.ContainerIndex == -1) { pokemon = pokemon.PokemonFinder.Pokemon; clickSelection.Tag = pokemon; } if (pokemon.IsReleased) { TriggerMessageBox.Show(this, "Cannot send this Pokémon, it has been released", "Released Pokémon"); } else if (pokemon.IsMoving) { TriggerMessageBox.Show(this, "Cannot send a Pokémon while it is being moved", "Moving Pokémon"); } else if (pokemon.ContainerIndex == -1) { TriggerMessageBox.Show(this, "The Search Results have lost track of " + pokemon.Nickname + " because it has been moved to a different game. This should not happen. Let me know if it does.", "Can't Find Pokémon"); } /*else if (pokemon.PokeContainer.Type == ContainerTypes.Purifier) { * TriggerMessageBox.Show(this, "Cannot send Pokémon in the Purifier", "Can't Send"); * }*/ else if (pokemon.IsShadowPokemon) { TriggerMessageBox.Show(this, "Cannot send Shadow Pokémon to other games", "Can't Send"); } else if (PokeManager.CanPickupPokemon(pokemon)) { SendPokemonToWindow.ShowSendToDialog(PokeManager.ManagerWindow, pokemon.PokePC.GameIndex, pokemon); PokeManager.RefreshUI(); } else if (PokeManager.IsPartyHoldingMail(pokemon.PokeContainer)) { TriggerMessageBox.Show(this, "Cannot send that Pokémon. One of the Pokémon in your party is holding mail. To remove the mail goto the mailbox tab and click Take Mail From Party", "Can't Send"); } else { TriggerMessageBox.Show(this, "Cannot send that Pokémon. It is the last valid Pokémon in your party", "Can't Send"); } }
private void OnGive(object sender, EventArgs e) { SendPokemonToWindow.ShowGiveItemDialog(Window.GetWindow(this), selectedItem); }
public static bool? ShowSendToDialog(Window owner, int gameIndex, IPokemon pokemon) { SendPokemonToWindow window = new SendPokemonToWindow(SendPokemonModes.SendTo, gameIndex, pokemon, null, 0, null); window.Owner = owner; return window.ShowDialog(); }
public static bool? ShowSendMultiDialog(Window owner, int gameIndex) { SendPokemonToWindow window = new SendPokemonToWindow(SendPokemonModes.SendMulti, gameIndex, null, null, 0, null); window.Owner = owner; return window.ShowDialog(); }
public static bool? ShowSendFromDialog(Window owner, int gameIndex, IPokeContainer container, int containerIndex) { SendPokemonToWindow window = new SendPokemonToWindow(SendPokemonModes.SendFrom, gameIndex, null, container, containerIndex, null); window.Owner = owner; return window.ShowDialog(); }
public static IPokemon ShowSelectDialog(Window owner, bool noEggs) { SendPokemonToWindow window = new SendPokemonToWindow(SendPokemonModes.SelectPokemon, -2, null, null, 0, null, noEggs); window.Owner = owner; var result = window.ShowDialog(); if (result.HasValue && result.Value) return window.pokemon; return null; }
public static bool? ShowGiveItemDialog(Window owner, Item item) { SendPokemonToWindow window = new SendPokemonToWindow(SendPokemonModes.GiveItem, -2, null, null, 0, item); window.Owner = owner; return window.ShowDialog(); }