Updated to show the Pokémon image based on the selected index instead of the selected text, for Pokémon name localization.

This commit is contained in:
依瑪貓 2017-02-14 22:07:18 +08:00
parent 403885d6cb
commit af0234ba97
2 changed files with 8 additions and 39 deletions

View File

@ -207,29 +207,15 @@ End Sub
' subLstPokemonSelected: When the Pokémon is selected. ' subLstPokemonSelected: When the Pokémon is selected.
Sub subLstPokemonSelected (oEvent As object) 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 Dim oImageModel As Object, sImageId As String
oDialog = oEvent.Source.getContext oDialog = oEvent.Source.getContext
' Updates the Pokémon image. ' Updates the Pokémon image.
sPokemon = oDialog.getControl ("lstPokemon").getSelectedItem nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
sImageId = "" subReadBaseStats
If sPokemon = "Farfetch'd" Then sImageId = "Pokemon" & maBaseStats (nSelected).sPokemon
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
oImageModel = oDialog.getControl ("imgPokemon").getModel oImageModel = oDialog.getControl ("imgPokemon").getModel
oImageModel.setPropertyValue ("ImageURL", _ oImageModel.setPropertyValue ("ImageURL", _
fnGetImageUrl (sImageId)) fnGetImageUrl (sImageId))

View File

@ -68,9 +68,6 @@ Sub subMain
Dim aBaseStats As New aStats, maIVs As Variant, nI As Integer Dim aBaseStats As New aStats, maIVs As Variant, nI As Integer
Dim aQuery As New aFindIVParam Dim aQuery As New aFindIVParam
' TODO: To be removed.
BasicLibraries.loadLibrary "XrayTool"
aQuery = fnAskParam aQuery = fnAskParam
If aQuery.bIsCancelled Then If aQuery.bIsCancelled Then
Exit Sub Exit Sub
@ -212,29 +209,15 @@ End Sub
' subLstPokemonSelected: When the Pokémon is selected. ' subLstPokemonSelected: When the Pokémon is selected.
Sub subLstPokemonSelected (oEvent As object) 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 Dim oImageModel As Object, sImageId As String
oDialog = oEvent.Source.getContext oDialog = oEvent.Source.getContext
' Updates the Pokémon image. ' Updates the Pokémon image.
sPokemon = oDialog.getControl ("lstPokemon").getSelectedItem nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
sImageId = "" subReadBaseStats
If sPokemon = "Farfetch'd" Then sImageId = "Pokemon" & maBaseStats (nSelected).sPokemon
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
oImageModel = oDialog.getControl ("imgPokemon").getModel oImageModel = oDialog.getControl ("imgPokemon").getModel
oImageModel.setPropertyValue ("ImageURL", _ oImageModel.setPropertyValue ("ImageURL", _
fnGetImageUrl (sImageId)) fnGetImageUrl (sImageId))