Gears

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.

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.

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.

GearsSharing.dll 1.0.0

GearsSharing

Read, write and check share codes.

TypeKindSummary
ShareCodeFormatStatic classEncodes, decodes and validates share codes. Has no game dependencies, so a website or tool can use it.
ShareCodeSealed classThe contents of a share code: the settings that differ from their defaults, grouped by mod.
ShareCodeScopeEnumWhich settings a share code holds.
SharedModSealed classOne mod's settings in a share code.
SharedSettingSealed classOne setting and its value in a share code.
SharedValueAbstract classOne 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.
SharedBoolSealed classA bool value (Switch).
SharedIntSealed classAn int value (Slider, Selector).
SharedFloatSealed classA float value (Slider, Selector), kept bit for bit.
SharedStringSealed classA string value, which may be null.
SharedEnumNameSealed classAn enum value, by member name.
SharedEnumValueSealed classAn enum value with no member name of its own (a flags combination), by number.
SharedColorSealed classA color of red, green, blue and alpha (RGBA) channels, each a float kept bit for bit.
SharedSerializedSealed classA mod-registered value type, as written by that type's own serializer.
ShareCodeValidationResultSealed classThe result of checking a share code.
ShareCodeErrorSealed classOne problem found in a share code.
ShareCodeErrorTypeEnumWhy a share code is not valid.

On this page