Renamed from "Pokémon Go" To "Pokémon GO". Changed to the dynamic full appraisal text selection instead of the keywords selection.

This commit is contained in:
依瑪貓 2016-12-05 16:44:04 +08:00
parent d3f2efe5fe
commit 54af6ff74e
13 changed files with 1370 additions and 524 deletions

View File

@ -1,4 +1,4 @@
' 0Main: The main module for the Pokémon Go IV calculator ' 0Main: The main module for the Pokémon GO IV calculator
' by imacat <imacat@mail.imacat.idv.tw>, 2016-11-27 ' by imacat <imacat@mail.imacat.idv.tw>, 2016-11-27
Option Explicit Option Explicit
@ -42,10 +42,11 @@ Private mCPM () As Double, mStarDust () As Integer
' subMain: The main program ' subMain: The main program
Sub subMain Sub subMain
BasicLibraries.loadLibrary "XrayTool"
Dim maIVs As Variant, nI As Integer, sOutput As String Dim maIVs As Variant, nI As Integer, sOutput As String
Dim aQuery As New aFindIVParam, aBaseStats As New aStats Dim aQuery As New aFindIVParam, aBaseStats As New aStats
aQuery = fnAskParam aQuery = fnAskParam0
If aQuery.bIsCancelled Then If aQuery.bIsCancelled Then
Exit Sub Exit Sub
End If End If
@ -77,270 +78,37 @@ End Sub
' fnAskParam: Asks the users for the parameters for the Pokémon. ' fnAskParam: Asks the users for the parameters for the Pokémon.
Function fnAskParam As aFindIVParam Function fnAskParam As aFindIVParam
Dim oDialog As Object, oDialogModel As Object Dim aQuery As New aFindIVParam, oDialog As Object
Dim oTextModel As Object, oListModel As Object Dim oDialogModel As Object, oListModel As Object
Dim oNumericModel As Object, oCheckBoxModel As Object
Dim oGroupModel As Object, oButtonModel As Object
Dim mListItems () As String, sTemp As String
Dim nI As Integer, nCount As Integer
Dim aQuery As New aFindIVParam
' Creates a dialog oDialog = CreateUnoDialog (DialogLibraries.PokemonGoIV.DlgMain)
oDialogModel = CreateUnoService ( _ oDialogModel = oDialog.getModel
"com.sun.star.awt.UnoControlDialogModel")
oDialogModel.setPropertyValue ("PositionX", 100)
oDialogModel.setPropertyValue ("PositionY", 100)
oDialogModel.setPropertyValue ("Height", 140)
oDialogModel.setPropertyValue ("Width", 220)
oDialogModel.setPropertyValue ("Title", "Pokémon Go IV Calculator")
' Adds a text label for the Pokémon list. oListModel = oDialogModel.getByName ("lstPokemon")
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 5)
oTextModel.setPropertyValue ("PositionY", 5)
oTextModel.setPropertyValue ("Height", 12)
oTextModel.setPropertyValue ("Width", 30)
oTextModel.setPropertyValue ("Label", "~Pokémon:")
oDialogModel.insertByName ("txtPokemon", oTextModel)
' Adds the Pokémon list.
subReadBaseStats
ReDim mListItems (UBound (maBaseStats)) As String
For nI = 0 To UBound (maBaseStats)
mListItems (nI) = maBaseStats (nI).sPokemon
Next nI
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 35)
oListModel.setPropertyValue ("PositionY", 4)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 50)
oListModel.setPropertyValue ("TabIndex", 0)
oListModel.setPropertyValue ("Dropdown", True) oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems) oDialogModel.removeByName ("lstPokemon")
oDialogModel.insertByName ("lstPokemon", oListModel) oDialogModel.insertByName ("lstPokemon", oListModel)
' Adds a text label for the CP field. oListModel = oDialogModel.getByName ("lstStarDust")
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 5)
oTextModel.setPropertyValue ("PositionY", 20)
oTextModel.setPropertyValue ("Height", 12)
oTextModel.setPropertyValue ("Width", 15)
oTextModel.setPropertyValue ("Label", "~CP:")
oDialogModel.insertByName ("txtCP", oTextModel)
' Adds the CP field.
oNumericModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlNumericFieldModel")
oNumericModel.setPropertyValue ("PositionX", 20)
oNumericModel.setPropertyValue ("PositionY", 19)
oNumericModel.setPropertyValue ("Height", 12)
oNumericModel.setPropertyValue ("Width", 20)
oNumericModel.setPropertyValue ("DecimalAccuracy", 0)
oDialogModel.insertByName ("numCP", oNumericModel)
' Adds a text label for the HP field.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 50)
oTextModel.setPropertyValue ("PositionY", 20)
oTextModel.setPropertyValue ("Height", 12)
oTextModel.setPropertyValue ("Width", 15)
oTextModel.setPropertyValue ("Label", "~HP:")
oDialogModel.insertByName ("txtHP", oTextModel)
' Adds the HP field.
oNumericModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlNumericFieldModel")
oNumericModel.setPropertyValue ("PositionX", 65)
oNumericModel.setPropertyValue ("PositionY", 19)
oNumericModel.setPropertyValue ("Height", 12)
oNumericModel.setPropertyValue ("Width", 15)
oNumericModel.setPropertyValue ("DecimalAccuracy", 0)
oDialogModel.insertByName ("numHP", oNumericModel)
' Adds a text label for the star dust field.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 90)
oTextModel.setPropertyValue ("PositionY", 20)
oTextModel.setPropertyValue ("Height", 12)
oTextModel.setPropertyValue ("Width", 30)
oTextModel.setPropertyValue ("Label", "S~tar dust:")
oDialogModel.insertByName ("txtStarDust", oTextModel)
' Adds the star dust field.
subReadStarDust
sTemp = " "
ReDim mListItems () As String
nCount = -1
For nI = 1 To UBound (mStarDust)
If InStr (sTemp, " " & CStr (mStarDust (nI)) & " ") = 0 Then
nCount = nCount + 1
ReDim Preserve mListItems (nCount) As String
mListItems (nCount) = CStr (mStarDust (nI))
sTemp = sTemp & CStr (mStarDust (nI)) & " "
End If
Next nI
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 120)
oListModel.setPropertyValue ("PositionY", 19)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 30)
oListModel.setPropertyValue ("Dropdown", True) oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems) oDialogModel.removeByName ("lstStarDust")
oDialogModel.insertByName ("lstStarDust", oListModel) oDialogModel.insertByName ("lstStarDust", oListModel)
' Adds a text label for the player level field. oListModel = oDialogModel.getByName ("lstPlayerLevel")
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 160)
oTextModel.setPropertyValue ("PositionY", 20)
oTextModel.setPropertyValue ("Height", 12)
oTextModel.setPropertyValue ("Width", 35)
oTextModel.setPropertyValue ("Label", "Player ~level:")
oDialogModel.insertByName ("txtPlayerLevel", oTextModel)
' Adds the player level field.
ReDim mListItems (39) As String
For nI = 0 To UBound (mListItems)
mListItems (nI) = CStr (nI + 1)
Next nI
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 195)
oListModel.setPropertyValue ("PositionY", 19)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 20)
oListModel.setPropertyValue ("Dropdown", True) oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems) oDialogModel.removeByName ("lstPlayerLevel")
oDialogModel.insertByName ("lstPlayerLevel", oListModel) oDialogModel.insertByName ("lstPlayerLevel", oListModel)
' Adds the whether powered-up check box. oListModel = oDialogModel.getByName ("lstApprasal1")
oCheckBoxModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlCheckBoxModel")
oCheckBoxModel.setPropertyValue ("PositionX", 5)
oCheckBoxModel.setPropertyValue ("PositionY", 35)
oCheckBoxModel.setPropertyValue ("Height", 12)
oCheckBoxModel.setPropertyValue ("Width", 210)
oCheckBoxModel.setPropertyValue ("Label", _
"This Pokémon is ~newly-caught and was not powered-up yet.")
oCheckBoxModel.setPropertyValue ("State", 1)
oDialogModel.insertByName ("cbxIsNew", oCheckBoxModel)
' Adds a group for the appraisals
oGroupModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlGroupBoxModel")
oGroupModel.setPropertyValue ("PositionX", 5)
oGroupModel.setPropertyValue ("PositionY", 50)
oGroupModel.setPropertyValue ("Height", 65)
oGroupModel.setPropertyValue ("Width", 210)
oGroupModel.setPropertyValue ("Label", "Apprasals")
oDialogModel.insertByName ("grpApprasals", oGroupModel)
' Adds the first appraisal list.
mListItems = Array ( _
"1. Amazed me/wonder/best", _
"2. Strong/caught my attention", _
"3. Decent/above average", _
"4. Not great/not make headway/has room")
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 10)
oListModel.setPropertyValue ("PositionY", 64)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 200)
oListModel.setPropertyValue ("Dropdown", True) oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems) oDialogModel.removeByName ("lstApprasal1")
oDialogModel.insertByName ("lstApprasal1", oListModel) oDialogModel.insertByName ("lstApprasal1", oListModel)
' Adds a text label for the HP field. oListModel = oDialogModel.getByName ("lstApprasal2")
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 10)
oTextModel.setPropertyValue ("PositionY", 80)
oTextModel.setPropertyValue ("Height", 12)
oTextModel.setPropertyValue ("Width", 15)
oTextModel.setPropertyValue ("Label", "Best:")
oDialogModel.insertByName ("txtBest", oTextModel)
' Adds the attack is best check box
oCheckBoxModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlCheckBoxModel")
oCheckBoxModel.setPropertyValue ("PositionX", 25)
oCheckBoxModel.setPropertyValue ("PositionY", 80)
oCheckBoxModel.setPropertyValue ("Height", 12)
oCheckBoxModel.setPropertyValue ("Width", 30)
oCheckBoxModel.setPropertyValue ("Label", "~Attack")
oDialogModel.insertByName ("cbxAttackBest", oCheckBoxModel)
' Adds the defense is best check box
oCheckBoxModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlCheckBoxModel")
oCheckBoxModel.setPropertyValue ("PositionX", 55)
oCheckBoxModel.setPropertyValue ("PositionY", 80)
oCheckBoxModel.setPropertyValue ("Height", 12)
oCheckBoxModel.setPropertyValue ("Width", 35)
oCheckBoxModel.setPropertyValue ("Label", "~Defense")
oDialogModel.insertByName ("cbxDefenseBest", oCheckBoxModel)
' Adds the defense is best check box
oCheckBoxModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlCheckBoxModel")
oCheckBoxModel.setPropertyValue ("PositionX", 90)
oCheckBoxModel.setPropertyValue ("PositionY", 80)
oCheckBoxModel.setPropertyValue ("Height", 12)
oCheckBoxModel.setPropertyValue ("Width", 45)
oCheckBoxModel.setPropertyValue ("Label", "HP (~Stamina)")
oDialogModel.insertByName ("cbxHPBest", oCheckBoxModel)
' Adds the second appraisal list.
mListItems = Array ( _
"1. WOW/incredible/stats are best", _
"2. Excellent/impressed/impressive", _
"3. Get the job done/noticeable/some good stats", _
"4. No greatness/not out of the norm/kinda basic")
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 10)
oListModel.setPropertyValue ("PositionY", 95)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 200)
oListModel.setPropertyValue ("Dropdown", True) oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems) oDialogModel.removeByName ("lstApprasal2")
oDialogModel.insertByName ("lstApprasal2", oListModel) oDialogModel.insertByName ("lstApprasal2", oListModel)
' Adds the OK button.
oButtonModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlButtonModel")
oButtonModel.setPropertyValue ("PositionX", 35)
oButtonModel.setPropertyValue ("PositionY", 120)
oButtonModel.setPropertyValue ("Height", 15)
oButtonModel.setPropertyValue ("Width", 60)
oButtonModel.setPropertyValue ("PushButtonType", _
com.sun.star.awt.PushButtonType.OK)
oButtonModel.setPropertyValue ("DefaultButton", True)
oDialogModel.insertByName ("btnOK", oButtonModel)
' Adds the cancel button.
oButtonModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlButtonModel")
oButtonModel.setPropertyValue ("PositionX", 125)
oButtonModel.setPropertyValue ("PositionY", 120)
oButtonModel.setPropertyValue ("Height", 15)
oButtonModel.setPropertyValue ("Width", 60)
oButtonModel.setPropertyValue ("PushButtonType", _
com.sun.star.awt.PushButtonType.CANCEL)
oDialogModel.insertByName ("btnCancel", oButtonModel)
' Adds the dialog model to the control and runs it.
oDialog = CreateUnoService ("com.sun.star.awt.UnoControlDialog")
oDialog.setModel (oDialogModel)
oDialog.setVisible (True)
oDialog.getControl ("lstPokemon").setFocus
If oDialog.execute = 0 Then If oDialog.execute = 0 Then
aQuery.bIsCancelled = True aQuery.bIsCancelled = True
fnAskParam = aQuery fnAskParam = aQuery
@ -375,6 +143,661 @@ Function fnAskParam As aFindIVParam
fnAskParam = aQuery fnAskParam = aQuery
End Function End Function
' fnAskParam: Asks the users for the parameters for the Pokémon.
Function fnAskParam0 As aFindIVParam
Dim oDialog As Object, oDialogModel As Object
Dim oTextModel As Object, oListModel As Object
Dim oNumericModel As Object, oCheckBoxModel As Object
Dim oGroupModel As Object, oRadioModel As Object
Dim oButtonModel As Object, oListener As Object
Dim mListItems () As String, sTemp As String
Dim nI As Integer, nCount As Integer
Dim bIsBestAttack As Boolean, bIsBestDefense As Boolean
Dim bIsBestHP As Boolean
Dim aQuery As New aFindIVParam
' Creates a dialog
oDialogModel = CreateUnoService ( _
"com.sun.star.awt.UnoControlDialogModel")
oDialogModel.setPropertyValue ("PositionX", 100)
oDialogModel.setPropertyValue ("PositionY", 100)
oDialogModel.setPropertyValue ("Height", 185)
oDialogModel.setPropertyValue ("Width", 220)
oDialogModel.setPropertyValue ("Title", "Pokémon GO IV Calculator")
' Adds a text label for the Pokémon list.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 5)
oTextModel.setPropertyValue ("PositionY", 6)
oTextModel.setPropertyValue ("Height", 8)
oTextModel.setPropertyValue ("Width", 30)
oTextModel.setPropertyValue ("Label", "~Pokémon:")
oDialogModel.insertByName ("txtPokemon", oTextModel)
' Adds the Pokémon list.
subReadBaseStats
ReDim mListItems (UBound (maBaseStats)) As String
For nI = 0 To UBound (maBaseStats)
mListItems (nI) = maBaseStats (nI).sPokemon
Next nI
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 35)
oListModel.setPropertyValue ("PositionY", 4)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 50)
oListModel.setPropertyValue ("TabIndex", 0)
oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems)
oDialogModel.insertByName ("lstPokemon", oListModel)
' Adds a text label for the CP field.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 5)
oTextModel.setPropertyValue ("PositionY", 21)
oTextModel.setPropertyValue ("Height", 8)
oTextModel.setPropertyValue ("Width", 15)
oTextModel.setPropertyValue ("Label", "~CP:")
oDialogModel.insertByName ("txtCP", oTextModel)
' Adds the CP field.
oNumericModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlNumericFieldModel")
oNumericModel.setPropertyValue ("PositionX", 20)
oNumericModel.setPropertyValue ("PositionY", 19)
oNumericModel.setPropertyValue ("Height", 12)
oNumericModel.setPropertyValue ("Width", 20)
oNumericModel.setPropertyValue ("DecimalAccuracy", 0)
oDialogModel.insertByName ("numCP", oNumericModel)
' Adds a text label for the HP field.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 50)
oTextModel.setPropertyValue ("PositionY", 21)
oTextModel.setPropertyValue ("Height", 8)
oTextModel.setPropertyValue ("Width", 15)
oTextModel.setPropertyValue ("Label", "~HP:")
oDialogModel.insertByName ("txtHP", oTextModel)
' Adds the HP field.
oNumericModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlNumericFieldModel")
oNumericModel.setPropertyValue ("PositionX", 65)
oNumericModel.setPropertyValue ("PositionY", 19)
oNumericModel.setPropertyValue ("Height", 12)
oNumericModel.setPropertyValue ("Width", 15)
oNumericModel.setPropertyValue ("DecimalAccuracy", 0)
oDialogModel.insertByName ("numHP", oNumericModel)
' Adds a text label for the star dust field.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 90)
oTextModel.setPropertyValue ("PositionY", 21)
oTextModel.setPropertyValue ("Height", 8)
oTextModel.setPropertyValue ("Width", 30)
oTextModel.setPropertyValue ("Label", "S~tar dust:")
oDialogModel.insertByName ("txtStarDust", oTextModel)
' Adds the star dust field.
subReadStarDust
sTemp = " "
ReDim mListItems () As String
nCount = -1
For nI = 1 To UBound (mStarDust)
If InStr (sTemp, " " & CStr (mStarDust (nI)) & " ") = 0 Then
nCount = nCount + 1
ReDim Preserve mListItems (nCount) As String
mListItems (nCount) = CStr (mStarDust (nI))
sTemp = sTemp & CStr (mStarDust (nI)) & " "
End If
Next nI
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 120)
oListModel.setPropertyValue ("PositionY", 19)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 30)
oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems)
oDialogModel.insertByName ("lstStarDust", oListModel)
' Adds a text label for the player level field.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 160)
oTextModel.setPropertyValue ("PositionY", 21)
oTextModel.setPropertyValue ("Height", 8)
oTextModel.setPropertyValue ("Width", 35)
oTextModel.setPropertyValue ("Label", "Player ~level:")
oDialogModel.insertByName ("txtPlayerLevel", oTextModel)
' Adds the player level field.
ReDim mListItems (39) As String
For nI = 0 To UBound (mListItems)
mListItems (nI) = CStr (nI + 1)
Next nI
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 195)
oListModel.setPropertyValue ("PositionY", 19)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 20)
oListModel.setPropertyValue ("Dropdown", True)
oListModel.setPropertyValue ("StringItemList", mListItems)
oDialogModel.insertByName ("lstPlayerLevel", oListModel)
' Adds the whether powered-up check box.
oCheckBoxModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlCheckBoxModel")
oCheckBoxModel.setPropertyValue ("PositionX", 5)
oCheckBoxModel.setPropertyValue ("PositionY", 36)
oCheckBoxModel.setPropertyValue ("Height", 8)
oCheckBoxModel.setPropertyValue ("Width", 210)
oCheckBoxModel.setPropertyValue ("Label", _
"This Pokémon is ~newly-caught and was not powered-up yet.")
oCheckBoxModel.setPropertyValue ("State", 1)
oDialogModel.insertByName ("cbxIsNew", oCheckBoxModel)
' Adds a group for the appraisals
oGroupModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlGroupBoxModel")
oGroupModel.setPropertyValue ("PositionX", 5)
oGroupModel.setPropertyValue ("PositionY", 50)
oGroupModel.setPropertyValue ("Height", 110)
oGroupModel.setPropertyValue ("Width", 210)
oGroupModel.setPropertyValue ("Label", "Team Leader Apprasal")
oDialogModel.insertByName ("grpApprasals", oGroupModel)
' Adds a text label for the team.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 10)
oTextModel.setPropertyValue ("PositionY", 66)
oTextModel.setPropertyValue ("Height", 8)
oTextModel.setPropertyValue ("Width", 20)
oTextModel.setPropertyValue ("Label", "Team:")
oDialogModel.insertByName ("txtTeam", oTextModel)
' Adds the red team radio button.
oRadioModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlRadioButtonModel")
oRadioModel.setPropertyValue ("PositionX", 30)
oRadioModel.setPropertyValue ("PositionY", 66)
oRadioModel.setPropertyValue ("Height", 8)
oRadioModel.setPropertyValue ("Width", 25)
oRadioModel.setPropertyValue ("Label", "~Valor")
oRadioModel.setPropertyValue ("TextColor", RGB (255, 255, 255))
oRadioModel.setPropertyValue ("BackgroundColor", RGB (255, 0, 0))
oDialogModel.insertByName ("rdoTeamRed", oRadioModel)
' Adds the blue team radio button.
oRadioModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlRadioButtonModel")
oRadioModel.setPropertyValue ("PositionX", 55)
oRadioModel.setPropertyValue ("PositionY", 66)
oRadioModel.setPropertyValue ("Height", 8)
oRadioModel.setPropertyValue ("Width", 30)
oRadioModel.setPropertyValue ("Label", "~Mystic")
oRadioModel.setPropertyValue ("TextColor", RGB (255, 255, 255))
oRadioModel.setPropertyValue ("BackgroundColor", RGB (0, 0, 255))
oDialogModel.insertByName ("rdoTeamBlue", oRadioModel)
' Adds the yellow team radio button.
oRadioModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlRadioButtonModel")
oRadioModel.setPropertyValue ("PositionX", 85)
oRadioModel.setPropertyValue ("PositionY", 66)
oRadioModel.setPropertyValue ("Height", 8)
oRadioModel.setPropertyValue ("Width", 30)
oRadioModel.setPropertyValue ("Label", "~Instinct")
oRadioModel.setPropertyValue ("BackgroundColor", RGB (255, 255, 0))
oDialogModel.insertByName ("rdoTeamYellow", oRadioModel)
' Adds the first appraisal list.
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 10)
oListModel.setPropertyValue ("PositionY", 79)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 200)
oListModel.setPropertyValue ("Dropdown", True)
oDialogModel.insertByName ("lstApprasal1", oListModel)
' Adds a text label before the best stat.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 10)
oTextModel.setPropertyValue ("PositionY", 96)
oTextModel.setPropertyValue ("Height", 8)
oTextModel.setPropertyValue ("Width", 0)
oDialogModel.insertByName ("txtBestBefore", oTextModel)
' Adds the best stat field.
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 10)
oListModel.setPropertyValue ("PositionY", 94)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 35)
oListModel.setPropertyValue ("Dropdown", True)
oDialogModel.insertByName ("lstBest", oListModel)
' Adds a text label after the best stat.
oTextModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlFixedTextModel")
oTextModel.setPropertyValue ("PositionX", 45)
oTextModel.setPropertyValue ("PositionY", 96)
oTextModel.setPropertyValue ("Height", 8)
oTextModel.setPropertyValue ("Width", 100)
oDialogModel.insertByName ("txtBestAfter", oTextModel)
' Adds the second best stat check box.
oCheckBoxModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlCheckBoxModel")
oCheckBoxModel.setPropertyValue ("PositionX", 10)
oCheckBoxModel.setPropertyValue ("PositionY", 111)
oCheckBoxModel.setPropertyValue ("Height", 8)
oCheckBoxModel.setPropertyValue ("Width", 210)
oDialogModel.insertByName ("cbxBest2", oCheckBoxModel)
' Adds the third best stat check box.
oCheckBoxModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlCheckBoxModel")
oCheckBoxModel.setPropertyValue ("PositionX", 10)
oCheckBoxModel.setPropertyValue ("PositionY", 126)
oCheckBoxModel.setPropertyValue ("Height", 8)
oCheckBoxModel.setPropertyValue ("Width", 210)
oDialogModel.insertByName ("cbxBest3", oCheckBoxModel)
' Adds the second appraisal list.
oListModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlListBoxModel")
oListModel.setPropertyValue ("PositionX", 10)
oListModel.setPropertyValue ("PositionY", 140)
oListModel.setPropertyValue ("Height", 12)
oListModel.setPropertyValue ("Width", 200)
oListModel.setPropertyValue ("Dropdown", True)
oDialogModel.insertByName ("lstApprasal2", oListModel)
' Adds the OK button.
oButtonModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlButtonModel")
oButtonModel.setPropertyValue ("PositionX", 35)
oButtonModel.setPropertyValue ("PositionY", 165)
oButtonModel.setPropertyValue ("Height", 15)
oButtonModel.setPropertyValue ("Width", 60)
oButtonModel.setPropertyValue ("PushButtonType", _
com.sun.star.awt.PushButtonType.OK)
oButtonModel.setPropertyValue ("DefaultButton", True)
oDialogModel.insertByName ("btnOK", oButtonModel)
' Adds the cancel button.
oButtonModel = oDialogModel.createInstance ( _
"com.sun.star.awt.UnoControlButtonModel")
oButtonModel.setPropertyValue ("PositionX", 125)
oButtonModel.setPropertyValue ("PositionY", 165)
oButtonModel.setPropertyValue ("Height", 15)
oButtonModel.setPropertyValue ("Width", 60)
oButtonModel.setPropertyValue ("PushButtonType", _
com.sun.star.awt.PushButtonType.CANCEL)
oDialogModel.insertByName ("btnCancel", oButtonModel)
' Adds the dialog model to the control and runs it.
oDialog = CreateUnoService ("com.sun.star.awt.UnoControlDialog")
oDialog.setModel (oDialogModel)
oDialog.setVisible (True)
oDialog.getControl ("lstPokemon").setFocus
oListener = CreateUnoListener ("subRdoTeamRedItemChanged_", _
"com.sun.star.awt.XItemListener")
oDialog.getControl ("rdoTeamRed").addItemListener (oListener)
oListener = CreateUnoListener ("subRdoTeamBlueItemChanged_", _
"com.sun.star.awt.XItemListener")
oDialog.getControl ("rdoTeamBlue").addItemListener (oListener)
oListener = CreateUnoListener ("subRdoTeamYellowItemChanged_", _
"com.sun.star.awt.XItemListener")
oDialog.getControl ("rdoTeamYellow").addItemListener (oListener)
oListener = CreateUnoListener ("subLstBestItemChanged_", _
"com.sun.star.awt.XItemListener")
oDialog.getControl ("lstBest").addItemListener (oListener)
oDialog.getControl ("lstApprasal1").setVisible (False)
oDialog.getControl ("txtBestBefore").setVisible (False)
oDialog.getControl ("lstBest").setVisible (False)
oDialog.getControl ("txtBestAfter").setVisible (False)
oDialog.getControl ("cbxBest2").setVisible (False)
oDialog.getControl ("cbxBest3").setVisible (False)
oDialog.getControl ("lstApprasal2").setVisible (False)
If oDialog.execute = 0 Then
aQuery.bIsCancelled = True
fnAskParam0 = aQuery
Exit Function
End If
With aQuery
.sPokemon = oDialog.getControl ("lstPokemon").getSelectedItem
.nCP = oDialog.getControl ("numCP").getValue
.nHP = oDialog.getControl ("numHP").getValue
.nStarDust = CInt (oDialog.getControl ("lstStarDust").getSelectedItem)
.nPlayerLevel = CInt (oDialog.getControl ("lstPlayerLevel").getSelectedItem)
.nAppraisal1 = oDialog.getControl ("lstApprasal1").getSelectedItemPos + 1
.nAppraisal2 = oDialog.getControl ("lstApprasal2").getSelectedItemPos + 1
.bIsCancelled = False
End With
If oDialog.getControl ("cbxIsNew").getState = 1 Then
aQuery.bIsNew = True
Else
aQuery.bIsNew = False
End If
' The best stats
bIsBestAttack = False
bIsBestDefense = False
bIsBestHP = False
If oDialog.getControl ("lstBest").getSelectedItem = "Attack" Then
bIsBestAttack = True
If oDialog.getControl ("cbxBest2").getState = 1 Then
bIsBestDefense = True
End If
If oDialog.getControl ("cbxBest3").getState = 1 Then
bIsBestHP = True
End If
End If
If oDialog.getControl ("lstBest").getSelectedItem = "Defense" Then
bIsBestDefense = True
If oDialog.getControl ("cbxBest2").getState = 1 Then
bIsBestAttack = True
End If
If oDialog.getControl ("cbxBest3").getState = 1 Then
bIsBestHP = True
End If
End If
If oDialog.getControl ("lstBest").getSelectedItem = "HP" Then
bIsBestHP = True
If oDialog.getControl ("cbxBest2").getState = 1 Then
bIsBestAttack = True
End If
If oDialog.getControl ("cbxBest3").getState = 1 Then
bIsBestDefense = True
End If
End If
aQuery.sBest = ""
If bIsBestAttack Then
aQuery.sBest = aQuery.sBest & "Atk "
End If
If bIsBestDefense Then
aQuery.sBest = aQuery.sBest & "Def "
End If
If bIsBestHP Then
aQuery.sBest = aQuery.sBest & "Sta "
End If
fnAskParam0 = aQuery
End Function
' subRdoTeamRedItemChanged_itemStateChanged: Dummy for the listener.
Sub subRdoTeamRedItemChanged_disposing (oEvent As object)
End Sub
' subRdoTeamRedItemChanged_itemStateChanged: When the team is selected.
Sub subRdoTeamRedItemChanged_itemStateChanged (oEvent As object)
Dim oDialog As Object, oList As Object, oText As Object
Dim mItems () As String
mItems = Array ( _
"1. Overall, your [Pokémon] simply amazes me. It can accomplish anything!", _
"2. Overall, your [Pokémon] is a strong Pokémon. You should be proud!", _
"3. Overall, your [Pokémon] is a decent Pokémon.", _
"4. Overall, your [Pokémon] may not be great in battle, but I still like it!")
oDialog = oEvent.Source.getContext
oList = oDialog.getControl ("lstApprasal1")
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setVisible (True)
oText = oDialog.getControl ("txtBestBefore")
oText.setPosSize (30, 96, 20, 8, _
com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH)
oText.setVisible (True)
oText.setText ("Its")
mItems = Array ("Attack", "Defense", "HP")
oList = oDialog.getControl ("lstBest")
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setPosSize (50, 96, 35, 8, _
com.sun.star.awt.PosSize.X)
oList.setVisible (True)
oText = oDialog.getControl ("txtBestAfter")
oText.setPosSize (145, 96, 160, 8, _
com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH)
oText.setVisible (True)
oText.setText ("is its strongest feature.")
oList = oDialog.getControl ("cbxBest2")
oList.setVisible (False)
oList = oDialog.getControl ("cbxBest3")
oList.setVisible (False)
mItems = Array ( _
"1. I'm blown away by its stats. WOW!", _
"2. It's got excellent stats! How exciting!", _
"3. Its stats indicate that in battle, it'll get the job done.", _
"4. Its stats don't point to greatness in battle.")
oDialog = oEvent.Source.getContext
oList = oDialog.getControl ("lstApprasal2")
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setVisible (True)
End Sub
' subRdoTeamBlueItemChanged_itemStateChanged: Dummy for the listener.
Sub subRdoTeamBlueItemChanged_disposing (oEvent As object)
End Sub
' subRdoTeamBlueItemChanged_itemStateChanged: When the blue team is selected.
Sub subRdoTeamBlueItemChanged_itemStateChanged (oEvent As object)
Dim oDialog As Object, oList As Object, oText As Object
Dim mItems () As String
mItems = Array ( _
"1. Overall, your [Pokémon] is a wonder! What a breathtaking Pokémon!", _
"2. Overall, your [Pokémon] has certainly caught my attention.", _
"3. Overall, your [Pokémon] is above average.", _
"4. Overall, your [Pokémon] is not likely to make much headway in battle.")
oDialog = oEvent.Source.getContext
oList = oDialog.getControl ("lstApprasal1")
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setVisible (True)
oText = oDialog.getControl ("txtBestBefore")
oText.setPosSize (30, 96, 200, 8, _
com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH)
oText.setVisible (True)
oText.setText ("I see that its best attribute is its")
mItems = Array ("Attack", "Defense", "HP")
oList = oDialog.getControl ("lstBest")
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setPosSize (230, 96, 35, 8, _
com.sun.star.awt.PosSize.X)
oList.setVisible (True)
oText = oDialog.getControl ("txtBestAfter")
oText.setPosSize (325, 96, 5, 8, _
com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH)
oText.setVisible (True)
oText.setText (".")
oList = oDialog.getControl ("cbxBest2")
oList.setVisible (False)
oList = oDialog.getControl ("cbxBest3")
oList.setVisible (False)
mItems = Array ( _
"1. Its stats exceed my calculations. It's incredible!", _
"2. I am certainly impressed by its stats, I must say.", _
"3. Its stats are noticeably trending to the positive.", _
"4. Its stats are not out of the norm, in my opinion.")
oDialog = oEvent.Source.getContext
oList = oDialog.getControl ("lstApprasal2")
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setVisible (True)
End Sub
' subRdoTeamYellowItemChanged_itemStateChanged: Dummy for the listener.
Sub subRdoTeamYellowItemChanged_disposing (oEvent As object)
End Sub
' subRdoTeamYellowItemChanged_itemStateChanged: When the yellow team is selected.
Sub subRdoTeamYellowItemChanged_itemStateChanged (oEvent As object)
Dim oDialog As Object, oList As Object, oText As Object
Dim mItems () As String
mItems = Array ( _
"1. Overall, your [Pokémon] looks like it can really battle with the best of them!", _
"2. Overall, your [Pokémon] is really strong!", _
"3. Overall, your [Pokémon] is pretty decent!", _
"4. Overall, your [Pokémon] has room for improvement as far as battling goes.")
oDialog = oEvent.Source.getContext
oList = oDialog.getControl ("lstApprasal1")
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setVisible (True)
oText = oDialog.getControl ("txtBestBefore")
oText.setPosSize (30, 96, 115, 8, _
com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH)
oText.setVisible (True)
oText.setText ("Its best quality is")
mItems = Array ("Attack", "Defense", "HP")
oList = oDialog.getControl ("lstBest")
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setPosSize (145, 96, 35, 8, _
com.sun.star.awt.PosSize.X)
oList.setVisible (True)
oText = oDialog.getControl ("txtBestAfter")
oText.setPosSize (240, 96, 5, 8, _
com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH)
oText.setVisible (True)
oText.setText (".")
oList = oDialog.getControl ("cbxBest2")
oList.setVisible (False)
oList = oDialog.getControl ("cbxBest3")
oList.setVisible (False)
mItems = Array ( _
"1. Its stats are the best I've ever seen! No doubt about it!", _
"2. Its stats are really strong! Impressive.", _
"3. It's definitely got some good stats. Definitely!", _
"4. Its stats are all right, but kinda basic, as far as I can see.")
oDialog = oEvent.Source.getContext
oList = oDialog.getControl ("lstApprasal2")
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setVisible (True)
End Sub
' subLstBestItemChanged_itemStateChanged: Dummy for the listener.
Sub subLstBestItemChanged_disposing (oEvent As object)
End Sub
' subLstBestItemChanged_itemStateChanged: When the best stat is selected.
Sub subLstBestItemChanged_itemStateChanged (oEvent As object)
Dim oDialog As Object, oCheckBox As Object
oDialog = oEvent.Source.getContext
If oDialog.getControl ("rdoTeamRed").getState Then
If oDialog.getControl ("lstBest").getSelectedItem = "Attack" Then
oCheckBox = oDialog.getControl ("cbxBest2")
oCheckBox.setLabel ("I'm just as impressed with its Defense.")
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl ("cbxBest3")
oCheckBox.setLabel ("I'm just as impressed with its HP.")
oCheckBox.setVisible (True)
End If
If oDialog.getControl ("lstBest").getSelectedItem = "Defense" Then
oCheckBox = oDialog.getControl ("cbxBest2")
oCheckBox.setLabel ("I'm just as impressed with its Attack.")
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl ("cbxBest3")
oCheckBox.setLabel ("I'm just as impressed with its HP.")
oCheckBox.setVisible (True)
End If
If oDialog.getControl ("lstBest").getSelectedItem = "HP" Then
oCheckBox = oDialog.getControl ("cbxBest2")
oCheckBox.setLabel ("I'm just as impressed with its Attack.")
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl ("cbxBest3")
oCheckBox.setLabel ("I'm just as impressed with its Defense.")
oCheckBox.setVisible (True)
End If
End If
If oDialog.getControl ("rdoTeamBlue").getState Then
If oDialog.getControl ("lstBest").getSelectedItem = "Attack" Then
oCheckBox = oDialog.getControl ("cbxBest2")
oCheckBox.setLabel ("It is matched equally by its Defense.")
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl ("cbxBest3")
oCheckBox.setLabel ("It is matched equally by its HP.")
oCheckBox.setVisible (True)
End If
If oDialog.getControl ("lstBest").getSelectedItem = "Defense" Then
oCheckBox = oDialog.getControl ("cbxBest2")
oCheckBox.setLabel ("It is matched equally by its Attack.")
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl ("cbxBest3")
oCheckBox.setLabel ("It is matched equally by its HP.")
oCheckBox.setVisible (True)
End If
If oDialog.getControl ("lstBest").getSelectedItem = "HP" Then
oCheckBox = oDialog.getControl ("cbxBest2")
oCheckBox.setLabel ("It is matched equally by its Attack.")
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl ("cbxBest3")
oCheckBox.setLabel ("It is matched equally by its Defense.")
oCheckBox.setVisible (True)
End If
End If
If oDialog.getControl ("rdoTeamYellow").getState Then
If oDialog.getControl ("lstBest").getSelectedItem = "Attack" Then
oCheckBox = oDialog.getControl ("cbxBest2")
oCheckBox.setLabel ("Its Defense is great, too!")
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl ("cbxBest3")
oCheckBox.setLabel ("Its HP is great, too!")
oCheckBox.setVisible (True)
End If
If oDialog.getControl ("lstBest").getSelectedItem = "Defense" Then
oCheckBox = oDialog.getControl ("cbxBest2")
oCheckBox.setLabel ("Its Attack is great, too!")
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl ("cbxBest3")
oCheckBox.setLabel ("Its HP is great, too!")
oCheckBox.setVisible (True)
End If
If oDialog.getControl ("lstBest").getSelectedItem = "HP" Then
oCheckBox = oDialog.getControl ("cbxBest2")
oCheckBox.setLabel ("Its Attack is great, too!")
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl ("cbxBest3")
oCheckBox.setLabel ("Its Defense is great, too!")
oCheckBox.setVisible (True)
End If
End If
End Sub
' fnFindIV: Finds the possible individual values of the Pokémon ' fnFindIV: Finds the possible individual values of the Pokémon
Function fnFindIV (aQuery As aFindIVParam) As Variant Function fnFindIV (aQuery As aFindIVParam) As Variant
Dim aBaseStats As New aStats, maIV () As New aStats Dim aBaseStats As New aStats, maIV () As New aStats

