Fixed to use a pre-recorded width for each part of the best stat appraisal. Fixed the copyright year of the Chinese description.

This commit is contained in:
依瑪貓 2017-02-24 17:15:27 +08:00
parent c6a1954932
commit 5c4cf83c12
5 changed files with 74 additions and 42 deletions

View File

@ -90,9 +90,9 @@ Function fnAskParam As aFindIVParam
DialogLibraries.loadLibrary "PokemonGoIV" DialogLibraries.loadLibrary "PokemonGoIV"
oDialog = CreateUnoDialog (DialogLibraries.PokemonGoIV.DlgMain) oDialog = CreateUnoDialog (DialogLibraries.PokemonGoIV.DlgMain)
oDialog.getControl ("lstTotal").setVisible (False) oDialog.getControl ("lstTotal").setVisible (False)
oDialog.getControl ("txtBestBefore").setVisible (False) oDialog.getControl ("txtBestHead").setVisible (False)
oDialog.getControl ("lstBest").setVisible (False) oDialog.getControl ("lstBest").setVisible (False)
oDialog.getControl ("txtBestAfter").setVisible (False) oDialog.getControl ("txtBestTail").setVisible (False)
oDialog.getControl ("cbxBest2").setVisible (False) oDialog.getControl ("cbxBest2").setVisible (False)
oDialog.getControl ("cbxBest3").setVisible (False) oDialog.getControl ("cbxBest3").setVisible (False)
oDialog.getControl ("lstMax").setVisible (False) oDialog.getControl ("lstMax").setVisible (False)
@ -237,7 +237,8 @@ Sub subRdoTeamValorItemChanged (oEvent As object)
' Updates the text of the best stat appraisal. ' Updates the text of the best stat appraisal.
subUpdateBestStatAppraisal (oDialog, _ subUpdateBestStatAppraisal (oDialog, _
fnGetResString ("AppraisalValorBest")) fnGetResString ("AppraisalValorBest"), _
CInt (fnGetResString ("AppraisalValorBestHeadWidth")))
mItems = Array ( _ mItems = Array ( _
fnGetResString ("AppraisalValorMax15"), _ fnGetResString ("AppraisalValorMax15"), _
@ -274,7 +275,8 @@ Sub subRdoTeamMysticItemChanged (oEvent As object)
' Updates the text of the best stat appraisal. ' Updates the text of the best stat appraisal.
subUpdateBestStatAppraisal (oDialog, _ subUpdateBestStatAppraisal (oDialog, _
fnGetResString ("AppraisalMysticBest")) fnGetResString ("AppraisalMysticBest"), _
CInt (fnGetResString ("AppraisalMysticBestHeadWidth")))
mItems = Array ( _ mItems = Array ( _
fnGetResString ("AppraisalMysticMax15"), _ fnGetResString ("AppraisalMysticMax15"), _
@ -311,7 +313,8 @@ Sub subRdoTeamInstinctItemChanged (oEvent As object)
' Updates the text of the best stat appraisal. ' Updates the text of the best stat appraisal.
subUpdateBestStatAppraisal (oDialog, _ subUpdateBestStatAppraisal (oDialog, _
fnGetResString ("AppraisalInstinctBest")) fnGetResString ("AppraisalInstinctBest"), _
CInt (fnGetResString ("AppraisalInstinctBestHeadWidth")))
mItems = Array ( _ mItems = Array ( _
fnGetResString ("AppraisalInstinctMax15"), _ fnGetResString ("AppraisalInstinctMax15"), _
@ -325,26 +328,25 @@ Sub subRdoTeamInstinctItemChanged (oEvent As object)
End Sub End Sub
' subUpdateBestStatAppraisal: Updates the text of the best stat appraisal. ' subUpdateBestStatAppraisal: Updates the text of the best stat appraisal.
Sub subUpdateBestStatAppraisal (oDialog As Object, sAppraisal) Sub subUpdateBestStatAppraisal (oDialog As Object, _
sAppraisal As String, nHeadWidth As Integer)
Dim oText As Object, oList As Object, nX As Integer Dim oText As Object, oList As Object, nX As Integer
Dim sBefore As String, nBeforeWidth As Integer Dim sHead As String, sTail As String, nTailWidth As Integer
Dim sAfter As String, nAfterWidth As Integer
Dim nDialogWidth As Integer Dim nDialogWidth As Integer
Dim nPos As Integer Dim nPos As Integer
Dim mItems () As String Dim mItems () As String
nPos = InStr (sAppraisal, "[Stat]") nPos = InStr (sAppraisal, "[Stat]")
sBefore = Left (sAppraisal, nPos - 1) sHead = Left (sAppraisal, nPos - 1)
nBeforeWidth = CInt (Len (sBefore) * 2.8) sTail = Right (sAppraisal, _
sAfter = Right (sAppraisal, _
Len (sAppraisal) - nPos - Len ("[Stat]") + 1) Len (sAppraisal) - nPos - Len ("[Stat]") + 1)
nDialogWidth = oDialog.getModel.getPropertyValue ("Width") nDialogWidth = oDialog.getModel.getPropertyValue ("Width")
oText = oDialog.getControl ("txtBestBefore") oText = oDialog.getControl ("txtBestHead")
oText.getModel.setPropertyValue ("Width", nBeforeWidth) oText.getModel.setPropertyValue ("Width", nHeadWidth)
oText.setVisible (True) oText.setVisible (True)
oText.setText (sBefore) oText.setText (sHead)
nX = oText.getModel.getPropertyValue ("PositionX") + nBeforeWidth nX = oText.getModel.getPropertyValue ("PositionX") + nHeadWidth
mItems = Array ( _ mItems = Array ( _
fnGetResString ("StatAttack"), _ fnGetResString ("StatAttack"), _
@ -354,15 +356,17 @@ Sub subUpdateBestStatAppraisal (oDialog As Object, sAppraisal)
oList.removeItems (0, oList.getItemCount()) oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0) oList.addItems (mItems, 0)
oList.getModel.setPropertyValue ("PositionX", nX) oList.getModel.setPropertyValue ("PositionX", nX)
oList.getModel.setPropertyValue ("Width", _
CInt (fnGetResString ("BestStatWidth")))
oList.setVisible (True) oList.setVisible (True)
nX = nX + oList.getModel.getPropertyValue ("Width") nX = nX + oList.getModel.getPropertyValue ("Width")
nAfterWidth = nDialogWidth - nX - 10 nTailWidth = nDialogWidth - nX - 10
oText = oDialog.getControl ("txtBestAfter") oText = oDialog.getControl ("txtBestTail")
oText.getModel.setPropertyValue ("PositionX", nX) oText.getModel.setPropertyValue ("PositionX", nX)
oText.getModel.setPropertyValue ("Width", nAfterWidth) oText.getModel.setPropertyValue ("Width", nTailWidth)
oText.setVisible (True) oText.setVisible (True)
oText.setText (sAfter) oText.setText (sTail)
oList = oDialog.getControl ("cbxBest2") oList = oDialog.getControl ("cbxBest2")
oList.setVisible (False) oList.setVisible (False)

View File

@ -73,6 +73,12 @@
<value xml:lang="de">KP</value> <value xml:lang="de">KP</value>
</prop> </prop>
</node> </node>
<node oor:name="BestStatWidth" oor:op="replace">
<prop oor:name="Text" oor:type="xs:string" oor:localized="true">
<value>42</value>
<value xml:lang="de">58</value>
</prop>
</node>
<!-- Team Valor (red) --> <!-- Team Valor (red) -->
<node oor:name="AppraiseFromCandela" oor:op="replace"> <node oor:name="AppraiseFromCandela" oor:op="replace">
<prop oor:name="Text" oor:type="xs:string" oor:localized="true"> <prop oor:name="Text" oor:type="xs:string" oor:localized="true">
@ -111,6 +117,12 @@
<value xml:lang="de">Sein [Stat]-Wert ist seine stärkste Eigenschaft.</value> <value xml:lang="de">Sein [Stat]-Wert ist seine stärkste Eigenschaft.</value>
</prop> </prop>
</node> </node>
<node oor:name="AppraisalValorBestHeadWidth" oor:op="replace">
<prop oor:name="Text" oor:type="xs:string" oor:localized="true">
<value>8</value>
<value xml:lang="de">14</value>
</prop>
</node>
<node oor:name="AppraisalValorBestToo" oor:op="replace"> <node oor:name="AppraisalValorBestToo" oor:op="replace">
<prop oor:name="Text" oor:type="xs:string" oor:localized="true"> <prop oor:name="Text" oor:type="xs:string" oor:localized="true">
<value>I'm just as impressed with its [Stat].</value> <value>I'm just as impressed with its [Stat].</value>
@ -179,6 +191,12 @@
<value xml:lang="de">Seine beste Eigenschaft ist offensichtlich sein [Stat]-Wert.</value> <value xml:lang="de">Seine beste Eigenschaft ist offensichtlich sein [Stat]-Wert.</value>
</prop> </prop>
</node> </node>
<node oor:name="AppraisalMysticBestHeadWidth" oor:op="replace">
<prop oor:name="Text" oor:type="xs:string" oor:localized="true">
<value>86</value>
<value xml:lang="de">129</value>
</prop>
</node>
<node oor:name="AppraisalMysticBestToo" oor:op="replace"> <node oor:name="AppraisalMysticBestToo" oor:op="replace">
<prop oor:name="Text" oor:type="xs:string" oor:localized="true"> <prop oor:name="Text" oor:type="xs:string" oor:localized="true">
<value>It is matched equally by its [Stat].</value> <value>It is matched equally by its [Stat].</value>
@ -247,6 +265,12 @@
<value xml:lang="de">Sein [Stat]-Wert ist seine beste Eigenschaft!</value> <value xml:lang="de">Sein [Stat]-Wert ist seine beste Eigenschaft!</value>
</prop> </prop>
</node> </node>
<node oor:name="AppraisalInstinctBestHeadWidth" oor:op="replace">
<prop oor:name="Text" oor:type="xs:string" oor:localized="true">
<value>46</value>
<value xml:lang="de">14</value>
</prop>
</node>
<node oor:name="AppraisalInstinctBestToo" oor:op="replace"> <node oor:name="AppraisalInstinctBestToo" oor:op="replace">
<prop oor:name="Text" oor:type="xs:string" oor:localized="true"> <prop oor:name="Text" oor:type="xs:string" oor:localized="true">
<value>Its [Stat] is great, too!</value> <value>Its [Stat] is great, too!</value>

View File

@ -92,9 +92,9 @@ Function fnAskParam As aFindIVParam
DialogLibraries.loadLibrary &quot;PokemonGoIV&quot; DialogLibraries.loadLibrary &quot;PokemonGoIV&quot;
oDialog = CreateUnoDialog (DialogLibraries.PokemonGoIV.DlgMain) oDialog = CreateUnoDialog (DialogLibraries.PokemonGoIV.DlgMain)
oDialog.getControl (&quot;lstTotal&quot;).setVisible (False) oDialog.getControl (&quot;lstTotal&quot;).setVisible (False)
oDialog.getControl (&quot;txtBestBefore&quot;).setVisible (False) oDialog.getControl (&quot;txtBestHead&quot;).setVisible (False)
oDialog.getControl (&quot;lstBest&quot;).setVisible (False) oDialog.getControl (&quot;lstBest&quot;).setVisible (False)
oDialog.getControl (&quot;txtBestAfter&quot;).setVisible (False) oDialog.getControl (&quot;txtBestTail&quot;).setVisible (False)
oDialog.getControl (&quot;cbxBest2&quot;).setVisible (False) oDialog.getControl (&quot;cbxBest2&quot;).setVisible (False)
oDialog.getControl (&quot;cbxBest3&quot;).setVisible (False) oDialog.getControl (&quot;cbxBest3&quot;).setVisible (False)
oDialog.getControl (&quot;lstMax&quot;).setVisible (False) oDialog.getControl (&quot;lstMax&quot;).setVisible (False)
@ -239,7 +239,8 @@ Sub subRdoTeamValorItemChanged (oEvent As object)
&apos; Updates the text of the best stat appraisal. &apos; Updates the text of the best stat appraisal.
subUpdateBestStatAppraisal (oDialog, _ subUpdateBestStatAppraisal (oDialog, _
fnGetResString (&quot;AppraisalValorBest&quot;)) fnGetResString (&quot;AppraisalValorBest&quot;), _
CInt (fnGetResString (&quot;AppraisalValorBestHeadWidth&quot;)))
mItems = Array ( _ mItems = Array ( _
fnGetResString (&quot;AppraisalValorMax15&quot;), _ fnGetResString (&quot;AppraisalValorMax15&quot;), _
@ -276,7 +277,8 @@ Sub subRdoTeamMysticItemChanged (oEvent As object)
&apos; Updates the text of the best stat appraisal. &apos; Updates the text of the best stat appraisal.
subUpdateBestStatAppraisal (oDialog, _ subUpdateBestStatAppraisal (oDialog, _
fnGetResString (&quot;AppraisalMysticBest&quot;)) fnGetResString (&quot;AppraisalMysticBest&quot;), _
CInt (fnGetResString (&quot;AppraisalMysticBestHeadWidth&quot;)))
mItems = Array ( _ mItems = Array ( _
fnGetResString (&quot;AppraisalMysticMax15&quot;), _ fnGetResString (&quot;AppraisalMysticMax15&quot;), _
@ -313,7 +315,8 @@ Sub subRdoTeamInstinctItemChanged (oEvent As object)
&apos; Updates the text of the best stat appraisal. &apos; Updates the text of the best stat appraisal.
subUpdateBestStatAppraisal (oDialog, _ subUpdateBestStatAppraisal (oDialog, _
fnGetResString (&quot;AppraisalInstinctBest&quot;)) fnGetResString (&quot;AppraisalInstinctBest&quot;), _
CInt (fnGetResString (&quot;AppraisalInstinctBestHeadWidth&quot;)))
mItems = Array ( _ mItems = Array ( _
fnGetResString (&quot;AppraisalInstinctMax15&quot;), _ fnGetResString (&quot;AppraisalInstinctMax15&quot;), _
@ -327,26 +330,25 @@ Sub subRdoTeamInstinctItemChanged (oEvent As object)
End Sub End Sub
&apos; subUpdateBestStatAppraisal: Updates the text of the best stat appraisal. &apos; subUpdateBestStatAppraisal: Updates the text of the best stat appraisal.
Sub subUpdateBestStatAppraisal (oDialog As Object, sAppraisal) Sub subUpdateBestStatAppraisal (oDialog As Object, _
sAppraisal As String, nHeadWidth As Integer)
Dim oText As Object, oList As Object, nX As Integer Dim oText As Object, oList As Object, nX As Integer
Dim sBefore As String, nBeforeWidth As Integer Dim sHead As String, sTail As String, nTailWidth As Integer
Dim sAfter As String, nAfterWidth As Integer
Dim nDialogWidth As Integer Dim nDialogWidth As Integer
Dim nPos As Integer Dim nPos As Integer
Dim mItems () As String Dim mItems () As String
nPos = InStr (sAppraisal, &quot;[Stat]&quot;) nPos = InStr (sAppraisal, &quot;[Stat]&quot;)
sBefore = Left (sAppraisal, nPos - 1) sHead = Left (sAppraisal, nPos - 1)
nBeforeWidth = CInt (Len (sBefore) * 2.8) sTail = Right (sAppraisal, _
sAfter = Right (sAppraisal, _
Len (sAppraisal) - nPos - Len (&quot;[Stat]&quot;) + 1) Len (sAppraisal) - nPos - Len (&quot;[Stat]&quot;) + 1)
nDialogWidth = oDialog.getModel.getPropertyValue (&quot;Width&quot;) nDialogWidth = oDialog.getModel.getPropertyValue (&quot;Width&quot;)
oText = oDialog.getControl (&quot;txtBestBefore&quot;) oText = oDialog.getControl (&quot;txtBestHead&quot;)
oText.getModel.setPropertyValue (&quot;Width&quot;, nBeforeWidth) oText.getModel.setPropertyValue (&quot;Width&quot;, nHeadWidth)
oText.setVisible (True) oText.setVisible (True)
oText.setText (sBefore) oText.setText (sHead)
nX = oText.getModel.getPropertyValue (&quot;PositionX&quot;) + nBeforeWidth nX = oText.getModel.getPropertyValue (&quot;PositionX&quot;) + nHeadWidth
mItems = Array ( _ mItems = Array ( _
fnGetResString (&quot;StatAttack&quot;), _ fnGetResString (&quot;StatAttack&quot;), _
@ -356,15 +358,17 @@ Sub subUpdateBestStatAppraisal (oDialog As Object, sAppraisal)
oList.removeItems (0, oList.getItemCount()) oList.removeItems (0, oList.getItemCount())
oList.addItems (mItems, 0) oList.addItems (mItems, 0)
oList.getModel.setPropertyValue (&quot;PositionX&quot;, nX) oList.getModel.setPropertyValue (&quot;PositionX&quot;, nX)
oList.getModel.setPropertyValue (&quot;Width&quot;, _
CInt (fnGetResString (&quot;BestStatWidth&quot;)))
oList.setVisible (True) oList.setVisible (True)
nX = nX + oList.getModel.getPropertyValue (&quot;Width&quot;) nX = nX + oList.getModel.getPropertyValue (&quot;Width&quot;)
nAfterWidth = nDialogWidth - nX - 10 nTailWidth = nDialogWidth - nX - 10
oText = oDialog.getControl (&quot;txtBestAfter&quot;) oText = oDialog.getControl (&quot;txtBestTail&quot;)
oText.getModel.setPropertyValue (&quot;PositionX&quot;, nX) oText.getModel.setPropertyValue (&quot;PositionX&quot;, nX)
oText.getModel.setPropertyValue (&quot;Width&quot;, nAfterWidth) oText.getModel.setPropertyValue (&quot;Width&quot;, nTailWidth)
oText.setVisible (True) oText.setVisible (True)
oText.setText (sAfter) oText.setText (sTail)
oList = oDialog.getControl (&quot;cbxBest2&quot;) oList = oDialog.getControl (&quot;cbxBest2&quot;)
oList.setVisible (False) oList.setVisible (False)

View File

@ -272,11 +272,11 @@
<dlg:img dlg:style-id="0" dlg:id="imgTeamLeader" dlg:tab-index="28" dlg:left="10" dlg:top="110" dlg:width="30" dlg:height="35"/> <dlg:img dlg:style-id="0" dlg:id="imgTeamLeader" dlg:tab-index="28" dlg:left="10" dlg:top="110" dlg:width="30" dlg:height="35"/>
<dlg:text dlg:id="txtLeaderAppraise" dlg:tab-index="27" dlg:left="45" dlg:top="116" dlg:width="210" dlg:height="8"/> <dlg:text dlg:id="txtLeaderAppraise" dlg:tab-index="27" dlg:left="45" dlg:top="116" dlg:width="210" dlg:height="8"/>
<dlg:menulist dlg:id="lstTotal" dlg:tab-index="9" dlg:left="45" dlg:top="129" dlg:width="210" dlg:height="12" dlg:spin="true"/> <dlg:menulist dlg:id="lstTotal" dlg:tab-index="9" dlg:left="45" dlg:top="129" dlg:width="210" dlg:height="12" dlg:spin="true"/>
<dlg:text dlg:id="txtBestBefore" dlg:tab-index="23" dlg:left="45" dlg:top="146" dlg:width="20" dlg:height="8"/> <dlg:text dlg:id="txtBestHead" dlg:tab-index="23" dlg:left="45" dlg:top="146" dlg:width="20" dlg:height="8"/>
<dlg:menulist dlg:id="lstBest" dlg:tab-index="10" dlg:left="65" dlg:top="144" dlg:width="58" dlg:height="12" dlg:spin="true"> <dlg:menulist dlg:id="lstBest" dlg:tab-index="10" dlg:left="65" dlg:top="144" dlg:width="58" dlg:height="12" dlg:spin="true">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subLstBestItemChanged?language=Basic&amp;location=application" script:language="Script"/> <script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subLstBestItemChanged?language=Basic&amp;location=application" script:language="Script"/>
</dlg:menulist> </dlg:menulist>
<dlg:text dlg:id="txtBestAfter" dlg:tab-index="24" dlg:left="110" dlg:top="146" dlg:width="100" dlg:height="8"/> <dlg:text dlg:id="txtBestTail" dlg:tab-index="24" dlg:left="110" dlg:top="146" dlg:width="100" dlg:height="8"/>
<dlg:checkbox dlg:id="cbxBest2" dlg:tab-index="11" dlg:left="45" dlg:top="161" dlg:width="210" dlg:height="8" dlg:checked="false"/> <dlg:checkbox dlg:id="cbxBest2" dlg:tab-index="11" dlg:left="45" dlg:top="161" dlg:width="210" dlg:height="8" dlg:checked="false"/>
<dlg:checkbox dlg:id="cbxBest3" dlg:tab-index="12" dlg:left="45" dlg:top="176" dlg:width="210" dlg:height="8" dlg:checked="false"/> <dlg:checkbox dlg:id="cbxBest3" dlg:tab-index="12" dlg:left="45" dlg:top="176" dlg:width="210" dlg:height="8" dlg:checked="false"/>
<dlg:menulist dlg:id="lstMax" dlg:tab-index="13" dlg:left="45" dlg:top="189" dlg:width="210" dlg:height="12" dlg:spin="true"/> <dlg:menulist dlg:id="lstMax" dlg:tab-index="13" dlg:left="45" dlg:top="189" dlg:width="210" dlg:height="12" dlg:spin="true"/>

View File

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