MSUTeam / MSU

Modding Standards and Utilities for Battle Brothers
22 stars 4 forks source link

[REQUEST] Optionally define a unit to be displayed behind ranged-setting #242

Open Darxo opened 1 year ago

Darxo commented 1 year ago

Is your feature request related to a problem? Please describe. It is not always clear what unit a ranged setting is in. A Threshold could be percentage based or absolute and currently the way to convey that information is via the tooltip.

Describe the solution you'd like Implement a function to set a custom unit for a ranged setting. function setUnit( _string ) If a setting has a unit then that unit is displayed behind the current ranged value while in the options menue.

Typical units would be %, s (seconds), h (hours), d (days). image

This is purely a minor visual feature for modders to use.

Enduriel commented 1 year ago

percentages will be hopefully unnecessary in 1.2 since floats will finally work then (so you can use those instead), but the other points are fair

LordMidas commented 1 year ago

What about the modder just writes the unit as an appendage to the setting name when creating the setting? E.g. Overlay Size (%), Blood Amount (ml). Would that look ugly or would it be ok? Because in this case no new handling will need to be added.

Darxo commented 1 year ago

percentages will be hopefully unnecessary in 1.2 since floats will finally work then (so you can use those instead), but the other points are fair

I haven't even tried using floats here. But that was more because I feel like presenting a range of 0% to 100% to the user is more natural than 0.0 to 1.0