-
Notifications
You must be signed in to change notification settings - Fork 4
Hooks
- ConfigApply
- ConfigChange
- MenuVGUIReady
- PluginDisabled
- PluginEnabled
- PluginLoaded
- PluginReset
- PluginRun
- PluginUndo
- ShutDown
- UserConfigChange
As various events occur within MPR, hooks will be fired to notify other plugins. Perhaps the most useful is ConfigApply.
⚠️ NOTE: At this time, hooks do not take any return values; they only notify of the event happening. ⚠️
Fired when a user clicks the "Apply config" button in a plugin's config window. This is technically more of a config refresh alert, since the config is always saved as the user modifies it.
- id: ID of the plugin where the configuration was applied
Fired whenever any config value on a plugin is changed, by both user input and the function. You probably don't want to rely on this hook for refreshing your plugin if an option was changed, instead use ConfigApply. This is called after UserConfigChange when applicable.
- id: ID of the plugin where the configuration is changed
- key: Key of the changed option
- value: New value
- old: Old value
Fired once on the first DrawOverlay hook, ported for legacy plugins.
When fired, this means pnlMainMenu
exists, so long as the stock main menu is being used.
(Keep in mind this is only fired once, so also check IsValid(pnlMainMenu)
in case your plugin was enabled after the menu was loaded.)
Fired after the manifest's enabled is set to false, but before the unload function is run.
- manifest: Extended manifest
Fired after the manifest's enabled is set to true, but before the plugin is run.
- manifest: Extended manifest
Fired when a plugin has successfully loaded and registered within MPR.
- manifest: Extended manifest
Fired after the user confirms to reset a plugin's config & store, but before it's actually wiped from the database.
- manifest: Extended manifest
Fired before a plugin is executed.
- manifest: Extended manifest
Fired before a plugin's unload function is run if present.
- manifest: Extended manifest
Fired one frame before the game is closed after the user clicks the "Quit" button.
Returning a value WILL NOT prevent the game from closing!
Fired ONLY whenever the user changes a config value, else identical to ConfigChange. You probably don't want to rely on this hook for refreshing your plugin if an option was changed, instead use ConfigApply. This is called before ConfigChange.
- id: ID of the plugin where the configuration is changed
- key: Key of the changed option
- value: New value
- old: Old value