Skip to content

Commit

Permalink
syntax fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
uniboi committed Oct 6, 2024
1 parent 8c19ee2 commit 21e40b6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/Modding/plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 5 additions & 1 deletion docs/Modding/plugins/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
It is expected of [CreateInterface](#createinterface) to return an instance, even if only a newer version of that interface is exposed.
31 changes: 13 additions & 18 deletions docs/Modding/plugins/required-interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)"
Expand Down Expand Up @@ -138,4 +133,4 @@ For some commonly used events northstar provides callbacks.

!!! cpp-member "HMODULE pluginHandle"

The handle of the initializing plugin
The handle of the initializing plugin

0 comments on commit 21e40b6

Please sign in to comment.