View File

@ -1,4 +1,4 @@
' 1Data: The Pokémon Go data for IV calculation ' 1Data: The Pokémon GO data for IV calculation
' by imacat <imacat@mail.imacat.idv.tw>, 2016-11-28 ' by imacat <imacat@mail.imacat.idv.tw>, 2016-11-28
' Generated with 9Load.subReadDataSheets () ' Generated with 9Load.subReadDataSheets ()

View File

@ -1,4 +1,4 @@
' 9Load: The Pokémon Go data sheets loader ' 9Load: The Pokémon GO data sheets loader
' by imacat <imacat@mail.imacat.idv.tw>, 2016-11-28 ' by imacat <imacat@mail.imacat.idv.tw>, 2016-11-28
Option Explicit Option Explicit
@ -9,7 +9,7 @@ Sub subReadDataSheets
Dim sOutput as String, mData As Variant Dim sOutput as String, mData As Variant
sOutput = "" _ sOutput = "" _
& "' 1Data: The Pokémon Go data for IV calculation" & Chr (10) _ & "' 1Data: 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) _
@ -32,7 +32,7 @@ Sub subShowBasicData (sContent As String)
oDialogModel.setPropertyValue ("PositionY", 100) oDialogModel.setPropertyValue ("PositionY", 100)
oDialogModel.setPropertyValue ("Height", 130) oDialogModel.setPropertyValue ("Height", 130)
oDialogModel.setPropertyValue ("Width", 200) oDialogModel.setPropertyValue ("Width", 200)
oDialogModel.setPropertyValue ("Title", "Pokémon Go Data") oDialogModel.setPropertyValue ("Title", "Pokémon GO Data")
' Adds the content area ' Adds the content area
oEditModel = oDialogModel.createInstance ( _ oEditModel = oDialogModel.createInstance ( _
@ -80,10 +80,10 @@ Function fnReadBaseStatsSheet As String
& "Function fnGetBaseStatsData As Variant" & Chr (10) _ & "Function fnGetBaseStatsData As Variant" & Chr (10) _
& Chr (9) & "fnGetBaseStatsData = Array( _" & Chr (10) & Chr (9) & "fnGetBaseStatsData = Array( _" & Chr (10)
For nI = 1 To UBound (mData) - 1 For nI = 1 To UBound (mData) - 1
For nJ = 9 To 7 Step -1 For nJ = 8 To 6 Step -1
If mData (nI) (nJ) <> "" Then If mData (nI) (nJ) <> "" Then
sEvolveInto = mData (nI) (nJ) sEvolveInto = mData (nI) (nJ)
nJ = 6 nJ = 5
End If End If
Next nJ Next nJ
sOutput = sOutput _ sOutput = sOutput _
@ -95,10 +95,10 @@ Function fnReadBaseStatsSheet As String
& ", """ & sEvolveInto & """), _" & Chr (10) & ", """ & sEvolveInto & """), _" & Chr (10)
Next nI Next nI
nI = UBound (mData) nI = UBound (mData)
For nJ = 9 To 7 Step -1 For nJ = 8 To 6 Step -1
If mData (nI) (nJ) <> "" Then If mData (nI) (nJ) <> "" Then
sEvolveInto = mData (nI) (nJ) sEvolveInto = mData (nI) (nJ)
nJ = 6 nJ = 5
End If End If
Next nJ Next nJ
sOutput = sOutput _ sOutput = sOutput _

4
README
View File

@ -1,4 +1,4 @@
pokemongoiv - The Pokémon Go IV calculator pokemongoiv - The Pokémon GO IV calculator
Copyright (c) 2016 imacat. Copyright (c) 2016 imacat.
@ -20,7 +20,7 @@ pokemongoiv - The Pokémon Go IV calculator
DESCRIPTION DESCRIPTION
pokemongoiv is an Pokémon Go IV calculator that finds the pokemongoiv is a Pokémon GO IV calculator that finds the
individual values (IVs) of your Pokémon. A tool bar is added to individual values (IVs) of your Pokémon. A tool bar is added to
run the calculator. run the calculator.

View File

@ -1 +1 @@
0.0.1 0.1.0

View File

@ -8,8 +8,8 @@
<node oor:name="OfficeToolBar"> <node oor:name="OfficeToolBar">
<node oor:name="PokemonGoIV.OfficeToolBar" oor:op="replace"> <node oor:name="PokemonGoIV.OfficeToolBar" oor:op="replace">
<prop oor:name="Title"> <prop oor:name="Title">
<value>Pok&#233;mon Go IV Calculator</value> <value>Pok&#233;mon GO IV Calculator</value>
<value xml:lang="zh-TW">寶可夢 Go IV 計算機</value> <value xml:lang="zh-TW">寶可夢 GO IV 計算機</value>
</prop> </prop>
<node oor:name="ToolBarItems"> <node oor:name="ToolBarItems">
<node oor:name="m001" oor:op="replace"> <node oor:name="m001" oor:op="replace">

View File

@ -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="0Main" script:language="StarBasic">&apos; 0Main: The main module for the Pokémon Go IV calculator <script:module xmlns:script="http://openoffice.org/2000/script" script:name="0Main" script:language="StarBasic">&apos; 0Main: The main module for the Pokémon GO IV calculator
&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-11-27 &apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-11-27
Option Explicit Option Explicit
@ -44,10 +44,11 @@ Private mCPM () As Double, mStarDust () As Integer
&apos; subMain: The main program &apos; subMain: The main program
Sub subMain Sub subMain
BasicLibraries.loadLibrary &quot;XrayTool&quot;
Dim maIVs As Variant, nI As Integer, sOutput As String Dim maIVs As Variant, nI As Integer, sOutput As String
Dim aQuery As New aFindIVParam, aBaseStats As New aStats Dim aQuery As New aFindIVParam, aBaseStats As New aStats
aQuery = fnAskParam aQuery = fnAskParam0
If aQuery.bIsCancelled Then If aQuery.bIsCancelled Then
Exit Sub Exit Sub
End If End If
@ -79,270 +80,37 @@ End Sub
&apos; fnAskParam: Asks the users for the parameters for the Pokémon. &apos; fnAskParam: Asks the users for the parameters for the Pokémon.
Function fnAskParam As aFindIVParam Function fnAskParam As aFindIVParam
Dim oDialog As Object, oDialogModel As Object Dim aQuery As New aFindIVParam, oDialog As Object
Dim oTextModel As Object, oListModel As Object Dim oDialogModel As Object, oListModel As Object
Dim oNumericModel As Object, oCheckBoxModel As Object
Dim oGroupModel As Object, oButtonModel As Object
Dim mListItems () As String, sTemp As String
Dim nI As Integer, nCount As Integer
Dim aQuery As New aFindIVParam
&apos; Creates a dialog oDialog = CreateUnoDialog (DialogLibraries.PokemonGoIV.DlgMain)
oDialogModel = CreateUnoService ( _ oDialogModel = oDialog.getModel
&quot;com.sun.star.awt.UnoControlDialogModel&quot;)
oDialogModel.setPropertyValue (&quot;PositionX&quot;, 100)
oDialogModel.setPropertyValue (&quot;PositionY&quot;, 100)
oDialogModel.setPropertyValue (&quot;Height&quot;, 140)
oDialogModel.setPropertyValue (&quot;Width&quot;, 220)
oDialogModel.setPropertyValue (&quot;Title&quot;, &quot;Pokémon Go IV Calculator&quot;)
&apos; Adds a text label for the Pokémon list. oListModel = oDialogModel.getByName (&quot;lstPokemon&quot;)
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 5)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 5)
oTextModel.setPropertyValue (&quot;Height&quot;, 12)
oTextModel.setPropertyValue (&quot;Width&quot;, 30)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;~Pokémon:&quot;)
oDialogModel.insertByName (&quot;txtPokemon&quot;, oTextModel)
&apos; Adds the Pokémon list.
subReadBaseStats
ReDim mListItems (UBound (maBaseStats)) As String
For nI = 0 To UBound (maBaseStats)
mListItems (nI) = maBaseStats (nI).sPokemon
Next nI
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 35)
oListModel.setPropertyValue (&quot;PositionY&quot;, 4)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 50)
oListModel.setPropertyValue (&quot;TabIndex&quot;, 0)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True) oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems) oDialogModel.removeByName (&quot;lstPokemon&quot;)
oDialogModel.insertByName (&quot;lstPokemon&quot;, oListModel) oDialogModel.insertByName (&quot;lstPokemon&quot;, oListModel)
&apos; Adds a text label for the CP field. oListModel = oDialogModel.getByName (&quot;lstStarDust&quot;)
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 5)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 20)
oTextModel.setPropertyValue (&quot;Height&quot;, 12)
oTextModel.setPropertyValue (&quot;Width&quot;, 15)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;~CP:&quot;)
oDialogModel.insertByName (&quot;txtCP&quot;, oTextModel)
&apos; Adds the CP field.
oNumericModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlNumericFieldModel&quot;)
oNumericModel.setPropertyValue (&quot;PositionX&quot;, 20)
oNumericModel.setPropertyValue (&quot;PositionY&quot;, 19)
oNumericModel.setPropertyValue (&quot;Height&quot;, 12)
oNumericModel.setPropertyValue (&quot;Width&quot;, 20)
oNumericModel.setPropertyValue (&quot;DecimalAccuracy&quot;, 0)
oDialogModel.insertByName (&quot;numCP&quot;, oNumericModel)
&apos; Adds a text label for the HP field.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 50)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 20)
oTextModel.setPropertyValue (&quot;Height&quot;, 12)
oTextModel.setPropertyValue (&quot;Width&quot;, 15)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;~HP:&quot;)
oDialogModel.insertByName (&quot;txtHP&quot;, oTextModel)
&apos; Adds the HP field.
oNumericModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlNumericFieldModel&quot;)
oNumericModel.setPropertyValue (&quot;PositionX&quot;, 65)
oNumericModel.setPropertyValue (&quot;PositionY&quot;, 19)
oNumericModel.setPropertyValue (&quot;Height&quot;, 12)
oNumericModel.setPropertyValue (&quot;Width&quot;, 15)
oNumericModel.setPropertyValue (&quot;DecimalAccuracy&quot;, 0)
oDialogModel.insertByName (&quot;numHP&quot;, oNumericModel)
&apos; Adds a text label for the star dust field.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 90)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 20)
oTextModel.setPropertyValue (&quot;Height&quot;, 12)
oTextModel.setPropertyValue (&quot;Width&quot;, 30)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;S~tar dust:&quot;)
oDialogModel.insertByName (&quot;txtStarDust&quot;, oTextModel)
&apos; Adds the star dust field.
subReadStarDust
sTemp = &quot; &quot;
ReDim mListItems () As String
nCount = -1
For nI = 1 To UBound (mStarDust)
If InStr (sTemp, &quot; &quot; &amp; CStr (mStarDust (nI)) &amp; &quot; &quot;) = 0 Then
nCount = nCount + 1
ReDim Preserve mListItems (nCount) As String
mListItems (nCount) = CStr (mStarDust (nI))
sTemp = sTemp &amp; CStr (mStarDust (nI)) &amp; &quot; &quot;
End If
Next nI
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 120)
oListModel.setPropertyValue (&quot;PositionY&quot;, 19)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 30)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True) oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems) oDialogModel.removeByName (&quot;lstStarDust&quot;)
oDialogModel.insertByName (&quot;lstStarDust&quot;, oListModel) oDialogModel.insertByName (&quot;lstStarDust&quot;, oListModel)
&apos; Adds a text label for the player level field. oListModel = oDialogModel.getByName (&quot;lstPlayerLevel&quot;)
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 160)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 20)
oTextModel.setPropertyValue (&quot;Height&quot;, 12)
oTextModel.setPropertyValue (&quot;Width&quot;, 35)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;Player ~level:&quot;)
oDialogModel.insertByName (&quot;txtPlayerLevel&quot;, oTextModel)
&apos; Adds the player level field.
ReDim mListItems (39) As String
For nI = 0 To UBound (mListItems)
mListItems (nI) = CStr (nI + 1)
Next nI
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 195)
oListModel.setPropertyValue (&quot;PositionY&quot;, 19)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 20)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True) oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems) oDialogModel.removeByName (&quot;lstPlayerLevel&quot;)
oDialogModel.insertByName (&quot;lstPlayerLevel&quot;, oListModel) oDialogModel.insertByName (&quot;lstPlayerLevel&quot;, oListModel)
&apos; Adds the whether powered-up check box. oListModel = oDialogModel.getByName (&quot;lstApprasal1&quot;)
oCheckBoxModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlCheckBoxModel&quot;)
oCheckBoxModel.setPropertyValue (&quot;PositionX&quot;, 5)
oCheckBoxModel.setPropertyValue (&quot;PositionY&quot;, 35)
oCheckBoxModel.setPropertyValue (&quot;Height&quot;, 12)
oCheckBoxModel.setPropertyValue (&quot;Width&quot;, 210)
oCheckBoxModel.setPropertyValue (&quot;Label&quot;, _
&quot;This Pokémon is ~newly-caught and was not powered-up yet.&quot;)
oCheckBoxModel.setPropertyValue (&quot;State&quot;, 1)
oDialogModel.insertByName (&quot;cbxIsNew&quot;, oCheckBoxModel)
&apos; Adds a group for the appraisals
oGroupModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlGroupBoxModel&quot;)
oGroupModel.setPropertyValue (&quot;PositionX&quot;, 5)
oGroupModel.setPropertyValue (&quot;PositionY&quot;, 50)
oGroupModel.setPropertyValue (&quot;Height&quot;, 65)
oGroupModel.setPropertyValue (&quot;Width&quot;, 210)
oGroupModel.setPropertyValue (&quot;Label&quot;, &quot;Apprasals&quot;)
oDialogModel.insertByName (&quot;grpApprasals&quot;, oGroupModel)
&apos; Adds the first appraisal list.
mListItems = Array ( _
&quot;1. Amazed me/wonder/best&quot;, _
&quot;2. Strong/caught my attention&quot;, _
&quot;3. Decent/above average&quot;, _
&quot;4. Not great/not make headway/has room&quot;)
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 10)
oListModel.setPropertyValue (&quot;PositionY&quot;, 64)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 200)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True) oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems) oDialogModel.removeByName (&quot;lstApprasal1&quot;)
oDialogModel.insertByName (&quot;lstApprasal1&quot;, oListModel) oDialogModel.insertByName (&quot;lstApprasal1&quot;, oListModel)
&apos; Adds a text label for the HP field. oListModel = oDialogModel.getByName (&quot;lstApprasal2&quot;)
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 10)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 80)
oTextModel.setPropertyValue (&quot;Height&quot;, 12)
oTextModel.setPropertyValue (&quot;Width&quot;, 15)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;Best:&quot;)
oDialogModel.insertByName (&quot;txtBest&quot;, oTextModel)
&apos; Adds the attack is best check box
oCheckBoxModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlCheckBoxModel&quot;)
oCheckBoxModel.setPropertyValue (&quot;PositionX&quot;, 25)
oCheckBoxModel.setPropertyValue (&quot;PositionY&quot;, 80)
oCheckBoxModel.setPropertyValue (&quot;Height&quot;, 12)
oCheckBoxModel.setPropertyValue (&quot;Width&quot;, 30)
oCheckBoxModel.setPropertyValue (&quot;Label&quot;, &quot;~Attack&quot;)
oDialogModel.insertByName (&quot;cbxAttackBest&quot;, oCheckBoxModel)
&apos; Adds the defense is best check box
oCheckBoxModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlCheckBoxModel&quot;)
oCheckBoxModel.setPropertyValue (&quot;PositionX&quot;, 55)
oCheckBoxModel.setPropertyValue (&quot;PositionY&quot;, 80)
oCheckBoxModel.setPropertyValue (&quot;Height&quot;, 12)
oCheckBoxModel.setPropertyValue (&quot;Width&quot;, 35)
oCheckBoxModel.setPropertyValue (&quot;Label&quot;, &quot;~Defense&quot;)
oDialogModel.insertByName (&quot;cbxDefenseBest&quot;, oCheckBoxModel)
&apos; Adds the defense is best check box
oCheckBoxModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlCheckBoxModel&quot;)
oCheckBoxModel.setPropertyValue (&quot;PositionX&quot;, 90)
oCheckBoxModel.setPropertyValue (&quot;PositionY&quot;, 80)
oCheckBoxModel.setPropertyValue (&quot;Height&quot;, 12)
oCheckBoxModel.setPropertyValue (&quot;Width&quot;, 45)
oCheckBoxModel.setPropertyValue (&quot;Label&quot;, &quot;HP (~Stamina)&quot;)
oDialogModel.insertByName (&quot;cbxHPBest&quot;, oCheckBoxModel)
&apos; Adds the second appraisal list.
mListItems = Array ( _
&quot;1. WOW/incredible/stats are best&quot;, _
&quot;2. Excellent/impressed/impressive&quot;, _
&quot;3. Get the job done/noticeable/some good stats&quot;, _
&quot;4. No greatness/not out of the norm/kinda basic&quot;)
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 10)
oListModel.setPropertyValue (&quot;PositionY&quot;, 95)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 200)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True) oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems) oDialogModel.removeByName (&quot;lstApprasal2&quot;)
oDialogModel.insertByName (&quot;lstApprasal2&quot;, oListModel) oDialogModel.insertByName (&quot;lstApprasal2&quot;, oListModel)
&apos; Adds the OK button.
oButtonModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlButtonModel&quot;)
oButtonModel.setPropertyValue (&quot;PositionX&quot;, 35)
oButtonModel.setPropertyValue (&quot;PositionY&quot;, 120)
oButtonModel.setPropertyValue (&quot;Height&quot;, 15)
oButtonModel.setPropertyValue (&quot;Width&quot;, 60)
oButtonModel.setPropertyValue (&quot;PushButtonType&quot;, _
com.sun.star.awt.PushButtonType.OK)
oButtonModel.setPropertyValue (&quot;DefaultButton&quot;, True)
oDialogModel.insertByName (&quot;btnOK&quot;, oButtonModel)
&apos; Adds the cancel button.
oButtonModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlButtonModel&quot;)
oButtonModel.setPropertyValue (&quot;PositionX&quot;, 125)
oButtonModel.setPropertyValue (&quot;PositionY&quot;, 120)
oButtonModel.setPropertyValue (&quot;Height&quot;, 15)
oButtonModel.setPropertyValue (&quot;Width&quot;, 60)
oButtonModel.setPropertyValue (&quot;PushButtonType&quot;, _
com.sun.star.awt.PushButtonType.CANCEL)
oDialogModel.insertByName (&quot;btnCancel&quot;, oButtonModel)
&apos; Adds the dialog model to the control and runs it.
oDialog = CreateUnoService (&quot;com.sun.star.awt.UnoControlDialog&quot;)
oDialog.setModel (oDialogModel)
oDialog.setVisible (True)
oDialog.getControl (&quot;lstPokemon&quot;).setFocus
If oDialog.execute = 0 Then If oDialog.execute = 0 Then
aQuery.bIsCancelled = True aQuery.bIsCancelled = True
fnAskParam = aQuery fnAskParam = aQuery
@ -377,6 +145,661 @@ Function fnAskParam As aFindIVParam
fnAskParam = aQuery fnAskParam = aQuery
End Function End Function
&apos; fnAskParam: Asks the users for the parameters for the Pokémon.
Function fnAskParam0 As aFindIVParam
Dim oDialog As Object, oDialogModel As Object
Dim oTextModel As Object, oListModel As Object
Dim oNumericModel As Object, oCheckBoxModel As Object
Dim oGroupModel As Object, oRadioModel As Object
Dim oButtonModel As Object, oListener As Object
Dim mListItems () As String, sTemp As String
Dim nI As Integer, nCount As Integer
Dim bIsBestAttack As Boolean, bIsBestDefense As Boolean
Dim bIsBestHP As Boolean
Dim aQuery As New aFindIVParam
&apos; Creates a dialog
oDialogModel = CreateUnoService ( _
&quot;com.sun.star.awt.UnoControlDialogModel&quot;)
oDialogModel.setPropertyValue (&quot;PositionX&quot;, 100)
oDialogModel.setPropertyValue (&quot;PositionY&quot;, 100)
oDialogModel.setPropertyValue (&quot;Height&quot;, 185)
oDialogModel.setPropertyValue (&quot;Width&quot;, 220)
oDialogModel.setPropertyValue (&quot;Title&quot;, &quot;Pokémon GO IV Calculator&quot;)
&apos; Adds a text label for the Pokémon list.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 5)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 6)
oTextModel.setPropertyValue (&quot;Height&quot;, 8)
oTextModel.setPropertyValue (&quot;Width&quot;, 30)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;~Pokémon:&quot;)
oDialogModel.insertByName (&quot;txtPokemon&quot;, oTextModel)
&apos; Adds the Pokémon list.
subReadBaseStats
ReDim mListItems (UBound (maBaseStats)) As String
For nI = 0 To UBound (maBaseStats)
mListItems (nI) = maBaseStats (nI).sPokemon
Next nI
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 35)
oListModel.setPropertyValue (&quot;PositionY&quot;, 4)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 50)
oListModel.setPropertyValue (&quot;TabIndex&quot;, 0)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems)
oDialogModel.insertByName (&quot;lstPokemon&quot;, oListModel)
&apos; Adds a text label for the CP field.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 5)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 21)
oTextModel.setPropertyValue (&quot;Height&quot;, 8)
oTextModel.setPropertyValue (&quot;Width&quot;, 15)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;~CP:&quot;)
oDialogModel.insertByName (&quot;txtCP&quot;, oTextModel)
&apos; Adds the CP field.
oNumericModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlNumericFieldModel&quot;)
oNumericModel.setPropertyValue (&quot;PositionX&quot;, 20)
oNumericModel.setPropertyValue (&quot;PositionY&quot;, 19)
oNumericModel.setPropertyValue (&quot;Height&quot;, 12)
oNumericModel.setPropertyValue (&quot;Width&quot;, 20)
oNumericModel.setPropertyValue (&quot;DecimalAccuracy&quot;, 0)
oDialogModel.insertByName (&quot;numCP&quot;, oNumericModel)
&apos; Adds a text label for the HP field.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 50)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 21)
oTextModel.setPropertyValue (&quot;Height&quot;, 8)
oTextModel.setPropertyValue (&quot;Width&quot;, 15)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;~HP:&quot;)
oDialogModel.insertByName (&quot;txtHP&quot;, oTextModel)
&apos; Adds the HP field.
oNumericModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlNumericFieldModel&quot;)
oNumericModel.setPropertyValue (&quot;PositionX&quot;, 65)
oNumericModel.setPropertyValue (&quot;PositionY&quot;, 19)
oNumericModel.setPropertyValue (&quot;Height&quot;, 12)
oNumericModel.setPropertyValue (&quot;Width&quot;, 15)
oNumericModel.setPropertyValue (&quot;DecimalAccuracy&quot;, 0)
oDialogModel.insertByName (&quot;numHP&quot;, oNumericModel)
&apos; Adds a text label for the star dust field.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 90)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 21)
oTextModel.setPropertyValue (&quot;Height&quot;, 8)
oTextModel.setPropertyValue (&quot;Width&quot;, 30)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;S~tar dust:&quot;)
oDialogModel.insertByName (&quot;txtStarDust&quot;, oTextModel)
&apos; Adds the star dust field.
subReadStarDust
sTemp = &quot; &quot;
ReDim mListItems () As String
nCount = -1
For nI = 1 To UBound (mStarDust)
If InStr (sTemp, &quot; &quot; &amp; CStr (mStarDust (nI)) &amp; &quot; &quot;) = 0 Then
nCount = nCount + 1
ReDim Preserve mListItems (nCount) As String
mListItems (nCount) = CStr (mStarDust (nI))
sTemp = sTemp &amp; CStr (mStarDust (nI)) &amp; &quot; &quot;
End If
Next nI
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 120)
oListModel.setPropertyValue (&quot;PositionY&quot;, 19)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 30)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems)
oDialogModel.insertByName (&quot;lstStarDust&quot;, oListModel)
&apos; Adds a text label for the player level field.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 160)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 21)
oTextModel.setPropertyValue (&quot;Height&quot;, 8)
oTextModel.setPropertyValue (&quot;Width&quot;, 35)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;Player ~level:&quot;)
oDialogModel.insertByName (&quot;txtPlayerLevel&quot;, oTextModel)
&apos; Adds the player level field.
ReDim mListItems (39) As String
For nI = 0 To UBound (mListItems)
mListItems (nI) = CStr (nI + 1)
Next nI
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 195)
oListModel.setPropertyValue (&quot;PositionY&quot;, 19)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 20)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oListModel.setPropertyValue (&quot;StringItemList&quot;, mListItems)
oDialogModel.insertByName (&quot;lstPlayerLevel&quot;, oListModel)
&apos; Adds the whether powered-up check box.
oCheckBoxModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlCheckBoxModel&quot;)
oCheckBoxModel.setPropertyValue (&quot;PositionX&quot;, 5)
oCheckBoxModel.setPropertyValue (&quot;PositionY&quot;, 36)
oCheckBoxModel.setPropertyValue (&quot;Height&quot;, 8)
oCheckBoxModel.setPropertyValue (&quot;Width&quot;, 210)
oCheckBoxModel.setPropertyValue (&quot;Label&quot;, _
&quot;This Pokémon is ~newly-caught and was not powered-up yet.&quot;)
oCheckBoxModel.setPropertyValue (&quot;State&quot;, 1)
oDialogModel.insertByName (&quot;cbxIsNew&quot;, oCheckBoxModel)
&apos; Adds a group for the appraisals
oGroupModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlGroupBoxModel&quot;)
oGroupModel.setPropertyValue (&quot;PositionX&quot;, 5)
oGroupModel.setPropertyValue (&quot;PositionY&quot;, 50)
oGroupModel.setPropertyValue (&quot;Height&quot;, 110)
oGroupModel.setPropertyValue (&quot;Width&quot;, 210)
oGroupModel.setPropertyValue (&quot;Label&quot;, &quot;Team Leader Apprasal&quot;)
oDialogModel.insertByName (&quot;grpApprasals&quot;, oGroupModel)
&apos; Adds a text label for the team.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 10)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 66)
oTextModel.setPropertyValue (&quot;Height&quot;, 8)
oTextModel.setPropertyValue (&quot;Width&quot;, 20)
oTextModel.setPropertyValue (&quot;Label&quot;, &quot;Team:&quot;)
oDialogModel.insertByName (&quot;txtTeam&quot;, oTextModel)
&apos; Adds the red team radio button.
oRadioModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlRadioButtonModel&quot;)
oRadioModel.setPropertyValue (&quot;PositionX&quot;, 30)
oRadioModel.setPropertyValue (&quot;PositionY&quot;, 66)
oRadioModel.setPropertyValue (&quot;Height&quot;, 8)
oRadioModel.setPropertyValue (&quot;Width&quot;, 25)
oRadioModel.setPropertyValue (&quot;Label&quot;, &quot;~Valor&quot;)
oRadioModel.setPropertyValue (&quot;TextColor&quot;, RGB (255, 255, 255))
oRadioModel.setPropertyValue (&quot;BackgroundColor&quot;, RGB (255, 0, 0))
oDialogModel.insertByName (&quot;rdoTeamRed&quot;, oRadioModel)
&apos; Adds the blue team radio button.
oRadioModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlRadioButtonModel&quot;)
oRadioModel.setPropertyValue (&quot;PositionX&quot;, 55)
oRadioModel.setPropertyValue (&quot;PositionY&quot;, 66)
oRadioModel.setPropertyValue (&quot;Height&quot;, 8)
oRadioModel.setPropertyValue (&quot;Width&quot;, 30)
oRadioModel.setPropertyValue (&quot;Label&quot;, &quot;~Mystic&quot;)
oRadioModel.setPropertyValue (&quot;TextColor&quot;, RGB (255, 255, 255))
oRadioModel.setPropertyValue (&quot;BackgroundColor&quot;, RGB (0, 0, 255))
oDialogModel.insertByName (&quot;rdoTeamBlue&quot;, oRadioModel)
&apos; Adds the yellow team radio button.
oRadioModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlRadioButtonModel&quot;)
oRadioModel.setPropertyValue (&quot;PositionX&quot;, 85)
oRadioModel.setPropertyValue (&quot;PositionY&quot;, 66)
oRadioModel.setPropertyValue (&quot;Height&quot;, 8)
oRadioModel.setPropertyValue (&quot;Width&quot;, 30)
oRadioModel.setPropertyValue (&quot;Label&quot;, &quot;~Instinct&quot;)
oRadioModel.setPropertyValue (&quot;BackgroundColor&quot;, RGB (255, 255, 0))
oDialogModel.insertByName (&quot;rdoTeamYellow&quot;, oRadioModel)
&apos; Adds the first appraisal list.
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 10)
oListModel.setPropertyValue (&quot;PositionY&quot;, 79)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 200)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oDialogModel.insertByName (&quot;lstApprasal1&quot;, oListModel)
&apos; Adds a text label before the best stat.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 10)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 96)
oTextModel.setPropertyValue (&quot;Height&quot;, 8)
oTextModel.setPropertyValue (&quot;Width&quot;, 0)
oDialogModel.insertByName (&quot;txtBestBefore&quot;, oTextModel)
&apos; Adds the best stat field.
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 10)
oListModel.setPropertyValue (&quot;PositionY&quot;, 94)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 35)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oDialogModel.insertByName (&quot;lstBest&quot;, oListModel)
&apos; Adds a text label after the best stat.
oTextModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
oTextModel.setPropertyValue (&quot;PositionX&quot;, 45)
oTextModel.setPropertyValue (&quot;PositionY&quot;, 96)
oTextModel.setPropertyValue (&quot;Height&quot;, 8)
oTextModel.setPropertyValue (&quot;Width&quot;, 100)
oDialogModel.insertByName (&quot;txtBestAfter&quot;, oTextModel)
&apos; Adds the second best stat check box.
oCheckBoxModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlCheckBoxModel&quot;)
oCheckBoxModel.setPropertyValue (&quot;PositionX&quot;, 10)
oCheckBoxModel.setPropertyValue (&quot;PositionY&quot;, 111)
oCheckBoxModel.setPropertyValue (&quot;Height&quot;, 8)
oCheckBoxModel.setPropertyValue (&quot;Width&quot;, 210)
oDialogModel.insertByName (&quot;cbxBest2&quot;, oCheckBoxModel)
&apos; Adds the third best stat check box.
oCheckBoxModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlCheckBoxModel&quot;)
oCheckBoxModel.setPropertyValue (&quot;PositionX&quot;, 10)
oCheckBoxModel.setPropertyValue (&quot;PositionY&quot;, 126)
oCheckBoxModel.setPropertyValue (&quot;Height&quot;, 8)
oCheckBoxModel.setPropertyValue (&quot;Width&quot;, 210)
oDialogModel.insertByName (&quot;cbxBest3&quot;, oCheckBoxModel)
&apos; Adds the second appraisal list.
oListModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
oListModel.setPropertyValue (&quot;PositionX&quot;, 10)
oListModel.setPropertyValue (&quot;PositionY&quot;, 140)
oListModel.setPropertyValue (&quot;Height&quot;, 12)
oListModel.setPropertyValue (&quot;Width&quot;, 200)
oListModel.setPropertyValue (&quot;Dropdown&quot;, True)
oDialogModel.insertByName (&quot;lstApprasal2&quot;, oListModel)
&apos; Adds the OK button.
oButtonModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlButtonModel&quot;)
oButtonModel.setPropertyValue (&quot;PositionX&quot;, 35)
oButtonModel.setPropertyValue (&quot;PositionY&quot;, 165)
oButtonModel.setPropertyValue (&quot;Height&quot;, 15)
oButtonModel.setPropertyValue (&quot;Width&quot;, 60)
oButtonModel.setPropertyValue (&quot;PushButtonType&quot;, _
com.sun.star.awt.PushButtonType.OK)
oButtonModel.setPropertyValue (&quot;DefaultButton&quot;, True)
oDialogModel.insertByName (&quot;btnOK&quot;, oButtonModel)
&apos; Adds the cancel button.
oButtonModel = oDialogModel.createInstance ( _
&quot;com.sun.star.awt.UnoControlButtonModel&quot;)
oButtonModel.setPropertyValue (&quot;PositionX&quot;, 125)
oButtonModel.setPropertyValue (&quot;PositionY&quot;, 165)
oButtonModel.setPropertyValue (&quot;Height&quot;, 15)
oButtonModel.setPropertyValue (&quot;Width&quot;, 60)
oButtonModel.setPropertyValue (&quot;PushButtonType&quot;, _
com.sun.star.awt.PushButtonType.CANCEL)
oDialogModel.insertByName (&quot;btnCancel&quot;, oButtonModel)
&apos; Adds the dialog model to the control and runs it.
oDialog = CreateUnoService (&quot;com.sun.star.awt.UnoControlDialog&quot;)
oDialog.setModel (oDialogModel)
oDialog.setVisible (True)
oDialog.getControl (&quot;lstPokemon&quot;).setFocus
oListener = CreateUnoListener (&quot;subRdoTeamRedItemChanged_&quot;, _
&quot;com.sun.star.awt.XItemListener&quot;)
oDialog.getControl (&quot;rdoTeamRed&quot;).addItemListener (oListener)
oListener = CreateUnoListener (&quot;subRdoTeamBlueItemChanged_&quot;, _
&quot;com.sun.star.awt.XItemListener&quot;)
oDialog.getControl (&quot;rdoTeamBlue&quot;).addItemListener (oListener)
oListener = CreateUnoListener (&quot;subRdoTeamYellowItemChanged_&quot;, _
&quot;com.sun.star.awt.XItemListener&quot;)
oDialog.getControl (&quot;rdoTeamYellow&quot;).addItemListener (oListener)
oListener = CreateUnoListener (&quot;subLstBestItemChanged_&quot;, _
&quot;com.sun.star.awt.XItemListener&quot;)
oDialog.getControl (&quot;lstBest&quot;).addItemListener (oListener)
oDialog.getControl (&quot;lstApprasal1&quot;).setVisible (False)
oDialog.getControl (&quot;txtBestBefore&quot;).setVisible (False)
oDialog.getControl (&quot;lstBest&quot;).setVisible (False)
oDialog.getControl (&quot;txtBestAfter&quot;).setVisible (False)
oDialog.getControl (&quot;cbxBest2&quot;).setVisible (False)
oDialog.getControl (&quot;cbxBest3&quot;).setVisible (False)
oDialog.getControl (&quot;lstApprasal2&quot;).setVisible (False)
If oDialog.execute = 0 Then
aQuery.bIsCancelled = True
fnAskParam0 = aQuery
Exit Function
End If
With aQuery
.sPokemon = oDialog.getControl (&quot;lstPokemon&quot;).getSelectedItem
.nCP = oDialog.getControl (&quot;numCP&quot;).getValue
.nHP = oDialog.getControl (&quot;numHP&quot;).getValue
.nStarDust = CInt (oDialog.getControl (&quot;lstStarDust&quot;).getSelectedItem)
.nPlayerLevel = CInt (oDialog.getControl (&quot;lstPlayerLevel&quot;).getSelectedItem)
.nAppraisal1 = oDialog.getControl (&quot;lstApprasal1&quot;).getSelectedItemPos + 1
.nAppraisal2 = oDialog.getControl (&quot;lstApprasal2&quot;).getSelectedItemPos + 1
.bIsCancelled = False
End With
If oDialog.getControl (&quot;cbxIsNew&quot;).getState = 1 Then
aQuery.bIsNew = True
Else
aQuery.bIsNew = False
End If
&apos; The best stats
bIsBestAttack = False
bIsBestDefense = False
bIsBestHP = False
If oDialog.getControl (&quot;lstBest&quot;).getSelectedItem = &quot;Attack&quot; Then
bIsBestAttack = True
If oDialog.getControl (&quot;cbxBest2&quot;).getState = 1 Then
bIsBestDefense = True
End If
If oDialog.getControl (&quot;cbxBest3&quot;).getState = 1 Then
bIsBestHP = True
End If
End If
If oDialog.getControl (&quot;lstBest&quot;).getSelectedItem = &quot;Defense&quot; Then
bIsBestDefense = True
If oDialog.getControl (&quot;cbxBest2&quot;).getState = 1 Then
bIsBestAttack = True
End If
If oDialog.getControl (&quot;cbxBest3&quot;).getState = 1 Then
bIsBestHP = True
End If
End If
If oDialog.getControl (&quot;lstBest&quot;).getSelectedItem = &quot;HP&quot; Then
bIsBestHP = True
If oDialog.getControl (&quot;cbxBest2&quot;).getState = 1 Then
bIsBestAttack = True
End If
If oDialog.getControl (&quot;cbxBest3&quot;).getState = 1 Then
bIsBestDefense = True
End If
End If
aQuery.sBest = &quot;&quot;
If bIsBestAttack Then
aQuery.sBest = aQuery.sBest &amp; &quot;Atk &quot;
End If
If bIsBestDefense Then
aQuery.sBest = aQuery.sBest &amp; &quot;Def &quot;
End If
If bIsBestHP Then
aQuery.sBest = aQuery.sBest &amp; &quot;Sta &quot;
End If
fnAskParam0 = aQuery
End Function
&apos; subRdoTeamRedItemChanged_itemStateChanged: Dummy for the listener.
Sub subRdoTeamRedItemChanged_disposing (oEvent As object)
End Sub
&apos; subRdoTeamRedItemChanged_itemStateChanged: When the team is selected.
Sub subRdoTeamRedItemChanged_itemStateChanged (oEvent As object)
Dim oDialog As Object, oList As Object, oText As Object
Dim mItems () As String
mItems = Array ( _
&quot;1. Overall, your [Pokémon] simply amazes me. It can accomplish anything!&quot;, _
&quot;2. Overall, your [Pokémon] is a strong Pokémon. You should be proud!&quot;, _
&quot;3. Overall, your [Pokémon] is a decent Pokémon.&quot;, _
&quot;4. Overall, your [Pokémon] may not be great in battle, but I still like it!&quot;)
oDialog = oEvent.Source.getContext
oList = oDialog.getControl (&quot;lstApprasal1&quot;)
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setVisible (True)
oText = oDialog.getControl (&quot;txtBestBefore&quot;)
oText.setPosSize (30, 96, 20, 8, _
com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH)
oText.setVisible (True)
oText.setText (&quot;Its&quot;)
mItems = Array (&quot;Attack&quot;, &quot;Defense&quot;, &quot;HP&quot;)
oList = oDialog.getControl (&quot;lstBest&quot;)
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setPosSize (50, 96, 35, 8, _
com.sun.star.awt.PosSize.X)
oList.setVisible (True)
oText = oDialog.getControl (&quot;txtBestAfter&quot;)
oText.setPosSize (145, 96, 160, 8, _
com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH)
oText.setVisible (True)
oText.setText (&quot;is its strongest feature.&quot;)
oList = oDialog.getControl (&quot;cbxBest2&quot;)
oList.setVisible (False)
oList = oDialog.getControl (&quot;cbxBest3&quot;)
oList.setVisible (False)
mItems = Array ( _
&quot;1. I&apos;m blown away by its stats. WOW!&quot;, _
&quot;2. It&apos;s got excellent stats! How exciting!&quot;, _
&quot;3. Its stats indicate that in battle, it&apos;ll get the job done.&quot;, _
&quot;4. Its stats don&apos;t point to greatness in battle.&quot;)
oDialog = oEvent.Source.getContext
oList = oDialog.getControl (&quot;lstApprasal2&quot;)
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setVisible (True)
End Sub
&apos; subRdoTeamBlueItemChanged_itemStateChanged: Dummy for the listener.
Sub subRdoTeamBlueItemChanged_disposing (oEvent As object)
End Sub
&apos; subRdoTeamBlueItemChanged_itemStateChanged: When the blue team is selected.
Sub subRdoTeamBlueItemChanged_itemStateChanged (oEvent As object)
Dim oDialog As Object, oList As Object, oText As Object
Dim mItems () As String
mItems = Array ( _
&quot;1. Overall, your [Pokémon] is a wonder! What a breathtaking Pokémon!&quot;, _
&quot;2. Overall, your [Pokémon] has certainly caught my attention.&quot;, _
&quot;3. Overall, your [Pokémon] is above average.&quot;, _
&quot;4. Overall, your [Pokémon] is not likely to make much headway in battle.&quot;)
oDialog = oEvent.Source.getContext
oList = oDialog.getControl (&quot;lstApprasal1&quot;)
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setVisible (True)
oText = oDialog.getControl (&quot;txtBestBefore&quot;)
oText.setPosSize (30, 96, 200, 8, _
com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH)
oText.setVisible (True)
oText.setText (&quot;I see that its best attribute is its&quot;)
mItems = Array (&quot;Attack&quot;, &quot;Defense&quot;, &quot;HP&quot;)
oList = oDialog.getControl (&quot;lstBest&quot;)
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setPosSize (230, 96, 35, 8, _
com.sun.star.awt.PosSize.X)
oList.setVisible (True)
oText = oDialog.getControl (&quot;txtBestAfter&quot;)
oText.setPosSize (325, 96, 5, 8, _
com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH)
oText.setVisible (True)
oText.setText (&quot;.&quot;)
oList = oDialog.getControl (&quot;cbxBest2&quot;)
oList.setVisible (False)
oList = oDialog.getControl (&quot;cbxBest3&quot;)
oList.setVisible (False)
mItems = Array ( _
&quot;1. Its stats exceed my calculations. It&apos;s incredible!&quot;, _
&quot;2. I am certainly impressed by its stats, I must say.&quot;, _
&quot;3. Its stats are noticeably trending to the positive.&quot;, _
&quot;4. Its stats are not out of the norm, in my opinion.&quot;)
oDialog = oEvent.Source.getContext
oList = oDialog.getControl (&quot;lstApprasal2&quot;)
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setVisible (True)
End Sub
&apos; subRdoTeamYellowItemChanged_itemStateChanged: Dummy for the listener.
Sub subRdoTeamYellowItemChanged_disposing (oEvent As object)
End Sub
&apos; subRdoTeamYellowItemChanged_itemStateChanged: When the yellow team is selected.
Sub subRdoTeamYellowItemChanged_itemStateChanged (oEvent As object)
Dim oDialog As Object, oList As Object, oText As Object
Dim mItems () As String
mItems = Array ( _
&quot;1. Overall, your [Pokémon] looks like it can really battle with the best of them!&quot;, _
&quot;2. Overall, your [Pokémon] is really strong!&quot;, _
&quot;3. Overall, your [Pokémon] is pretty decent!&quot;, _
&quot;4. Overall, your [Pokémon] has room for improvement as far as battling goes.&quot;)
oDialog = oEvent.Source.getContext
oList = oDialog.getControl (&quot;lstApprasal1&quot;)
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setVisible (True)
oText = oDialog.getControl (&quot;txtBestBefore&quot;)
oText.setPosSize (30, 96, 115, 8, _
com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH)
oText.setVisible (True)
oText.setText (&quot;Its best quality is&quot;)
mItems = Array (&quot;Attack&quot;, &quot;Defense&quot;, &quot;HP&quot;)
oList = oDialog.getControl (&quot;lstBest&quot;)
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setPosSize (145, 96, 35, 8, _
com.sun.star.awt.PosSize.X)
oList.setVisible (True)
oText = oDialog.getControl (&quot;txtBestAfter&quot;)
oText.setPosSize (240, 96, 5, 8, _
com.sun.star.awt.PosSize.X + com.sun.star.awt.PosSize.WIDTH)
oText.setVisible (True)
oText.setText (&quot;.&quot;)
oList = oDialog.getControl (&quot;cbxBest2&quot;)
oList.setVisible (False)
oList = oDialog.getControl (&quot;cbxBest3&quot;)
oList.setVisible (False)
mItems = Array ( _
&quot;1. Its stats are the best I&apos;ve ever seen! No doubt about it!&quot;, _
&quot;2. Its stats are really strong! Impressive.&quot;, _
&quot;3. It&apos;s definitely got some good stats. Definitely!&quot;, _
&quot;4. Its stats are all right, but kinda basic, as far as I can see.&quot;)
oDialog = oEvent.Source.getContext
oList = oDialog.getControl (&quot;lstApprasal2&quot;)
oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0)
oList.setVisible (True)
End Sub
&apos; subLstBestItemChanged_itemStateChanged: Dummy for the listener.
Sub subLstBestItemChanged_disposing (oEvent As object)
End Sub
&apos; subLstBestItemChanged_itemStateChanged: When the best stat is selected.
Sub subLstBestItemChanged_itemStateChanged (oEvent As object)
Dim oDialog As Object, oCheckBox As Object
oDialog = oEvent.Source.getContext
If oDialog.getControl (&quot;rdoTeamRed&quot;).getState Then
If oDialog.getControl (&quot;lstBest&quot;).getSelectedItem = &quot;Attack&quot; Then
oCheckBox = oDialog.getControl (&quot;cbxBest2&quot;)
oCheckBox.setLabel (&quot;I&apos;m just as impressed with its Defense.&quot;)
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl (&quot;cbxBest3&quot;)
oCheckBox.setLabel (&quot;I&apos;m just as impressed with its HP.&quot;)
oCheckBox.setVisible (True)
End If
If oDialog.getControl (&quot;lstBest&quot;).getSelectedItem = &quot;Defense&quot; Then
oCheckBox = oDialog.getControl (&quot;cbxBest2&quot;)
oCheckBox.setLabel (&quot;I&apos;m just as impressed with its Attack.&quot;)
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl (&quot;cbxBest3&quot;)
oCheckBox.setLabel (&quot;I&apos;m just as impressed with its HP.&quot;)
oCheckBox.setVisible (True)
End If
If oDialog.getControl (&quot;lstBest&quot;).getSelectedItem = &quot;HP&quot; Then
oCheckBox = oDialog.getControl (&quot;cbxBest2&quot;)
oCheckBox.setLabel (&quot;I&apos;m just as impressed with its Attack.&quot;)
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl (&quot;cbxBest3&quot;)
oCheckBox.setLabel (&quot;I&apos;m just as impressed with its Defense.&quot;)
oCheckBox.setVisible (True)
End If
End If
If oDialog.getControl (&quot;rdoTeamBlue&quot;).getState Then
If oDialog.getControl (&quot;lstBest&quot;).getSelectedItem = &quot;Attack&quot; Then
oCheckBox = oDialog.getControl (&quot;cbxBest2&quot;)
oCheckBox.setLabel (&quot;It is matched equally by its Defense.&quot;)
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl (&quot;cbxBest3&quot;)
oCheckBox.setLabel (&quot;It is matched equally by its HP.&quot;)
oCheckBox.setVisible (True)
End If
If oDialog.getControl (&quot;lstBest&quot;).getSelectedItem = &quot;Defense&quot; Then
oCheckBox = oDialog.getControl (&quot;cbxBest2&quot;)
oCheckBox.setLabel (&quot;It is matched equally by its Attack.&quot;)
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl (&quot;cbxBest3&quot;)
oCheckBox.setLabel (&quot;It is matched equally by its HP.&quot;)
oCheckBox.setVisible (True)
End If
If oDialog.getControl (&quot;lstBest&quot;).getSelectedItem = &quot;HP&quot; Then
oCheckBox = oDialog.getControl (&quot;cbxBest2&quot;)
oCheckBox.setLabel (&quot;It is matched equally by its Attack.&quot;)
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl (&quot;cbxBest3&quot;)
oCheckBox.setLabel (&quot;It is matched equally by its Defense.&quot;)
oCheckBox.setVisible (True)
End If
End If
If oDialog.getControl (&quot;rdoTeamYellow&quot;).getState Then
If oDialog.getControl (&quot;lstBest&quot;).getSelectedItem = &quot;Attack&quot; Then
oCheckBox = oDialog.getControl (&quot;cbxBest2&quot;)
oCheckBox.setLabel (&quot;Its Defense is great, too!&quot;)
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl (&quot;cbxBest3&quot;)
oCheckBox.setLabel (&quot;Its HP is great, too!&quot;)
oCheckBox.setVisible (True)
End If
If oDialog.getControl (&quot;lstBest&quot;).getSelectedItem = &quot;Defense&quot; Then
oCheckBox = oDialog.getControl (&quot;cbxBest2&quot;)
oCheckBox.setLabel (&quot;Its Attack is great, too!&quot;)
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl (&quot;cbxBest3&quot;)
oCheckBox.setLabel (&quot;Its HP is great, too!&quot;)
oCheckBox.setVisible (True)
End If
If oDialog.getControl (&quot;lstBest&quot;).getSelectedItem = &quot;HP&quot; Then
oCheckBox = oDialog.getControl (&quot;cbxBest2&quot;)
oCheckBox.setLabel (&quot;Its Attack is great, too!&quot;)
oCheckBox.setVisible (True)
oCheckBox = oDialog.getControl (&quot;cbxBest3&quot;)
oCheckBox.setLabel (&quot;Its Defense is great, too!&quot;)
oCheckBox.setVisible (True)
End If
End If
End Sub
&apos; fnFindIV: Finds the possible individual values of the Pokémon &apos; fnFindIV: Finds the possible individual values of the Pokémon
Function fnFindIV (aQuery As aFindIVParam) As Variant Function fnFindIV (aQuery As aFindIVParam) As Variant
Dim aBaseStats As New aStats, maIV () As New aStats Dim aBaseStats As New aStats, maIV () As New aStats

View File

@ -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">&apos; 1Data: The Pokémon Go data for IV calculation <script:module xmlns:script="http://openoffice.org/2000/script" script:name="1Data" script:language="StarBasic">&apos; 1Data: The Pokémon GO data for IV calculation
&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-11-28 &apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-11-28
&apos; Generated with 9Load.subReadDataSheets () &apos; Generated with 9Load.subReadDataSheets ()

View File

@ -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="9Load" script:language="StarBasic">&apos; 9Load: The Pokémon Go data sheets loader <script:module xmlns:script="http://openoffice.org/2000/script" script:name="9Load" script:language="StarBasic">&apos; 9Load: The Pokémon GO data sheets loader
&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-11-28 &apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, 2016-11-28
Option Explicit Option Explicit
@ -11,7 +11,7 @@ Sub subReadDataSheets
Dim sOutput as String, mData As Variant Dim sOutput as String, mData As Variant
sOutput = &quot;&quot; _ sOutput = &quot;&quot; _
&amp; &quot;&apos; 1Data: The Pokémon Go data for IV calculation&quot; &amp; Chr (10) _ &amp; &quot;&apos; 1Data: The Pokémon GO data for IV calculation&quot; &amp; Chr (10) _
&amp; &quot;&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, &quot; &amp; Format (Date (), &quot;yyyy-mm-dd&quot;) &amp; Chr (10) _ &amp; &quot;&apos; by imacat &lt;imacat@mail.imacat.idv.tw&gt;, &quot; &amp; Format (Date (), &quot;yyyy-mm-dd&quot;) &amp; Chr (10) _
&amp; &quot;&apos; Generated with 9Load.subReadDataSheets ()&quot; &amp; Chr (10) _ &amp; &quot;&apos; Generated with 9Load.subReadDataSheets ()&quot; &amp; Chr (10) _
&amp; Chr (10) _ &amp; Chr (10) _
@ -34,7 +34,7 @@ Sub subShowBasicData (sContent As String)
oDialogModel.setPropertyValue (&quot;PositionY&quot;, 100) oDialogModel.setPropertyValue (&quot;PositionY&quot;, 100)
oDialogModel.setPropertyValue (&quot;Height&quot;, 130) oDialogModel.setPropertyValue (&quot;Height&quot;, 130)
oDialogModel.setPropertyValue (&quot;Width&quot;, 200) oDialogModel.setPropertyValue (&quot;Width&quot;, 200)
oDialogModel.setPropertyValue (&quot;Title&quot;, &quot;Pokémon Go Data&quot;) oDialogModel.setPropertyValue (&quot;Title&quot;, &quot;Pokémon GO Data&quot;)
&apos; Adds the content area &apos; Adds the content area
oEditModel = oDialogModel.createInstance ( _ oEditModel = oDialogModel.createInstance ( _
@ -82,10 +82,10 @@ Function fnReadBaseStatsSheet As String
&amp; &quot;Function fnGetBaseStatsData As Variant&quot; &amp; Chr (10) _ &amp; &quot;Function fnGetBaseStatsData As Variant&quot; &amp; Chr (10) _
&amp; Chr (9) &amp; &quot;fnGetBaseStatsData = Array( _&quot; &amp; Chr (10) &amp; Chr (9) &amp; &quot;fnGetBaseStatsData = Array( _&quot; &amp; Chr (10)
For nI = 1 To UBound (mData) - 1 For nI = 1 To UBound (mData) - 1
For nJ = 9 To 7 Step -1 For nJ = 8 To 6 Step -1
If mData (nI) (nJ) &lt;&gt; &quot;&quot; Then If mData (nI) (nJ) &lt;&gt; &quot;&quot; Then
sEvolveInto = mData (nI) (nJ) sEvolveInto = mData (nI) (nJ)
nJ = 6 nJ = 5
End If End If
Next nJ Next nJ
sOutput = sOutput _ sOutput = sOutput _
@ -97,10 +97,10 @@ Function fnReadBaseStatsSheet As String
&amp; &quot;, &quot;&quot;&quot; &amp; sEvolveInto &amp; &quot;&quot;&quot;), _&quot; &amp; Chr (10) &amp; &quot;, &quot;&quot;&quot; &amp; sEvolveInto &amp; &quot;&quot;&quot;), _&quot; &amp; Chr (10)
Next nI Next nI
nI = UBound (mData) nI = UBound (mData)
For nJ = 9 To 7 Step -1 For nJ = 8 To 6 Step -1
If mData (nI) (nJ) &lt;&gt; &quot;&quot; Then If mData (nI) (nJ) &lt;&gt; &quot;&quot; Then
sEvolveInto = mData (nI) (nJ) sEvolveInto = mData (nI) (nJ)
nJ = 6 nJ = 5
End If End If
Next nJ Next nJ
sOutput = sOutput _ sOutput = sOutput _

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-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="9Load"/>
<library:element library:name="0Main"/> <library:element library:name="0Main"/>
<library:element library:name="1Data"/> <library:element library:name="1Data"/>
<library:element library:name="9Load"/>
</library:library> </library:library>

View File

@ -18,8 +18,8 @@
</simple-license> </simple-license>
</registration> </registration>
<display-name> <display-name>
<name>Pokémon Go IV Calculator</name> <name>Pokémon GO IV Calculator</name>
<name lang="zh-TW">寶可夢 Go IV 計算機</name> <name lang="zh-TW">寶可夢 GO IV 計算機</name>
</display-name> </display-name>
<icon> <icon>
<default xlink:href="icons/pokemongoiv.png" /> <default xlink:href="icons/pokemongoiv.png" />

View File

@ -1,4 +1,4 @@
PokemonGoIV - Pokémon Go IV Calculator PokemonGoIV - Pokémon GO IV Calculator
Copyright (c) 2016 imacat Copyright (c) 2016 imacat
Calculates the individual values (IVs) of the Pokémon. Calculates the individual values (IVs) of the Pokémon.

View File

@ -1,4 +1,4 @@
PokemonGoIV - 寶可夢 Go IV 計算機 PokemonGoIV - 寶可夢 GO IV 計算機
版權所有 (c) 2016 依瑪貓 版權所有 (c) 2016 依瑪貓
計算寶可夢的 IV 值。 計算寶可夢的 IV 值。