Plugin callbacks
These are the functions that will be called for each plugin, if the plugin exists.
void Main()- Main entry point. Yieldable.
void Render()- Render function called every frame.
void RenderInterface()- Render function called every frame intended for
UI.
- Render function called every frame intended for
void RenderMenu()- Render function called every frame intended only for menu items in
UI.
- Render function called every frame intended only for menu items in
void RenderMenuMain()- Render function called every frame intended only for menu items in the main menu of the
UI.
- Render function called every frame intended only for menu items in the main menu of the
void RenderSettings()void RenderEarly()- Same as
Render(), but called before every other plugin's (regular) rendering functions. It's unlikely you will ever need to use this callback. This is primarily used by theCameradependency to ensure a proper state before every other plugin uses its data.
- Same as
void Update(float dt)- Called every frame.
dtis the delta time (milliseconds since last frame).
- Called every frame.
void OnDisabled()- Called when the plugin is disabled from the settings, the menu or programatically via the
MetaAPI.
- Called when the plugin is disabled from the settings, the menu or programatically via the
void OnEnabled()- Called when the plugin is enabled from the settings, the menu or programatically via the
MetaAPI.
- Called when the plugin is enabled from the settings, the menu or programatically via the
void OnDestroyed()- Called when the plugin is unloaded and completely removed from memory.
void OnSettingsChanged()- Called when a setting in the settings panel was changed.
void OnSettingsSave(Settings::Section& section)- Called when the settings for the plugin are being saved. This usually happens when the plugin gets reloaded (which includes shutting down the game or Openplanet as well as plugin reloading), when the user saves the Openplanet settings manually by closing the settings window, or when another plugin calls
Meta::SaveSettings().
- Called when the settings for the plugin are being saved. This usually happens when the plugin gets reloaded (which includes shutting down the game or Openplanet as well as plugin reloading), when the user saves the Openplanet settings manually by closing the settings window, or when another plugin calls
void OnSettingsLoad(Settings::Section& section)- Called when the settings for the plugin are being loaded.
void OnKeyPress(bool down, VirtualKey key)UI::InputBlocking OnKeyPress(bool down, VirtualKey key)- Called whenever a key is pressed on the keyboard. See the documentation for the
VirtualKeyenum.
- Called whenever a key is pressed on the keyboard. See the documentation for the
void OnMouseButton(bool down, int button, int x, int y)UI::InputBlocking OnMouseButton(bool down, int button, int x, int y)- Called whenever a mouse button is pressed.
xandyare the viewport coordinates.
- Called whenever a mouse button is pressed.
void OnMouseMove(int x, int y)- Called whenever the mouse moves.
xandyare the viewport coordinates.
- Called whenever the mouse moves.
void OnMouseWheel(int x, int y)UI::InputBlocking OnMouseWheel(int x, int y)- Called whenever the mouse wheel is scrolled.
xandyare the scroll delta values.
- Called whenever the mouse wheel is scrolled.
void OnLoadCallback(CMwNod@ nod)- Called when a Nod is loaded from a file. You have to call
RegisterLoadCallbackfirst before this is called. This callback is meant as an early callback for a loaded nod. If you're not sure whether you need an early callback and you can avoid using this callback, then avoid using this function.
- Called when a Nod is loaded from a file. You have to call