Gears

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.

TypeKindSummary
GearsApiClassThe 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.

TypeKindSummary
GearsSettingsManagerAbstract classStatic access to every mod Gears knows about, without waiting for a callback.
IGearsModInterfaceWhat Gears knows about one loaded mod: its settings trees, icon and banner.
IGearsModApiInterfaceThe callback contract a C# mod implements to be told about its settings.
IModSettingInterfaceThe members every setting shares, including categories.
OnSettingEnabledEventDelegateHandler for IModSetting.OnEnabled.
IValueModSetting<T>InterfaceA setting that holds a value of type T: the default, the applied value and the selected value.
OnSelectedChangedEvent<T>DelegateHandler for IValueModSetting<T>.OnSelectedChanged.
SettingRestartScopeEnumWhat a change to a global setting costs the player.

GearsAPI.Settings.Base

Non-generic faces of the value settings, for type-agnostic code.

TypeKindSummary
IValueModSettingBaseInterfaceThe non-generic face of a value setting: string in, string out.
ISelectorSettingBaseInterfaceThe non-generic members of a Selector: display, storage and selection by position.
ISliderSettingBaseInterfaceThe non-generic members of a Slider.
ISwitchSettingBaseInterfaceThe non-generic members of a Switch: the two buttons, their text, and which one is lit.
ISwitchSettingBase.SelectedButtonEnumWhich side of a Switch is lit.

GearsAPI.Settings.Global

The player's settings: tabs, categories and the global setting types.

TypeKindSummary
IModGlobalSettingsInterfaceThe root of a mod's global settings: the tabs, and operations across the whole tree.
IGlobalModSettingsTabInterfaceA tab in the mod's settings page. A tab is not a setting.
IGlobalModSettingsCategoryInterfaceA category inside a tab. A category is itself a global setting.
IGlobalModSettingInterfaceA setting that belongs to the player rather than to a world.
OnSettingAppliedEventDelegateHandler for IGlobalModSetting.OnSettingApplied. Carries no value.
IGlobalValueSetting<T>InterfaceA global setting that holds a value of type T, with the applied-value event.
ValueChangedEvent<T>DelegateHandler for IGlobalValueSetting<T>.OnValueChanged.
ISelectorGlobalSetting<T>InterfaceA global setting chosen from a list of allowed values.
ISliderGlobalSetting<T>InterfaceA global numeric setting dragged within a range. int and float only.
ISwitchGlobalSetting<T>InterfaceA global two-position setting.
IColorSelectorGlobalSettingInterfaceA global color picker over UnityEngine.Color.
IControlBindingSettingInterfaceA global key-binding row. Not a value setting.

GearsAPI.Settings.World

A save's settings: categories and the world setting types.

TypeKindSummary
IModWorldSettingsInterfaceThe root of a mod's world settings. No tab level; categories sit directly here.
IWorldModSettingsCategoryInterfaceA category of world settings. Like its global counterpart, itself a setting.
IWorldModSettingInterfaceA setting that belongs to a save. No RestartScope, no OnSettingApplied.
ISelectorWorldSetting<T>InterfaceA world setting chosen from a list of allowed values.
ISliderWorldSetting<T>InterfaceA world numeric setting within a range. int and float only.
ISwitchWorldSetting<T>InterfaceA world two-position setting.

GearsAPI.Attributes

Binding, listener and serialization attributes.

TypeKindSummary
SettingPathAttributeAbstract classBase 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.
SettingAttributeSealed classBinds 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.
SettingPlayerActionAttributeSealed classAssigns 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.
SettingListenerAttributeAbstract classBase 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.
SettingOnValueChangedAttributeSealed classBinds a static method to OnValueChanged. Raised on global value settings; on a world path the method is bound invoke-only.
SettingOnSelectedChangedAttributeSealed classBinds a static method to OnSelectedChanged. Global and world value settings.
SettingOnAppliedAttributeSealed classBinds a static method to OnSettingApplied. Global settings only.
SettingOnEnabledAttributeSealed classBinds a static method to OnEnabled. Works on every setting.
SettingsSerializationProviderSealed classMarks a class as holding SettingParserAttribute and SettingFormatterAttribute methods.
SettingParserAttributeSealed classMarks a static method as the parser for a value type.
SettingFormatterAttributeSealed classMarks a static method as the formatter for a value type.
SettingFactoryAttributeSealed classRegisters a setting family implementation for one value type.
SettingFactoryEnumAttributeSealed classRegisters a setting family implementation for every enum.
SettingFactoryFixedAttributeSealed classRegisters an implementation of a non-generic setting interface.

On this page