From 72df457f0be61942216e7ae15ffbd86db8c13fd0 Mon Sep 17 00:00:00 2001 From: Mark Benson Date: Sun, 8 Dec 2024 22:25:35 +0000 Subject: [PATCH 1/2] Add performance health warning. Remove Beanshell preference advice as it is not relevant here, except specifically the bit on leading zeros. Generic advice on Beanshell vs Legacy is given in the general section on expressions. --- .../main/readme-referencemanual/ReferenceManual/Label.adoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vassal-doc/src/main/readme-referencemanual/ReferenceManual/Label.adoc b/vassal-doc/src/main/readme-referencemanual/ReferenceManual/Label.adoc index bfd384c521..f6f19482f6 100644 --- a/vassal-doc/src/main/readme-referencemanual/ReferenceManual/Label.adoc +++ b/vassal-doc/src/main/readme-referencemanual/ReferenceManual/Label.adoc @@ -22,9 +22,12 @@ The text of the label can be fixed or specifiable by a player at game time. . Check if the entered label is a $$ Variable Substitution (defined by a string enclosed between $ characters). This allows <> of the piece to be substituted with $..$ notation, as in a <> . If no check is true the entered string is displayed. +**** +**Note!** _Label Text_ will be reevaluated every time a piece bearing the Text Label trait is drawn, which will occur frequently in a typical module whenever such a piece is displayed. Therefore, longer, more convoluted Beanshell expressions (e.g., comparisons, arithmetic, Count/Sums etc.) may affect performance, especially with widespread use. +**** + A known limitation of the evaluation order above is that if you enter a sequence of digits starting with 0s, these will be removed when the string is evaluated as integer. A workaround to this is to enter the same string via a Beanshell expression. For example to display a sequence of 3 zeroes as label text you can use *{"000"}*. -Note that the Beanshell expressions should be preferred to $$ Variable Substitutions. The latter are only available for historical reasons. By enclosing the text within tags, you can use simple HTML format to specify various colors, fonts and sizes. From 51014783abbac9458ba6bd20b3d21f9a70bd04b9 Mon Sep 17 00:00:00 2001 From: Mark Benson Date: Sun, 8 Dec 2024 22:34:25 +0000 Subject: [PATCH 2/2] Slight text mod. --- .../src/main/readme-referencemanual/ReferenceManual/Label.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vassal-doc/src/main/readme-referencemanual/ReferenceManual/Label.adoc b/vassal-doc/src/main/readme-referencemanual/ReferenceManual/Label.adoc index f6f19482f6..16ea8a1b05 100644 --- a/vassal-doc/src/main/readme-referencemanual/ReferenceManual/Label.adoc +++ b/vassal-doc/src/main/readme-referencemanual/ReferenceManual/Label.adoc @@ -23,7 +23,7 @@ The text of the label can be fixed or specifiable by a player at game time. . If no check is true the entered string is displayed. **** -**Note!** _Label Text_ will be reevaluated every time a piece bearing the Text Label trait is drawn, which will occur frequently in a typical module whenever such a piece is displayed. Therefore, longer, more convoluted Beanshell expressions (e.g., comparisons, arithmetic, Count/Sums etc.) may affect performance, especially with widespread use. +**Note!** _Label Text_ will be reevaluated every time a piece bearing the Text Label trait is drawn, which will occur frequently in a typical module whenever such a piece is on display. Therefore, longer, more convoluted Beanshell expressions (e.g., comparisons, arithmetic, Count/Sums etc.) may affect performance, especially with widespread use. **** A known limitation of the evaluation order above is that if you enter a sequence of digits starting with 0s, these will be removed when the string is evaluated as integer.