diff --git a/PokemonGoIV/1Dialog.vb b/PokemonGoIV/1Dialog.vb index 5794346..43f36b7 100644 --- a/PokemonGoIV/1Dialog.vb +++ b/PokemonGoIV/1Dialog.vb @@ -17,6 +17,9 @@ Option Explicit +' Remembers the selected Pokémon for the next run. +Global sSelected As String + ' The parameters to find the individual values. Type aFindIVParam sPokemonId As String @@ -68,6 +71,9 @@ Function fnAskParam As aFindIVParam oDialog.getControl ("imgTeamLogo").getModel.setPropertyValue ( _ "ImageURL", fnGetImageUrl ("Unknown")) + ' Remembers the previously-selected Pokémon. + oDialog.getControl ("lstPokemon").selectItem (sSelected, True) + If oDialog.execute = 0 Then aQuery.bIsCancelled = True fnAskParam = aQuery @@ -168,8 +174,15 @@ Sub subLstPokemonSelected (oEvent As object) oDialog = oEvent.Source.getContext - ' Updates the Pokémon image. + ' Checks which Pokémon was selected. + sSelected = oDialog.getControl ("lstPokemon").getSelectedItem nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos + ' This happens at the beginning where sSelected is "". + If nSelected = -1 Then + Exit Sub + End If + + ' Updates the Pokémon image. subReadBaseStats sImageId = "Pokemon" & maBaseStats (nSelected).sPokemonId oImageModel = oDialog.getControl ("imgPokemon").getModel diff --git a/VERSION b/VERSION index 100435b..ee94dd8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.2 +0.8.3 diff --git a/excludes/pokemongoiv.update.xml b/excludes/pokemongoiv.update.xml index f6bc89e..27e9489 100644 --- a/excludes/pokemongoiv.update.xml +++ b/excludes/pokemongoiv.update.xml @@ -2,8 +2,8 @@ - + - + diff --git a/oxt/PokemonGoIV/1Dialog.xba b/oxt/PokemonGoIV/1Dialog.xba index 63988b8..353f6f3 100644 --- a/oxt/PokemonGoIV/1Dialog.xba +++ b/oxt/PokemonGoIV/1Dialog.xba @@ -19,6 +19,9 @@ Option Explicit +' Remembers the selected Pokémon for the next run. +Global sSelected As String + ' The parameters to find the individual values. Type aFindIVParam sPokemonId As String @@ -70,6 +73,9 @@ Function fnAskParam As aFindIVParam oDialog.getControl ("imgTeamLogo").getModel.setPropertyValue ( _ "ImageURL", fnGetImageUrl ("Unknown")) + ' Remembers the previously-selected Pokémon. + oDialog.getControl ("lstPokemon").selectItem (sSelected, True) + If oDialog.execute = 0 Then aQuery.bIsCancelled = True fnAskParam = aQuery @@ -170,8 +176,15 @@ Sub subLstPokemonSelected (oEvent As object) oDialog = oEvent.Source.getContext - ' Updates the Pokémon image. + ' Checks which Pokémon was selected. + sSelected = oDialog.getControl ("lstPokemon").getSelectedItem nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos + ' This happens at the beginning where sSelected is "". + If nSelected = -1 Then + Exit Sub + End If + + ' Updates the Pokémon image. subReadBaseStats sImageId = "Pokemon" & maBaseStats (nSelected).sPokemonId oImageModel = oDialog.getControl ("imgPokemon").getModel