API Reference
Every public type in GearsAPI.dll 3.0.0, one page per type, grouped by namespace.
Every public type in GearsAPI.dll 3.0.0 — one page per type, laid out the way the .NET API
browser does it: a declaration, then its constructors, properties, methods and events, each with
its real signature.
Members inherited from a base interface are not repeated. Every GearsAPI type named on an
Implements, Derived or Inheritance line links to its own page, so follow those to find
them. Game and .NET types (Mod, IModApi, PlayerAction, Color, Attribute) are not linked.
Generated from source
These pages are generated from the C# in GearsAPI/Source by
docs-site/scripts/gen-api-reference.mjs. Signatures always match the assembly.
GearsAPI
The assembly entry point.
| Type | Kind | Summary |
|---|---|---|
GearsApi | Class | The game's IModApi entry point for GearsAPI.dll itself. Not intended for use by mods. |
GearsAPI.Settings
The mod-level contracts and the members every setting shares.
| Type | Kind | Summary |
|---|---|---|
GearsSettingsManager | Abstract class | Static access to every mod Gears knows about, without waiting for a callback. |
IGearsMod | Interface | What Gears knows about one loaded mod: its settings trees, icon and banner. |
IGearsModApi | Interface | The callback contract a C# mod implements to be told about its settings. |
IModSetting | Interface | The members every setting shares, including categories. |
OnSettingEnabledEvent | Delegate | Handler for IModSetting.OnEnabled. |
IValueModSetting<T> | Interface | A setting that holds a value of type T: the default, the applied value and the selected value. |
OnSelectedChangedEvent<T> | Delegate | Handler for IValueModSetting<T>.OnSelectedChanged. |
SettingRestartScope | Enum | What a change to a global setting costs the player. |
GearsAPI.Settings.Base
Non-generic faces of the value settings, for type-agnostic code.
| Type | Kind | Summary |
|---|---|---|
IValueModSettingBase | Interface | The non-generic face of a value setting: string in, string out. |
ISelectorSettingBase | Interface | The non-generic members of a Selector: display, storage and selection by position. |
ISliderSettingBase | Interface | The non-generic members of a Slider. |
ISwitchSettingBase | Interface | The non-generic members of a Switch: the two buttons, their text, and which one is lit. |
ISwitchSettingBase.SelectedButton | Enum | Which side of a Switch is lit. |
GearsAPI.Settings.Global
The player's settings: tabs, categories and the global setting types.
| Type | Kind | Summary |
|---|---|---|
IModGlobalSettings | Interface | The root of a mod's global settings: the tabs, and operations across the whole tree. |
IGlobalModSettingsTab | Interface | A tab in the mod's settings page. A tab is not a setting. |
IGlobalModSettingsCategory | Interface | A category inside a tab. A category is itself a global setting. |
IGlobalModSetting | Interface | A setting that belongs to the player rather than to a world. |
OnSettingAppliedEvent | Delegate | Handler for IGlobalModSetting.OnSettingApplied. Carries no value. |
IGlobalValueSetting<T> | Interface | A global setting that holds a value of type T, with the applied-value event. |
ValueChangedEvent<T> | Delegate | Handler for IGlobalValueSetting<T>.OnValueChanged. |
ISelectorGlobalSetting<T> | Interface | A global setting chosen from a list of allowed values. |
ISliderGlobalSetting<T> | Interface | A global numeric setting dragged within a range. int and float only. |
ISwitchGlobalSetting<T> | Interface | A global two-position setting. |
IColorSelectorGlobalSetting | Interface | A global color picker over UnityEngine.Color. |
IControlBindingSetting | Interface | A global key-binding row. Not a value setting. |
GearsAPI.Settings.World
A save's settings: categories and the world setting types.
| Type | Kind | Summary |
|---|---|---|
IModWorldSettings | Interface | The root of a mod's world settings. No tab level; categories sit directly here. |
IWorldModSettingsCategory | Interface | A category of world settings. Like its global counterpart, itself a setting. |
IWorldModSetting | Interface | A setting that belongs to a save. No RestartScope, no OnSettingApplied. |
ISelectorWorldSetting<T> | Interface | A world setting chosen from a list of allowed values. |
ISliderWorldSetting<T> | Interface | A world numeric setting within a range. int and float only. |
ISwitchWorldSetting<T> | Interface | A world two-position setting. |
GearsAPI.Attributes
Binding, listener and serialization attributes.
| Type | Kind | Summary |
|---|---|---|
SettingPathAttribute | Abstract class | Base for any attribute that names a setting by its path. The path is "tabName.CategoryName.SettingName" for global settings and "CategoryName.SettingName" for world settings. |
SettingAttribute | Sealed class | Binds a static field or property to the setting its path names. Pass the declaring type to BindSettingsClass and the member is assigned the resolved setting. A field must be static and neither readonly nor const; a property must be static and have a setter, which may be private. |
SettingPlayerActionAttribute | Sealed class | Assigns the PlayerAction held by a static field or property to the Binding setting its path names. Pass the declaring type to BindSettingsClass and Gears reads the member and sets IControlBindingSetting.PlayerAction from it. |
SettingListenerAttribute | Abstract class | Base for attributes that bind a static method to a setting's event. The setting path must be in the form "tabName.CategoryName.SettingName" for global settings and "CategoryName.SettingName" for world settings. |
SettingOnValueChangedAttribute | Sealed class | Binds a static method to OnValueChanged. Raised on global value settings; on a world path the method is bound invoke-only. |
SettingOnSelectedChangedAttribute | Sealed class | Binds a static method to OnSelectedChanged. Global and world value settings. |
SettingOnAppliedAttribute | Sealed class | Binds a static method to OnSettingApplied. Global settings only. |
SettingOnEnabledAttribute | Sealed class | Binds a static method to OnEnabled. Works on every setting. |
SettingsSerializationProvider | Sealed class | Marks a class as holding SettingParserAttribute and SettingFormatterAttribute methods. |
SettingParserAttribute | Sealed class | Marks a static method as the parser for a value type. |
SettingFormatterAttribute | Sealed class | Marks a static method as the formatter for a value type. |
SettingFactoryAttribute | Sealed class | Registers a setting family implementation for one value type. |
SettingFactoryEnumAttribute | Sealed class | Registers a setting family implementation for every enum. |
SettingFactoryFixedAttribute | Sealed class | Registers an implementation of a non-generic setting interface. |