-
Notifications
You must be signed in to change notification settings - Fork 91
Creating modules
A few basic events are included in SUF by default to make it easier for modules to be written, in order to get module events you first have to register your module with SUF, you do that using ShadowUF:RegisterModule:
Arg | Type | Description |
module | table | The table that contains all of your functions/events for the module. |
key | string | The used to identify the module, this should be the same as your configuration key if you include the name field. |
name | string/nil | Optional, if you’re registering this as a configuration then this is the text that shows up in the visibility panel. |
isBar | true/false/nil | Optional, indicates that this module includes a bar inside the unit frames, and needs to be positioned/sized. |
If your module includes functionality that should always be enabled, then you do not need to pass the name or isBar options. The key you pass will be used as your configuration key inside the units table, and will be checked against things such as visibility and if it’s enabled or not.
An example of how you would implement a fader module that fades the unit frames to set alpha when out of combat, another alpha when in combat, that could be toggled per unit can be found at Fader module example (Configuration screenshot) this also includes examples on Module events for more information on configuration see Module configuration and for general information on units see Unit frame functions and fields