We recommend using the Thunderstore Mod Manager or an alternative for installing mods

Risk Of Options
A convenient API for adding BepInEx ConfigEntry's to a option menu
Last updated | a year ago |
Total downloads | 546506 |
Total rating | 23 |
Categories | Mods Libraries Client-side |
Dependency string | Rune580-Risk_Of_Options-2.5.3 |
Dependants | 343 other mods depend on this mod |
This mod requires the following mods to function

bbepis-BepInExPack
Unified BepInEx all-in-one modding pack - plugin framework, detour library
Preferred version: 5.4.1905README
RiskOfOptions
An API to provide a user interface in game to interact with BepInEx ConfigEntry's.
Currently supported options
- CheckBoxes
bool
- Sliders
float
- StepSliders
float
- IntSliders
int
- KeyBinds
KeyboardShortcut
- String Input Fields
string
- Choice DropDowns
Enum
- Color Picker
UnityEngine.Color
Additional Components
- GenericButtons
For feature requests or issues head over to my repository.
Developer Resources
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 the dll in your project in Visual Studio. [Project->Add Reference...->Browse]
Then add to where ever you will use this.
using RiskOfOptions;
Next you need to add Risk Of Options as a dependency for your mod.
[BepInDependency("com.rune580.riskofoptions")]
Finally make sure you know how to use BepInEx Config
Now you're ready to start adding options.
Adding an option
Given a ConfigEntry<bool>
ConfigEntry<bool> enableThing = Config.Bind(...);
ModSettingsManager.AddOption(new CheckBoxOption(enableThing);
Need a volume slider?
ConfigEntry<float> volume = Config.Bind(...);
ModSettingsManager.AddOption(new SliderOption(volume));
Every option constructor can take a Config for the example above it would be SliderConfig
.
Say you need a slider that only goes between 60 - 130. You would do:
ModSettingsManager.AddOption(new SliderOption(limitedRangeFloat, new SliderConfig() { min = 60, max = 130 }));
What about a slider that goes in increments of 0.15 and is limited between 1 - 5?
ModSettingsManager.AddOption(new StepSliderOption(incrementedFloat, new StepSliderConfig() { min = 1, max = 5, increment = 0.15f }));
Enough about floats, let's talk about the spaghetti and meatballs, KeyBinds.
ConfigEntry<KeyboardShortcut> keyBind = Config.Bind(...);
ModSettingsManager.AddOption(new KeyBindOption(keyBind)); // This also has a KeyBindConfig but can be omitted if defaults are desired.
And that's it, said KeyboardShortcut will show up on the ModOptions menu.
Checkbox and Slider configs can be set with a delegate that will be used to check if said option should be disabled in the menu.
ConfigEntry<bool> disableThing = Config.Bind(...);
ConfigEntry<bool> overridenThing = Config.Bind(...);
ModSettingsManager.AddOption(new CheckBoxOption(disableThing));
ModSettingsManager.AddOption(new CheckBoxOption(overridenThing, new CheckBoxConfig() { checkIfDisabled = Check }));
...
private bool Check()
{
return disabledThing.value;
}
When disableThing
is enabled overridenThing
will show up as non-interactable in the menu.
"Okay that's all fine but how do I, you know, do stuff when an value is changed?"
Well thankfully ConfigEntry
's have this innately:
ConfigEntry<bool> toggleThing = Config.Bind(...);
toggleThing.SettingChanged += (object, args) => { Debug.Log(toggleThing.Value) };
Of course when an option changes the value of a passed ConfigEntry
, the value updates in real time,
so in some cases where you are checking the value of the entry directly you don't need to do anything.
There may be cases where you just want a convenient button to open your own menu, as such you can do this:
ModSettingsManager.AddOption(new GenericButtonOption("Custom Menu", "Misc", "Configure stuff in here", "Open Custom Menu", OpenMenu));
private void OpenMenu()
{
/// Do stuff
}
The GenericButtonOption may be used to provide an entry point for opening your custom GUI's.
Setting the description of the mod
ModSettingsManager.SetModDescription("Describe your mod in incredible detail over the course of the next 2 hours");
Setting the icon of the mod
Sprite icon = ...;
ModSettingsManager.SetModIcon(icon);
Quick Showcase
Contact
Discord: Rune#0001
Github: Rune580
Changelog
2.5.3:
Merged PR by Bubbet https://github.com/Rune580/RiskOfOptions/pull/28
- Abstracts references to bepinexconfig out.
- Allows mods to extend off of RoO's options.
Updated to preview C# language.
2.5.2:
Fixed descriptions not wrapping.
2.5.1:
Minor improvements to the layout of the mod options menu.
Fixed some minor stutters when opening the settings menu for the first time.
Removed HookGenPatcher/MMHook as a dependency.
2.5.0:
Added ColorOption.
Added ColorPickerUtil for manually opening a color picker.
Added 2 new submit modes for input fields:
- OnExitOrSubmit
- OnSubmit
These can be used with the `submitOn` Field in the InputFieldConfig.
Fixed an issue where having multiple input fields causes hitching.
Fixed an issue where input fields wouldn't visually revert.
2.4.2:
Sliders can now have their values be manually set in the text box. No more finagling the slider to get the value you want.
The future is now!
2.4.1:
Fixed category indicators taking up more vertical space than intended.
2.4.0:
Added IntSlider option, which is just a normal slider but it accepts an ConfigEntry<int> instead.
2.3.2:
Added overrides for modGuid and modName when adding an option.
CheckBox is now a prefab instead of being copied from a button in game. What does that mean for the normal user?
realistically nothing at all, you shouldn't notice anything different. For the dev however, this puts us a step closer
to having RiskOfOptions ui elements be accessible to other mods.
2.3.1:
Disable functionality is now fully implemented on all simple options.
2.3.0:
Quite a few things in this update, as always let me know if you have any issues.
- Added ChoiceOption, takes an CongiEntry<enum>.
- Removed dependency on R2API, I didn't really use it anyways, now you don't have to worry about an unnecessary dependency.
haha dependencies bad ;))))))))))))))))
- Fixed animation issues with the Mod Options menu while playing in singleplayer.
- Added workaround for when a mod embeds it's own settings api (the reason why one would do this alludes me...),
as they can break the Mod Options panel.
2.2.0 - Added GenericButtonOption which allows for devs to supply a UnityAction that is invoked when the button is pressed.
Cleaned up a few things. Should work for the newest patch, let me know if you find any issues.
2.1.0 - Added StringInputFieldOption. Configuration option `restartRequired` has been fully implemented,
set this to true to show a restart warning when the option is modified. Description panels now scroll.
2.0.0 - Massive Rewrite of the entire mod. Now exclusively uses BepInEx ConfigEntry's.
Completely new UI, with a working revert button. Added Stepped Slider, and KeyBind options.
Mods dependent on 1.0 will not work with 2.0
1.0.4 - Quick update for SOTV.
1.0.3 - Added R2API as a dependency because I forgot about that. Also I'm currently rewriting ROO,
so hopefully the next update should be a pretty big one. No ETA on that, but progress is good
so far.
Available versions
Please note that the install buttons only work if you have compatible client software installed, such as the Thunderstore Mod Manager. Otherwise use the zip download links instead.
Upload date | Version number | Downloads | Download link | |
---|---|---|---|---|
2022-6-14 | 2.5.3 | 250586 | Version 2.5.3 | Install |
2022-5-24 | 2.5.2 | 16026 | Version 2.5.2 | Install |
2022-5-18 | 2.5.1 | 4774 | Version 2.5.1 | Install |
2022-5-4 | 2.5.0 | 18220 | Version 2.5.0 | Install |
2022-4-22 | 2.4.2 | 10182 | Version 2.4.2 | Install |
2022-4-20 | 2.4.1 | 1342 | Version 2.4.1 | Install |
2022-4-19 | 2.4.0 | 1442 | Version 2.4.0 | Install |
2022-4-18 | 2.3.2 | 1559 | Version 2.3.2 | Install |
2022-4-10 | 2.3.1 | 8010 | Version 2.3.1 | Install |
2022-4-2 | 2.3.0 | 8671 | Version 2.3.0 | Install |
2022-3-11 | 2.2.0 | 15062 | Version 2.2.0 | Install |
2022-3-11 | 2.1.0 | 1381 | Version 2.1.0 | Install |
2022-3-10 | 2.0.0 | 1181 | Version 2.0.0 | Install |
2022-3-7 | 1.0.4 | 3397 | Version 1.0.4 | Install |
2021-4-15 | 1.0.3 | 111935 | Version 1.0.3 | Install |
2020-9-26 | 1.0.2 | 92738 | Version 1.0.2 | Install |