From af0234ba979fedca8ccd084a70a75675983bd5ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 14 Feb 2017 22:07:18 +0800 Subject: [PATCH] =?UTF-8?q?Updated=20to=20show=20the=20Pok=C3=A9mon=20imag?= =?UTF-8?q?e=20based=20on=20the=20selected=20index=20instead=20of=20the=20?= =?UTF-8?q?selected=20text,=20for=20Pok=C3=A9mon=20name=20localization.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PokemonGoIV/0Main.vb | 22 ++++------------------ oxt/PokemonGoIV/0Main.xba | 25 ++++--------------------- 2 files changed, 8 insertions(+), 39 deletions(-) diff --git a/PokemonGoIV/0Main.vb b/PokemonGoIV/0Main.vb index 381b677..e5c4c55 100644 --- a/PokemonGoIV/0Main.vb +++ b/PokemonGoIV/0Main.vb @@ -207,29 +207,15 @@ End Sub ' subLstPokemonSelected: When the Pokémon is selected. Sub subLstPokemonSelected (oEvent As object) - Dim oDialog As Object, sPokemon As String + Dim oDialog As Object, nSelected As Integer Dim oImageModel As Object, sImageId As String oDialog = oEvent.Source.getContext ' Updates the Pokémon image. - sPokemon = oDialog.getControl ("lstPokemon").getSelectedItem - sImageId = "" - If sPokemon = "Farfetch'd" Then - sImageId = "PokemonFarfetchd" - End If - If sPokemon = "Nidoran♀" Then - sImageId = "PokemonNidoranFemale" - End If - If sPokemon = "Nidoran♂" Then - sImageId = "PokemonNidoranMale" - End If - If sPokemon = "Mr. Mime" Then - sImageId = "PokemonMrMime" - End If - If sImageId = "" Then - sImageId = "Pokemon" & sPokemon - End If + nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos + subReadBaseStats + sImageId = "Pokemon" & maBaseStats (nSelected).sPokemon oImageModel = oDialog.getControl ("imgPokemon").getModel oImageModel.setPropertyValue ("ImageURL", _ fnGetImageUrl (sImageId)) diff --git a/oxt/PokemonGoIV/0Main.xba b/oxt/PokemonGoIV/0Main.xba index bfe75d6..93f7a6c 100644 --- a/oxt/PokemonGoIV/0Main.xba +++ b/oxt/PokemonGoIV/0Main.xba @@ -68,9 +68,6 @@ Sub subMain Dim aBaseStats As New aStats, maIVs As Variant, nI As Integer Dim aQuery As New aFindIVParam - ' TODO: To be removed. - BasicLibraries.loadLibrary "XrayTool" - aQuery = fnAskParam If aQuery.bIsCancelled Then Exit Sub @@ -212,29 +209,15 @@ End Sub ' subLstPokemonSelected: When the Pokémon is selected. Sub subLstPokemonSelected (oEvent As object) - Dim oDialog As Object, sPokemon As String + Dim oDialog As Object, nSelected As Integer Dim oImageModel As Object, sImageId As String oDialog = oEvent.Source.getContext ' Updates the Pokémon image. - sPokemon = oDialog.getControl ("lstPokemon").getSelectedItem - sImageId = "" - If sPokemon = "Farfetch'd" Then - sImageId = "PokemonFarfetchd" - End If - If sPokemon = "Nidoran♀" Then - sImageId = "PokemonNidoranFemale" - End If - If sPokemon = "Nidoran♂" Then - sImageId = "PokemonNidoranMale" - End If - If sPokemon = "Mr. Mime" Then - sImageId = "PokemonMrMime" - End If - If sImageId = "" Then - sImageId = "Pokemon" & sPokemon - End If + nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos + subReadBaseStats + sImageId = "Pokemon" & maBaseStats (nSelected).sPokemon oImageModel = oDialog.getControl ("imgPokemon").getModel oImageModel.setPropertyValue ("ImageURL", _ fnGetImageUrl (sImageId))