UIFramework
A UI For settings in Rumble VR
模組介紹 作者原文
btw: The changelog doubles as a feature list
New in 0.10.1/2
New feature: Made resize handles visible
- Right handle for scale
- Bottom handle to stretch downwards
Bug fix: Nullref error when the player doesn't have ModUI
Wasn't really motivated to be rigorous because everybody had ModUI😅
Bug fix: Continuous refresh error
Fixed the refresh method to not keep trying every frame when a part of the UI fails to build
New feature: Made UI Framework available in the loader
UI Framework can now be used in the loader.
New feature: Enabled Re-registration
Mods can now register themselves any time the game is running and re-register to change what categories they have and what order.
Bug fix: Null check for requestrefresh
In case anyone assigns a value before the UI is built
New in 0.10.0
New Feature: Window is now resizable
You can now scale the window or adjust its height.
- Scale: Click and drag the right edge to make the window scale uniformly.
- Height: Click and drag the bottom edge to adjust the height of the window.
New Feature: Increment and Decrement buttons in number fields
You can now click on buttons to increment or decrement values in number fields.
- Integral types like ints, bytes, longs, etc. will increment and decrement by 1 by default.
- Floating point types like floats and doubles will increment and decrement by 0.1 by default.
Note: This change has made floating point errors more obvious. I've opted to limit floating point types to display
1 decimal place by default. This can be easily overridden with the INumberBoxDescriptor UI Extension class.
New Feature: Advanced UI Customization for modders
You can now use the ICustomViewProvider interface to be able to pass your own custom representations to the UI Framework.
Default implementation: CustomViewProvider. More details in CustomUI
For Users
Drop the dll in your mods folder.
Default toggle is the F9 key
~~Changing a value of an entry automatically updates the value of the preference and is applied. How that preference's parent mod reacts depends on the modder's implementation.~~
- the above is no longer true as of 0.8.0. Values will not update until the saved button has been clicked
The save button writes it to the file for permanent storage. Closing your game might also save preferences to file automatically depending on whether it's closed from the game window or through Steam. Stopping through Steam doesn't save because it force closes it.
For Modders
A (more) detailed API Overview exists over at
Basic Registration
Add [assembly: MelonAdditionalDependencies("UIFramework")] to your AssemblyInfo. This prevents your mod from calling on UIFramework before it's been initialized.
Define your MelonPreferences in OnInitializeMelon and then register them to the UI.
UI.RegisterMelon(this, TestCategory1, TestCategory2...);
~~Right now, support is limited to common types like string, int, bool, double, float, and enums without the flags attribute. Working on expanding this.~~
Type Support: Whatever works with Tomlet
Expanded Type Support details
Support is no longer limited to the types mentioned above. Serialization and parsing is now handled by Tomlet.
This means that it supports types described in Toml 1.0.0 and whatever Tomlet supports. You can even make your own custom mappers
Caveat: Types handled by Tomlet will be presented as regular text inputs and they might not always look good. Numerics will have the appropriate filters.
I do plan to continue expanding the number of custom UI presenters like I did with enums and booleans.
Optional: OnSave Event Handler
You can add an event handler that gets called when the save button is clicked while your mod is selected.
private void MyModSaved()
{
// Do something when the save button is clicked while your mod is selected
}
UI.RegisterMelon(this, OBSAutoRecorderSettings, TestCategory1, TestCategory2...).OnModSaved += MyModSave
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。