maptool icon indicating copy to clipboard operation
maptool copied to clipboard

[Feature]: Initiative sort order method improvements (case-insensitivity and strings with leading numbers)

Open Baaaaaz opened this issue 6 months ago • 1 comments

Describe the Problem

Currently initiative default sorting method sorts by numbers, then case-sensitive strings, then nulls.

However if you have a string that starts with a number the resulting sorted initiative can look odd. Similarly if you have just strings and a mixture of upper and lower cases, the resulting sorting can look odd.

The Solution you'd like

If the initiative value is a string and starts with a number (integer or double), treat it as a number for initiative sorting purposes.

If the initiative value is a string and does not start with a number, make the sort case-insensitive.

This would improve the utility of the Initiative value held for each token.

Alternatives that you've considered.

Provide different sorting options that a GM could pick from the Initiative Panel

  1. Default = Current (Numbers, Case-sensitive Strings, Nulls)
  2. Numbers + Strings starting with Numbers as Numbers, String not starting with Numbers as Strings, Nulls
  3. Case-Insensitive strings

Additional Context

Example of a default sorted initiative with a confusing (well to me) order:

Image

Baaaaaz avatar Jun 21 '25 14:06 Baaaaaz

Didn't even know that initiative could be a string.

FullBleed avatar Jun 22 '25 01:06 FullBleed