From 66002e1a99ac5b73e8f8f42e8946d9ae35cec6ea Mon Sep 17 00:00:00 2001 From: riverwanderer <58135975+riverwanderer@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:24:05 +0000 Subject: [PATCH 1/3] Suppress boolean bad data on piece pallettes. --- .../main/java/VASSAL/configure/PropertyExpression.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vassal-app/src/main/java/VASSAL/configure/PropertyExpression.java b/vassal-app/src/main/java/VASSAL/configure/PropertyExpression.java index 9b2a6baf46..611b8e5ace 100644 --- a/vassal-app/src/main/java/VASSAL/configure/PropertyExpression.java +++ b/vassal-app/src/main/java/VASSAL/configure/PropertyExpression.java @@ -1,7 +1,9 @@ package VASSAL.configure; import VASSAL.build.BadDataReport; +import VASSAL.build.module.Map; import VASSAL.build.module.properties.PropertySource; +import VASSAL.counters.EditablePiece; import VASSAL.counters.GamePiece; import VASSAL.counters.PieceFilter; import VASSAL.i18n.Resources; @@ -15,7 +17,7 @@ /* * Class encapsulating a Property Match Expression - * A PropertyExpression is it's own PieceFilter. + * A PropertyExpression is its own PieceFilter. */ public class PropertyExpression implements PieceFilter { @@ -120,7 +122,9 @@ public boolean isTrue(PropertySource ps, Auditable owner, AuditTrail audit) { result = expression.evaluate(ps, owner, audit); } catch (ExpressionException e) { - ErrorDialog.dataWarning(new BadDataReport(Resources.getString("Error.expression_error"), + // suppress error report if this is an editable piece on the Piece Palette (where boolean calcs are not supported) + if (!(owner instanceof EditablePiece) || ((EditablePiece) owner).getMap() != null) + ErrorDialog.dataWarning(new BadDataReport(Resources.getString("Error.expression_error"), "Expression=" + getExpression() + ", Error=" + e.getError(), e)); //NON-NLS } return "true".equals(result); //NON-NLS From b32c24d11635bdca91954d6644b083581edb2619 Mon Sep 17 00:00:00 2001 From: riverwanderer <58135975+riverwanderer@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:24:05 +0000 Subject: [PATCH 2/3] Suppress boolean bad data on piece pallettes. --- .../src/main/java/VASSAL/configure/PropertyExpression.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vassal-app/src/main/java/VASSAL/configure/PropertyExpression.java b/vassal-app/src/main/java/VASSAL/configure/PropertyExpression.java index 9b2a6baf46..c1a65940c2 100644 --- a/vassal-app/src/main/java/VASSAL/configure/PropertyExpression.java +++ b/vassal-app/src/main/java/VASSAL/configure/PropertyExpression.java @@ -2,6 +2,7 @@ import VASSAL.build.BadDataReport; import VASSAL.build.module.properties.PropertySource; +import VASSAL.counters.EditablePiece; import VASSAL.counters.GamePiece; import VASSAL.counters.PieceFilter; import VASSAL.i18n.Resources; @@ -15,7 +16,7 @@ /* * Class encapsulating a Property Match Expression - * A PropertyExpression is it's own PieceFilter. + * A PropertyExpression is its own PieceFilter. */ public class PropertyExpression implements PieceFilter { @@ -120,7 +121,9 @@ public boolean isTrue(PropertySource ps, Auditable owner, AuditTrail audit) { result = expression.evaluate(ps, owner, audit); } catch (ExpressionException e) { - ErrorDialog.dataWarning(new BadDataReport(Resources.getString("Error.expression_error"), + // suppress error report if this is an editable piece on the Piece Palette (where boolean calcs are not supported) + if (!(owner instanceof EditablePiece) || ((EditablePiece) owner).getMap() != null) + ErrorDialog.dataWarning(new BadDataReport(Resources.getString("Error.expression_error"), "Expression=" + getExpression() + ", Error=" + e.getError(), e)); //NON-NLS } return "true".equals(result); //NON-NLS From 9fe089d5dcb07aeff19bc04f94021aa6f82e37bd Mon Sep 17 00:00:00 2001 From: riverwanderer <58135975+riverwanderer@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:27:01 +0000 Subject: [PATCH 3/3] Suppress boolean bad data on piece pallettes. --- .../src/main/java/VASSAL/configure/PropertyExpression.java | 1 - 1 file changed, 1 deletion(-) diff --git a/vassal-app/src/main/java/VASSAL/configure/PropertyExpression.java b/vassal-app/src/main/java/VASSAL/configure/PropertyExpression.java index 611b8e5ace..c1a65940c2 100644 --- a/vassal-app/src/main/java/VASSAL/configure/PropertyExpression.java +++ b/vassal-app/src/main/java/VASSAL/configure/PropertyExpression.java @@ -1,7 +1,6 @@ package VASSAL.configure; import VASSAL.build.BadDataReport; -import VASSAL.build.module.Map; import VASSAL.build.module.properties.PropertySource; import VASSAL.counters.EditablePiece; import VASSAL.counters.GamePiece;