From f200cbaa48a89d893fad65dc121df79791e6face Mon Sep 17 00:00:00 2001 From: CaptainSegis Date: Fri, 11 Aug 2017 02:01:17 -0500 Subject: [PATCH] Updated the new GUI to the latest state of the cool_menus_experiment branch. --- 2.5DHero/2.5DHero/2.5DHero.vbproj | 8 --- .../Battle/BattleSystemV2/BattleMenu.vb | 35 +++++++-- .../QueryObjects/SwitchPokemonQueryObject.vb | 9 ++- .../2.5DHero/Entites/Enviroment/LoamySoil.vb | 11 ++- .../Network/GameJolt/GTS/GTSSetupScreen.vb | 9 ++- .../Network/GameJolt/GTS/GTSTradeScreen.vb | 13 +++- .../Network/GameJolt/GTS/WonderTradeScreen.vb | 9 ++- .../Network/Servers/DirectTradeScreen.vb | 10 ++- .../Network/Servers/PVPLobbyScreen.vb | 9 ++- .../2.5DHero/Overworld/OverworldScreen.vb | 2 +- .../Pokemon/Items/Berries/AspearBerry.vb | 5 +- .../Pokemon/Items/Berries/CheriBerry.vb | 5 +- .../Pokemon/Items/Berries/ChestoBerry.vb | 5 +- .../Pokemon/Items/Berries/GrepaBerry.vb | 5 +- .../Pokemon/Items/Berries/HondewBerry.vb | 5 +- .../Pokemon/Items/Berries/KelpsyBerry.vb | 5 +- .../Pokemon/Items/Berries/LeppaBerry.vb | 5 +- .../Pokemon/Items/Berries/OranBerry.vb | 5 +- .../Pokemon/Items/Berries/PechaBerry.vb | 5 +- .../Pokemon/Items/Berries/PomegBerry.vb | 5 +- .../Pokemon/Items/Berries/QualotBerry.vb | 5 +- .../Pokemon/Items/Berries/RawstBerry.vb | 5 +- .../Pokemon/Items/Berries/SitrusBerry.vb | 9 ++- .../Pokemon/Items/Berries/TamatoBerry.vb | 5 +- 2.5DHero/2.5DHero/Pokemon/Items/Item.vb | 4 ++ .../Pokemon/Items/Medicine/Antidote.vb | 5 +- .../Pokemon/Items/Medicine/Awakening.vb | 5 +- .../Pokemon/Items/Medicine/BerryJuice.vb | 5 +- .../Pokemon/Items/Medicine/BurnHeal.vb | 5 +- .../2.5DHero/Pokemon/Items/Medicine/Elixir.vb | 5 +- .../Pokemon/Items/Medicine/EnergyPowder.vb | 5 +- .../Pokemon/Items/Medicine/EnergyRoot.vb | 5 +- .../2.5DHero/Pokemon/Items/Medicine/Ether.vb | 5 +- .../2.5DHero/Pokemon/Items/Medicine/Fanta.vb | 5 +- .../Pokemon/Items/Medicine/FreshWater.vb | 5 +- .../Pokemon/Items/Medicine/FullHeal.vb | 5 +- .../Pokemon/Items/Medicine/FullRestore.vb | 5 +- .../Pokemon/Items/Medicine/HealPowder.vb | 5 +- .../Pokemon/Items/Medicine/HyperPotion.vb | 5 +- .../Pokemon/Items/Medicine/IceHeal.vb | 5 +- .../Pokemon/Items/Medicine/LavaCookie.vb | 5 +- .../Pokemon/Items/Medicine/Lemonade.vb | 5 +- .../Pokemon/Items/Medicine/MaxElixir.vb | 5 +- .../Pokemon/Items/Medicine/MaxEther.vb | 5 +- .../Pokemon/Items/Medicine/MaxPotion.vb | 5 +- .../Pokemon/Items/Medicine/MaxRevive.vb | 5 +- .../Pokemon/Items/Medicine/MooMooMilk.vb | 5 +- .../2.5DHero/Pokemon/Items/Medicine/PPMax.vb | 5 +- .../2.5DHero/Pokemon/Items/Medicine/PPUp.vb | 5 +- .../Pokemon/Items/Medicine/ParalyzeHeal.vb | 5 +- .../2.5DHero/Pokemon/Items/Medicine/Potion.vb | 5 +- .../Pokemon/Items/Medicine/RageCandyBar.vb | 5 +- .../Pokemon/Items/Medicine/RareCandy.vb | 5 +- .../Pokemon/Items/Medicine/RevivalHerb.vb | 5 +- .../2.5DHero/Pokemon/Items/Medicine/Revive.vb | 5 +- .../Pokemon/Items/Medicine/ShinyCandy.vb | 5 +- .../Pokemon/Items/Medicine/SodaPop.vb | 5 +- .../Pokemon/Items/Medicine/SuperPotion.vb | 5 +- .../2.5DHero/Pokemon/Items/MedicineItem.vb | 71 +++++++------------ .../Pokemon/Items/Standard/AbilityCapsule.vb | 5 +- 2.5DHero/2.5DHero/Pokemon/Items/StoneItem.vb | 5 +- .../2.5DHero/Pokemon/Items/TechMachine.vb | 5 +- .../2.5DHero/Pokemon/Items/VitaminItem.vb | 5 +- 2.5DHero/2.5DHero/Pokemon/Items/WingItem.vb | 5 +- .../Screens/Inventory/ItemDetailScreen.vb | 9 ++- .../2.5DHero/Screens/PC/MailSystemScreen.vb | 20 +++++- .../Screens/PC/StorageSystemScreen.vb | 4 +- .../2.5DHero/World/ActionScript/Script.vb | 4 ++ .../V2/ScriptCommands/DoPokemon.vb | 11 ++- 69 files changed, 375 insertions(+), 127 deletions(-) diff --git a/2.5DHero/2.5DHero/2.5DHero.vbproj b/2.5DHero/2.5DHero/2.5DHero.vbproj index 6a86ca103..61536e744 100644 --- a/2.5DHero/2.5DHero/2.5DHero.vbproj +++ b/2.5DHero/2.5DHero/2.5DHero.vbproj @@ -1661,7 +1661,6 @@ - @@ -1672,8 +1671,6 @@ - - @@ -1689,7 +1686,6 @@ - @@ -1708,9 +1704,6 @@ - - - @@ -1718,7 +1711,6 @@ - diff --git a/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleMenu.vb b/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleMenu.vb index 58d5fbeda..56a713441 100644 --- a/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleMenu.vb +++ b/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleMenu.vb @@ -692,14 +692,24 @@ Private Sub MainMenuOpenPokemon(ByVal BattleScreen As BattleScreen) TempBattleScreen = BattleScreen - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf ShowPokemonMenu, "Choose Pokémon", True)) - CType(Core.CurrentScreen, PartyScreen)._index = BattleScreen.OwnPokemonIndex + + Player.Temp.PokemonScreenIndex = BattleScreen.OwnPokemonIndex + Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf ShowPokemonMenu, "Choose Pokémon", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf ShowPokemonMenuHandler + + Core.SetScreen(selScreen) + End Sub Private Sub MainMenuOpenBag(ByVal BattleScreen As BattleScreen) If BattleScreen.CanUseItems = True Then TempBattleScreen = BattleScreen - Core.SetScreen(New NewInventoryScreen(Core.CurrentScreen, {}, AddressOf SelectedItem)) + Dim selScreen As New NewInventoryScreen(Core.CurrentScreen) + selScreen.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection + selScreen.CanExit = True + + AddHandler selScreen.SelectedObject, AddressOf SelectedItemHandler + Core.SetScreen(selScreen) End If End Sub @@ -908,9 +918,12 @@ #Region "SwitchPokemon" Shared TempBattleScreen As BattleScreen + Private Shared Sub ShowPokemonMenuHandler(ByVal params As Object()) + ShowPokemonMenu(CInt(params(0))) + End Sub Private Shared Sub ShowPokemonMenu(ByVal PokeIndex As Integer) - Core.SetScreen(New BattlePokemonInfoScreen(Core.CurrentScreen, PokeIndex, AddressOf SwitchPokemonTo, TempBattleScreen)) + SwitchPokemonTo(PokeIndex) End Sub Private Shared Sub SwitchPokemonTo(ByVal PokeIndex As Integer) @@ -953,6 +966,10 @@ #Region "UseItem" + Private Shared Sub SelectedItemHandler(ByVal params As Object()) + SelectedItem(CInt(params(0))) + End Sub + Private Shared Sub SelectedItem(ByVal itemID As Integer) Dim Item As Item = Item.GetItemByID(itemID) @@ -982,7 +999,11 @@ TempItemID = itemID If Item.BattleSelectPokemon = True Then - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Item, AddressOf UseItem, "Use " & Item.Name, True)) + 'Core.SetScreen(New PartyScreen(Core.CurrentScreen, Item, AddressOf UseItem, "Use " & Item.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Item, AddressOf Item.UseOnPokemon, "Use " & Item.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemHandler + + Core.SetScreen(selScreen) Else UseItem(0) End If @@ -992,6 +1013,10 @@ Shared TempItemID As Integer = -1 + Private Shared Sub UseItemhandler(ByVal params As Object()) + UseItem(CInt(params(0))) + End Sub + Private Shared Sub UseItem(ByVal PokeIndex As Integer) Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex) diff --git a/2.5DHero/2.5DHero/Battle/BattleSystemV2/QueryObjects/SwitchPokemonQueryObject.vb b/2.5DHero/2.5DHero/Battle/BattleSystemV2/QueryObjects/SwitchPokemonQueryObject.vb index eb5ccf365..6f312cc4c 100644 --- a/2.5DHero/2.5DHero/Battle/BattleSystemV2/QueryObjects/SwitchPokemonQueryObject.vb +++ b/2.5DHero/2.5DHero/Battle/BattleSystemV2/QueryObjects/SwitchPokemonQueryObject.vb @@ -109,7 +109,10 @@ If Controls.Accept(True, True, True) = True Then If _chooseIndex = 0 Then - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf Me.ChoosePokemon, "Choose Pokémon to battle:", False)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf ChoosePokemon, "Choose Pokémon to battle!", False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf ChoosePokemonHandler + + Core.SetScreen(selScreen) Else _ready = True End If @@ -118,6 +121,10 @@ Dim TempScreen As BattleScreen + Private Sub ChoosePokemonHandler(ByVal params As Object()) + ChoosePokemon(CInt(params(0))) + End Sub + Private Sub ChoosePokemon(ByVal PokeIndex As Integer) TempScreen.Battle.SwitchOutOwn(TempScreen, PokeIndex, insertIndex) Me._ready = True diff --git a/2.5DHero/2.5DHero/Entites/Enviroment/LoamySoil.vb b/2.5DHero/2.5DHero/Entites/Enviroment/LoamySoil.vb index a02a25643..17cbaac58 100644 --- a/2.5DHero/2.5DHero/Entites/Enviroment/LoamySoil.vb +++ b/2.5DHero/2.5DHero/Entites/Enviroment/LoamySoil.vb @@ -25,10 +25,19 @@ Public Overrides Sub ResultFunction(ByVal Result As Integer) If Result = 0 Then - Core.SetScreen(New NewInventoryScreen(Core.CurrentScreen, {4}, 4, AddressOf Me.PlantBerry)) + Dim selScreen As New NewInventoryScreen(Core.CurrentScreen, {2}, 2, Nothing) + selScreen.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection + selScreen.CanExit = True + + AddHandler selScreen.SelectedObject, AddressOf PlantBerryHandler + Core.SetScreen(selScreen) End If End Sub + Public Sub PlantBerryHandler(ByVal params As Object()) + PlantBerry(CInt(params(0))) + End Sub + Public Sub PlantBerry(ByVal ChosenBerry As Integer) Dim testItem As Item = Item.GetItemByID(ChosenBerry) If testItem.isBerry = True Then diff --git a/2.5DHero/2.5DHero/Network/GameJolt/GTS/GTSSetupScreen.vb b/2.5DHero/2.5DHero/Network/GameJolt/GTS/GTSSetupScreen.vb index e36c5b984..8ae8c8843 100644 --- a/2.5DHero/2.5DHero/Network/GameJolt/GTS/GTSSetupScreen.vb +++ b/2.5DHero/2.5DHero/Network/GameJolt/GTS/GTSSetupScreen.vb @@ -716,7 +716,10 @@ Core.SetScreen(New SelectFriendScreen(Me)) End If If New Rectangle(100, 300, 32 * 5 + 64, 32).Contains(MouseHandler.MousePosition) = True Then - Core.SetScreen(New PartyScreen(Me, Item.GetItemByID(5), AddressOf ChosenPokemon, "Choose Pokémon to trade", True, True, False)) + Dim selScreen = New PartyScreen(Me, Item.GetItemByID(5), AddressOf ChosenPokemon, "Choose Pokémon for Trade", True, True, False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf ChosenPokemonHandler + + Core.SetScreen(selScreen) CType(Core.CurrentScreen, PartyScreen).CanChooseHMPokemon = False End If If New Rectangle(700, 540, 32 * 3 + 64, 32).Contains(MouseHandler.MousePosition) = True Then @@ -739,6 +742,10 @@ End If End Sub + Private Sub ChosenPokemonHandler(ByVal params As Object()) + ChosenPokemon(CInt(params(0))) + End Sub + Private Sub ChosenPokemon(ByVal PokeIndex As Integer) If Me.PokeIndex = -1 And NewTrade = False Then LoadedPokemon = D.Pokemon diff --git a/2.5DHero/2.5DHero/Network/GameJolt/GTS/GTSTradeScreen.vb b/2.5DHero/2.5DHero/Network/GameJolt/GTS/GTSTradeScreen.vb index 9818efd76..56ed76981 100644 --- a/2.5DHero/2.5DHero/Network/GameJolt/GTS/GTSTradeScreen.vb +++ b/2.5DHero/2.5DHero/Network/GameJolt/GTS/GTSTradeScreen.vb @@ -44,13 +44,18 @@ If Controls.Accept(True, False) = True Then If New Rectangle(180, 560, 32 * 5 + 64, 32).Contains(MouseHandler.MousePosition) = True Then - Core.SetScreen(New PartyScreen(Me, Item.GetItemByID(5), AddressOf ChosePokemon, "Chose Pokémon to trade!", True)) + + Dim selScreen = New PartyScreen(Me, Item.GetItemByID(5), AddressOf ChosePokemon, "Choose Pokémon to trade", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf ChosePokemonHandler + + Core.SetScreen(selScreen) End If If New Rectangle(180, 510, 32 * 5 + 64, 32).Contains(MouseHandler.MousePosition) = True Then PokeIndex = -1 End If If New Rectangle(780, 560, 32 * 5 + 64, 32).Contains(MouseHandler.MousePosition) = True Then - Core.SetScreen(New PokemonStatusScreen(Me, 0, {D.Pokemon}, D.Pokemon, False)) + Core.SetScreen(New SummaryScreen(Me, {D.Pokemon}, 0)) + ''Core.SetScreen(New PokemonStatusScreen(Me, 0, {D.Pokemon}, D.Pokemon, False)) End If If New Rectangle(520, 560, 32 * 3 + 64, 32).Contains(MouseHandler.MousePosition) = True Then If MeetsCondition() = True Then @@ -64,6 +69,10 @@ End If End Sub + Private Sub ChosePokemonHandler(ByVal params As Object()) + ChosePokemon(CInt(params(0))) + End Sub + Private Sub ChosePokemon(ByVal PokeIndex As Integer) Me.PokeIndex = PokeIndex End Sub diff --git a/2.5DHero/2.5DHero/Network/GameJolt/GTS/WonderTradeScreen.vb b/2.5DHero/2.5DHero/Network/GameJolt/GTS/WonderTradeScreen.vb index 93122ee97..01d6554ef 100644 --- a/2.5DHero/2.5DHero/Network/GameJolt/GTS/WonderTradeScreen.vb +++ b/2.5DHero/2.5DHero/Network/GameJolt/GTS/WonderTradeScreen.vb @@ -202,7 +202,10 @@ If Me.OpenedSelect = True Then Me.CloseScreen() Else - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf Me.SelectPokemonForTrade, "Choose Pokémon for Trade", True, True, False)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf SelectPokemonForTrade, "Choose Pokémon for Trade", True, False, False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf SelectPokemonForTradeHandler + + Core.SetScreen(selScreen) CType(Core.CurrentScreen, PartyScreen).CanChooseHMPokemon = False Me.OpenedSelect = True End If @@ -243,6 +246,10 @@ End Select End Sub + Private Sub SelectPokemonForTradeHandler(ByVal params As Object()) + SelectPokemonForTrade(CInt(params(0))) + End Sub + Private Sub SelectPokemonForTrade(ByVal pokeIndex As Integer) Me.SelectedPokemonIndex = pokeIndex Me.SelectedPokemon = Core.Player.Pokemons(pokeIndex) diff --git a/2.5DHero/2.5DHero/Network/Servers/DirectTradeScreen.vb b/2.5DHero/2.5DHero/Network/Servers/DirectTradeScreen.vb index 85978e172..dadc7f81a 100644 --- a/2.5DHero/2.5DHero/Network/Servers/DirectTradeScreen.vb +++ b/2.5DHero/2.5DHero/Network/Servers/DirectTradeScreen.vb @@ -288,8 +288,12 @@ Case 0 Me.StartTrade() Case 1 - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf Me.SelectPokemonForTrade, "Choose Pokémon for Trade", True, False, False)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf SelectPokemonForTrade, "Choose Pokémon for Trade", True, False, False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf SelectPokemonForTradeHandler + + Core.SetScreen(selScreen) CType(Core.CurrentScreen, PartyScreen).CanChooseHMPokemon = False + Case 2 Me.QuitTrade() End Select @@ -314,6 +318,10 @@ End If End Sub + Private Sub SelectPokemonForTradeHandler(ByVal params As Object()) + SelectPokemonForTrade(CInt(params(0))) + End Sub + Private Sub SelectPokemonForTrade(ByVal pokeIndex As Integer) If pokeIndex > -1 Then Me.OfferPokemon = Core.Player.Pokemons(pokeIndex) diff --git a/2.5DHero/2.5DHero/Network/Servers/PVPLobbyScreen.vb b/2.5DHero/2.5DHero/Network/Servers/PVPLobbyScreen.vb index 644d88cf4..35b5cf966 100644 --- a/2.5DHero/2.5DHero/Network/Servers/PVPLobbyScreen.vb +++ b/2.5DHero/2.5DHero/Network/Servers/PVPLobbyScreen.vb @@ -286,10 +286,17 @@ Private Sub StartBattle() If Not Me.OwnTeam Is Nothing And Not OppTeam Is Nothing Then - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf LeadPickedStart, "Choose your lead.", True, True, False, _pokemonList:=OwnTeam)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf LeadPickedStart, "Choose your Lead", True, True, False, _pokemonList:=OwnTeam) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf LeadPickedStartHandler + + Core.SetScreen(selScreen) End If End Sub + Public Sub LeadPickedStartHandler(ByVal params As Object()) + LeadPickedStart(CInt(params(0))) + End Sub + Private Sub LeadPickedStart(ByVal index As Integer) BattleSystem.BattleScreen.OwnLeadIndex = index Core.ServersManager.ServerConnection.SendPackage(New Servers.Package(Servers.Package.PackageTypes.BattleOffer, diff --git a/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb b/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb index 3aeeeb4be..aedabdf0a 100644 --- a/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb +++ b/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb @@ -173,7 +173,7 @@ Public Class OverworldScreen If ActionScript.IsReady = True Then If MouseHandler.ButtonPressed(MouseHandler.MouseButtons.MiddleButton) = True Or ControllerHandler.ButtonPressed(Buttons.LeftStick) = True Then If Core.Player.Pokemons.Count > 0 Then - Core.SetScreen(New PokemonStatusScreen(Core.CurrentScreen, 0, {}, Core.Player.Pokemons(0), True)) + Core.SetScreen(New SummaryScreen(CurrentScreen, Core.Player.Pokemons.ToArray, 0)) End If End If End If diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/AspearBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/AspearBerry.vb index 9bc90c404..43ed36a97 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/AspearBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/AspearBerry.vb @@ -19,7 +19,10 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/CheriBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/CheriBerry.vb index 0f4c03f35..b9b6f6087 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/CheriBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/CheriBerry.vb @@ -19,7 +19,10 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/ChestoBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/ChestoBerry.vb index a5cca79a3..ef2b27701 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/ChestoBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/ChestoBerry.vb @@ -19,7 +19,10 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/GrepaBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/GrepaBerry.vb index 12a88e0b4..9c076efbf 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/GrepaBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/GrepaBerry.vb @@ -19,7 +19,10 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/HondewBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/HondewBerry.vb index 183f6a4f1..778b6fbbe 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/HondewBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/HondewBerry.vb @@ -19,7 +19,10 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/KelpsyBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/KelpsyBerry.vb index 5eed1e7c8..1bd0c2a9b 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/KelpsyBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/KelpsyBerry.vb @@ -19,7 +19,10 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/LeppaBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/LeppaBerry.vb index cda9fdf4a..48d0b87db 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/LeppaBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/LeppaBerry.vb @@ -19,7 +19,10 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/OranBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/OranBerry.vb index 7cf34376f..4f1aa0ed9 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/OranBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/OranBerry.vb @@ -25,7 +25,10 @@ Namespace Items.Berries Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemHandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/PechaBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/PechaBerry.vb index d66964367..4d19b892d 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/PechaBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/PechaBerry.vb @@ -19,7 +19,10 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/PomegBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/PomegBerry.vb index 46eb49825..b32061184 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/PomegBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/PomegBerry.vb @@ -19,7 +19,10 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/QualotBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/QualotBerry.vb index 9d8f79a17..78b0535d9 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/QualotBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/QualotBerry.vb @@ -19,7 +19,10 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/RawstBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/RawstBerry.vb index dfacae9da..07a491c30 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/RawstBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/RawstBerry.vb @@ -19,7 +19,10 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/SitrusBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/SitrusBerry.vb index 8be03b334..828668a9d 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/SitrusBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/SitrusBerry.vb @@ -19,7 +19,14 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + If CBool(GameModeManager.GetGameRuleValue("CanUseHealItem", "1")) = False Then + Screen.TextBox.Show("Cannot use heal items.", {}, False, False) + Exit Sub + End If + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Berries/TamatoBerry.vb b/2.5DHero/2.5DHero/Pokemon/Items/Berries/TamatoBerry.vb index 154cbbf3b..8db5d3afd 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Berries/TamatoBerry.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Berries/TamatoBerry.vb @@ -19,7 +19,10 @@ Namespace Items.Berries End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Item.vb b/2.5DHero/2.5DHero/Pokemon/Items/Item.vb index 38e35baa1..3884e4a16 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Item.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Item.vb @@ -200,6 +200,10 @@ Public MustInherit Class Item Logger.Debug("PLACEHOLDER FOR ITEM USE") End Sub + Public Sub UseItemhandler(ByVal params As Object()) + UseOnPokemon(CInt(params(0))) + End Sub + ''' ''' A method that gets used when the item is applied to a Pokémon. Returns True if the action was successful. ''' diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Antidote.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Antidote.vb index be44b73d0..6df407d7e 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Antidote.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Antidote.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Awakening.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Awakening.vb index 17cdaeab3..5dd7c8c90 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Awakening.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Awakening.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/BerryJuice.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/BerryJuice.vb index da25fe5d4..d1c3d9e30 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/BerryJuice.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/BerryJuice.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/BurnHeal.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/BurnHeal.vb index c95c905c1..b5aa77c43 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/BurnHeal.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/BurnHeal.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Elixir.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Elixir.vb index 580cc7c0c..b63961a2e 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Elixir.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Elixir.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/EnergyPowder.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/EnergyPowder.vb index 2c86deb16..3f8592216 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/EnergyPowder.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/EnergyPowder.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/EnergyRoot.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/EnergyRoot.vb index 874e7959d..599c383ef 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/EnergyRoot.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/EnergyRoot.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Ether.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Ether.vb index ff69f8dbd..558a0fe54 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Ether.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Ether.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Fanta.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Fanta.vb index f607325d9..03407408c 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Fanta.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Fanta.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/FreshWater.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/FreshWater.vb index 55d9f1f2b..55c0da758 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/FreshWater.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/FreshWater.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/FullHeal.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/FullHeal.vb index fb0f241c9..21b7bfc8c 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/FullHeal.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/FullHeal.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/FullRestore.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/FullRestore.vb index 60e928131..1fd7f56b2 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/FullRestore.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/FullRestore.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/HealPowder.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/HealPowder.vb index 9c7aa1059..44ca8f249 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/HealPowder.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/HealPowder.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/HyperPotion.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/HyperPotion.vb index 0ae13d176..67db8987f 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/HyperPotion.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/HyperPotion.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/IceHeal.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/IceHeal.vb index a65b40a24..cfdc26cb5 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/IceHeal.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/IceHeal.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/LavaCookie.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/LavaCookie.vb index 36ac7d12f..417a7b8ed 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/LavaCookie.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/LavaCookie.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Lemonade.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Lemonade.vb index d8ef04050..916540dd6 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Lemonade.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Lemonade.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxElixir.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxElixir.vb index d08fe96f6..932bc03cd 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxElixir.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxElixir.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxEther.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxEther.vb index 3de045d84..6fcafe078 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxEther.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxEther.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxPotion.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxPotion.vb index 556fd85c1..075d9d1bc 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxPotion.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxPotion.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxRevive.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxRevive.vb index 555a8da86..26dd8e488 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxRevive.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MaxRevive.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MooMooMilk.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MooMooMilk.vb index 77489d1e1..82dcff737 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MooMooMilk.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/MooMooMilk.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/PPMax.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/PPMax.vb index cc41b8230..defab731d 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/PPMax.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/PPMax.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/PPUp.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/PPUp.vb index fc7aab320..87da64b68 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/PPUp.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/PPUp.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/ParalyzeHeal.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/ParalyzeHeal.vb index f13e0ca52..9a5afc992 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/ParalyzeHeal.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/ParalyzeHeal.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Potion.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Potion.vb index 5dc6c1885..f2ac38fc2 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Potion.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Potion.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/RageCandyBar.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/RageCandyBar.vb index 4e39aa171..13076e66c 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/RageCandyBar.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/RageCandyBar.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/RareCandy.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/RareCandy.vb index 23e9bab46..9be1ae480 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/RareCandy.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/RareCandy.vb @@ -14,7 +14,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/RevivalHerb.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/RevivalHerb.vb index 863704516..285efb29a 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/RevivalHerb.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/RevivalHerb.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Revive.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Revive.vb index bdae62847..98085e2d5 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Revive.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/Revive.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/ShinyCandy.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/ShinyCandy.vb index 961da0587..521c0e502 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/ShinyCandy.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/ShinyCandy.vb @@ -13,7 +13,10 @@ Namespace Items.Medicine End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/SodaPop.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/SodaPop.vb index ff2ed8e18..ceba42d68 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/SodaPop.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/SodaPop.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/SuperPotion.vb b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/SuperPotion.vb index d4fb2c925..2efff0d5f 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Medicine/SuperPotion.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Medicine/SuperPotion.vb @@ -18,7 +18,10 @@ Namespace Items.Medicine Screen.TextBox.Show("Cannot use heal items.", {}, False, False) Exit Sub End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/MedicineItem.vb b/2.5DHero/2.5DHero/Pokemon/Items/MedicineItem.vb index b1628c99e..ff8a4cc84 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/MedicineItem.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/MedicineItem.vb @@ -26,14 +26,11 @@ Namespace Items End If If Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Fainted Then - Screen.TextBox.reDelay = 0.0F - Screen.TextBox.Show(Pokemon.GetDisplayName() & "~is fainted!", {}) - + CType(CurrentScreen, PartyScreen).ShowMessage(Pokemon.GetDisplayName() & " is fainted!") Return False Else If Pokemon.HP = Pokemon.MaxHP Then - Screen.TextBox.reDelay = 0.0F - Screen.TextBox.Show(Pokemon.GetDisplayName() & " has full~HP already.", {}) + CType(CurrentScreen, PartyScreen).ShowMessage(Pokemon.GetDisplayName() & " has full HP already.") Return False Else @@ -42,13 +39,11 @@ Namespace Items Pokemon.Heal(HP) - Screen.TextBox.reDelay = 0.0F - - Dim t As String = "Restored " & Pokemon.GetDisplayName() & "'s~HP by " & diff & "." + Dim t As String = "Restored " & Pokemon.GetDisplayName() & "'s HP by " & diff & "." t &= RemoveItem() SoundManager.PlaySound("single_heal", False) - Screen.TextBox.Show(t, {}) + CType(CurrentScreen, PartyScreen).ShowMessage(t) PlayerStatistics.Track("[17]Medicine Items used", 1) Return True @@ -68,27 +63,23 @@ Namespace Items Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex) If Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Fainted Then - Screen.TextBox.reDelay = 0.0F - Screen.TextBox.Show(Pokemon.GetDisplayName() & "~is fainted!", {}) - + CType(CurrentScreen, PartyScreen).ShowMessage(Pokemon.GetDisplayName() & " is fainted!") Return False + ElseIf Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Poison Or Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.BadPoison Then Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.None - Screen.TextBox.reDelay = 0.0F Dim t As String = "Cures the poison of " & Pokemon.GetDisplayName() & "." t &= RemoveItem() PlayerStatistics.Track("[17]Medicine Items used", 1) SoundManager.PlaySound("single_heal", False) - Screen.TextBox.Show(t, {}) + CType(CurrentScreen, PartyScreen).ShowMessage(t) Return True Else - Screen.TextBox.reDelay = 0.0F - Screen.TextBox.Show(Pokemon.GetDisplayName() & " is not poisoned.", {}) - + CType(CurrentScreen, PartyScreen).ShowMessage(Pokemon.GetDisplayName() & " is not poisoned.") Return False End If End Function @@ -105,26 +96,23 @@ Namespace Items Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex) If Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Fainted Then - Screen.TextBox.reDelay = 0.0F - Screen.TextBox.Show(Pokemon.GetDisplayName() & "~is fainted!", {}) - + CType(CurrentScreen, PartyScreen).ShowMessage(Pokemon.GetDisplayName() & " is fainted!") Return False + ElseIf Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Sleep Then Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.None - Screen.TextBox.reDelay = 0.0F Dim t As String = "Cures the sleep of " & Pokemon.GetDisplayName() & "." t &= RemoveItem() SoundManager.PlaySound("single_heal", False) - Screen.TextBox.Show(t, {}) + CType(CurrentScreen, PartyScreen).ShowMessage(t) PlayerStatistics.Track("[17]Medicine Items used", 1) Return True Else - Screen.TextBox.reDelay = 0.0F - Screen.TextBox.Show(Pokemon.GetDisplayName() & " is not asleep.", {}) + CType(CurrentScreen, PartyScreen).ShowMessage(Pokemon.GetDisplayName() & " is not asleep.") Return False End If @@ -142,26 +130,23 @@ Namespace Items Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex) If Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Fainted Then - Screen.TextBox.reDelay = 0.0F - Screen.TextBox.Show(Pokemon.GetDisplayName() & "~is fainted!", {}) - + CType(CurrentScreen, PartyScreen).ShowMessage(Pokemon.GetDisplayName() & " is fainted!") Return False + ElseIf Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Burn Then Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.None - Screen.TextBox.reDelay = 0.0F Dim t As String = "Cures the burn of " & Pokemon.GetDisplayName() & "." t &= RemoveItem() SoundManager.PlaySound("single_heal", False) - Screen.TextBox.Show(t, {}) + CType(CurrentScreen, PartyScreen).ShowMessage(t) PlayerStatistics.Track("[17]Medicine Items used", 1) Return True Else - Screen.TextBox.reDelay = 0.0F - Screen.TextBox.Show(Pokemon.GetDisplayName() & " is not burned.", {}) + CType(CurrentScreen, PartyScreen).ShowMessage(Pokemon.GetDisplayName() & " is not burned.") Return False End If @@ -179,28 +164,25 @@ Namespace Items Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex) If Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Fainted Then - Screen.TextBox.reDelay = 0.0F - Screen.TextBox.Show(Pokemon.GetDisplayName() & "~is fainted!", {}) - + CType(CurrentScreen, PartyScreen).ShowMessage(Pokemon.GetDisplayName() & " is fainted!") Return False + ElseIf Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Freeze Then Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.None Core.Player.Inventory.RemoveItem(Me.ID, 1) - Screen.TextBox.reDelay = 0.0F Dim t As String = "Cures the ice of " & Pokemon.GetDisplayName() & "." t &= RemoveItem() SoundManager.PlaySound("single_heal", False) - Screen.TextBox.Show(t, {}) + CType(CurrentScreen, PartyScreen).ShowMessage(t) PlayerStatistics.Track("[17]Medicine Items used", 1) Return True Else - Screen.TextBox.reDelay = 0.0F - Screen.TextBox.Show(Pokemon.GetDisplayName() & " is not frozen.", {}) + CType(CurrentScreen, PartyScreen).ShowMessage(Pokemon.GetDisplayName() & " is not frozen.") Return False End If @@ -218,28 +200,25 @@ Namespace Items Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex) If Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Fainted Then - Screen.TextBox.reDelay = 0.0F - Screen.TextBox.Show(Pokemon.GetDisplayName() & "~is fainted!", {}) - + CType(CurrentScreen, PartyScreen).ShowMessage(Pokemon.GetDisplayName() & " is fainted!") Return False + ElseIf Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Paralyzed Then Pokemon.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.None Core.Player.Inventory.RemoveItem(Me.ID, 1) - Screen.TextBox.reDelay = 0.0F - Dim t As String = "Cures the paralyzis~of " & Pokemon.GetDisplayName() & "." + Dim t As String = "Cures the paralysis of " & Pokemon.GetDisplayName() & "." t &= RemoveItem() SoundManager.PlaySound("single_heal", False) - Screen.TextBox.Show(t, {}) + CType(CurrentScreen, PartyScreen).ShowMessage(t) PlayerStatistics.Track("[17]Medicine Items used", 1) Return True Else - Screen.TextBox.reDelay = 0.0F - Screen.TextBox.Show(Pokemon.GetDisplayName() & " is not~paralyzed.", {}) + CType(CurrentScreen, PartyScreen).ShowMessage(Pokemon.GetDisplayName() & " is not paralyzed.") Return False End If diff --git a/2.5DHero/2.5DHero/Pokemon/Items/Standard/AbilityCapsule.vb b/2.5DHero/2.5DHero/Pokemon/Items/Standard/AbilityCapsule.vb index ff687e58d..22fe85b94 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/Standard/AbilityCapsule.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/Standard/AbilityCapsule.vb @@ -14,7 +14,10 @@ Namespace Items.Standard End Sub Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/StoneItem.vb b/2.5DHero/2.5DHero/Pokemon/Items/StoneItem.vb index d2904459c..5f34e2360 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/StoneItem.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/StoneItem.vb @@ -8,7 +8,10 @@ Namespace Items Public Overrides ReadOnly Property PokeDollarPrice As Integer = 2100 Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub Public Overrides Function UseOnPokemon(ByVal PokeIndex As Integer) As Boolean diff --git a/2.5DHero/2.5DHero/Pokemon/Items/TechMachine.vb b/2.5DHero/2.5DHero/Pokemon/Items/TechMachine.vb index 7b5952c78..ac4f64b2a 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/TechMachine.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/TechMachine.vb @@ -92,7 +92,10 @@ Public Overrides Sub Use() SoundManager.PlaySound("PC\pc_logon", False) - SetScreen(New PartyScreen(CurrentScreen, Me, AddressOf UseOnPokemon, "Teach " & Attack.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) CType(CurrentScreen, PartyScreen).SetupLearnAttack(Attack, 1, Me) End Sub diff --git a/2.5DHero/2.5DHero/Pokemon/Items/VitaminItem.vb b/2.5DHero/2.5DHero/Pokemon/Items/VitaminItem.vb index f7e3d4998..7c7725fe1 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/VitaminItem.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/VitaminItem.vb @@ -12,7 +12,10 @@ Namespace Items Public Overrides ReadOnly Property CanBeUsedInBattle As Boolean = False Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub ''' diff --git a/2.5DHero/2.5DHero/Pokemon/Items/WingItem.vb b/2.5DHero/2.5DHero/Pokemon/Items/WingItem.vb index fe938c0fb..47c26a7b5 100644 --- a/2.5DHero/2.5DHero/Pokemon/Items/WingItem.vb +++ b/2.5DHero/2.5DHero/Pokemon/Items/WingItem.vb @@ -13,7 +13,10 @@ Namespace Items Public Overrides ReadOnly Property PokeDollarPrice As Integer = 3000 Public Overrides Sub Use() - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me, AddressOf Me.UseOnPokemon, "Use " & Me.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf UseItemhandler + + Core.SetScreen(selScreen) End Sub ''' diff --git a/2.5DHero/2.5DHero/Screens/Inventory/ItemDetailScreen.vb b/2.5DHero/2.5DHero/Screens/Inventory/ItemDetailScreen.vb index dc5df2f32..5831feea0 100644 --- a/2.5DHero/2.5DHero/Screens/Inventory/ItemDetailScreen.vb +++ b/2.5DHero/2.5DHero/Screens/Inventory/ItemDetailScreen.vb @@ -139,7 +139,10 @@ Case Localization.GetString("item_detail_screen_use") Item.Use() Case Localization.GetString("item_detail_screen_give") - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Me.Item, AddressOf GiveItem, Localization.GetString("item_detail_screen_give_item") & Me.Item.Name, True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Me.Item, AddressOf GiveItem, Localization.GetString("item_detail_screen_give_item") & Me.Item.Name, True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf GiveItemHandler + + Core.SetScreen(selScreen) Case Localization.GetString("item_detail_screen_trash") Core.Player.Inventory.RemoveItem(Me.Item.ID, trashValue) Case Localization.GetString("item_detail_screen_back") @@ -153,6 +156,10 @@ End If End Sub + Private Sub GiveItemHandler(ByVal params As Object()) + GiveItem(CInt(params(0))) + End Sub + Private Sub GiveItem(ByVal PokeIndex As Integer) Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex) diff --git a/2.5DHero/2.5DHero/Screens/PC/MailSystemScreen.vb b/2.5DHero/2.5DHero/Screens/PC/MailSystemScreen.vb index fb0ecd0f1..fae4aba36 100644 --- a/2.5DHero/2.5DHero/Screens/PC/MailSystemScreen.vb +++ b/2.5DHero/2.5DHero/Screens/PC/MailSystemScreen.vb @@ -219,7 +219,12 @@ If Controls.Accept(True, True, True) = True Then If Me.selectIndex = 0 Then - Core.SetScreen(New NewInventoryScreen(Me, {5}, 5, AddressOf Me.ChosenMail)) + Dim selScreen As New NewInventoryScreen(Core.CurrentScreen, {5}, 5, Nothing) + selScreen.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection + selScreen.CanExit = True + + AddHandler selScreen.SelectedObject, AddressOf ChosenMailHandler + Core.SetScreen(selScreen) Else If Me.index = Me.selectIndex Then Me.index = -1 @@ -275,7 +280,10 @@ If TempNewMail.MailHeader = "" Or TempNewMail.MailText = "" Or TempNewMail.MailSignature = "" Then message = "Please fill in the Header, the Message and the Signature." Else - Core.SetScreen(New PartyScreen(Me, Item.GetItemByID(TempNewMail.MailID), AddressOf Me.ChosenPokemon, "Give mail to:", True)) + Dim selScreen = New PartyScreen(Me, Item.GetItemByID(TempNewMail.MailID), AddressOf Me.ChosenPokemon, "Give mail to:", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf ChosenPokemonHandler + + Core.SetScreen(selScreen) End If Case 4 Me.index = -1 @@ -288,6 +296,10 @@ End If End Sub + Private Sub ChosenMailHandler(ByVal params As Object()) + ChosenMail(CInt(params(0))) + End Sub + Private Sub ChosenMail(ByVal ItemID As Integer) Me.index = 0 Me.EditMailIndex = 0 @@ -302,6 +314,10 @@ Me.TempNewMail.MailSignature = "" End Sub + Private Sub ChosenPokemonHandler(ByVal params As Object()) + ChosenPokemon(CInt(params(0))) + End Sub + Private Sub ChosenPokemon(ByVal PokeIndex As Integer) If Not Core.Player.Pokemons(PokeIndex).Item Is Nothing Then Core.Player.Inventory.AddItem(Core.Player.Pokemons(PokeIndex).Item.ID, 1) diff --git a/2.5DHero/2.5DHero/Screens/PC/StorageSystemScreen.vb b/2.5DHero/2.5DHero/Screens/PC/StorageSystemScreen.vb index 9d6baa149..6ab561522 100644 --- a/2.5DHero/2.5DHero/Screens/PC/StorageSystemScreen.vb +++ b/2.5DHero/2.5DHero/Screens/PC/StorageSystemScreen.vb @@ -1007,14 +1007,14 @@ Public Class StorageSystemScreen Private Sub SummaryPokemon() If CursorPosition.X = 6 Then - Core.SetScreen(New PokemonStatusScreen(Core.CurrentScreen, CInt(CursorPosition.Y), Core.Player.Pokemons.ToArray(), Core.Player.Pokemons(CInt(CursorPosition.Y)), False)) + Core.SetScreen(New SummaryScreen(Me, Core.Player.Pokemons.ToArray(), CInt(CursorPosition.Y))) Else Dim id As Integer = CInt(CursorPosition.X) + CInt((CursorPosition.Y - 1) * 6) If GetBox(CurrentBox).IsBattleBox = True Then id = GetBattleBoxID() End If - Core.SetScreen(New PokemonStatusScreen(Core.CurrentScreen, GetBox(CurrentBox).GetPokemonList().IndexOf(GetBox(CurrentBox).Pokemon(id).GetPokemon()), GetBox(CurrentBox).GetPokemonList().ToArray(), GetBox(CurrentBox).Pokemon(id).GetPokemon(), False)) + Core.SetScreen(New SummaryScreen(Me, GetBox(CurrentBox).GetPokemonList().ToArray(), GetBox(CurrentBox).GetPokemonList().IndexOf(GetBox(CurrentBox).Pokemon(id).GetPokemon()))) End If End Sub diff --git a/2.5DHero/2.5DHero/World/ActionScript/Script.vb b/2.5DHero/2.5DHero/World/ActionScript/Script.vb index ff3a6dfe4..e04f0d778 100644 --- a/2.5DHero/2.5DHero/World/ActionScript/Script.vb +++ b/2.5DHero/2.5DHero/World/ActionScript/Script.vb @@ -203,6 +203,10 @@ Screen.TextBox.Show(message2, {}, False, False) End Sub + Public Shared Sub DoNPCTradeHandler(ByVal params As Object()) + DoNPCTrade(CInt(params(0))) + End Sub + Public Shared Sub DoNPCTrade(ByVal pokeIndex As Integer) Core.SetScreen(Core.CurrentScreen.PreScreen) diff --git a/2.5DHero/2.5DHero/World/ActionScript/V2/ScriptCommands/DoPokemon.vb b/2.5DHero/2.5DHero/World/ActionScript/V2/ScriptCommands/DoPokemon.vb index d4b9be15a..d16f40d20 100644 --- a/2.5DHero/2.5DHero/World/ActionScript/V2/ScriptCommands/DoPokemon.vb +++ b/2.5DHero/2.5DHero/World/ActionScript/V2/ScriptCommands/DoPokemon.vb @@ -210,7 +210,11 @@ Dim splits() As String = argument.Split(CChar("|")) Script.SaveNPCTrade = splits - Core.SetScreen(New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf Script.DoNPCTrade, "Choose trade Pokémon", True)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf Script.DoNPCTrade, "Choose Pokémon for trade", True) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, AddressOf Script.DoNPCTradeHandler + + Core.SetScreen(selScreen) + CType(Core.CurrentScreen, PartyScreen).ExitedSub = AddressOf Script.ExitedNPCTrade CanContinue = False @@ -331,7 +335,10 @@ End If End If - Core.SetScreen(New PartyScreen(Core.CurrentScreen, New Items.Balls.Pokeball, Nothing, "Choose Pokémon", canExit, canChooseFainted, canChooseEgg)) + Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), Nothing, "Choose Pokémon", canExit, canChooseFainted, canChooseEgg) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True} + AddHandler selScreen.SelectedObject, Nothing + + Core.SetScreen(selScreen) CanContinue = False Case "selectmove"