API Reference
Every public type in GearsAPI.dll 3.0.0 and GearsSharing.dll 1.0.0, one page per type, grouped by namespace.
Every public type in the two Gears assemblies you can reference, one page per type, laid out much like the .NET API browser: a declaration, then its constructors, fields, properties, events, methods and operators, each with its real signature.
GearsAPI.dll3.0.0 is the assembly mods reference to create and read their settings.GearsSharing.dll1.0.0 reads and writes share codes, for websites and tools. See Share Codes.
Members inherited from a base type are not repeated. Every 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 and GearsSharing by
docs-site/scripts/gen-api-reference.mjs. Signatures always match the assemblies.
GearsAPI.dll 3.0.0
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. |
GearsSharing.dll 1.0.0
GearsSharing
Read, write and check share codes.
| Type | Kind | Summary |
|---|---|---|
ShareCodeFormat | Static class | Encodes, decodes and validates share codes. Has no game dependencies, so a website or tool can use it. |
ShareCode | Sealed class | The contents of a share code: the settings that differ from their defaults, grouped by mod. |
ShareCodeScope | Enum | Which settings a share code holds. |
SharedMod | Sealed class | One mod's settings in a share code. |
SharedSetting | Sealed class | One setting and its value in a share code. |
SharedValue | Abstract class | One setting value in a share code. Create one with the static factory for its kind; each kind is its own sealed subclass holding only its own data. |
SharedBool | Sealed class | A bool value (Switch). |
SharedInt | Sealed class | An int value (Slider, Selector). |
SharedFloat | Sealed class | A float value (Slider, Selector), kept bit for bit. |
SharedString | Sealed class | A string value, which may be null. |
SharedEnumName | Sealed class | An enum value, by member name. |
SharedEnumValue | Sealed class | An enum value with no member name of its own (a flags combination), by number. |
SharedColor | Sealed class | A color of red, green, blue and alpha (RGBA) channels, each a float kept bit for bit. |
SharedSerialized | Sealed class | A mod-registered value type, as written by that type's own serializer. |
ShareCodeValidationResult | Sealed class | The result of checking a share code. |
ShareCodeError | Sealed class | One problem found in a share code. |
ShareCodeErrorType | Enum | Why a share code is not valid. |