Gears
API ReferenceSettings.World

IModWorldSettings

The root of a mod's world settings. No tab level; categories sit directly here.

InterfaceNamespace GearsAPI.Settings.WorldAssembly GearsAPI.dllSource
public interface IModWorldSettings

The root of a mod's world settings. There is no tab level; categories sit directly here. Handed to IGearsModApi.OnWorldSettingsLoaded; also IGearsMod.WorldSettings.

Methods

GetCategory(String)

IWorldModSettingsCategory GetCategory(string categoryName);

Returns the IWorldModSettingsCategory named categoryName, or null.

CreateCategory(String, String)

IWorldModSettingsCategory CreateCategory(string categoryName, string displayName);

Creates a category with the given name and display key. Throws ArgumentException on a duplicate name.

GetOrCreateCategory(String, String)

IWorldModSettingsCategory GetOrCreateCategory(string categoryName, string displayName);

Returns the existing category, or creates it.

AddCategory(IWorldModSettingsCategory)

bool AddCategory(IWorldModSettingsCategory category);

Adds an existing category object. Returns false if the name is taken.

RemoveCategory(String)

bool RemoveCategory(string categoryName);

Removes the category with that name. Returns whether one was removed.

RemoveCategory(IWorldModSettingsCategory)

bool RemoveCategory(IWorldModSettingsCategory category);

Removes that category. Returns whether it was removed.

GetAllCategories()

List<IWorldModSettingsCategory> GetAllCategories();

Returns every category as a List<IWorldModSettingsCategory>.

GetAllWorldSettings()

List<IWorldModSetting> GetAllWorldSettings();

Returns every setting in every category, categories included, as a List<IWorldModSetting>.

BindSettingsClass(Type)

void BindSettingsClass(Type settingsType);

Binds a settings class. A type is bound once; later calls for it do nothing.

SyncSettingsToClass(Type)

void SyncSettingsToClass(Type settingsType);

Calls the opted-in value listeners on an already-bound class with the values their settings hold now.

SaveSettings()

void SaveSettings();

Writes the player-level saved settings file. World values themselves are written to the save folder by the world settings screen and on world start, not by this call.

On this page