Skip to content

Toggling bar visibility resets the bar #2326

@jfranciscoap

Description

@jfranciscoap

Describe the bug
When using the bars in tokens, if you hide the bar it resets the value to 100%. I assume this is undesirable, as the visibility of the bar should be unrelated to its value.

To Reproduce
Steps to reproduce the behavior:

  1. Double click a token to open the edit window and go to State
  2. At the bottom of the page choose any bar (e.g. "Health") and lower its value below 100% (or pick one that is already below 100%), then click the "Hide"checkbox.
  3. Click "OK" to confirm the edit.
  4. Open the token editor once again and the bar will have been reset to 100%.

The same happens when using the setBarVisible() function.

Expected behavior
I would expect the bar to become invisible (which it does), but the value of the bar not be altered. If you are, for instance, toggling show/hide of a health bar using setBarVisible("Health", 1-isBarVisible("Health")) every time the bar pops back up it's at 100%. The current workaround is to call the macro that sets the bar's value in the first place, but it doesn't seem like that would be the expected behavior.

Screenshots
N/A

MapTool Info

  • Version: 1.7.0?
  • Install: New

Desktop (please complete the following information):

  • OS: Windows
  • Version 10

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdocumentation neededMissing, out-of-date or bad documentationgood first issueA good issue for people wanting to contribute to start withmacro changesThis issue adds or changes macro functions. Extra work is required (testing, wiki, code editor)up for grabsMinimal context and are well-suited for new contributors

    Type

    Projects

    Status

    Awaiting-Review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions