Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
This package has been marked as deprecated, and it's suggested another
alternative is used.
You are viewing a potentially older version of this package.
View all versions.
Risk Of Options
A nice looking Mod Options API
| Date uploaded | 5 years ago |
| Version | 1.0.1 |
| Download link | Rune48a891aab771429d-Risk_Of_Options-1.0.1.zip |
| Downloads | 253 |
| Dependency string | Rune48a891aab771429d-Risk_Of_Options-1.0.1 |
This mod requires the following mods to function
bbepis-BepInExPack
Unified BepInEx all-in-one modding pack - plugin framework, detour library
Preferred version: 5.3.1README
RiskOfOptions
An API to add Mod Options in game to ROR2.
Getting Started
First you need to grab the latest release from the Thunderstore. Extract the mod to your plugins folder, and then add a reference to it in Visual Studio.
Next you need to add Risk Of Options as a dependecy for your mod.
[BepInDependency("com.rune580.riskofoptions")]
Now you're ready to start adding options.
Adding an option
ModSettingsManager.addOption(new ModOption(ModOption.OptionType.Slider, "Test Slider", "This is a Slider test."));
ModSettingsManager.addOption(new ModOption(ModOption.OptionType.Bool, "Test Bool", "This is a Bool test."));
Changing the description of the mod panel
ModSettingsManager.setPanelDescription("Testing stuff");
Changing the title of the mod panel
ModSettingsManager.setPanelTitle("Risk of Options Testing Stuff");
Fire event when value has changed
for a slider
ModSettingsManager.addListener(ModSettingsManager.getOption("Test Slider"), new UnityEngine.Events.UnityAction<float>(floatEvent));
public void floatEvent(float f)
{
Debug.Log(f);
}
or for a bool
ModSettingsManager.addListener(ModSettingsManager.getOption("Test Bool"), new UnityEngine.Events.UnityAction<bool>(boolEvent));
public void boolEvent(bool b)
{
Debug.Log(b);
}
Get the current value of an option
string b = ModSettingsManager.getOptionValue("Test Bool");
// BaseConVar returns a string as a value.
// for example it could be "1" or "0"
Get the ModOption of an option
ModSettingsManager.getOption("Test Bool")