JsonFileIO
BETA! (For making mods) Code lets you read/write JSONs full of key-value pairs to your plugin folder.
模組介紹 作者原文
JsonSaveSystem
Features
- Everything's under namespace NGA
- Class ExtensibleDictionary is made up of a list of key-value pairs 'DictionaryEntry'
- Call ExtensibleDictionary.AddEntry to create a new key-value pair,.RemoveEntry to remove it by key, and.GetValue to get it value by key
- Call.ContainsKey to quickly check if a key exists
- Call ExtensibleDictionary.ToJson to turn the dictionary into a string
- Calling.FromJson on a valid string will return ExtensibleDictionary
- Class FileIO has utilities that let you write to your own mod's folder within the current profile
- Call FileJsonIO.WriteToFile() with a filename (not a file path) and string content to write/clean-overwrite an existing file
- Call.ReadFile() with a filename to read in string of that file
How to use in Your mod
Plugin
- Add this to your plugin.csproj
bin\Debug\net35\JsonSaveSystem.dll
- Add the JsonSaveSystem.dll file found in this mod's download to your local workspace, usually bin\Debug\net35
- Add [BepInDependency("NGA.JsonFileIO", "0.0.0")] at the top of your C# file class declaration.
- Add "NGA-JsonFileIO-0.0.1" to your manifest.json dependencies
- Use reference code:
Collapsed Info
- Nothing to see here
Planned Features
- [✓] ExtensibleDictionary and FileIO classes work
Versions
0.0.1
- Bug fixes
- Allows different mods to use it simultanously
- Example code link
0.0.1
- Adds ExtensibleDictionary and FileIO
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。