Skip to content
Justin Oroz edited this page Jul 8, 2018 · 8 revisions

Checkbox

Overview

Adding a ConfigToggle object to your menu displays a Checkbox which can be toggled on or off.

Usage

Initializing

ConfigToggle myCheckbox = new ConfigToggle("mySetting", "Option Label");

ConfigToggle initialization requires only an identifier and label, but can be initialized with additional arguments isOn and the standard enabled. You can then add it to an OptionsTab.

Reading/Modifying Values

To read the checkbox value check the boolean IsOn property. If the checkbox is checked the value is true, unchecked is false. The event StateDidChange is triggered every time the IsOn property is changed, except on initialization.

The mod can manually change the state of the checkbox by writing to the IsOn property or using the Toggle() method.

Properties and Methods

Initializers

ConfigToggle(string identifier, string labelText, bool isOn = true, bool enabled = true)

Properties

bool IsOn { get; set; }

Methods

void Toggle();

Events

event ToggleHandler StateDidChange;
Clone this wiki locally