From 21e40b69009d284a1b0e118118a9eb050fedcd49 Mon Sep 17 00:00:00 2001 From: uniboi Date: Sun, 6 Oct 2024 16:45:25 +0200 Subject: [PATCH] syntax fixes --- docs/Modding/plugins/index.md | 2 +- docs/Modding/plugins/interfaces.md | 6 +++- docs/Modding/plugins/required-interfaces.md | 31 +++++++++------------ 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/docs/Modding/plugins/index.md b/docs/Modding/plugins/index.md index 3f2f8a33..ec59a760 100644 --- a/docs/Modding/plugins/index.md +++ b/docs/Modding/plugins/index.md @@ -56,7 +56,7 @@ Otherwise are the steps basically the same everywhere else. 3. Launch `NorthstarLauncher.exe` with a debugger or attach a debugger to a running process -4. Load debug symbols of your plugin(s) (`myplugin.pdb`) in the debugger +4. Load debug symbols of your plugin(s) (for example `myplugin.pdb`) in the debugger That's it. diff --git a/docs/Modding/plugins/interfaces.md b/docs/Modding/plugins/interfaces.md index 9ad1be2c..7c030605 100644 --- a/docs/Modding/plugins/interfaces.md +++ b/docs/Modding/plugins/interfaces.md @@ -26,6 +26,10 @@ Because interface instances are C++ class instances that extend a virtual class, ### VTables +!!! note + + Methods interfaces are always documented in the order they appear in the vtable. + A vtable is a list of pointers to methods of that interface. The first parameter of these methods is always a pointer to the instance. In C++ this parameter is passed implicitly. @@ -151,4 +155,4 @@ Now we would call this interface `ILog002` because it's the second iteration of In practice this means that you only need to expose the newest version of an interface. - It is expected of [CreateInterface](#createinterface) to return an instance, even if only a newer version of that interface is exposed. \ No newline at end of file + It is expected of [CreateInterface](#createinterface) to return an instance, even if only a newer version of that interface is exposed. diff --git a/docs/Modding/plugins/required-interfaces.md b/docs/Modding/plugins/required-interfaces.md index 1091fe47..7c15fd81 100644 --- a/docs/Modding/plugins/required-interfaces.md +++ b/docs/Modding/plugins/required-interfaces.md @@ -12,7 +12,9 @@ Some interfaces are required to be exposed by every plugin. -# IPluginId +Plugins without all of these interfaces will be unloaded immediately. + +## IPluginId !!! note @@ -22,11 +24,11 @@ The IPluginId provides information about the plugin itself, like the name and wh !!! cpp-class "IPluginId" - !!! cpp-function "[offset 0] char* GetString(PluginString id)" + !!! cpp-function "char* GetString(PluginString id)" Returns a string associated with the id, or `0` if the id is unknown. - !!! cpp-function "[offset 8] int64_t GetField(PluginField id)" + !!! cpp-function "int64_t GetField(PluginField id)" Returns a number associated with the id, or `0` if the id is unknown. @@ -36,20 +38,14 @@ The IPluginId provides information about the plugin itself, like the name and wh !!! cpp-member "NAME = 0" - [REQUIRED] - The name of the plugin !!! cpp-member "LOG_NAME = 1" - [REQUIRED] - The prefix to use for logs in northstar. Use 8 characters to align with northstar prefixes. !!! cpp-member "DEPENDENCY_NAME = 1" - [REQUIRED] - For every loaded plugin a squirrel global constant is registered with this value. Has to be a valid squirrel identifier. The constant can be used to control when a script is compiled and can be used in the "RunOn" field of the mod.json or in a script directly @@ -68,8 +64,6 @@ The IPluginId provides information about the plugin itself, like the name and wh !!! cpp-member "CONTEXT = 0" - [REQUIRED] - A bitfield used to determine if the plugin should loaded in the current context. - DEDICATED: 0x1 @@ -80,26 +74,27 @@ The IPluginId provides information about the plugin itself, like the name and wh Keep the plugin loaded on dedicated northstar clients - !! cpp-member "COLOR = 1" - - [OPTIONAL] + !!! cpp-member "COLOR = 1" Determines the color used for the log prefix of the plugin. + If all channels are 0, Northstar will use a default color. + - [bits 0-8]: RED - [bits 8-16]: BLUE - [bits 16-24]: GREEN -# IPluginCallbacks - -For some commonly used events northstar provides callbacks. +## IPluginCallbacks !!! note Current latest version: `IPluginCallbacks001` + +For some commonly used events northstar provides callbacks. + !!! cpp-class "IPluginCallbacks" !!! cpp-function "void Init(HMODULE northstarModule, const PluginNorthstarData* initData, bool reloaded)" @@ -138,4 +133,4 @@ For some commonly used events northstar provides callbacks. !!! cpp-member "HMODULE pluginHandle" - The handle of the initializing plugin \ No newline at end of file + The handle of the initializing plugin