πŸ› οΈString Formatter

IMU provides a string formatter for some configs.

The formatter works with a variable system. Theses variables are encased between {{ and }} . The formatter use different types of variable.


Simple Variables

The simple variables are a simple string which are replaced when the formatter is enabled. For example if we have a variable count which is incremented each tick, we can use it like this : {{count}}


Conditions

The variable system also allow to do conditions inside a string. The condition are represented like this {{?<condition>:<if_true>(|<if_false>)}}

The ? is here to tell the formatter that we are in a condition

The <condition> must be an expression.

The : is a separation after between the condition and the if true value

The <if_true> part is a litteral part that is kept if the expression is true.

The part |<if_false> is an optional part that allow user to give a litteral string if the expression is false.

Expressions

The expressions are simple arithmetic expressions. The available operators are < > = >= <= .

An expression must be represented like this : <variable> <operator> <integer> Variables in expressions can be passed without {{ }}

Example :

Here the expression verify if the tick count is greater or equals to 4

Examples :

Here we return Count is more than 4 if the count variable is more or equals than 4 otherwise we return an empty string

Here we return Count is more than 4 if the count variable is more or equals than 4 otherwise we return Count is less than 4

Last updated