RPTools / maptool

Virtual Tabletop for playing roleplaying games with remote players or face to face.
http://rptools.net
GNU Affero General Public License v3.0
801 stars 262 forks source link

[Feature]: Functions for manipulating token bars should be available in JavaScript. #4898

Closed fishface60 closed 2 months ago

fishface60 commented 2 months ago

Describe the Problem

When writing macros for handling HP injury I would like to update other token attributes.

setProperty and setState are bound to javascript and allow me to update HP values and the Dead state, but the bars do not have bindings, requiring work-arounds like returning an object to the parent macro to do it or evaluating a macro from JavaScript.

The Solution you'd like

The addition of a token.setBar function, and probably the rest of the bar functions for completeness.

Alternatives that you've considered.

Continue with my injury javascript function returning an object with the correct values for the bar and call the macros, or call evalMacro from javascript.

Additional Context

No response