maptool icon indicating copy to clipboard operation
maptool copied to clipboard

[Bug]: Mouseover on token with undeclared variable in a property on statsheet causes infinite popup dialogs

Open Pmofmalasia opened this issue 1 month ago • 0 comments

Describe the Bug

When a token property references a variable that has not yet been declared and a token with that property is moused over (and that property is shown), popup dialogs appear (near) infinitely requesting to input a value for the missing variable. This often completely locks up MapTool, forcing the user to force quit and lose work. Sometimes you may get lucky by rapidly clicking "cancel" and making the boxes go away fast enough to avoid freezing it.

A couple notes about this:

  • This bug does not occur if the variable is referenced directly by the property (e.g. default value = '[r:fakeVar]'), but if the property references another bit of code that has a non-declared variable, then this bug occurs (e.g. default value = '[r:getProperty("Charisma")]', where the default value for Charisma is '[r:fakeVar]'; alternatively, fakeVar is used in a UDF called by the property)
  • This bug has been around for as long as I've been using the program, for some reason I had it in my head that it's been determined to be not fixable. I didn't see any issues about it, though, so figured I'd create the issue at the very least to document it.

To Reproduce

  1. Create a completely new campaign
  2. Drag a token into it
  3. Edit a property's default value to read [r:fakeVar], and show it on the statsheet
  4. Accept and mouseover the token; the property will just read [r:fakeVar]
  5. Edit the properties again, setting the default value of a separate property shown on the statsheet to '[r:getProperty(String_Name_Step_3_Property)]'
  6. Accept and mouseover the token again; rapidly click the "cancel" button as fast as you can and pray. Or wait for MT to freeze up.

Expected Behaviour

Properties that have variables that are not declared should fail in the manner of step 3 above, similar to any other way that code fails in the stat sheet - just showing the raw code of the property value.

Screenshots

No response

MapTool Info

1.14.3

Desktop

Windows 10

Additional Context

No response

Pmofmalasia avatar May 26 '24 04:05 Pmofmalasia