Skip to content

Fix for localised string being unhelpful in shape.getProperties()#5923

Merged
cwisniew merged 6 commits intoRPTools:developfrom
bubblobill:shape_function_fix
Mar 17, 2026
Merged

Fix for localised string being unhelpful in shape.getProperties()#5923
cwisniew merged 6 commits intoRPTools:developfrom
bubblobill:shape_function_fix

Conversation

@bubblobill
Copy link
Copy Markdown
Collaborator

@bubblobill bubblobill commented Jan 17, 2026

Identify the Bug or Feature request

fixes #5922
closes #5922

Description of the Change

Problem

Stems from shape.properties() calling toString() on ShapeDrawable
#5922 (comment)

##Fix

  • Created new methods
    • ShapeDrawable.toString(boolean localisation), and
    • AbstractDrawing.toString(boolean localisation)
  • On localisation = FALSE, Zone.Layer.name() is used instead of Zone.Layer.value()
  • Changed ShapeDrawable.toString() & AbstractDrawing.toString() to call toString(true) instead, i.e. defaults to true, leaving previous uses unaffected.

Token used for testing lib_shapeTest.rptok.zip

Possible Drawbacks

none

Documentation Notes

Fixed localisation string issue with shape.properties()

Release Notes

Fixed localisation string issue with shape.properties()


This change is Reviewable

ShapeDrawable and AbstractDrawing.
- On FALSE it returns the Zone.Layer.name() instead of Zone.Layer.value()
@github-actions github-actions bot added the bug label Jan 17, 2026
@bubblobill bubblobill self-assigned this Jan 17, 2026
Copy link
Copy Markdown
Member

@cwisniew cwisniew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its clearer if you create a new function and have

  • toString()
  • toLocalisedString()

Having just a boolean variable makes it harder to follow unless its obvious what the value represents (e.g. if the function is something like setVisible)

@bubblobill
Copy link
Copy Markdown
Collaborator Author

Its clearer if you create a new function and have

  • toString()
  • toLocalisedString()

Having just a boolean variable makes it harder to follow unless its obvious what the value represents (e.g. if the function is something like setVisible)

Well, I could just go through every Enum and remove the override on toString and make sure every UI call specifically called getDisplayName(), but this seemed easier.

@bubblobill
Copy link
Copy Markdown
Collaborator Author

@cwisniew Done now

@cwisniew cwisniew added this pull request to the merge queue Mar 17, 2026
Merged via the queue into RPTools:develop with commit f7c9458 Mar 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: shape.getProperties return depends on UI localization

2 participants