![FancyMenu [Fabric] [MOVED TO NEW PROJECT]](https://media.forgecdn.net/avatars/thumbnails/310/137/256/256/637397690731730986.png)
Some extra placeholders
Bebrich opened this issue · 7 comments
- Ceil, Floor, Round functions to turn decimals into integers
- Sign function that gives the sign of a number
- A switch case placeholder, so that you can drive stuff like sources without bulky condition logic, especially usefull with conjunction with the sign placeholder.
Please don't combine multiple issues/requests in one issue, thank you very much.
Sorry mate, just thought it would make sense to group these, will make separate issues next time
Like that:
{"placeholder":"switch_case","values":{"value":"1","cases":"1:first,2:second,3:third","default":"none"}}
?
This would check the input value and return the correct case depending on the input or a default value if nothing matches.
I originally thought it would make more if it were formatted like a dictionary, like:
{"placeholder":"switch_case","values":{"value":"1","cases":{"eat":"first.png", "game":"second.png", "sleep":"third.fma", "": ""},"default":"first.png"}}
But that kinda falls out of the unwritten placeholder convention of not going higher than 2 nesting, and only really serves to bulk the expression up, so I dig this string way of formatting switch cases in your example.