Class ModOptions
Abstract class that provides the framework for your mod's in-game configuration options.
public abstract class ModOptions
- Inheritance
-
ModOptions
- Inherited Members
- Extension Methods
Constructors
ModOptions(string)
Creates a new instance of ModOptions.
public ModOptions(string name)
Parameters
namestring- The name that will display above this section of options in the in-game menu.
Fields
Name
The name of this set of configuration options.
public string Name
Field Value
Properties
Options
Obtains the OptionItems that belong to this instance. Can be null.
public IReadOnlyCollection<OptionItem> Options { get; }
Property Value
Methods
AddItem(OptionItem)
Attaches a OptionItem to the options menu.
public bool AddItem(OptionItem option)
Parameters
optionOptionItem- The OptionItem to add to the options menu.
Returns
BuildModOptions(uGUI_TabbedControlsPanel, int, IReadOnlyCollection<OptionItem>)
Builds up the configuration the options.
public virtual void BuildModOptions(uGUI_TabbedControlsPanel panel, int modsTabIndex, IReadOnlyCollection<OptionItem> options)
Parameters
paneluGUI_TabbedControlsPanelmodsTabIndexintoptionsIReadOnlyCollection<OptionItem>
GetDelegates()
Gets the Invocation List for the OnChanged event or returns null if none present.
public List<EventHandler<OptionEventArgs>> GetDelegates()
Returns
OnChange<T, E>(string, T)
Notifies an option change to all subscribed event handlers.
public void OnChange<T, E>(string id, T value) where E : ConfigOptionEventArgs<T>
Parameters
idstringvalueT
Type Parameters
TE
RemoveItem(string)
Attaches a OptionItem to the options menu.
public bool RemoveItem(string id)
Parameters
idstring- The id of the OptionItem to remove from the options menu.
Returns
Events
GameObjectCreated
The event that is called whenever a game object created for the option
protected event EventHandler<GameObjectCreatedEventArgs> GameObjectCreated
Event Type
OnChanged
The event that is called whenever an option is changed.
public event EventHandler<OptionEventArgs> OnChanged