1 Method annotations
Daniella edited this page 2024-05-31 00:49:23 +02:00

@Trigger(name)

Requires:

  • no args

This specifies that a method should appear as a button in the GUI.

@Description(desc)

Requires:

  • @Trigher

Shows a description for the button when it is hovered.

@KeyBound(name?)

Requires:

  • Either @Trigger or a name must be specified.
  • no args

Allows the user to set a key to run this function. If a name is specified, this is the name of the keybind. Otherwise, the one from a @Trigger on the same field is used.

@Gate(n)

Requires:

  • Marked field n's Type is boolean
  • @KeyBound or @Trigger

Only allows allows running if the specified marked field is true.

If it is false, a key bound to the method will do nothing, and a Trigger/Button for it will be hidden.

@MultiGate(overrideOr?, and?, or?)

Requires:

  • Specified marked fields are all booleans
  • @KeyBound or @Trigger

All arguments are arrays of numeric identifiers for marked fields.

Allows running if any of the following is true:

  • Any value in overrideOr is true
  • No value in and is false and or is empty
  • No value in and is false and any value in or is true

Which can be written like: canRun = any(overrideOr) || (all(and) && (or.isEmpty() || any(or)))

If this canRun is false, a key bound to the method will do nothing, and a Trigger/Button for it will be hidden.