
Risk of Rain 2
You are viewing a potentially older version of this package. View Latest Version

An API to add Mod Options in game to ROR2.
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 dependecy for your mod.
[BepInDependency("com.rune580.riskofoptions")]
Now you're ready to start adding options.
This needs to be run on Awake()
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."));
and with default values
ModSettingsManager.addOption(new ModOption(ModOption.OptionType.Slider, "Test Slider", "This is a Slider test.", "20"));
ModSettingsManager.addOption(new ModOption(ModOption.OptionType.Bool, "Test Bool", "This is a Bool test.", "1"));
ModSettingsManager.setPanelDescription("Testing stuff");
ModSettingsManager.setPanelTitle("Risk of Options Testing Stuff");
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);
}
string b = ModSettingsManager.getOptionValue("Test Bool");
// BaseConVar returns a string as a value.
// for example it could be "1" or "0"
ModSettingsManager.getOption("Test Bool")
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.