FancyMenu [Fabric] [MOVED TO NEW PROJECT]

FancyMenu [Fabric] [MOVED TO NEW PROJECT]

17M Downloads

Some extra placeholders

Bebrich opened this issue · 7 comments

commented
  • 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.
commented

Please don't combine multiple issues/requests in one issue, thank you very much.

commented

Sorry mate, just thought it would make sense to group these, will make separate issues next time

commented

How exactly would the switch case placeholder work?

commented

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.

commented

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.

commented

You are the man honestly, didnt think you'd implement these so fast.

commented

Fixed/Added in FancyMenu v3.4.0!