Options

This page contains documentation to explain how to register and configuration options within the Mod Launcher.

This is a C# API that can be called within a mod, typically in the void OnModLoaded() on your main MonoBehaviour class. These APIs can be called at any point in time to create or update options on the fly, for example, adding or removing options, or updating the current value based on what has happened in the game.

The APIs are available via AzzaMods.Options, or simply Options if you add the using AzzaMods; to the start of your mod like the example mod provides.

Options.RegisterBool

Options.RegisterBool(string optionName, bool defaultValue = false)

This registers a bool based option called optionName.

The default / starting value is configured via defaultValue.

The UI appears as a toggle button in the mod launcher.

e.g - Creating a new bool based option:

Options.RegisterBool("Player 1 Can't Die", false);

Options.GetBool

Options.GetBool(string optionName):bool

Options.SetBool

Options.SetBool(string optionName, bool optionValue)

Options.RegisterFloat

Options.RegisterFloat(string optionName, float defaultValue = 0)

Options.GetFloat

Options.GetFloat(string optionName):float

Options.SetFloat

Options.SetFloat(string optionName, float optionValue)

Options.SetMinValue

Options.SetMinValue(string optionName, float minValue)

Options.RemoveMinValue

Options.RemoveMinValue(string optionName)

Options.SetMaxValue

Options.SetMaxValue(string optionName, float maxValue)

Options.RemoveMaxValue

Options.RemoveMaxValue(string optionName)

Options.SetStep

Options.SetStep(string optionName, float step)

Options.RemoveStep

Options.RemoveStep(string optionName)

Options.RegisterInt

Options.RegisterInt(string optionName, int defaultValue = 0)

Options.GetInt

Options.GetInt(string optionName):int

Options.SetInt

Options.SetInt(string optionName, int optionValue)

Options.RegisterAction

Options.RegisterAction(string actionName)

Options.RegisterString

Options.RegisterString(string optionName, string defaultValue = "")

Options.GetString

Options.GetString(string optionName):string

Options.SetString

Options.SetString(string optionName, string optionValue)

Options.RegisterDropdown

Options.RegisterDropdown(string optionName, List<string> options = null, string defaultValue = null)

This registers a dropdown based option called optionName.

The options are defined via the List parameter options.

You can update the dropdown options at any point with Options.SetDropdownOptions(string optionName, List<string> options)

e.g. - Creating a new dropdown based option:

Options.RegisterDropdown("Selected Weapon", new List<string>{"Weapon 1", "Weapon 2"}, "Weapon 2");

e.g. - Updating a dropdown based option:

Options.SetDropdownOptions("Selected Weapon", new List<string>{"Weapon 1", "Weapon 2", "Weapon 3"});

Options.SetDropdownOptions

Options.SetDropdownOptions(string optionName, List<string> options)

This updates the options in the given dropdown with the new list of options.

e.g. - Updating a dropdown based option:

Options.SetDropdownOptions("Selected Weapon", new List<string>{"Weapon 1", "Weapon 2", "Weapon 3"});

Options.RegisterColor

Options.RegisterColor(string optionName, AzzaColor color)

Options.GetColor

Options.GetColor(string optionName):AzzaColor

Options.SetDescrption

Options.SetDescription(string optionName, string description)

Modifies the description that is shown in the mod launcher itself for the given option.

Options.AddPersistence

Options.AddPersistence(string optionName)

Makes your option persist / show up even when the game isn't running. Options are NOT persistent by default.

Options.RemovePersistence

Options.RemovePersistence(string optionName)

Options.AddToggle

Options.AddToggle(string optionName)

Adds a toggle to the given option.

When the toggle state is changed, it will fire the void OnOptionChanged(string optionName) method on your mod's MonoBehaviour.

Options.GetToggleState

Options.GetToggleState(string optionName):bool

Options.RemoveToggle

Options.RemoveToggle(string optionName)

Options.AddLock

Options.AddLock(string optionName)

Adds a lock to the given option. A lock is represented as a little lock icon that can be toggled on or off by clicking it.

When the lock state is changed, it will fire the void OnOptionChanged(string optionName) method on your mod's MonoBehaviour.

e.g. - Adding a lock to an option:

Options.AddLock("Total Candy");

Options.GetLockState

Options.GetLockState(string optionName):bool

Get the current lock state of the given option.

Options.RemoveLock

Options.RemoveLock(string optionName)

Removes a lock from the given option.