Thorn Core
The powerful config system behind Thorn, for any mod.
模組介紹 作者原文
Thorn Core
GitHub || Wiki
Powerful config system
- Supports all the usual basic data types (string, bool, numbers, enums), plus:
- Colors with rainbow pulse
- Enemy types
- Keybinds with modifiers (e.g. Ctrl+A instead of just A)
- Any custom data you can serialize to JSON, and allows custom UI
- Compact UI, great for tuning settings live (no Esc and multiple clicks)
- Hot reload on disk change
Comparison with PluginConfig and Configgy: see Thorn Wiki
Screenshots
Usage
public class HatsModConfig: Module
{
public static Setting FunkyMode = null!;
public static Setting HatColor = null!;
public static Setting HatTexture = null!;
public HatsModConfig(): base("myHatsMod.config", "Hats Mod", "Adds custom hat to enemies", ModuleCategory.Render)
{
FunkyMode = CreateSetting("funkyMode", "Funky Mode", "Funny effects", false);
HatColor = CreateSetting("color", "Hat Color", "The color for the custom hat", new EnhancedColor(0.66f, 1f, 0.97f, 0.5f));
HatTexture = CreateSetting("texture", "Hat Texture", "The texture for the custom hat", HatsMod.DefaultHatTexturePath);
}
}
[BepInDependency("com.github.end-4.thornClient")]
public class HatsMod: BaseUnityPlugin
{
public const string DefaultHatTexturePath = "/path/to/texture.png";
private void Update()
{
Logger.LogInfo($"Funky Mode: {HatsModConfig.FunkyMode.Value}");
Logger.LogInfo($"Hat Color: {HatsModConfig.HatColor.Value.GetCurrentColor()}");
Logger.LogInfo($"Hat Texture: {HatsModConfig.HatTexture.Value.ToString()}");
}
}
For more details, see Thorn Wiki
Copyleft
Thorn's code is released under the LGPL-3.0 license, which means you are free to use its config system in your mod, whether or not it's open source; modifications to Thorn's code itself however are required to be open-sourced.
Assets are released under the CC BY-SA 4.0 license. This means you are free to reuse them as long as you give attribution and maintain the same license for derivative works.
Mods that use Thorn
- SpawnerArmExtras
- BillionNemesis
- LGBTQ Hitscan
- Crossover
Technical description
Thorn as a whole is an utility mod, with its own config system featuring a compact UI to house its 50+ modules. This package contains the base system without those modules.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: