< Dice | MacroRegistry
Difference between revisions of "Dice/MacroRegistry/RegisterGlobalMacro"
From DiceRoller Documentation
(Created page with "{{APIdoc|MacroRegistry.RegisterGlobalMacro Method (MacroCallback)}} Registers a callback to the global macro registry. The same callback may be registered more than once. {{n...") |
(No difference)
|
Latest revision as of 19:27, 15 September 2017
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