From 2c5c0909e08051db9fedc3422bdea828b01c98d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Wed, 29 Nov 2017 21:32:29 +0800 Subject: [PATCH] =?UTF-8?q?*=20Updated=20the=20dialog=20to=20remember=20th?= =?UTF-8?q?e=20last=20selected=20Pok=C3=A9mon.=20=20This=20helps=20when=20?= =?UTF-8?q?checking=20with=20a=20bunch=20of=20Pok=C3=A9mons=20of=20the=20s?= =?UTF-8?q?ame=20type.=20=20Selecting=20Pok=C3=A9mon=20was=20a=20challenge?= =?UTF-8?q?=20with=20Chinese=20where=20keyboard=20finding=20does=20not=20w?= =?UTF-8?q?ork=20with=20the=20drop-down=20menu.=20*=20Advanced=20to=20vers?= =?UTF-8?q?ion=200.8.3.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PokemonGoIV/1Dialog.vb | 15 ++++++++++++++- VERSION | 2 +- excludes/pokemongoiv.update.xml | 4 ++-- oxt/PokemonGoIV/1Dialog.xba | 15 ++++++++++++++- 4 files changed, 31 insertions(+), 5 deletions(-) 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