Moved the dialog UI control from 0Main to 1Dialog, to keep the code clean. 0Main processes mostly the algorithm itself now.
This commit is contained in:
parent
5c4cf83c12
commit
98069f942c
@ -87,21 +87,7 @@ Function fnAskParam As aFindIVParam
|
|||||||
Dim bIsBestHP As Boolean
|
Dim bIsBestHP As Boolean
|
||||||
Dim aQuery As New aFindIVParam
|
Dim aQuery As New aFindIVParam
|
||||||
|
|
||||||
DialogLibraries.loadLibrary "PokemonGoIV"
|
oDialog = fnLoadParamDialog
|
||||||
oDialog = CreateUnoDialog (DialogLibraries.PokemonGoIV.DlgMain)
|
|
||||||
oDialog.getControl ("lstTotal").setVisible (False)
|
|
||||||
oDialog.getControl ("txtBestHead").setVisible (False)
|
|
||||||
oDialog.getControl ("lstBest").setVisible (False)
|
|
||||||
oDialog.getControl ("txtBestTail").setVisible (False)
|
|
||||||
oDialog.getControl ("cbxBest2").setVisible (False)
|
|
||||||
oDialog.getControl ("cbxBest3").setVisible (False)
|
|
||||||
oDialog.getControl ("lstMax").setVisible (False)
|
|
||||||
|
|
||||||
oDialog.getControl ("imgPokemon").getModel.setPropertyValue ( _
|
|
||||||
"ImageURL", fnGetImageUrl ("Unknown"))
|
|
||||||
oDialog.getControl ("imgTeamLogo").getModel.setPropertyValue ( _
|
|
||||||
"ImageURL", fnGetImageUrl ("Unknown"))
|
|
||||||
|
|
||||||
If oDialog.execute = 0 Then
|
If oDialog.execute = 0 Then
|
||||||
aQuery.bIsCancelled = True
|
aQuery.bIsCancelled = True
|
||||||
fnAskParam = aQuery
|
fnAskParam = aQuery
|
||||||
@ -169,387 +155,6 @@ Function fnAskParam As aFindIVParam
|
|||||||
fnAskParam = aQuery
|
fnAskParam = aQuery
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
' subBtnOKCheck: Checks whether the required columns are filled.
|
|
||||||
Sub subBtnOKCheck (oEvent As object)
|
|
||||||
Dim oDialog As Object
|
|
||||||
Dim oPokemon As Object, oCP As Object
|
|
||||||
Dim oHP As Object, oStardust As Object, oOK As Object
|
|
||||||
|
|
||||||
oDialog = oEvent.Source.getContext
|
|
||||||
oPokemon = oDialog.getControl ("lstPokemon")
|
|
||||||
oCP = oDialog.getControl ("numCP")
|
|
||||||
oHP = oDialog.getControl ("numHP")
|
|
||||||
oStardust = oDialog.getControl ("lstStardust")
|
|
||||||
oOK = oDialog.getControl ("btnOK")
|
|
||||||
|
|
||||||
If oPokemon.getSelectedItemPos <> -1 _
|
|
||||||
And oCP.getText <> "" _
|
|
||||||
And oHP.getText <> "" _
|
|
||||||
And oStardust.getSelectedItemPos <> -1 Then
|
|
||||||
oOK.setEnable (True)
|
|
||||||
Else
|
|
||||||
oOK.setEnable (False)
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subLstPokemonSelected: When the Pokémon is selected.
|
|
||||||
Sub subLstPokemonSelected (oEvent As object)
|
|
||||||
Dim oDialog As Object, nSelected As Integer
|
|
||||||
Dim oImageModel As Object, sImageId As String
|
|
||||||
|
|
||||||
oDialog = oEvent.Source.getContext
|
|
||||||
|
|
||||||
' Updates the Pokémon image.
|
|
||||||
nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
|
|
||||||
subReadBaseStats
|
|
||||||
sImageId = "Pokemon" & maBaseStats (nSelected).sPokemon
|
|
||||||
oImageModel = oDialog.getControl ("imgPokemon").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl (sImageId))
|
|
||||||
|
|
||||||
' Updates the text of the stats total appraisal.
|
|
||||||
subUpdateTotalAppraisal (oDialog, True)
|
|
||||||
' Checks if the required columns are filled.
|
|
||||||
subBtnOKCheck (oEvent)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subRdoTeamValorItemChanged: When Team Valor is selected.
|
|
||||||
Sub subRdoTeamValorItemChanged (oEvent As object)
|
|
||||||
Dim oDialog As Object, oList As Object, oText As Object
|
|
||||||
Dim oImageModel As Object
|
|
||||||
Dim mItems () As String
|
|
||||||
|
|
||||||
oDialog = oEvent.Source.getContext
|
|
||||||
|
|
||||||
oImageModel = oDialog.getControl ("imgTeamLogo").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl ("TeamLogoValor"))
|
|
||||||
oImageModel = oDialog.getControl ("imgTeamLeader").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl ("TeamLeaderCandela"))
|
|
||||||
|
|
||||||
oText = oDialog.getControl ("txtLeaderAppraise")
|
|
||||||
oText.setVisible (True)
|
|
||||||
oText.setText (fnGetResString ("AppraiseFromCandela"))
|
|
||||||
|
|
||||||
' Updates the text of the stats total appraisal.
|
|
||||||
subUpdateTotalAppraisal (oDialog, False)
|
|
||||||
|
|
||||||
' Updates the text of the best stat appraisal.
|
|
||||||
subUpdateBestStatAppraisal (oDialog, _
|
|
||||||
fnGetResString ("AppraisalValorBest"), _
|
|
||||||
CInt (fnGetResString ("AppraisalValorBestHeadWidth")))
|
|
||||||
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("AppraisalValorMax15"), _
|
|
||||||
fnGetResString ("AppraisalValorMax13Or14"), _
|
|
||||||
fnGetResString ("AppraisalValorMax8To12"), _
|
|
||||||
fnGetResString ("AppraisalValorMaxUpTo7"))
|
|
||||||
oList = oDialog.getControl ("lstMax")
|
|
||||||
oList.removeItems (0, oList.getItemCount())
|
|
||||||
oList.addItems (mItems, 0)
|
|
||||||
oList.setVisible (True)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subRdoTeamMysticItemChanged: When Team Mystic is selected.
|
|
||||||
Sub subRdoTeamMysticItemChanged (oEvent As object)
|
|
||||||
Dim oDialog As Object, oList As Object, oText As Object
|
|
||||||
Dim oImageModel As Object
|
|
||||||
Dim mItems () As String
|
|
||||||
|
|
||||||
oDialog = oEvent.Source.getContext
|
|
||||||
|
|
||||||
oImageModel = oDialog.getControl ("imgTeamLogo").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl ("TeamLogoMystic"))
|
|
||||||
oImageModel = oDialog.getControl ("imgTeamLeader").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl ("TeamLeaderBlanche"))
|
|
||||||
|
|
||||||
oText = oDialog.getControl ("txtLeaderAppraise")
|
|
||||||
oText.setVisible (True)
|
|
||||||
oText.setText (fnGetResString ("AppraiseFromBlanche"))
|
|
||||||
|
|
||||||
' Updates the text of the stats total appraisal.
|
|
||||||
subUpdateTotalAppraisal (oDialog, False)
|
|
||||||
|
|
||||||
' Updates the text of the best stat appraisal.
|
|
||||||
subUpdateBestStatAppraisal (oDialog, _
|
|
||||||
fnGetResString ("AppraisalMysticBest"), _
|
|
||||||
CInt (fnGetResString ("AppraisalMysticBestHeadWidth")))
|
|
||||||
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("AppraisalMysticMax15"), _
|
|
||||||
fnGetResString ("AppraisalMysticMax13Or14"), _
|
|
||||||
fnGetResString ("AppraisalMysticMax8To12"), _
|
|
||||||
fnGetResString ("AppraisalMysticMaxUpTo7"))
|
|
||||||
oList = oDialog.getControl ("lstMax")
|
|
||||||
oList.removeItems (0, oList.getItemCount())
|
|
||||||
oList.addItems (mItems, 0)
|
|
||||||
oList.setVisible (True)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subRdoTeamInstinctItemChanged: When Team Instinct is selected.
|
|
||||||
Sub subRdoTeamInstinctItemChanged (oEvent As object)
|
|
||||||
Dim oDialog As Object, oList As Object, oText As Object
|
|
||||||
Dim oImageModel As Object
|
|
||||||
Dim mItems () As String
|
|
||||||
|
|
||||||
oDialog = oEvent.Source.getContext
|
|
||||||
|
|
||||||
oImageModel = oDialog.getControl ("imgTeamLogo").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl ("TeamLogoInstinct"))
|
|
||||||
oImageModel = oDialog.getControl ("imgTeamLeader").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl ("TeamLeaderSpark"))
|
|
||||||
|
|
||||||
oText = oDialog.getControl ("txtLeaderAppraise")
|
|
||||||
oText.setVisible (True)
|
|
||||||
oText.setText (fnGetResString ("AppraiseFromSpark"))
|
|
||||||
|
|
||||||
' Updates the text of the stats total appraisal.
|
|
||||||
subUpdateTotalAppraisal (oDialog, False)
|
|
||||||
|
|
||||||
' Updates the text of the best stat appraisal.
|
|
||||||
subUpdateBestStatAppraisal (oDialog, _
|
|
||||||
fnGetResString ("AppraisalInstinctBest"), _
|
|
||||||
CInt (fnGetResString ("AppraisalInstinctBestHeadWidth")))
|
|
||||||
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("AppraisalInstinctMax15"), _
|
|
||||||
fnGetResString ("AppraisalInstinctMax13Or14"), _
|
|
||||||
fnGetResString ("AppraisalInstinctMax8To12"), _
|
|
||||||
fnGetResString ("AppraisalInstinctMaxUpTo7"))
|
|
||||||
oList = oDialog.getControl ("lstMax")
|
|
||||||
oList.removeItems (0, oList.getItemCount())
|
|
||||||
oList.addItems (mItems, 0)
|
|
||||||
oList.setVisible (True)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subUpdateBestStatAppraisal: Updates the text of the best stat appraisal.
|
|
||||||
Sub subUpdateBestStatAppraisal (oDialog As Object, _
|
|
||||||
sAppraisal As String, nHeadWidth As Integer)
|
|
||||||
Dim oText As Object, oList As Object, nX As Integer
|
|
||||||
Dim sHead As String, sTail As String, nTailWidth As Integer
|
|
||||||
Dim nDialogWidth As Integer
|
|
||||||
Dim nPos As Integer
|
|
||||||
Dim mItems () As String
|
|
||||||
|
|
||||||
nPos = InStr (sAppraisal, "[Stat]")
|
|
||||||
sHead = Left (sAppraisal, nPos - 1)
|
|
||||||
sTail = Right (sAppraisal, _
|
|
||||||
Len (sAppraisal) - nPos - Len ("[Stat]") + 1)
|
|
||||||
nDialogWidth = oDialog.getModel.getPropertyValue ("Width")
|
|
||||||
|
|
||||||
oText = oDialog.getControl ("txtBestHead")
|
|
||||||
oText.getModel.setPropertyValue ("Width", nHeadWidth)
|
|
||||||
oText.setVisible (True)
|
|
||||||
oText.setText (sHead)
|
|
||||||
nX = oText.getModel.getPropertyValue ("PositionX") + nHeadWidth
|
|
||||||
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("StatAttack"), _
|
|
||||||
fnGetResString ("StatDefense"), _
|
|
||||||
fnGetResString ("StatHP"))
|
|
||||||
oList = oDialog.getControl ("lstBest")
|
|
||||||
oList.removeItems (0, oList.getItemCount())
|
|
||||||
oList.addItems (mItems, 0)
|
|
||||||
oList.getModel.setPropertyValue ("PositionX", nX)
|
|
||||||
oList.getModel.setPropertyValue ("Width", _
|
|
||||||
CInt (fnGetResString ("BestStatWidth")))
|
|
||||||
oList.setVisible (True)
|
|
||||||
nX = nX + oList.getModel.getPropertyValue ("Width")
|
|
||||||
|
|
||||||
nTailWidth = nDialogWidth - nX - 10
|
|
||||||
oText = oDialog.getControl ("txtBestTail")
|
|
||||||
oText.getModel.setPropertyValue ("PositionX", nX)
|
|
||||||
oText.getModel.setPropertyValue ("Width", nTailWidth)
|
|
||||||
oText.setVisible (True)
|
|
||||||
oText.setText (sTail)
|
|
||||||
|
|
||||||
oList = oDialog.getControl ("cbxBest2")
|
|
||||||
oList.setVisible (False)
|
|
||||||
|
|
||||||
oList = oDialog.getControl ("cbxBest3")
|
|
||||||
oList.setVisible (False)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subLstBestItemChanged: When the best stat is selected.
|
|
||||||
Sub subLstBestItemChanged (oEvent As object)
|
|
||||||
Dim oDialog As Object, oCheckBox As Object, sBestToo As String
|
|
||||||
|
|
||||||
oDialog = oEvent.Source.getContext
|
|
||||||
If oDialog.getControl ("rdoTeamValor").getState Then
|
|
||||||
sBestToo = fnGetResString ("AppraisalValorBestToo")
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 0 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 1 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 2 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("rdoTeamMystic").getState Then
|
|
||||||
sBestToo = fnGetResString ("AppraisalMysticBestToo")
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 0 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 1 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 2 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("rdoTeamInstinct").getState Then
|
|
||||||
sBestToo = fnGetResString ("AppraisalInstinctBestToo")
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 0 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 1 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 2 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subUpdateTotalAppraisal: Updates the text of the stats total
|
|
||||||
' appraisal.
|
|
||||||
Sub subUpdateTotalAppraisal ( _
|
|
||||||
oDialog As Object, bIsKeepSelected As Boolean)
|
|
||||||
Dim sPokemon As String, oList As Object, nSelected As Integer
|
|
||||||
Dim mItems () As String, nI As Integer
|
|
||||||
|
|
||||||
If oDialog.getControl ("rdoTeamValor").getState Then
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("AppraisalValorTotal37OrHigher"), _
|
|
||||||
fnGetResString ("AppraisalValorTotal30To36"), _
|
|
||||||
fnGetResString ("AppraisalValorTotal23To29"), _
|
|
||||||
fnGetResString ("AppraisalValorTotalUpTo22"))
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("rdoTeamMystic").getState Then
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("AppraisalMysticTotal37OrHigher"), _
|
|
||||||
fnGetResString ("AppraisalMysticTotal30To36"), _
|
|
||||||
fnGetResString ("AppraisalMysticTotal23To29"), _
|
|
||||||
fnGetResString ("AppraisalMysticTotalUpTo22"))
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("rdoTeamInstinct").getState Then
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("AppraisalInstinctTotal37OrHigher"), _
|
|
||||||
fnGetResString ("AppraisalInstinctTotal30To36"), _
|
|
||||||
fnGetResString ("AppraisalInstinctTotal23To29"), _
|
|
||||||
fnGetResString ("AppraisalInstinctTotalUpTo22"))
|
|
||||||
End If
|
|
||||||
' The team was not selected yet.
|
|
||||||
If UBound (mItems) = -1 Then
|
|
||||||
Exit sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
sPokemon = oDialog.getControl ("lstPokemon").getSelectedItem
|
|
||||||
If sPokemon <> "" Then
|
|
||||||
For nI = 0 To UBound (mItems)
|
|
||||||
mItems (nI) = fnReplace (mItems (nI), _
|
|
||||||
"[Pokémon]", sPokemon)
|
|
||||||
Next nI
|
|
||||||
End If
|
|
||||||
|
|
||||||
oList = oDialog.getControl ("lstTotal")
|
|
||||||
If bIsKeepSelected Then
|
|
||||||
nSelected = oList.getSelectedItemPos
|
|
||||||
End If
|
|
||||||
oList.removeItems (0, oList.getItemCount())
|
|
||||||
oList.addItems (mItems, 0)
|
|
||||||
If bIsKeepSelected Then
|
|
||||||
oList.selectItemPos (nSelected, True)
|
|
||||||
End If
|
|
||||||
oList.setVisible (True)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' fnFindIV: Finds the possible individual values of the Pokémon
|
' fnFindIV: Finds the possible individual values of the Pokémon
|
||||||
Function fnFindIV ( _
|
Function fnFindIV ( _
|
||||||
aBaseStats As aStats, aQuery As aFindIVParam) As Variant
|
aBaseStats As aStats, aQuery As aFindIVParam) As Variant
|
||||||
|
421
PokemonGoIV/1Dialog.vb
Normal file
421
PokemonGoIV/1Dialog.vb
Normal file
@ -0,0 +1,421 @@
|
|||||||
|
' Copyright (c) 2016-2017 imacat.
|
||||||
|
'
|
||||||
|
' Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
' you may not use this file except in compliance with the License.
|
||||||
|
' You may obtain a copy of the License at
|
||||||
|
'
|
||||||
|
' http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
'
|
||||||
|
' Unless required by applicable law or agreed to in writing, software
|
||||||
|
' distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
' See the License for the specific language governing permissions and
|
||||||
|
' limitations under the License.
|
||||||
|
|
||||||
|
' 1Dialog: The Dialog UI processor
|
||||||
|
' by imacat <imacat@mail.imacat.idv.tw>, 2017-02-24
|
||||||
|
|
||||||
|
Option Explicit
|
||||||
|
|
||||||
|
' fnLoadParamDialog: Loads the parameter dialog.
|
||||||
|
Function fnLoadParamDialog As Object
|
||||||
|
Dim oDialog As Object
|
||||||
|
|
||||||
|
DialogLibraries.loadLibrary "PokemonGoIV"
|
||||||
|
oDialog = CreateUnoDialog (DialogLibraries.PokemonGoIV.DlgMain)
|
||||||
|
oDialog.getControl ("lstTotal").setVisible (False)
|
||||||
|
oDialog.getControl ("txtBestHead").setVisible (False)
|
||||||
|
oDialog.getControl ("lstBest").setVisible (False)
|
||||||
|
oDialog.getControl ("txtBestTail").setVisible (False)
|
||||||
|
oDialog.getControl ("cbxBest2").setVisible (False)
|
||||||
|
oDialog.getControl ("cbxBest3").setVisible (False)
|
||||||
|
oDialog.getControl ("lstMax").setVisible (False)
|
||||||
|
|
||||||
|
oDialog.getControl ("imgPokemon").getModel.setPropertyValue ( _
|
||||||
|
"ImageURL", fnGetImageUrl ("Unknown"))
|
||||||
|
oDialog.getControl ("imgTeamLogo").getModel.setPropertyValue ( _
|
||||||
|
"ImageURL", fnGetImageUrl ("Unknown"))
|
||||||
|
|
||||||
|
fnLoadParamDialog = oDialog
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' subBtnOKCheck: Checks whether the required columns are filled.
|
||||||
|
Sub subBtnOKCheck (oEvent As object)
|
||||||
|
Dim oDialog As Object
|
||||||
|
Dim oPokemon As Object, oCP As Object
|
||||||
|
Dim oHP As Object, oStardust As Object, oOK As Object
|
||||||
|
|
||||||
|
oDialog = oEvent.Source.getContext
|
||||||
|
oPokemon = oDialog.getControl ("lstPokemon")
|
||||||
|
oCP = oDialog.getControl ("numCP")
|
||||||
|
oHP = oDialog.getControl ("numHP")
|
||||||
|
oStardust = oDialog.getControl ("lstStardust")
|
||||||
|
oOK = oDialog.getControl ("btnOK")
|
||||||
|
|
||||||
|
If oPokemon.getSelectedItemPos <> -1 _
|
||||||
|
And oCP.getText <> "" _
|
||||||
|
And oHP.getText <> "" _
|
||||||
|
And oStardust.getSelectedItemPos <> -1 Then
|
||||||
|
oOK.setEnable (True)
|
||||||
|
Else
|
||||||
|
oOK.setEnable (False)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subLstPokemonSelected: When the Pokémon is selected.
|
||||||
|
Sub subLstPokemonSelected (oEvent As object)
|
||||||
|
Dim oDialog As Object, nSelected As Integer
|
||||||
|
Dim oImageModel As Object, sImageId As String
|
||||||
|
|
||||||
|
oDialog = oEvent.Source.getContext
|
||||||
|
|
||||||
|
' Updates the Pokémon image.
|
||||||
|
nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
|
||||||
|
subReadBaseStats
|
||||||
|
sImageId = "Pokemon" & maBaseStats (nSelected).sPokemon
|
||||||
|
oImageModel = oDialog.getControl ("imgPokemon").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl (sImageId))
|
||||||
|
|
||||||
|
' Updates the text of the stats total appraisal.
|
||||||
|
subUpdateTotalAppraisal (oDialog, True)
|
||||||
|
' Checks if the required columns are filled.
|
||||||
|
subBtnOKCheck (oEvent)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subRdoTeamValorItemChanged: When Team Valor is selected.
|
||||||
|
Sub subRdoTeamValorItemChanged (oEvent As object)
|
||||||
|
Dim oDialog As Object, oList As Object, oText As Object
|
||||||
|
Dim oImageModel As Object
|
||||||
|
Dim mItems () As String
|
||||||
|
|
||||||
|
oDialog = oEvent.Source.getContext
|
||||||
|
|
||||||
|
oImageModel = oDialog.getControl ("imgTeamLogo").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl ("TeamLogoValor"))
|
||||||
|
oImageModel = oDialog.getControl ("imgTeamLeader").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl ("TeamLeaderCandela"))
|
||||||
|
|
||||||
|
oText = oDialog.getControl ("txtLeaderAppraise")
|
||||||
|
oText.setVisible (True)
|
||||||
|
oText.setText (fnGetResString ("AppraiseFromCandela"))
|
||||||
|
|
||||||
|
' Updates the text of the stats total appraisal.
|
||||||
|
subUpdateTotalAppraisal (oDialog, False)
|
||||||
|
|
||||||
|
' Updates the text of the best stat appraisal.
|
||||||
|
subUpdateBestStatAppraisal (oDialog, _
|
||||||
|
fnGetResString ("AppraisalValorBest"), _
|
||||||
|
CInt (fnGetResString ("AppraisalValorBestHeadWidth")))
|
||||||
|
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("AppraisalValorMax15"), _
|
||||||
|
fnGetResString ("AppraisalValorMax13Or14"), _
|
||||||
|
fnGetResString ("AppraisalValorMax8To12"), _
|
||||||
|
fnGetResString ("AppraisalValorMaxUpTo7"))
|
||||||
|
oList = oDialog.getControl ("lstMax")
|
||||||
|
oList.removeItems (0, oList.getItemCount())
|
||||||
|
oList.addItems (mItems, 0)
|
||||||
|
oList.setVisible (True)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subRdoTeamMysticItemChanged: When Team Mystic is selected.
|
||||||
|
Sub subRdoTeamMysticItemChanged (oEvent As object)
|
||||||
|
Dim oDialog As Object, oList As Object, oText As Object
|
||||||
|
Dim oImageModel As Object
|
||||||
|
Dim mItems () As String
|
||||||
|
|
||||||
|
oDialog = oEvent.Source.getContext
|
||||||
|
|
||||||
|
oImageModel = oDialog.getControl ("imgTeamLogo").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl ("TeamLogoMystic"))
|
||||||
|
oImageModel = oDialog.getControl ("imgTeamLeader").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl ("TeamLeaderBlanche"))
|
||||||
|
|
||||||
|
oText = oDialog.getControl ("txtLeaderAppraise")
|
||||||
|
oText.setVisible (True)
|
||||||
|
oText.setText (fnGetResString ("AppraiseFromBlanche"))
|
||||||
|
|
||||||
|
' Updates the text of the stats total appraisal.
|
||||||
|
subUpdateTotalAppraisal (oDialog, False)
|
||||||
|
|
||||||
|
' Updates the text of the best stat appraisal.
|
||||||
|
subUpdateBestStatAppraisal (oDialog, _
|
||||||
|
fnGetResString ("AppraisalMysticBest"), _
|
||||||
|
CInt (fnGetResString ("AppraisalMysticBestHeadWidth")))
|
||||||
|
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("AppraisalMysticMax15"), _
|
||||||
|
fnGetResString ("AppraisalMysticMax13Or14"), _
|
||||||
|
fnGetResString ("AppraisalMysticMax8To12"), _
|
||||||
|
fnGetResString ("AppraisalMysticMaxUpTo7"))
|
||||||
|
oList = oDialog.getControl ("lstMax")
|
||||||
|
oList.removeItems (0, oList.getItemCount())
|
||||||
|
oList.addItems (mItems, 0)
|
||||||
|
oList.setVisible (True)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subRdoTeamInstinctItemChanged: When Team Instinct is selected.
|
||||||
|
Sub subRdoTeamInstinctItemChanged (oEvent As object)
|
||||||
|
Dim oDialog As Object, oList As Object, oText As Object
|
||||||
|
Dim oImageModel As Object
|
||||||
|
Dim mItems () As String
|
||||||
|
|
||||||
|
oDialog = oEvent.Source.getContext
|
||||||
|
|
||||||
|
oImageModel = oDialog.getControl ("imgTeamLogo").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl ("TeamLogoInstinct"))
|
||||||
|
oImageModel = oDialog.getControl ("imgTeamLeader").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl ("TeamLeaderSpark"))
|
||||||
|
|
||||||
|
oText = oDialog.getControl ("txtLeaderAppraise")
|
||||||
|
oText.setVisible (True)
|
||||||
|
oText.setText (fnGetResString ("AppraiseFromSpark"))
|
||||||
|
|
||||||
|
' Updates the text of the stats total appraisal.
|
||||||
|
subUpdateTotalAppraisal (oDialog, False)
|
||||||
|
|
||||||
|
' Updates the text of the best stat appraisal.
|
||||||
|
subUpdateBestStatAppraisal (oDialog, _
|
||||||
|
fnGetResString ("AppraisalInstinctBest"), _
|
||||||
|
CInt (fnGetResString ("AppraisalInstinctBestHeadWidth")))
|
||||||
|
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("AppraisalInstinctMax15"), _
|
||||||
|
fnGetResString ("AppraisalInstinctMax13Or14"), _
|
||||||
|
fnGetResString ("AppraisalInstinctMax8To12"), _
|
||||||
|
fnGetResString ("AppraisalInstinctMaxUpTo7"))
|
||||||
|
oList = oDialog.getControl ("lstMax")
|
||||||
|
oList.removeItems (0, oList.getItemCount())
|
||||||
|
oList.addItems (mItems, 0)
|
||||||
|
oList.setVisible (True)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subUpdateBestStatAppraisal: Updates the text of the best stat appraisal.
|
||||||
|
Sub subUpdateBestStatAppraisal (oDialog As Object, _
|
||||||
|
sAppraisal As String, nHeadWidth As Integer)
|
||||||
|
Dim oText As Object, oList As Object, nX As Integer
|
||||||
|
Dim sHead As String, sTail As String, nTailWidth As Integer
|
||||||
|
Dim nDialogWidth As Integer
|
||||||
|
Dim nPos As Integer
|
||||||
|
Dim mItems () As String
|
||||||
|
|
||||||
|
nPos = InStr (sAppraisal, "[Stat]")
|
||||||
|
sHead = Left (sAppraisal, nPos - 1)
|
||||||
|
sTail = Right (sAppraisal, _
|
||||||
|
Len (sAppraisal) - nPos - Len ("[Stat]") + 1)
|
||||||
|
nDialogWidth = oDialog.getModel.getPropertyValue ("Width")
|
||||||
|
|
||||||
|
oText = oDialog.getControl ("txtBestHead")
|
||||||
|
oText.getModel.setPropertyValue ("Width", nHeadWidth)
|
||||||
|
oText.setVisible (True)
|
||||||
|
oText.setText (sHead)
|
||||||
|
nX = oText.getModel.getPropertyValue ("PositionX") + nHeadWidth
|
||||||
|
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("StatAttack"), _
|
||||||
|
fnGetResString ("StatDefense"), _
|
||||||
|
fnGetResString ("StatHP"))
|
||||||
|
oList = oDialog.getControl ("lstBest")
|
||||||
|
oList.removeItems (0, oList.getItemCount())
|
||||||
|
oList.addItems (mItems, 0)
|
||||||
|
oList.getModel.setPropertyValue ("PositionX", nX)
|
||||||
|
oList.getModel.setPropertyValue ("Width", _
|
||||||
|
CInt (fnGetResString ("BestStatWidth")))
|
||||||
|
oList.setVisible (True)
|
||||||
|
nX = nX + oList.getModel.getPropertyValue ("Width")
|
||||||
|
|
||||||
|
nTailWidth = nDialogWidth - nX - 10
|
||||||
|
oText = oDialog.getControl ("txtBestTail")
|
||||||
|
oText.getModel.setPropertyValue ("PositionX", nX)
|
||||||
|
oText.getModel.setPropertyValue ("Width", nTailWidth)
|
||||||
|
oText.setVisible (True)
|
||||||
|
oText.setText (sTail)
|
||||||
|
|
||||||
|
oList = oDialog.getControl ("cbxBest2")
|
||||||
|
oList.setVisible (False)
|
||||||
|
|
||||||
|
oList = oDialog.getControl ("cbxBest3")
|
||||||
|
oList.setVisible (False)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subLstBestItemChanged: When the best stat is selected.
|
||||||
|
Sub subLstBestItemChanged (oEvent As object)
|
||||||
|
Dim oDialog As Object, oCheckBox As Object, sBestToo As String
|
||||||
|
|
||||||
|
oDialog = oEvent.Source.getContext
|
||||||
|
If oDialog.getControl ("rdoTeamValor").getState Then
|
||||||
|
sBestToo = fnGetResString ("AppraisalValorBestToo")
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 0 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 1 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 2 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("rdoTeamMystic").getState Then
|
||||||
|
sBestToo = fnGetResString ("AppraisalMysticBestToo")
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 0 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 1 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 2 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("rdoTeamInstinct").getState Then
|
||||||
|
sBestToo = fnGetResString ("AppraisalInstinctBestToo")
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 0 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 1 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 2 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subUpdateTotalAppraisal: Updates the text of the stats total
|
||||||
|
' appraisal.
|
||||||
|
Sub subUpdateTotalAppraisal ( _
|
||||||
|
oDialog As Object, bIsKeepSelected As Boolean)
|
||||||
|
Dim sPokemon As String, oList As Object, nSelected As Integer
|
||||||
|
Dim mItems () As String, nI As Integer
|
||||||
|
|
||||||
|
If oDialog.getControl ("rdoTeamValor").getState Then
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("AppraisalValorTotal37OrHigher"), _
|
||||||
|
fnGetResString ("AppraisalValorTotal30To36"), _
|
||||||
|
fnGetResString ("AppraisalValorTotal23To29"), _
|
||||||
|
fnGetResString ("AppraisalValorTotalUpTo22"))
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("rdoTeamMystic").getState Then
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("AppraisalMysticTotal37OrHigher"), _
|
||||||
|
fnGetResString ("AppraisalMysticTotal30To36"), _
|
||||||
|
fnGetResString ("AppraisalMysticTotal23To29"), _
|
||||||
|
fnGetResString ("AppraisalMysticTotalUpTo22"))
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("rdoTeamInstinct").getState Then
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("AppraisalInstinctTotal37OrHigher"), _
|
||||||
|
fnGetResString ("AppraisalInstinctTotal30To36"), _
|
||||||
|
fnGetResString ("AppraisalInstinctTotal23To29"), _
|
||||||
|
fnGetResString ("AppraisalInstinctTotalUpTo22"))
|
||||||
|
End If
|
||||||
|
' The team was not selected yet.
|
||||||
|
If UBound (mItems) = -1 Then
|
||||||
|
Exit sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
sPokemon = oDialog.getControl ("lstPokemon").getSelectedItem
|
||||||
|
If sPokemon <> "" Then
|
||||||
|
For nI = 0 To UBound (mItems)
|
||||||
|
mItems (nI) = fnReplace (mItems (nI), _
|
||||||
|
"[Pokémon]", sPokemon)
|
||||||
|
Next nI
|
||||||
|
End If
|
||||||
|
|
||||||
|
oList = oDialog.getControl ("lstTotal")
|
||||||
|
If bIsKeepSelected Then
|
||||||
|
nSelected = oList.getSelectedItemPos
|
||||||
|
End If
|
||||||
|
oList.removeItems (0, oList.getItemCount())
|
||||||
|
oList.addItems (mItems, 0)
|
||||||
|
If bIsKeepSelected Then
|
||||||
|
oList.selectItemPos (nSelected, True)
|
||||||
|
End If
|
||||||
|
oList.setVisible (True)
|
||||||
|
End Sub
|
@ -12,7 +12,7 @@
|
|||||||
' See the License for the specific language governing permissions and
|
' See the License for the specific language governing permissions and
|
||||||
' limitations under the License.
|
' limitations under the License.
|
||||||
|
|
||||||
' 1Data: The Pokémon GO data for IV calculation
|
' 2Data: The Pokémon GO data for IV calculation
|
||||||
' by imacat <imacat@mail.imacat.idv.tw>, 2017-02-14
|
' by imacat <imacat@mail.imacat.idv.tw>, 2017-02-14
|
||||||
' Generated with 9Load.subReadDataSheets ()
|
' Generated with 9Load.subReadDataSheets ()
|
||||||
|
|
@ -37,7 +37,7 @@ Sub subReadDataSheets
|
|||||||
& "' See the License for the specific language governing permissions and" & Chr (10) _
|
& "' See the License for the specific language governing permissions and" & Chr (10) _
|
||||||
& "' limitations under the License." & Chr (10) _
|
& "' limitations under the License." & Chr (10) _
|
||||||
& Chr (10) _
|
& Chr (10) _
|
||||||
& "' 1Data: The Pokémon GO data for IV calculation" & Chr (10) _
|
& "' 2Data: The Pokémon GO data for IV calculation" & Chr (10) _
|
||||||
& "' by imacat <imacat@mail.imacat.idv.tw>, " & Format (Date (), "yyyy-mm-dd") & Chr (10) _
|
& "' by imacat <imacat@mail.imacat.idv.tw>, " & Format (Date (), "yyyy-mm-dd") & Chr (10) _
|
||||||
& "' Generated with 9Load.subReadDataSheets ()" & Chr (10) _
|
& "' Generated with 9Load.subReadDataSheets ()" & Chr (10) _
|
||||||
& Chr (10) _
|
& Chr (10) _
|
||||||
|
@ -89,21 +89,7 @@ Function fnAskParam As aFindIVParam
|
|||||||
Dim bIsBestHP As Boolean
|
Dim bIsBestHP As Boolean
|
||||||
Dim aQuery As New aFindIVParam
|
Dim aQuery As New aFindIVParam
|
||||||
|
|
||||||
DialogLibraries.loadLibrary "PokemonGoIV"
|
oDialog = fnLoadParamDialog
|
||||||
oDialog = CreateUnoDialog (DialogLibraries.PokemonGoIV.DlgMain)
|
|
||||||
oDialog.getControl ("lstTotal").setVisible (False)
|
|
||||||
oDialog.getControl ("txtBestHead").setVisible (False)
|
|
||||||
oDialog.getControl ("lstBest").setVisible (False)
|
|
||||||
oDialog.getControl ("txtBestTail").setVisible (False)
|
|
||||||
oDialog.getControl ("cbxBest2").setVisible (False)
|
|
||||||
oDialog.getControl ("cbxBest3").setVisible (False)
|
|
||||||
oDialog.getControl ("lstMax").setVisible (False)
|
|
||||||
|
|
||||||
oDialog.getControl ("imgPokemon").getModel.setPropertyValue ( _
|
|
||||||
"ImageURL", fnGetImageUrl ("Unknown"))
|
|
||||||
oDialog.getControl ("imgTeamLogo").getModel.setPropertyValue ( _
|
|
||||||
"ImageURL", fnGetImageUrl ("Unknown"))
|
|
||||||
|
|
||||||
If oDialog.execute = 0 Then
|
If oDialog.execute = 0 Then
|
||||||
aQuery.bIsCancelled = True
|
aQuery.bIsCancelled = True
|
||||||
fnAskParam = aQuery
|
fnAskParam = aQuery
|
||||||
@ -171,387 +157,6 @@ Function fnAskParam As aFindIVParam
|
|||||||
fnAskParam = aQuery
|
fnAskParam = aQuery
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
' subBtnOKCheck: Checks whether the required columns are filled.
|
|
||||||
Sub subBtnOKCheck (oEvent As object)
|
|
||||||
Dim oDialog As Object
|
|
||||||
Dim oPokemon As Object, oCP As Object
|
|
||||||
Dim oHP As Object, oStardust As Object, oOK As Object
|
|
||||||
|
|
||||||
oDialog = oEvent.Source.getContext
|
|
||||||
oPokemon = oDialog.getControl ("lstPokemon")
|
|
||||||
oCP = oDialog.getControl ("numCP")
|
|
||||||
oHP = oDialog.getControl ("numHP")
|
|
||||||
oStardust = oDialog.getControl ("lstStardust")
|
|
||||||
oOK = oDialog.getControl ("btnOK")
|
|
||||||
|
|
||||||
If oPokemon.getSelectedItemPos <> -1 _
|
|
||||||
And oCP.getText <> "" _
|
|
||||||
And oHP.getText <> "" _
|
|
||||||
And oStardust.getSelectedItemPos <> -1 Then
|
|
||||||
oOK.setEnable (True)
|
|
||||||
Else
|
|
||||||
oOK.setEnable (False)
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subLstPokemonSelected: When the Pokémon is selected.
|
|
||||||
Sub subLstPokemonSelected (oEvent As object)
|
|
||||||
Dim oDialog As Object, nSelected As Integer
|
|
||||||
Dim oImageModel As Object, sImageId As String
|
|
||||||
|
|
||||||
oDialog = oEvent.Source.getContext
|
|
||||||
|
|
||||||
' Updates the Pokémon image.
|
|
||||||
nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
|
|
||||||
subReadBaseStats
|
|
||||||
sImageId = "Pokemon" & maBaseStats (nSelected).sPokemon
|
|
||||||
oImageModel = oDialog.getControl ("imgPokemon").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl (sImageId))
|
|
||||||
|
|
||||||
' Updates the text of the stats total appraisal.
|
|
||||||
subUpdateTotalAppraisal (oDialog, True)
|
|
||||||
' Checks if the required columns are filled.
|
|
||||||
subBtnOKCheck (oEvent)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subRdoTeamValorItemChanged: When Team Valor is selected.
|
|
||||||
Sub subRdoTeamValorItemChanged (oEvent As object)
|
|
||||||
Dim oDialog As Object, oList As Object, oText As Object
|
|
||||||
Dim oImageModel As Object
|
|
||||||
Dim mItems () As String
|
|
||||||
|
|
||||||
oDialog = oEvent.Source.getContext
|
|
||||||
|
|
||||||
oImageModel = oDialog.getControl ("imgTeamLogo").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl ("TeamLogoValor"))
|
|
||||||
oImageModel = oDialog.getControl ("imgTeamLeader").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl ("TeamLeaderCandela"))
|
|
||||||
|
|
||||||
oText = oDialog.getControl ("txtLeaderAppraise")
|
|
||||||
oText.setVisible (True)
|
|
||||||
oText.setText (fnGetResString ("AppraiseFromCandela"))
|
|
||||||
|
|
||||||
' Updates the text of the stats total appraisal.
|
|
||||||
subUpdateTotalAppraisal (oDialog, False)
|
|
||||||
|
|
||||||
' Updates the text of the best stat appraisal.
|
|
||||||
subUpdateBestStatAppraisal (oDialog, _
|
|
||||||
fnGetResString ("AppraisalValorBest"), _
|
|
||||||
CInt (fnGetResString ("AppraisalValorBestHeadWidth")))
|
|
||||||
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("AppraisalValorMax15"), _
|
|
||||||
fnGetResString ("AppraisalValorMax13Or14"), _
|
|
||||||
fnGetResString ("AppraisalValorMax8To12"), _
|
|
||||||
fnGetResString ("AppraisalValorMaxUpTo7"))
|
|
||||||
oList = oDialog.getControl ("lstMax")
|
|
||||||
oList.removeItems (0, oList.getItemCount())
|
|
||||||
oList.addItems (mItems, 0)
|
|
||||||
oList.setVisible (True)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subRdoTeamMysticItemChanged: When Team Mystic is selected.
|
|
||||||
Sub subRdoTeamMysticItemChanged (oEvent As object)
|
|
||||||
Dim oDialog As Object, oList As Object, oText As Object
|
|
||||||
Dim oImageModel As Object
|
|
||||||
Dim mItems () As String
|
|
||||||
|
|
||||||
oDialog = oEvent.Source.getContext
|
|
||||||
|
|
||||||
oImageModel = oDialog.getControl ("imgTeamLogo").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl ("TeamLogoMystic"))
|
|
||||||
oImageModel = oDialog.getControl ("imgTeamLeader").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl ("TeamLeaderBlanche"))
|
|
||||||
|
|
||||||
oText = oDialog.getControl ("txtLeaderAppraise")
|
|
||||||
oText.setVisible (True)
|
|
||||||
oText.setText (fnGetResString ("AppraiseFromBlanche"))
|
|
||||||
|
|
||||||
' Updates the text of the stats total appraisal.
|
|
||||||
subUpdateTotalAppraisal (oDialog, False)
|
|
||||||
|
|
||||||
' Updates the text of the best stat appraisal.
|
|
||||||
subUpdateBestStatAppraisal (oDialog, _
|
|
||||||
fnGetResString ("AppraisalMysticBest"), _
|
|
||||||
CInt (fnGetResString ("AppraisalMysticBestHeadWidth")))
|
|
||||||
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("AppraisalMysticMax15"), _
|
|
||||||
fnGetResString ("AppraisalMysticMax13Or14"), _
|
|
||||||
fnGetResString ("AppraisalMysticMax8To12"), _
|
|
||||||
fnGetResString ("AppraisalMysticMaxUpTo7"))
|
|
||||||
oList = oDialog.getControl ("lstMax")
|
|
||||||
oList.removeItems (0, oList.getItemCount())
|
|
||||||
oList.addItems (mItems, 0)
|
|
||||||
oList.setVisible (True)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subRdoTeamInstinctItemChanged: When Team Instinct is selected.
|
|
||||||
Sub subRdoTeamInstinctItemChanged (oEvent As object)
|
|
||||||
Dim oDialog As Object, oList As Object, oText As Object
|
|
||||||
Dim oImageModel As Object
|
|
||||||
Dim mItems () As String
|
|
||||||
|
|
||||||
oDialog = oEvent.Source.getContext
|
|
||||||
|
|
||||||
oImageModel = oDialog.getControl ("imgTeamLogo").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl ("TeamLogoInstinct"))
|
|
||||||
oImageModel = oDialog.getControl ("imgTeamLeader").getModel
|
|
||||||
oImageModel.setPropertyValue ("ImageURL", _
|
|
||||||
fnGetImageUrl ("TeamLeaderSpark"))
|
|
||||||
|
|
||||||
oText = oDialog.getControl ("txtLeaderAppraise")
|
|
||||||
oText.setVisible (True)
|
|
||||||
oText.setText (fnGetResString ("AppraiseFromSpark"))
|
|
||||||
|
|
||||||
' Updates the text of the stats total appraisal.
|
|
||||||
subUpdateTotalAppraisal (oDialog, False)
|
|
||||||
|
|
||||||
' Updates the text of the best stat appraisal.
|
|
||||||
subUpdateBestStatAppraisal (oDialog, _
|
|
||||||
fnGetResString ("AppraisalInstinctBest"), _
|
|
||||||
CInt (fnGetResString ("AppraisalInstinctBestHeadWidth")))
|
|
||||||
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("AppraisalInstinctMax15"), _
|
|
||||||
fnGetResString ("AppraisalInstinctMax13Or14"), _
|
|
||||||
fnGetResString ("AppraisalInstinctMax8To12"), _
|
|
||||||
fnGetResString ("AppraisalInstinctMaxUpTo7"))
|
|
||||||
oList = oDialog.getControl ("lstMax")
|
|
||||||
oList.removeItems (0, oList.getItemCount())
|
|
||||||
oList.addItems (mItems, 0)
|
|
||||||
oList.setVisible (True)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subUpdateBestStatAppraisal: Updates the text of the best stat appraisal.
|
|
||||||
Sub subUpdateBestStatAppraisal (oDialog As Object, _
|
|
||||||
sAppraisal As String, nHeadWidth As Integer)
|
|
||||||
Dim oText As Object, oList As Object, nX As Integer
|
|
||||||
Dim sHead As String, sTail As String, nTailWidth As Integer
|
|
||||||
Dim nDialogWidth As Integer
|
|
||||||
Dim nPos As Integer
|
|
||||||
Dim mItems () As String
|
|
||||||
|
|
||||||
nPos = InStr (sAppraisal, "[Stat]")
|
|
||||||
sHead = Left (sAppraisal, nPos - 1)
|
|
||||||
sTail = Right (sAppraisal, _
|
|
||||||
Len (sAppraisal) - nPos - Len ("[Stat]") + 1)
|
|
||||||
nDialogWidth = oDialog.getModel.getPropertyValue ("Width")
|
|
||||||
|
|
||||||
oText = oDialog.getControl ("txtBestHead")
|
|
||||||
oText.getModel.setPropertyValue ("Width", nHeadWidth)
|
|
||||||
oText.setVisible (True)
|
|
||||||
oText.setText (sHead)
|
|
||||||
nX = oText.getModel.getPropertyValue ("PositionX") + nHeadWidth
|
|
||||||
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("StatAttack"), _
|
|
||||||
fnGetResString ("StatDefense"), _
|
|
||||||
fnGetResString ("StatHP"))
|
|
||||||
oList = oDialog.getControl ("lstBest")
|
|
||||||
oList.removeItems (0, oList.getItemCount())
|
|
||||||
oList.addItems (mItems, 0)
|
|
||||||
oList.getModel.setPropertyValue ("PositionX", nX)
|
|
||||||
oList.getModel.setPropertyValue ("Width", _
|
|
||||||
CInt (fnGetResString ("BestStatWidth")))
|
|
||||||
oList.setVisible (True)
|
|
||||||
nX = nX + oList.getModel.getPropertyValue ("Width")
|
|
||||||
|
|
||||||
nTailWidth = nDialogWidth - nX - 10
|
|
||||||
oText = oDialog.getControl ("txtBestTail")
|
|
||||||
oText.getModel.setPropertyValue ("PositionX", nX)
|
|
||||||
oText.getModel.setPropertyValue ("Width", nTailWidth)
|
|
||||||
oText.setVisible (True)
|
|
||||||
oText.setText (sTail)
|
|
||||||
|
|
||||||
oList = oDialog.getControl ("cbxBest2")
|
|
||||||
oList.setVisible (False)
|
|
||||||
|
|
||||||
oList = oDialog.getControl ("cbxBest3")
|
|
||||||
oList.setVisible (False)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subLstBestItemChanged: When the best stat is selected.
|
|
||||||
Sub subLstBestItemChanged (oEvent As object)
|
|
||||||
Dim oDialog As Object, oCheckBox As Object, sBestToo As String
|
|
||||||
|
|
||||||
oDialog = oEvent.Source.getContext
|
|
||||||
If oDialog.getControl ("rdoTeamValor").getState Then
|
|
||||||
sBestToo = fnGetResString ("AppraisalValorBestToo")
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 0 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 1 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 2 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("rdoTeamMystic").getState Then
|
|
||||||
sBestToo = fnGetResString ("AppraisalMysticBestToo")
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 0 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 1 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 2 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("rdoTeamInstinct").getState Then
|
|
||||||
sBestToo = fnGetResString ("AppraisalInstinctBestToo")
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 0 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 1 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("lstBest").getSelectedItemPos = 2 Then
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest2")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
oCheckBox = oDialog.getControl ("cbxBest3")
|
|
||||||
oCheckBox.setLabel (fnReplace ( _
|
|
||||||
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
|
||||||
oCheckBox.setVisible (True)
|
|
||||||
oCheckBox.setState (0)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' subUpdateTotalAppraisal: Updates the text of the stats total
|
|
||||||
' appraisal.
|
|
||||||
Sub subUpdateTotalAppraisal ( _
|
|
||||||
oDialog As Object, bIsKeepSelected As Boolean)
|
|
||||||
Dim sPokemon As String, oList As Object, nSelected As Integer
|
|
||||||
Dim mItems () As String, nI As Integer
|
|
||||||
|
|
||||||
If oDialog.getControl ("rdoTeamValor").getState Then
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("AppraisalValorTotal37OrHigher"), _
|
|
||||||
fnGetResString ("AppraisalValorTotal30To36"), _
|
|
||||||
fnGetResString ("AppraisalValorTotal23To29"), _
|
|
||||||
fnGetResString ("AppraisalValorTotalUpTo22"))
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("rdoTeamMystic").getState Then
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("AppraisalMysticTotal37OrHigher"), _
|
|
||||||
fnGetResString ("AppraisalMysticTotal30To36"), _
|
|
||||||
fnGetResString ("AppraisalMysticTotal23To29"), _
|
|
||||||
fnGetResString ("AppraisalMysticTotalUpTo22"))
|
|
||||||
End If
|
|
||||||
If oDialog.getControl ("rdoTeamInstinct").getState Then
|
|
||||||
mItems = Array ( _
|
|
||||||
fnGetResString ("AppraisalInstinctTotal37OrHigher"), _
|
|
||||||
fnGetResString ("AppraisalInstinctTotal30To36"), _
|
|
||||||
fnGetResString ("AppraisalInstinctTotal23To29"), _
|
|
||||||
fnGetResString ("AppraisalInstinctTotalUpTo22"))
|
|
||||||
End If
|
|
||||||
' The team was not selected yet.
|
|
||||||
If UBound (mItems) = -1 Then
|
|
||||||
Exit sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
sPokemon = oDialog.getControl ("lstPokemon").getSelectedItem
|
|
||||||
If sPokemon <> "" Then
|
|
||||||
For nI = 0 To UBound (mItems)
|
|
||||||
mItems (nI) = fnReplace (mItems (nI), _
|
|
||||||
"[Pokémon]", sPokemon)
|
|
||||||
Next nI
|
|
||||||
End If
|
|
||||||
|
|
||||||
oList = oDialog.getControl ("lstTotal")
|
|
||||||
If bIsKeepSelected Then
|
|
||||||
nSelected = oList.getSelectedItemPos
|
|
||||||
End If
|
|
||||||
oList.removeItems (0, oList.getItemCount())
|
|
||||||
oList.addItems (mItems, 0)
|
|
||||||
If bIsKeepSelected Then
|
|
||||||
oList.selectItemPos (nSelected, True)
|
|
||||||
End If
|
|
||||||
oList.setVisible (True)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' fnFindIV: Finds the possible individual values of the Pokémon
|
' fnFindIV: Finds the possible individual values of the Pokémon
|
||||||
Function fnFindIV ( _
|
Function fnFindIV ( _
|
||||||
aBaseStats As aStats, aQuery As aFindIVParam) As Variant
|
aBaseStats As aStats, aQuery As aFindIVParam) As Variant
|
||||||
|
424
oxt/PokemonGoIV/1Dialog.xba
Normal file
424
oxt/PokemonGoIV/1Dialog.xba
Normal file
@ -0,0 +1,424 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||||
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="1Dialog" script:language="StarBasic">' Copyright (c) 2016-2017 imacat.
|
||||||
|
'
|
||||||
|
' Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
' you may not use this file except in compliance with the License.
|
||||||
|
' You may obtain a copy of the License at
|
||||||
|
'
|
||||||
|
' http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
'
|
||||||
|
' Unless required by applicable law or agreed to in writing, software
|
||||||
|
' distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
' See the License for the specific language governing permissions and
|
||||||
|
' limitations under the License.
|
||||||
|
|
||||||
|
' 1Dialog: The Dialog UI processor
|
||||||
|
' by imacat <imacat@mail.imacat.idv.tw>, 2017-02-24
|
||||||
|
|
||||||
|
Option Explicit
|
||||||
|
|
||||||
|
' fnLoadParamDialog: Loads the parameter dialog.
|
||||||
|
Function fnLoadParamDialog As Object
|
||||||
|
Dim oDialog As Object
|
||||||
|
|
||||||
|
DialogLibraries.loadLibrary "PokemonGoIV"
|
||||||
|
oDialog = CreateUnoDialog (DialogLibraries.PokemonGoIV.DlgMain)
|
||||||
|
oDialog.getControl ("lstTotal").setVisible (False)
|
||||||
|
oDialog.getControl ("txtBestHead").setVisible (False)
|
||||||
|
oDialog.getControl ("lstBest").setVisible (False)
|
||||||
|
oDialog.getControl ("txtBestTail").setVisible (False)
|
||||||
|
oDialog.getControl ("cbxBest2").setVisible (False)
|
||||||
|
oDialog.getControl ("cbxBest3").setVisible (False)
|
||||||
|
oDialog.getControl ("lstMax").setVisible (False)
|
||||||
|
|
||||||
|
oDialog.getControl ("imgPokemon").getModel.setPropertyValue ( _
|
||||||
|
"ImageURL", fnGetImageUrl ("Unknown"))
|
||||||
|
oDialog.getControl ("imgTeamLogo").getModel.setPropertyValue ( _
|
||||||
|
"ImageURL", fnGetImageUrl ("Unknown"))
|
||||||
|
|
||||||
|
fnLoadParamDialog = oDialog
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' subBtnOKCheck: Checks whether the required columns are filled.
|
||||||
|
Sub subBtnOKCheck (oEvent As object)
|
||||||
|
Dim oDialog As Object
|
||||||
|
Dim oPokemon As Object, oCP As Object
|
||||||
|
Dim oHP As Object, oStardust As Object, oOK As Object
|
||||||
|
|
||||||
|
oDialog = oEvent.Source.getContext
|
||||||
|
oPokemon = oDialog.getControl ("lstPokemon")
|
||||||
|
oCP = oDialog.getControl ("numCP")
|
||||||
|
oHP = oDialog.getControl ("numHP")
|
||||||
|
oStardust = oDialog.getControl ("lstStardust")
|
||||||
|
oOK = oDialog.getControl ("btnOK")
|
||||||
|
|
||||||
|
If oPokemon.getSelectedItemPos <> -1 _
|
||||||
|
And oCP.getText <> "" _
|
||||||
|
And oHP.getText <> "" _
|
||||||
|
And oStardust.getSelectedItemPos <> -1 Then
|
||||||
|
oOK.setEnable (True)
|
||||||
|
Else
|
||||||
|
oOK.setEnable (False)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subLstPokemonSelected: When the Pokémon is selected.
|
||||||
|
Sub subLstPokemonSelected (oEvent As object)
|
||||||
|
Dim oDialog As Object, nSelected As Integer
|
||||||
|
Dim oImageModel As Object, sImageId As String
|
||||||
|
|
||||||
|
oDialog = oEvent.Source.getContext
|
||||||
|
|
||||||
|
' Updates the Pokémon image.
|
||||||
|
nSelected = oDialog.getControl ("lstPokemon").getSelectedItemPos
|
||||||
|
subReadBaseStats
|
||||||
|
sImageId = "Pokemon" & maBaseStats (nSelected).sPokemon
|
||||||
|
oImageModel = oDialog.getControl ("imgPokemon").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl (sImageId))
|
||||||
|
|
||||||
|
' Updates the text of the stats total appraisal.
|
||||||
|
subUpdateTotalAppraisal (oDialog, True)
|
||||||
|
' Checks if the required columns are filled.
|
||||||
|
subBtnOKCheck (oEvent)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subRdoTeamValorItemChanged: When Team Valor is selected.
|
||||||
|
Sub subRdoTeamValorItemChanged (oEvent As object)
|
||||||
|
Dim oDialog As Object, oList As Object, oText As Object
|
||||||
|
Dim oImageModel As Object
|
||||||
|
Dim mItems () As String
|
||||||
|
|
||||||
|
oDialog = oEvent.Source.getContext
|
||||||
|
|
||||||
|
oImageModel = oDialog.getControl ("imgTeamLogo").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl ("TeamLogoValor"))
|
||||||
|
oImageModel = oDialog.getControl ("imgTeamLeader").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl ("TeamLeaderCandela"))
|
||||||
|
|
||||||
|
oText = oDialog.getControl ("txtLeaderAppraise")
|
||||||
|
oText.setVisible (True)
|
||||||
|
oText.setText (fnGetResString ("AppraiseFromCandela"))
|
||||||
|
|
||||||
|
' Updates the text of the stats total appraisal.
|
||||||
|
subUpdateTotalAppraisal (oDialog, False)
|
||||||
|
|
||||||
|
' Updates the text of the best stat appraisal.
|
||||||
|
subUpdateBestStatAppraisal (oDialog, _
|
||||||
|
fnGetResString ("AppraisalValorBest"), _
|
||||||
|
CInt (fnGetResString ("AppraisalValorBestHeadWidth")))
|
||||||
|
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("AppraisalValorMax15"), _
|
||||||
|
fnGetResString ("AppraisalValorMax13Or14"), _
|
||||||
|
fnGetResString ("AppraisalValorMax8To12"), _
|
||||||
|
fnGetResString ("AppraisalValorMaxUpTo7"))
|
||||||
|
oList = oDialog.getControl ("lstMax")
|
||||||
|
oList.removeItems (0, oList.getItemCount())
|
||||||
|
oList.addItems (mItems, 0)
|
||||||
|
oList.setVisible (True)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subRdoTeamMysticItemChanged: When Team Mystic is selected.
|
||||||
|
Sub subRdoTeamMysticItemChanged (oEvent As object)
|
||||||
|
Dim oDialog As Object, oList As Object, oText As Object
|
||||||
|
Dim oImageModel As Object
|
||||||
|
Dim mItems () As String
|
||||||
|
|
||||||
|
oDialog = oEvent.Source.getContext
|
||||||
|
|
||||||
|
oImageModel = oDialog.getControl ("imgTeamLogo").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl ("TeamLogoMystic"))
|
||||||
|
oImageModel = oDialog.getControl ("imgTeamLeader").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl ("TeamLeaderBlanche"))
|
||||||
|
|
||||||
|
oText = oDialog.getControl ("txtLeaderAppraise")
|
||||||
|
oText.setVisible (True)
|
||||||
|
oText.setText (fnGetResString ("AppraiseFromBlanche"))
|
||||||
|
|
||||||
|
' Updates the text of the stats total appraisal.
|
||||||
|
subUpdateTotalAppraisal (oDialog, False)
|
||||||
|
|
||||||
|
' Updates the text of the best stat appraisal.
|
||||||
|
subUpdateBestStatAppraisal (oDialog, _
|
||||||
|
fnGetResString ("AppraisalMysticBest"), _
|
||||||
|
CInt (fnGetResString ("AppraisalMysticBestHeadWidth")))
|
||||||
|
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("AppraisalMysticMax15"), _
|
||||||
|
fnGetResString ("AppraisalMysticMax13Or14"), _
|
||||||
|
fnGetResString ("AppraisalMysticMax8To12"), _
|
||||||
|
fnGetResString ("AppraisalMysticMaxUpTo7"))
|
||||||
|
oList = oDialog.getControl ("lstMax")
|
||||||
|
oList.removeItems (0, oList.getItemCount())
|
||||||
|
oList.addItems (mItems, 0)
|
||||||
|
oList.setVisible (True)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subRdoTeamInstinctItemChanged: When Team Instinct is selected.
|
||||||
|
Sub subRdoTeamInstinctItemChanged (oEvent As object)
|
||||||
|
Dim oDialog As Object, oList As Object, oText As Object
|
||||||
|
Dim oImageModel As Object
|
||||||
|
Dim mItems () As String
|
||||||
|
|
||||||
|
oDialog = oEvent.Source.getContext
|
||||||
|
|
||||||
|
oImageModel = oDialog.getControl ("imgTeamLogo").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl ("TeamLogoInstinct"))
|
||||||
|
oImageModel = oDialog.getControl ("imgTeamLeader").getModel
|
||||||
|
oImageModel.setPropertyValue ("ImageURL", _
|
||||||
|
fnGetImageUrl ("TeamLeaderSpark"))
|
||||||
|
|
||||||
|
oText = oDialog.getControl ("txtLeaderAppraise")
|
||||||
|
oText.setVisible (True)
|
||||||
|
oText.setText (fnGetResString ("AppraiseFromSpark"))
|
||||||
|
|
||||||
|
' Updates the text of the stats total appraisal.
|
||||||
|
subUpdateTotalAppraisal (oDialog, False)
|
||||||
|
|
||||||
|
' Updates the text of the best stat appraisal.
|
||||||
|
subUpdateBestStatAppraisal (oDialog, _
|
||||||
|
fnGetResString ("AppraisalInstinctBest"), _
|
||||||
|
CInt (fnGetResString ("AppraisalInstinctBestHeadWidth")))
|
||||||
|
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("AppraisalInstinctMax15"), _
|
||||||
|
fnGetResString ("AppraisalInstinctMax13Or14"), _
|
||||||
|
fnGetResString ("AppraisalInstinctMax8To12"), _
|
||||||
|
fnGetResString ("AppraisalInstinctMaxUpTo7"))
|
||||||
|
oList = oDialog.getControl ("lstMax")
|
||||||
|
oList.removeItems (0, oList.getItemCount())
|
||||||
|
oList.addItems (mItems, 0)
|
||||||
|
oList.setVisible (True)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subUpdateBestStatAppraisal: Updates the text of the best stat appraisal.
|
||||||
|
Sub subUpdateBestStatAppraisal (oDialog As Object, _
|
||||||
|
sAppraisal As String, nHeadWidth As Integer)
|
||||||
|
Dim oText As Object, oList As Object, nX As Integer
|
||||||
|
Dim sHead As String, sTail As String, nTailWidth As Integer
|
||||||
|
Dim nDialogWidth As Integer
|
||||||
|
Dim nPos As Integer
|
||||||
|
Dim mItems () As String
|
||||||
|
|
||||||
|
nPos = InStr (sAppraisal, "[Stat]")
|
||||||
|
sHead = Left (sAppraisal, nPos - 1)
|
||||||
|
sTail = Right (sAppraisal, _
|
||||||
|
Len (sAppraisal) - nPos - Len ("[Stat]") + 1)
|
||||||
|
nDialogWidth = oDialog.getModel.getPropertyValue ("Width")
|
||||||
|
|
||||||
|
oText = oDialog.getControl ("txtBestHead")
|
||||||
|
oText.getModel.setPropertyValue ("Width", nHeadWidth)
|
||||||
|
oText.setVisible (True)
|
||||||
|
oText.setText (sHead)
|
||||||
|
nX = oText.getModel.getPropertyValue ("PositionX") + nHeadWidth
|
||||||
|
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("StatAttack"), _
|
||||||
|
fnGetResString ("StatDefense"), _
|
||||||
|
fnGetResString ("StatHP"))
|
||||||
|
oList = oDialog.getControl ("lstBest")
|
||||||
|
oList.removeItems (0, oList.getItemCount())
|
||||||
|
oList.addItems (mItems, 0)
|
||||||
|
oList.getModel.setPropertyValue ("PositionX", nX)
|
||||||
|
oList.getModel.setPropertyValue ("Width", _
|
||||||
|
CInt (fnGetResString ("BestStatWidth")))
|
||||||
|
oList.setVisible (True)
|
||||||
|
nX = nX + oList.getModel.getPropertyValue ("Width")
|
||||||
|
|
||||||
|
nTailWidth = nDialogWidth - nX - 10
|
||||||
|
oText = oDialog.getControl ("txtBestTail")
|
||||||
|
oText.getModel.setPropertyValue ("PositionX", nX)
|
||||||
|
oText.getModel.setPropertyValue ("Width", nTailWidth)
|
||||||
|
oText.setVisible (True)
|
||||||
|
oText.setText (sTail)
|
||||||
|
|
||||||
|
oList = oDialog.getControl ("cbxBest2")
|
||||||
|
oList.setVisible (False)
|
||||||
|
|
||||||
|
oList = oDialog.getControl ("cbxBest3")
|
||||||
|
oList.setVisible (False)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subLstBestItemChanged: When the best stat is selected.
|
||||||
|
Sub subLstBestItemChanged (oEvent As object)
|
||||||
|
Dim oDialog As Object, oCheckBox As Object, sBestToo As String
|
||||||
|
|
||||||
|
oDialog = oEvent.Source.getContext
|
||||||
|
If oDialog.getControl ("rdoTeamValor").getState Then
|
||||||
|
sBestToo = fnGetResString ("AppraisalValorBestToo")
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 0 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 1 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 2 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("rdoTeamMystic").getState Then
|
||||||
|
sBestToo = fnGetResString ("AppraisalMysticBestToo")
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 0 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 1 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 2 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("rdoTeamInstinct").getState Then
|
||||||
|
sBestToo = fnGetResString ("AppraisalInstinctBestToo")
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 0 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 1 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatHP")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("lstBest").getSelectedItemPos = 2 Then
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest2")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatAttack")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
oCheckBox = oDialog.getControl ("cbxBest3")
|
||||||
|
oCheckBox.setLabel (fnReplace ( _
|
||||||
|
sBestToo, "[Stat]", fnGetResString ("StatDefense")))
|
||||||
|
oCheckBox.setVisible (True)
|
||||||
|
oCheckBox.setState (0)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' subUpdateTotalAppraisal: Updates the text of the stats total
|
||||||
|
' appraisal.
|
||||||
|
Sub subUpdateTotalAppraisal ( _
|
||||||
|
oDialog As Object, bIsKeepSelected As Boolean)
|
||||||
|
Dim sPokemon As String, oList As Object, nSelected As Integer
|
||||||
|
Dim mItems () As String, nI As Integer
|
||||||
|
|
||||||
|
If oDialog.getControl ("rdoTeamValor").getState Then
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("AppraisalValorTotal37OrHigher"), _
|
||||||
|
fnGetResString ("AppraisalValorTotal30To36"), _
|
||||||
|
fnGetResString ("AppraisalValorTotal23To29"), _
|
||||||
|
fnGetResString ("AppraisalValorTotalUpTo22"))
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("rdoTeamMystic").getState Then
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("AppraisalMysticTotal37OrHigher"), _
|
||||||
|
fnGetResString ("AppraisalMysticTotal30To36"), _
|
||||||
|
fnGetResString ("AppraisalMysticTotal23To29"), _
|
||||||
|
fnGetResString ("AppraisalMysticTotalUpTo22"))
|
||||||
|
End If
|
||||||
|
If oDialog.getControl ("rdoTeamInstinct").getState Then
|
||||||
|
mItems = Array ( _
|
||||||
|
fnGetResString ("AppraisalInstinctTotal37OrHigher"), _
|
||||||
|
fnGetResString ("AppraisalInstinctTotal30To36"), _
|
||||||
|
fnGetResString ("AppraisalInstinctTotal23To29"), _
|
||||||
|
fnGetResString ("AppraisalInstinctTotalUpTo22"))
|
||||||
|
End If
|
||||||
|
' The team was not selected yet.
|
||||||
|
If UBound (mItems) = -1 Then
|
||||||
|
Exit sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
sPokemon = oDialog.getControl ("lstPokemon").getSelectedItem
|
||||||
|
If sPokemon <> "" Then
|
||||||
|
For nI = 0 To UBound (mItems)
|
||||||
|
mItems (nI) = fnReplace (mItems (nI), _
|
||||||
|
"[Pokémon]", sPokemon)
|
||||||
|
Next nI
|
||||||
|
End If
|
||||||
|
|
||||||
|
oList = oDialog.getControl ("lstTotal")
|
||||||
|
If bIsKeepSelected Then
|
||||||
|
nSelected = oList.getSelectedItemPos
|
||||||
|
End If
|
||||||
|
oList.removeItems (0, oList.getItemCount())
|
||||||
|
oList.addItems (mItems, 0)
|
||||||
|
If bIsKeepSelected Then
|
||||||
|
oList.selectItemPos (nSelected, True)
|
||||||
|
End If
|
||||||
|
oList.setVisible (True)
|
||||||
|
End Sub
|
||||||
|
</script:module>
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="1Data" script:language="StarBasic">' Copyright (c) 2016-2017 imacat.
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="2Data" script:language="StarBasic">' Copyright (c) 2016-2017 imacat.
|
||||||
'
|
'
|
||||||
' Licensed under the Apache License, Version 2.0 (the "License");
|
' Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
' you may not use this file except in compliance with the License.
|
' you may not use this file except in compliance with the License.
|
||||||
@ -14,7 +14,7 @@
|
|||||||
' See the License for the specific language governing permissions and
|
' See the License for the specific language governing permissions and
|
||||||
' limitations under the License.
|
' limitations under the License.
|
||||||
|
|
||||||
' 1Data: The Pokémon GO data for IV calculation
|
' 2Data: The Pokémon GO data for IV calculation
|
||||||
' by imacat <imacat@mail.imacat.idv.tw>, 2017-02-14
|
' by imacat <imacat@mail.imacat.idv.tw>, 2017-02-14
|
||||||
' Generated with 9Load.subReadDataSheets ()
|
' Generated with 9Load.subReadDataSheets ()
|
||||||
|
|
@ -39,7 +39,7 @@ Sub subReadDataSheets
|
|||||||
& "' See the License for the specific language governing permissions and" & Chr (10) _
|
& "' See the License for the specific language governing permissions and" & Chr (10) _
|
||||||
& "' limitations under the License." & Chr (10) _
|
& "' limitations under the License." & Chr (10) _
|
||||||
& Chr (10) _
|
& Chr (10) _
|
||||||
& "' 1Data: The Pokémon GO data for IV calculation" & Chr (10) _
|
& "' 2Data: The Pokémon GO data for IV calculation" & Chr (10) _
|
||||||
& "' by imacat <imacat@mail.imacat.idv.tw>, " & Format (Date (), "yyyy-mm-dd") & Chr (10) _
|
& "' by imacat <imacat@mail.imacat.idv.tw>, " & Format (Date (), "yyyy-mm-dd") & Chr (10) _
|
||||||
& "' Generated with 9Load.subReadDataSheets ()" & Chr (10) _
|
& "' Generated with 9Load.subReadDataSheets ()" & Chr (10) _
|
||||||
& Chr (10) _
|
& Chr (10) _
|
||||||
|
@ -171,16 +171,16 @@
|
|||||||
<dlg:menuitem dlg:value="&1239.lstPokemon.StringItemList"/>
|
<dlg:menuitem dlg:value="&1239.lstPokemon.StringItemList"/>
|
||||||
<dlg:menuitem dlg:value="&1240.lstPokemon.StringItemList"/>
|
<dlg:menuitem dlg:value="&1240.lstPokemon.StringItemList"/>
|
||||||
</dlg:menupopup>
|
</dlg:menupopup>
|
||||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subLstPokemonSelected?language=Basic&location=application" script:language="Script"/>
|
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.1Dialog.subLstPokemonSelected?language=Basic&location=application" script:language="Script"/>
|
||||||
</dlg:menulist>
|
</dlg:menulist>
|
||||||
<dlg:img dlg:style-id="0" dlg:id="imgPokemon" dlg:tab-index="26" dlg:left="95" dlg:top="5" dlg:width="30" dlg:height="30"/>
|
<dlg:img dlg:style-id="0" dlg:id="imgPokemon" dlg:tab-index="26" dlg:left="95" dlg:top="5" dlg:width="30" dlg:height="30"/>
|
||||||
<dlg:text dlg:id="txtCP" dlg:tab-index="17" dlg:left="5" dlg:top="41" dlg:width="15" dlg:height="8" dlg:value="&3.DlgMain.txtCP.Label"/>
|
<dlg:text dlg:id="txtCP" dlg:tab-index="17" dlg:left="5" dlg:top="41" dlg:width="15" dlg:height="8" dlg:value="&3.DlgMain.txtCP.Label"/>
|
||||||
<dlg:numericfield dlg:id="numCP" dlg:tab-index="1" dlg:left="20" dlg:top="39" dlg:width="20" dlg:height="12" dlg:decimal-accuracy="0" dlg:value-min="10" dlg:value-max="5000">
|
<dlg:numericfield dlg:id="numCP" dlg:tab-index="1" dlg:left="20" dlg:top="39" dlg:width="20" dlg:height="12" dlg:decimal-accuracy="0" dlg:value-min="10" dlg:value-max="5000">
|
||||||
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subBtnOKCheck?language=Basic&location=application" script:language="Script"/>
|
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:PokemonGoIV.1Dialog.subBtnOKCheck?language=Basic&location=application" script:language="Script"/>
|
||||||
</dlg:numericfield>
|
</dlg:numericfield>
|
||||||
<dlg:text dlg:id="txtHP" dlg:tab-index="18" dlg:left="50" dlg:top="41" dlg:width="15" dlg:height="8" dlg:value="&4.DlgMain.txtHP.Label"/>
|
<dlg:text dlg:id="txtHP" dlg:tab-index="18" dlg:left="50" dlg:top="41" dlg:width="15" dlg:height="8" dlg:value="&4.DlgMain.txtHP.Label"/>
|
||||||
<dlg:numericfield dlg:id="numHP" dlg:tab-index="2" dlg:left="65" dlg:top="39" dlg:width="15" dlg:height="12" dlg:decimal-accuracy="0" dlg:value-min="10" dlg:value-max="500">
|
<dlg:numericfield dlg:id="numHP" dlg:tab-index="2" dlg:left="65" dlg:top="39" dlg:width="15" dlg:height="12" dlg:decimal-accuracy="0" dlg:value-min="10" dlg:value-max="500">
|
||||||
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subBtnOKCheck?language=Basic&location=application" script:language="Script"/>
|
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:PokemonGoIV.1Dialog.subBtnOKCheck?language=Basic&location=application" script:language="Script"/>
|
||||||
</dlg:numericfield>
|
</dlg:numericfield>
|
||||||
<dlg:text dlg:id="txtStardust" dlg:tab-index="19" dlg:left="90" dlg:top="41" dlg:width="45" dlg:height="8" dlg:value="&5.DlgMain.txtStardust.Label"/>
|
<dlg:text dlg:id="txtStardust" dlg:tab-index="19" dlg:left="90" dlg:top="41" dlg:width="45" dlg:height="8" dlg:value="&5.DlgMain.txtStardust.Label"/>
|
||||||
<dlg:menulist dlg:id="lstStardust" dlg:tab-index="3" dlg:left="135" dlg:top="39" dlg:width="40" dlg:height="12" dlg:spin="true" dlg:linecount="20">
|
<dlg:menulist dlg:id="lstStardust" dlg:tab-index="3" dlg:left="135" dlg:top="39" dlg:width="40" dlg:height="12" dlg:spin="true" dlg:linecount="20">
|
||||||
@ -206,7 +206,7 @@
|
|||||||
<dlg:menuitem dlg:value="9000"/>
|
<dlg:menuitem dlg:value="9000"/>
|
||||||
<dlg:menuitem dlg:value="10000"/>
|
<dlg:menuitem dlg:value="10000"/>
|
||||||
</dlg:menupopup>
|
</dlg:menupopup>
|
||||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subBtnOKCheck?language=Basic&location=application" script:language="Script"/>
|
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.1Dialog.subBtnOKCheck?language=Basic&location=application" script:language="Script"/>
|
||||||
</dlg:menulist>
|
</dlg:menulist>
|
||||||
<dlg:text dlg:id="txtPlayerLevel" dlg:tab-index="20" dlg:left="185" dlg:top="41" dlg:width="45" dlg:height="8" dlg:value="&6.DlgMain.txtPlayerLevel.Label"/>
|
<dlg:text dlg:id="txtPlayerLevel" dlg:tab-index="20" dlg:left="185" dlg:top="41" dlg:width="45" dlg:height="8" dlg:value="&6.DlgMain.txtPlayerLevel.Label"/>
|
||||||
<dlg:menulist dlg:id="lstPlayerLevel" dlg:tab-index="4" dlg:left="230" dlg:top="39" dlg:width="30" dlg:height="12" dlg:spin="true" dlg:linecount="20">
|
<dlg:menulist dlg:id="lstPlayerLevel" dlg:tab-index="4" dlg:left="230" dlg:top="39" dlg:width="30" dlg:height="12" dlg:spin="true" dlg:linecount="20">
|
||||||
@ -260,13 +260,13 @@
|
|||||||
<dlg:img dlg:style-id="0" dlg:id="imgTeamLogo" dlg:tab-index="25" dlg:left="10" dlg:top="80" dlg:width="30" dlg:height="30"/>
|
<dlg:img dlg:style-id="0" dlg:id="imgTeamLogo" dlg:tab-index="25" dlg:left="10" dlg:top="80" dlg:width="30" dlg:height="30"/>
|
||||||
<dlg:radiogroup>
|
<dlg:radiogroup>
|
||||||
<dlg:radio dlg:style-id="1" dlg:id="rdoTeamValor" dlg:tab-index="6" dlg:left="45" dlg:top="100" dlg:width="60" dlg:height="10" dlg:value="&9.DlgMain.rdoTeamValor.Label" dlg:valign="center">
|
<dlg:radio dlg:style-id="1" dlg:id="rdoTeamValor" dlg:tab-index="6" dlg:left="45" dlg:top="100" dlg:width="60" dlg:height="10" dlg:value="&9.DlgMain.rdoTeamValor.Label" dlg:valign="center">
|
||||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subRdoTeamValorItemChanged?language=Basic&location=application" script:language="Script"/>
|
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.1Dialog.subRdoTeamValorItemChanged?language=Basic&location=application" script:language="Script"/>
|
||||||
</dlg:radio>
|
</dlg:radio>
|
||||||
<dlg:radio dlg:style-id="2" dlg:id="rdoTeamMystic" dlg:tab-index="7" dlg:left="120" dlg:top="100" dlg:width="60" dlg:height="10" dlg:value="&10.DlgMain.rdoTeamMystic.Label" dlg:valign="center">
|
<dlg:radio dlg:style-id="2" dlg:id="rdoTeamMystic" dlg:tab-index="7" dlg:left="120" dlg:top="100" dlg:width="60" dlg:height="10" dlg:value="&10.DlgMain.rdoTeamMystic.Label" dlg:valign="center">
|
||||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subRdoTeamMysticItemChanged?language=Basic&location=application" script:language="Script"/>
|
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.1Dialog.subRdoTeamMysticItemChanged?language=Basic&location=application" script:language="Script"/>
|
||||||
</dlg:radio>
|
</dlg:radio>
|
||||||
<dlg:radio dlg:style-id="3" dlg:id="rdoTeamInstinct" dlg:tab-index="8" dlg:left="195" dlg:top="100" dlg:width="60" dlg:height="10" dlg:value="&11.DlgMain.rdoTeamInstinct.Label" dlg:valign="center">
|
<dlg:radio dlg:style-id="3" dlg:id="rdoTeamInstinct" dlg:tab-index="8" dlg:left="195" dlg:top="100" dlg:width="60" dlg:height="10" dlg:value="&11.DlgMain.rdoTeamInstinct.Label" dlg:valign="center">
|
||||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subRdoTeamInstinctItemChanged?language=Basic&location=application" script:language="Script"/>
|
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.1Dialog.subRdoTeamInstinctItemChanged?language=Basic&location=application" script:language="Script"/>
|
||||||
</dlg:radio>
|
</dlg:radio>
|
||||||
</dlg:radiogroup>
|
</dlg:radiogroup>
|
||||||
<dlg:img dlg:style-id="0" dlg:id="imgTeamLeader" dlg:tab-index="28" dlg:left="10" dlg:top="110" dlg:width="30" dlg:height="35"/>
|
<dlg:img dlg:style-id="0" dlg:id="imgTeamLeader" dlg:tab-index="28" dlg:left="10" dlg:top="110" dlg:width="30" dlg:height="35"/>
|
||||||
@ -274,7 +274,7 @@
|
|||||||
<dlg:menulist dlg:id="lstTotal" dlg:tab-index="9" dlg:left="45" dlg:top="129" dlg:width="210" dlg:height="12" dlg:spin="true"/>
|
<dlg:menulist dlg:id="lstTotal" dlg:tab-index="9" dlg:left="45" dlg:top="129" dlg:width="210" dlg:height="12" dlg:spin="true"/>
|
||||||
<dlg:text dlg:id="txtBestHead" dlg:tab-index="23" dlg:left="45" dlg:top="146" dlg:width="20" dlg:height="8"/>
|
<dlg:text dlg:id="txtBestHead" dlg:tab-index="23" dlg:left="45" dlg:top="146" dlg:width="20" dlg:height="8"/>
|
||||||
<dlg:menulist dlg:id="lstBest" dlg:tab-index="10" dlg:left="65" dlg:top="144" dlg:width="58" dlg:height="12" dlg:spin="true">
|
<dlg:menulist dlg:id="lstBest" dlg:tab-index="10" dlg:left="65" dlg:top="144" dlg:width="58" dlg:height="12" dlg:spin="true">
|
||||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subLstBestItemChanged?language=Basic&location=application" script:language="Script"/>
|
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.1Dialog.subLstBestItemChanged?language=Basic&location=application" script:language="Script"/>
|
||||||
</dlg:menulist>
|
</dlg:menulist>
|
||||||
<dlg:text dlg:id="txtBestTail" dlg:tab-index="24" dlg:left="110" dlg:top="146" dlg:width="100" dlg:height="8"/>
|
<dlg:text dlg:id="txtBestTail" dlg:tab-index="24" dlg:left="110" dlg:top="146" dlg:width="100" dlg:height="8"/>
|
||||||
<dlg:checkbox dlg:id="cbxBest2" dlg:tab-index="11" dlg:left="45" dlg:top="161" dlg:width="210" dlg:height="8" dlg:checked="false"/>
|
<dlg:checkbox dlg:id="cbxBest2" dlg:tab-index="11" dlg:left="45" dlg:top="161" dlg:width="210" dlg:height="8" dlg:checked="false"/>
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="PokemonGoIV" library:readonly="false" library:passwordprotected="false">
|
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="PokemonGoIV" library:readonly="false" library:passwordprotected="false">
|
||||||
<library:element library:name="0Main"/>
|
<library:element library:name="0Main"/>
|
||||||
<library:element library:name="1Data"/>
|
<library:element library:name="2Data"/>
|
||||||
<library:element library:name="9Load"/>
|
<library:element library:name="9Load"/>
|
||||||
<library:element library:name="8Registry"/>
|
<library:element library:name="8Registry"/>
|
||||||
|
<library:element library:name="1Dialog"/>
|
||||||
</library:library>
|
</library:library>
|
Loading…
Reference in New Issue
Block a user