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:
		| @@ -90,9 +90,9 @@ Function fnAskParam As aFindIVParam | ||||
| 	DialogLibraries.loadLibrary "PokemonGoIV" | ||||
| 	oDialog = CreateUnoDialog (DialogLibraries.PokemonGoIV.DlgMain) | ||||
| 	oDialog.getControl ("lstTotal").setVisible (False) | ||||
| 	oDialog.getControl ("txtBestBefore").setVisible (False) | ||||
| 	oDialog.getControl ("txtBestHead").setVisible (False) | ||||
| 	oDialog.getControl ("lstBest").setVisible (False) | ||||
| 	oDialog.getControl ("txtBestAfter").setVisible (False) | ||||
| 	oDialog.getControl ("txtBestTail").setVisible (False) | ||||
| 	oDialog.getControl ("cbxBest2").setVisible (False) | ||||
| 	oDialog.getControl ("cbxBest3").setVisible (False) | ||||
| 	oDialog.getControl ("lstMax").setVisible (False) | ||||
| @@ -237,7 +237,8 @@ Sub subRdoTeamValorItemChanged (oEvent As object) | ||||
| 	 | ||||
| 	' Updates the text of the best stat appraisal. | ||||
| 	subUpdateBestStatAppraisal (oDialog, _ | ||||
| 		fnGetResString ("AppraisalValorBest")) | ||||
| 		fnGetResString ("AppraisalValorBest"), _ | ||||
| 		CInt (fnGetResString ("AppraisalValorBestHeadWidth"))) | ||||
| 	 | ||||
| 	mItems = Array ( _ | ||||
| 		fnGetResString ("AppraisalValorMax15"), _ | ||||
| @@ -274,7 +275,8 @@ Sub subRdoTeamMysticItemChanged (oEvent As object) | ||||
| 	 | ||||
| 	' Updates the text of the best stat appraisal. | ||||
| 	subUpdateBestStatAppraisal (oDialog, _ | ||||
| 		fnGetResString ("AppraisalMysticBest")) | ||||
| 		fnGetResString ("AppraisalMysticBest"), _ | ||||
| 		CInt (fnGetResString ("AppraisalMysticBestHeadWidth"))) | ||||
| 	 | ||||
| 	mItems = Array ( _ | ||||
| 		fnGetResString ("AppraisalMysticMax15"), _ | ||||
| @@ -311,7 +313,8 @@ Sub subRdoTeamInstinctItemChanged (oEvent As object) | ||||
| 	 | ||||
| 	' Updates the text of the best stat appraisal. | ||||
| 	subUpdateBestStatAppraisal (oDialog, _ | ||||
| 		fnGetResString ("AppraisalInstinctBest")) | ||||
| 		fnGetResString ("AppraisalInstinctBest"), _ | ||||
| 		CInt (fnGetResString ("AppraisalInstinctBestHeadWidth"))) | ||||
| 	 | ||||
| 	mItems = Array ( _ | ||||
| 		fnGetResString ("AppraisalInstinctMax15"), _ | ||||
| @@ -325,26 +328,25 @@ Sub subRdoTeamInstinctItemChanged (oEvent As object) | ||||
| End Sub | ||||
|  | ||||
| ' 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 sBefore As String, nBeforeWidth As Integer | ||||
| 	Dim sAfter As String, nAfterWidth As Integer | ||||
| 	Dim sHead As String, sTail As String, nTailWidth As Integer | ||||
| 	Dim nDialogWidth As Integer | ||||
| 	Dim nPos As Integer | ||||
| 	Dim mItems () As String | ||||
| 	 | ||||
| 	nPos = InStr (sAppraisal, "[Stat]") | ||||
| 	sBefore = Left (sAppraisal, nPos - 1) | ||||
| 	nBeforeWidth = CInt (Len (sBefore) * 2.8) | ||||
| 	sAfter = Right (sAppraisal, _ | ||||
| 	sHead = Left (sAppraisal, nPos - 1) | ||||
| 	sTail = Right (sAppraisal, _ | ||||
| 	    Len (sAppraisal) - nPos - Len ("[Stat]") + 1) | ||||
| 	nDialogWidth = oDialog.getModel.getPropertyValue ("Width") | ||||
| 	 | ||||
| 	oText = oDialog.getControl ("txtBestBefore") | ||||
| 	oText.getModel.setPropertyValue ("Width", nBeforeWidth) | ||||
| 	oText = oDialog.getControl ("txtBestHead") | ||||
| 	oText.getModel.setPropertyValue ("Width", nHeadWidth) | ||||
| 	oText.setVisible (True) | ||||
| 	oText.setText (sBefore) | ||||
| 	nX = oText.getModel.getPropertyValue ("PositionX") + nBeforeWidth | ||||
| 	oText.setText (sHead) | ||||
| 	nX = oText.getModel.getPropertyValue ("PositionX") + nHeadWidth | ||||
| 	 | ||||
| 	mItems = Array ( _ | ||||
| 		fnGetResString ("StatAttack"), _ | ||||
| @@ -354,15 +356,17 @@ Sub subUpdateBestStatAppraisal (oDialog As Object, sAppraisal) | ||||
| 	oList.removeItems (0, oList.getItemCount()) | ||||
| 	oList.addItems (mItems, 0) | ||||
| 	oList.getModel.setPropertyValue ("PositionX", nX) | ||||
| 	oList.getModel.setPropertyValue ("Width", _ | ||||
| 	    CInt (fnGetResString ("BestStatWidth"))) | ||||
| 	oList.setVisible (True) | ||||
| 	nX = nX + oList.getModel.getPropertyValue ("Width") | ||||
| 	 | ||||
| 	nAfterWidth = nDialogWidth - nX - 10 | ||||
| 	oText = oDialog.getControl ("txtBestAfter") | ||||
| 	nTailWidth = nDialogWidth - nX - 10 | ||||
| 	oText = oDialog.getControl ("txtBestTail") | ||||
| 	oText.getModel.setPropertyValue ("PositionX", nX) | ||||
| 	oText.getModel.setPropertyValue ("Width", nAfterWidth) | ||||
| 	oText.getModel.setPropertyValue ("Width", nTailWidth) | ||||
| 	oText.setVisible (True) | ||||
| 	oText.setText (sAfter) | ||||
| 	oText.setText (sTail) | ||||
| 	 | ||||
| 	oList = oDialog.getControl ("cbxBest2") | ||||
| 	oList.setVisible (False) | ||||
|   | ||||
| @@ -73,6 +73,12 @@ | ||||
| 				<value xml:lang="de">KP</value> | ||||
| 			</prop> | ||||
| 		</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) --> | ||||
| 		<node oor:name="AppraiseFromCandela" oor:op="replace">		 | ||||
| 			<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> | ||||
| 			</prop> | ||||
| 		</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">		 | ||||
| 			<prop oor:name="Text" oor:type="xs:string" oor:localized="true">	 | ||||
| 				<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> | ||||
| 			</prop> | ||||
| 		</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">		 | ||||
| 			<prop oor:name="Text" oor:type="xs:string" oor:localized="true">	 | ||||
| 				<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> | ||||
| 			</prop> | ||||
| 		</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">		 | ||||
| 			<prop oor:name="Text" oor:type="xs:string" oor:localized="true">	 | ||||
| 				<value>Its [Stat] is great, too!</value> | ||||
|   | ||||
| @@ -92,9 +92,9 @@ Function fnAskParam As aFindIVParam | ||||
| 	DialogLibraries.loadLibrary "PokemonGoIV" | ||||
| 	oDialog = CreateUnoDialog (DialogLibraries.PokemonGoIV.DlgMain) | ||||
| 	oDialog.getControl ("lstTotal").setVisible (False) | ||||
| 	oDialog.getControl ("txtBestBefore").setVisible (False) | ||||
| 	oDialog.getControl ("txtBestHead").setVisible (False) | ||||
| 	oDialog.getControl ("lstBest").setVisible (False) | ||||
| 	oDialog.getControl ("txtBestAfter").setVisible (False) | ||||
| 	oDialog.getControl ("txtBestTail").setVisible (False) | ||||
| 	oDialog.getControl ("cbxBest2").setVisible (False) | ||||
| 	oDialog.getControl ("cbxBest3").setVisible (False) | ||||
| 	oDialog.getControl ("lstMax").setVisible (False) | ||||
| @@ -239,7 +239,8 @@ Sub subRdoTeamValorItemChanged (oEvent As object) | ||||
| 	 | ||||
| 	' Updates the text of the best stat appraisal. | ||||
| 	subUpdateBestStatAppraisal (oDialog, _ | ||||
| 		fnGetResString ("AppraisalValorBest")) | ||||
| 		fnGetResString ("AppraisalValorBest"), _ | ||||
| 		CInt (fnGetResString ("AppraisalValorBestHeadWidth"))) | ||||
| 	 | ||||
| 	mItems = Array ( _ | ||||
| 		fnGetResString ("AppraisalValorMax15"), _ | ||||
| @@ -276,7 +277,8 @@ Sub subRdoTeamMysticItemChanged (oEvent As object) | ||||
| 	 | ||||
| 	' Updates the text of the best stat appraisal. | ||||
| 	subUpdateBestStatAppraisal (oDialog, _ | ||||
| 		fnGetResString ("AppraisalMysticBest")) | ||||
| 		fnGetResString ("AppraisalMysticBest"), _ | ||||
| 		CInt (fnGetResString ("AppraisalMysticBestHeadWidth"))) | ||||
| 	 | ||||
| 	mItems = Array ( _ | ||||
| 		fnGetResString ("AppraisalMysticMax15"), _ | ||||
| @@ -313,7 +315,8 @@ Sub subRdoTeamInstinctItemChanged (oEvent As object) | ||||
| 	 | ||||
| 	' Updates the text of the best stat appraisal. | ||||
| 	subUpdateBestStatAppraisal (oDialog, _ | ||||
| 		fnGetResString ("AppraisalInstinctBest")) | ||||
| 		fnGetResString ("AppraisalInstinctBest"), _ | ||||
| 		CInt (fnGetResString ("AppraisalInstinctBestHeadWidth"))) | ||||
| 	 | ||||
| 	mItems = Array ( _ | ||||
| 		fnGetResString ("AppraisalInstinctMax15"), _ | ||||
| @@ -327,26 +330,25 @@ Sub subRdoTeamInstinctItemChanged (oEvent As object) | ||||
| End Sub | ||||
|  | ||||
| ' 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 sBefore As String, nBeforeWidth As Integer | ||||
| 	Dim sAfter As String, nAfterWidth As Integer | ||||
| 	Dim sHead As String, sTail As String, nTailWidth As Integer | ||||
| 	Dim nDialogWidth As Integer | ||||
| 	Dim nPos As Integer | ||||
| 	Dim mItems () As String | ||||
| 	 | ||||
| 	nPos = InStr (sAppraisal, "[Stat]") | ||||
| 	sBefore = Left (sAppraisal, nPos - 1) | ||||
| 	nBeforeWidth = CInt (Len (sBefore) * 2.8) | ||||
| 	sAfter = Right (sAppraisal, _ | ||||
| 	sHead = Left (sAppraisal, nPos - 1) | ||||
| 	sTail = Right (sAppraisal, _ | ||||
| 	    Len (sAppraisal) - nPos - Len ("[Stat]") + 1) | ||||
| 	nDialogWidth = oDialog.getModel.getPropertyValue ("Width") | ||||
| 	 | ||||
| 	oText = oDialog.getControl ("txtBestBefore") | ||||
| 	oText.getModel.setPropertyValue ("Width", nBeforeWidth) | ||||
| 	oText = oDialog.getControl ("txtBestHead") | ||||
| 	oText.getModel.setPropertyValue ("Width", nHeadWidth) | ||||
| 	oText.setVisible (True) | ||||
| 	oText.setText (sBefore) | ||||
| 	nX = oText.getModel.getPropertyValue ("PositionX") + nBeforeWidth | ||||
| 	oText.setText (sHead) | ||||
| 	nX = oText.getModel.getPropertyValue ("PositionX") + nHeadWidth | ||||
| 	 | ||||
| 	mItems = Array ( _ | ||||
| 		fnGetResString ("StatAttack"), _ | ||||
| @@ -356,15 +358,17 @@ Sub subUpdateBestStatAppraisal (oDialog As Object, sAppraisal) | ||||
| 	oList.removeItems (0, oList.getItemCount()) | ||||
| 	oList.addItems (mItems, 0) | ||||
| 	oList.getModel.setPropertyValue ("PositionX", nX) | ||||
| 	oList.getModel.setPropertyValue ("Width", _ | ||||
| 	    CInt (fnGetResString ("BestStatWidth"))) | ||||
| 	oList.setVisible (True) | ||||
| 	nX = nX + oList.getModel.getPropertyValue ("Width") | ||||
| 	 | ||||
| 	nAfterWidth = nDialogWidth - nX - 10 | ||||
| 	oText = oDialog.getControl ("txtBestAfter") | ||||
| 	nTailWidth = nDialogWidth - nX - 10 | ||||
| 	oText = oDialog.getControl ("txtBestTail") | ||||
| 	oText.getModel.setPropertyValue ("PositionX", nX) | ||||
| 	oText.getModel.setPropertyValue ("Width", nAfterWidth) | ||||
| 	oText.getModel.setPropertyValue ("Width", nTailWidth) | ||||
| 	oText.setVisible (True) | ||||
| 	oText.setText (sAfter) | ||||
| 	oText.setText (sTail) | ||||
| 	 | ||||
| 	oList = oDialog.getControl ("cbxBest2") | ||||
| 	oList.setVisible (False) | ||||
|   | ||||
| @@ -272,15 +272,15 @@ | ||||
|   <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: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"> | ||||
|    <script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:PokemonGoIV.0Main.subLstBestItemChanged?language=Basic&location=application" script:language="Script"/> | ||||
|   </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="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:button dlg:id="btnOK" dlg:tab-index="14" dlg:disabled="true" dlg:left="45" dlg:top="215" dlg:width="60" dlg:height="15" dlg:default="true" dlg:button-type="ok"/> | ||||
|   <dlg:button dlg:id="btnCancel" dlg:tab-index="15" dlg:left="145" dlg:top="215" dlg:width="60" dlg:height="15" dlg:button-type="cancel"/> | ||||
|  </dlg:bulletinboard> | ||||
| </dlg:window> | ||||
| </dlg:window> | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| PokemonGoIV - 寶可夢 GO IV 計算機 | ||||
| 版權所有 (c) 2016 依瑪貓 | ||||
| 版權所有 (c) 2016-2017 依瑪貓 | ||||
|  | ||||
| 計算寶可夢的 IV 值。 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user