A class in Root.Township, the global namespace.
A named on/off setting that registers itself in a static list so console commands can toggle it by name. Examples: immortals, damagepopup, xppopup.
Constructors
| Member | What it is |
|---|
ToggleBool(string name, bool defaultValue = false) | Creates a ToggleBool from name and defaultValue. |
Fields
| Member | What it is |
|---|
static Dictionary<string, ToggleBool> toggleableSettings | Every registered setting by name, used by the settings console commands. |
1 private and internal field
| Member | What it is |
|---|
private bool value | Backing field for Value. |
Properties
| Member | What it is |
|---|
string Name { get; private set; } | The name the setting is registered under. |
bool Value { get; set; } | The current state. Setting a new value logs it and raises Toggled. |
Events
| Member | What it is |
|---|
event Action<bool> Toggled | Raised with the new value when Value changes. |
Methods
| Member | What it is |
|---|
void Destroy() | Removes this setting from toggleableSettings. |
void Toggle() | Flips Value. |
Used in
Members of other types that take, return or hold a ToggleBool: