PDA

View Full Version : Tags with variable width



Mephisto
October 1st, 2025, 18:23
Hi there,
I'm looking for some suggestions/ideas to implement "tags" with variable size for a location based hit system in one of my rulesets.

From a data perspective, I have a windowlist with child nodes, containing the data for every hit location (e.g. armor values). For every child note, I would like to have a tag (buttonfield ?) with the location name which the user can hover over to get more details and which can accept drops. The number of child nodes can vary.

For spacing reasons, the tag should be only as wide as is required to hold the name string and they should - ideally - be added programmatically via lua per node and fill a defined space (similar to like a windowlist fills from left to right and then the next line.

A windowlist would probably work just fine for adding and filling the space but I don't have an idea how every window item could have a different width.

Maybe someone has a brilliant idea how to accomplish this? :)

Moon Wizard
October 2nd, 2025, 04:02
There is no built-in support for a list like this; only fixed width list entries are supported. If you really wanted to do something like this, you'd have to build it from scratch.

Regards,
JPG

RosenMcStern
October 3rd, 2025, 14:44
Have a look at my ruleset, it does something vaguely similar, with multiple armour entries upon which you can drop a damage value and have a wound generated if the damage is big enough. Unfortunately, the number of entries is fixed, so it is not exactly what you are looking for. The area list is in the combat tracker, under the defense entry section (the shield icon activates it) and there are also areas for hits that bypass armor or land on the shield.

One of the advantages of having a fixed number of elements is that you can implement dynamic width easily, it is just a call to setAnchor. This is not possible with windowlists.

The fundamental question for you is how you want your list arranged. If the list is arranged vertically, then fixed width is totally unnecessary. If it is arranged horizontally, then a list could not be the best option. With another type of control, similar to tabs, you can have dynamic dimensions. But it is a bit complicate to implement.