< Dice | MacroRegistry
MacroRegistry.RegisterGlobalMacro Method (MacroCallback)
From DiceRoller Documentation
Registers a callback to the global macro registry. The same callback may be registered more than once.
- Namespace: Dice
- Assembly: DiceRoller (in DiceRoller.dll)
Syntax
public void RegisterGlobalMacro(
MacroCallback callback
)
Parameters
- callback
- Type: Dice.MacroCallback
- The method to be called whenever the macro is called in a dice expression.
Remarks
This registers a new global callback macro. The same callback can be registered multiple times; it is called as many times as it is registered. For example, registering a callback twice means that it will be called twice on each macro. The RemoveGlobal method can unregister all instances of a callback. Global macros are executed on each macro request, after all name-specific callbacks have fired. The exact order of evaluation is as follows:
- Name-specific macro callback on the RollData
- Name-specific macro callback on the RollerConfig (only if no name-specific RollData macros existed)
- Global callbacks on the RollData
- Global callbacks on the RollerConfig