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
787 stars 259 forks source link

[Bug]: Macro sort prefix is causing group duplication or incorrect group sorting in the Selected and Impersonated windows #4852

Open Baaaaaz opened 2 months ago

Baaaaaz commented 2 months ago

Describe the Bug

Setting a macro sort prefix to a certain value when you have certain named macro groups seems to also sort the macro groups which can lead to macro groups either being duplicated and/or displayed out of sort order in the Selected and Impersonate windows.

To Reproduce

  1. Create a new token.
  2. Add three macros, labelled 1, 2, 3
  3. Set macros 1 and 2 to be Macro Group A and macro 3 into Macro Group A C
  4. Set all three macros to have a sort prefix of 1
  5. Observe token macros and macro groups in the Selected window. 3 macros in 2 groups. All sorted nicely (both tokens and groups) and all looks good.
  6. Now set macro 1 to have a sort prefix of D. (e.g. > the second letter of the Macro Group A C. Macro Group A now appears twice in the Selected and Impersonated windows, first group A has macro 2, then group A C with macro 3, and then and the second group A has macro 1.
  7. Set macro 2 to have a sort prefix of C. (e.g. >= the second letter of the Macro Group A C. Macro group A C now appears incorrectly listed before macro group A.

Expected Behaviour

A macro sort prefix should just sort the macro within its macro group and should not lead to the display of duplicate macro groups nor incorrect sorting of groups in the Selected and Impersonated windows.

Screenshots

Step 5: All good!
image

Step 6: All not good! Group A now appears twice in the Selected window (same for Impersonated window) image

Note that token context menu item is behaving and not showing duplicated group A. image

Step 7: Group A C sorted before group A in the Selected window (same for Impersonated window) image

MapTool Info

1.14.3

Desktop

Windows 11

Additional Context

No response