Rune580-Risk_Of_Options icon

Risk Of Options

A convenient API for adding BepInEx ConfigEntry's to a option menu

Last updated 2 months ago
Total downloads 1240497
Total rating 33 
Categories Mods Libraries Client-side
Dependency string Rune580-Risk_Of_Options-2.7.1
Dependants 636 other mods depend on this mod

This mod requires the following mods to function

bbepis-BepInExPack-5.4.1905 icon

Unified BepInEx all-in-one modding pack - plugin framework, detour library

Preferred version: 5.4.1905



Animated icon made by UnsavedTrash#0001 on discord

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.


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 = ...;


Quick Showcase



Discord: @rune

Github: Rune580


  StringInputFields have improved newline behavior.
    - InputFieldConfig has a new field `lineType`, it represents TMP's `lineType` enum.
    - SubmitEnum is now marked with the `Flags` attribute, should allow for more fine-tuned input field behavior.
    - `Shift` + `Enter` will always insert a newline, if the StringInputField is configured to allow newlines, without submitting.
  Because of the above changes, StringInputFields may behave differently to prior versions. If you relied on the 
    previous behavior, sorry for making more work for you, but this should make input fields be more reliable.
  In addition the default behavior for StringInputFields are `MultiLineSubmit` as this mimics the previous
    behavior the closest.

  All numeric InputFields now properly use InvariantCulture, for example numbers are formatted as `1,000,000.20`.
    - RiskOfOptions exposes an option to change this behavior in-game.
  RiskOfOptions option menu.
  Experimental support for Prefabs as mod icons.
    - The root object's RectTransform must have a width and height of 45.
  Animated icon has been updated.

  Forgot to include some assets that are required for the color picker.

  Added Method for setting mod descriptions with a language token.
  Added event when the mod options panel is closed.
  Slight behaviour change for color wheel, (I did this like a year ago and forgot to push it out in an update, so here you go.)
  Any other commits that happened between last year and now.

  Merged PR by Bubbet
    - Abstracts references to bepinexconfig out.
    - Allows mods to extend off of RoO's options.
  Updated to preview C# language.

  Fixed descriptions not wrapping.

  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.

  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.

  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!

  Fixed category indicators taking up more vertical space than intended.

  Added IntSlider option, which is just a normal slider but it accepts an ConfigEntry<int> instead.

  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.

  Disable functionality is now fully implemented on all simple options.

  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  
2023-10-18 2.7.1 224268 Version 2.7.1 Install
2023-7-27 2.7.0 212931 Version 2.7.0 Install
2023-6-6 2.6.1 170045 Version 2.6.1 Install
2023-6-5 2.6.0 7564 Version 2.6.0 Install
2022-6-14 2.5.3 323973 Version 2.5.3 Install
2022-5-24 2.5.2 16640 Version 2.5.2 Install
2022-5-18 2.5.1 4812 Version 2.5.1 Install
2022-5-4 2.5.0 18839 Version 2.5.0 Install
2022-4-22 2.4.2 10445 Version 2.4.2 Install
2022-4-20 2.4.1 1377 Version 2.4.1 Install
2022-4-19 2.4.0 1475 Version 2.4.0 Install
2022-4-18 2.3.2 1596 Version 2.3.2 Install
2022-4-10 2.3.1 8145 Version 2.3.1 Install
2022-4-2 2.3.0 9377 Version 2.3.0 Install
2022-3-11 2.2.0 15145 Version 2.2.0 Install
2022-3-11 2.1.0 1414 Version 2.1.0 Install
2022-3-10 2.0.0 1225 Version 2.0.0 Install
2022-3-7 1.0.4 3438 Version 1.0.4 Install
2021-4-15 1.0.3 112062 Version 1.0.3 Install
2020-9-26 1.0.2 95726 Version 1.0.2 Install