lambda
lambda copied to clipboard
AbstractSetting: Add "formatter" parameter
This patch adds a new "formatter: (T) -> String" parameter to the AbstractSetting abstract class. This allows for formatter functions to be passed to settings for them to display their value in a more user friendly way :)
A possible usage of this would be to replace the unit parameter, as it simply concatenates the unit string to the setting value, which is a bit misleading IMO.
P.S. This PR also includes an actual usage of this new parameter in the AntiDisconnect module
this is very similar to the unit parameter which is only suffix. yours can be any format. so if you want you can add some default formattings like "x ticks" or "x blocks" and remove unit.