Table of Contents

Class ModOptions

Namespace
Nautilus.Options
Assembly
Nautilus.dll
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

name string
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

string

Properties

Options

Obtains the OptionItems that belong to this instance. Can be null.
public IReadOnlyCollection<OptionItem> Options { get; }

Property Value

IReadOnlyCollection<OptionItem>

Methods

AddItem(OptionItem)

Attaches a OptionItem to the options menu.

public bool AddItem(OptionItem option)

Parameters

option OptionItem
The OptionItem to add to the options menu.

Returns

bool

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

panel uGUI_TabbedControlsPanel
modsTabIndex int
options IReadOnlyCollection<OptionItem>

GetDelegates()

Gets the Invocation List for the OnChanged event or returns null if none present.
public List<EventHandler<OptionEventArgs>> GetDelegates()

Returns

List<EventHandler<OptionEventArgs>>

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

id string
value T

Type Parameters

T
E

RemoveItem(string)

Attaches a OptionItem to the options menu.

public bool RemoveItem(string id)

Parameters

id string
The id of the OptionItem to remove from the options menu.

Returns

bool

Events

GameObjectCreated

The event that is called whenever a game object created for the option
protected event EventHandler<GameObjectCreatedEventArgs> GameObjectCreated

Event Type

EventHandler<GameObjectCreatedEventArgs>

OnChanged

The event that is called whenever an option is changed.
public event EventHandler<OptionEventArgs> OnChanged

Event Type

EventHandler<OptionEventArgs>