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.
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))

View File

@ -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))