-
Notifications
You must be signed in to change notification settings - Fork 6
2. Quick start
one-nora edited this page May 10, 2026
·
2 revisions
First, we need to access the API by creating a WKLibAPI instance.
This instance is the main entry point for WKLib. Through it, you can create, save, and load configs, load assets, create UI, etc.
An API instance can be created using either of these methods
WKLibAPI.Create(string displayName, string guid)
WKLibAPI.Create(string displayName, string guid, string defaultConfigFileName)// ... Somewhere easily accessible (like your plugin class)
public static WKLibAPI WKLibAPI = WKLibAPI.Create("My mod", "my.mod.guid");You can also choose the default config file name
public static WKLibAPI WKLibAPI = WKLibAPI.Create("My Mod", "my.mod.guid", "Settings");You can destroy the current instance when it is no longer needed.
It is recommended to call this during your plugin cleanup, typically inside OnDestroy.
private void OnDestroy()
{
WKLibAPI.Destroy();
}-
DisplayNameAPI display name -
GUIDAPI identifier -
WindowsregisteredWKLibWindowinstances -
ModTaboptional custom mod tab -
ConfigFolderAPI config folder -
DefaultConfigFiledefault config file -
AssetServiceasset service instance
-
AddWindow(WKLibWindow window)registers a window if it is not already present -
AddToModList(ModTab modTab)assigns a mod tab, only 1 mod tab can be set -
Destroy()removes the API from the internal registry
- GUIDs must be unique.
- There can only be 1 mod tab per instance.
- The default config file name defaults to
DefaultConfig. - The constructor is private.