Expand description
Modules§
- bind
- Runtime for typed bindings generated by
oxidizer --bindgen ksa.rs. - imgui
- Direct calls into KSA’s own ImGui library (its plain C exports, the ones the game itself calls), so mods share the game’s ImGui context.
Only valid inside
Mod::gui(and the menu functions insideMod::menu). Like Dear ImGui: always callendafterbegin, andend_childafterbegin_child.
Macros§
- oxidizer_
mod - Exports the C entry points the loader looks for.
Structs§
- Api
- Function table shared by loader, bridge and mods. Field order must match
bridge/Bridge.cs. - ModStatus
- One Oxidizer mod, as Mods > Oxidizer shows it.
- Obj
- Owned reference to a .NET object (freed on drop).
Constants§
- API_
VERSION - ABI version of
Apiand the mod exports. Bump when the table grows or changes; the loader runs mods built for its version or an older one, and refuses newer ones. Version 2 added hook results, keys, typed-binding calls and 64-bit integers. Version 3 added reading the log and mod status, and running Rhai code. Version 4 addedMod::loaded.
Traits§
- Mod
- Implement and register with
oxidizer_mod!.
Functions§
- api
- config_
path - Where a mod keeps its settings:
<game documents>/oxidizer/<mod_id>.toml(its folder is created). It lives outside the mod folder so updating the mod doesn’t lose it; read and write it with your own TOML code. - hook
- Patch with a plain fn(instance, args) -> run_original. Return value is ignored for postfixes.
- hook_
result - Inside a hook: the hooked method’s return value (null for void methods or outside a hook). In a prefix it is the default until something sets it.
- key_
down - True while
keyis held down. - key_
pressed - True on the frame
keywas pressed. Key names are the game’s (GLFW) names, e.g. “F5”, “K”, “Space”. Keys typed into text fields or the console don’t count. - log
- log_
lines - Oxidizer’s log (what Mods > Oxidizer shows) from line number
fromon. Only the last few hundred lines are kept, so older ones are gone. - log_
next - Number the next line of Oxidizer’s log will get. Lines are numbered from 0 as they are logged; keep this to
read only what is new with
log_lines. - mod_
statuses - mods_
dir - The game’s mods folder,
<game documents>/mods, where every mod has its folder. - patch
- Harmony-patch
ty.methodwith a raw callback. SeeHookFn. - read_
string - Read a UTF-8 string out of a bridge “fill buffer, return length” call.
- rhai_
eval - Runs Rhai code in Oxidizer’s script engine, with the game access Rhai mods have, and returns its value as text
(empty for
()), or the error. Variables persist between calls, like a console. - set_
hook_ result - Inside a hook: replace the hooked method’s return value (converted to its return type).
From a prefix, combine with returning
falseto skip the original and return this value.
Type Aliases§
- Handle
- .NET GCHandle. 0 = null.
- HookFn
- Hook callback: (user data, instance or 0 for static methods, object[] of args) -> 0 to skip the original (prefix only).
The callback owns both handles (wrap with
Obj::from_handle).