### OnCampaignStart Method Source: https://mcm.bannerlord.aragas.org/api/MCM.MCMSubModule.html Called when a campaign starts. This method is intended for campaign-specific initialization logic. ```APIDOC ## OnCampaignStart(Game, object) ### Description Called when a campaign starts. This method is intended for campaign-specific initialization logic. ### Method Public override void ### Parameters - **game** (Game) - The current game instance. - **starterObject** (object) - An object containing starter information for the campaign. ### Code ```csharp public override void OnCampaignStart(Game game, object starterObject) ``` ``` -------------------------------- ### MCMSubModule OnCampaignStart Method Source: https://mcm.bannerlord.aragas.org/api/MCM.MCMSubModule.html Handles logic when a campaign starts. Accepts Game and starterObject parameters. ```csharp public override void OnCampaignStart(Game game, object starterObject) ``` -------------------------------- ### Instance Property Source: https://mcm.bannerlord.aragas.org/api/MCM.MCMSubModule.html Gets the singleton instance of MCMSubModule. ```APIDOC ## Instance ### Description Gets the singleton instance of MCMSubModule. ### Property Type MCMSubModule? ### Access Public static getter ### Code ```csharp public static MCMSubModule? Instance { get; } ``` ``` -------------------------------- ### MCMSubModule OnGameStart Method Source: https://mcm.bannerlord.aragas.org/api/MCM.MCMSubModule.html Handles logic when the game starts. Accepts Game and IGameStarter parameters. ```csharp protected override void OnGameStart(Game game, IGameStarter gameStarterObject) ``` -------------------------------- ### GetSystemPath Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.GameFeatures.IFileSystemProvider.html Gets the system path for a given game file. ```APIDOC ## GetSystemPath (GameFile) ### Description Gets the system path for a given game file. ### Method `string? GetSystemPath(GameFile file)` ### Parameters #### Path Parameters - **file** (GameFile) - Description not available ### Returns - **string?** - The system path of the file or null if not found. ``` -------------------------------- ### IWrapper.Object Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.IWrapper.html Gets the wrapped object. ```APIDOC ## Property: Object ### Description Gets the wrapped object. ### Type object? ``` -------------------------------- ### GetSystemPath Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.GameFeatures.IFileSystemProvider.html Gets the system path for a given game directory. ```APIDOC ## GetSystemPath (GameDirectory) ### Description Gets the system path for a given game directory. ### Method `string? GetSystemPath(GameDirectory directory)` ### Parameters #### Path Parameters - **directory** (GameDirectory) - Description not available ### Returns - **string?** - The system path of the directory or null if not found. ``` -------------------------------- ### Object Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.RefWrapper.html Gets the wrapped object. ```APIDOC ## Object Property ### Description Gets the object that is being wrapped by this instance. ### Property Value - **object** (object) - The wrapped object. ``` -------------------------------- ### SettingsPropertyDefinition.SettingType Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsPropertyDefinition.html Gets the type of the setting. ```csharp public SettingType SettingType { get; } ``` -------------------------------- ### OnGameStart Method Source: https://mcm.bannerlord.aragas.org/api/MCM.MCMSubModule.html Called during the game startup process. Use this for initializing game systems or modules. ```APIDOC ## OnGameStart(Game, IGameStarter) ### Description Called during the game startup process. Use this for initializing game systems or modules. ### Method Protected override void ### Parameters - **game** (Game) - The game instance. - **gameStarterObject** (IGameStarter) - The game starter object providing access to game initialization services. ### Code ```csharp protected override void OnGameStart(Game game, IGameStarter gameStarterObject) ``` ``` -------------------------------- ### SettingsPropertyDefinition.PropertyReference Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsPropertyDefinition.html Gets the reference to the property. ```csharp public IRef PropertyReference { get; } ``` -------------------------------- ### CreatePreset Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.Global.SettingsWrapper.html Abstract method to create a settings preset. ```APIDOC ## CreatePreset(object? @object) ### Description Abstract method to create a settings preset. ### Parameters - **object** (object?) - The object to use for preset creation. ### Returns ISettingsPreset ``` -------------------------------- ### GroupOrder Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyGroupDefinitionWrapper.html Gets the order of the group. ```APIDOC ## GroupOrder ### Description Gets the order of the group. ### Property Value - **int** - The order of the group. ``` -------------------------------- ### FluentPerCampaignSettings UIVersion Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.PerCampaign.FluentPerCampaignSettings.html Gets the UI version for the settings. This is a sealed override. ```csharp public override sealed int UIVersion { get; } ``` -------------------------------- ### PropertyDefinitionButtonWrapper.Content Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionButtonWrapper.html Gets the content of the button. ```APIDOC ## Content ### Description Gets the content of the button. ### Property Value - **string** - The content of the button. ``` -------------------------------- ### Instance Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.BaseSettingsProvider.html Provides access to the singleton instance of the BaseSettingsProvider. ```APIDOC ## Instance Property ### Description Provides access to the singleton instance of the BaseSettingsProvider. ### Property Value BaseSettingsProvider ``` -------------------------------- ### Implement Custom Settings Format Source: https://mcm.bannerlord.aragas.org/articles/MCMv5/mcmv5.html Define a custom settings format by implementing the 'ISettingsFormat' interface. This example shows a YAML format. ```csharp internal class YamlSettingsFormat : ISettingsFormat { ... public IEnumerable FormatTypes { get; } = new [] { "your_prefix_yaml", "your_prefix_yml" }; ... } ``` -------------------------------- ### CreatePreset Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.BaseSettingsBuilder.html Creates a preset for settings. ```csharp public abstract ISettingsBuilder CreatePreset(string id, string name, Action builder) ``` -------------------------------- ### BehaviorType Property Source: https://mcm.bannerlord.aragas.org/api/MCM.SettingsProviderMissionBehavior.html Gets the type of the mission behavior. ```APIDOC ## BehaviorType ### Description Gets the type of the mission behavior. ### Property Value MissionBehaviorType ``` -------------------------------- ### JsonSettingsPreset FromFile Method (BaseSettings) Source: https://mcm.bannerlord.aragas.org/api/MCM.Implementation.JsonSettingsPreset.html Creates a JsonSettingsPreset instance by loading settings from a specified GameFile using existing BaseSettings. Requires BaseSettings and GameFile. ```csharp public static JsonSettingsPreset? FromFile(BaseSettings settings, GameFile file) ``` -------------------------------- ### GroupOrder Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyGroupDefinitionWrapper.html Gets the order of the settings group. ```csharp public int GroupOrder { get; } ``` -------------------------------- ### Create Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.Global.SettingsWrapper.html Abstract method to create a new instance of BaseSettings. ```APIDOC ## Create(object? @object) ### Description Abstract method to create a new instance of BaseSettings. ### Parameters - **object** (object?) - The object to use for creation. ### Returns BaseSettings ``` -------------------------------- ### Id Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionWithIdWrapper.html Gets the identifier of the property definition. ```APIDOC ## Id ### Description Gets the unique identifier for the property definition. ### Property Value - **string**: The ID of the property definition. ``` -------------------------------- ### Create Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.BaseSettingsBuilder.html Creates a new settings builder instance. ```csharp public static ISettingsBuilder? Create(string id, string displayName) ``` -------------------------------- ### Create Default Preset with Fluent Builder Source: https://mcm.bannerlord.aragas.org/articles/MCMv5/mcmv5-fluent-builder.html Demonstrates how to access and configure the default preset using the Fluent Builder interface. This is useful for setting up default configurations for your mod's settings. ```csharp builder.CreatePreset(BaseSettings.DefaultPresetId, BaseSettings.DefaultPresetName, pBuilder => { }); ``` -------------------------------- ### SelectedIndex Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Attributes.v2.SettingPropertyDropdownAttribute.html Gets the selected index of the dropdown. ```APIDOC ## SelectedIndex ### Description Gets the currently selected index of the dropdown. ### Property Value - **SelectedIndex** (int) - The selected index. ``` -------------------------------- ### CreateNew Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.Global.SettingsWrapper.html Creates a new instance of BaseSettings. ```APIDOC ## CreateNew() ### Description Creates a new instance of BaseSettings. ### Returns BaseSettings ``` -------------------------------- ### Get() Method Source: https://mcm.bannerlord.aragas.org/api/MCM.SettingsProviderCampaignBehavior.html Retrieves settings of a specified type. ```APIDOC ## Get() ### Description Retrieves settings of a specified type. ### Returns TSettings - The settings object of the specified type, or null if not found. ### Type Parameters #### TSettings - TSettings: A type that inherits from BaseSettings and has a parameterless constructor. ``` -------------------------------- ### CopyAsNew Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.Global.SettingsWrapper.html Creates a new instance of BaseSettings by copying the current settings. ```APIDOC ## CopyAsNew() ### Description Creates a new instance of BaseSettings by copying the current settings. ### Returns BaseSettings ``` -------------------------------- ### Get() Method Source: https://mcm.bannerlord.aragas.org/api/MCM.SettingsProviderMissionBehavior.html Retrieves settings of a specific type. ```APIDOC ## Get() ### Description Retrieves settings of a specific type. ### Returns TSettings - The requested settings object, or null if not found. ### Type Parameters `TSettings` - The type of settings to retrieve. Must inherit from BaseSettings and have a parameterless constructor. ``` -------------------------------- ### SettingsProviderWrapper.Create Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsProviderWrapper.html Abstract method to create a BaseSettings object from a given object. Derived classes must implement this to define how settings are created. ```csharp protected abstract BaseSettings? Create(object obj)__ ``` -------------------------------- ### FormatTypes Source: https://mcm.bannerlord.aragas.org/api/MCM.Implementation.BaseJsonSettingsFormat.html Gets the supported format types for this settings format. ```APIDOC ## FormatTypes ### Description Gets the supported format types for this settings format. ### Property public virtual IEnumerable FormatTypes { get; } ### Returns - **IEnumerable** - An enumerable collection of supported format type strings. ``` -------------------------------- ### Create(string, string) Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.BaseSettingsBuilder.html Creates a new settings builder instance. ```APIDOC ## Create(string id, string displayName) ### Description Creates a new settings builder instance. ### Method ```csharp static ISettingsBuilder? Create(string id, string displayName) ``` ### Parameters #### Parameters - **id** (string) - The unique identifier for the settings. - **displayName** (string) - The display name for the settings. ### Returns ISettingsBuilder ``` -------------------------------- ### Value Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.RefWrapper.html Gets or sets the value of the wrapped object. ```APIDOC ## Value Property ### Description Gets or sets the current value of the wrapped object. ### Property Value - **object?** (object) - The value of the wrapped object. ``` -------------------------------- ### CreatePreset Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.ISettingsBuilder.html Creates a preset for settings. ```APIDOC ## CreatePreset(string id, string name, Action builder) ### Description Creates a preset for settings. ### Method ``` ISettingsBuilder CreatePreset(string id, string name, Action builder) ``` ### Parameters #### Parameters - **id** (string) - Description - **name** (string) - Description - **builder** (Action) - Description ### Returns ISettingsBuilder - The settings builder. ``` -------------------------------- ### Value Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.ProxyRef-1.html Gets or sets the value stored in the ProxyRef. ```APIDOC ## Value ### Description Gets or sets the value. ### Property Value - **object?** (object?) - The value. ``` -------------------------------- ### Type Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.RefWrapper.html Gets the underlying type of the wrapped value. ```APIDOC ## Type Property ### Description Gets the underlying type of the value being wrapped. ### Property Value - **Type** (Type) - The underlying type of the value. ``` -------------------------------- ### BuildAsGlobal Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.BaseSettingsBuilder.html Returns a Global setting instance. Use Register and Unregister for MCM to use it. ```csharp public abstract FluentGlobalSettings BuildAsGlobal() ``` -------------------------------- ### XmlSettingsFormat.FormatTypes Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Implementation.XmlSettingsFormat.html Gets the supported format types for settings. ```APIDOC ## FormatTypes ### Description Gets the collection of format types supported by this settings format. ### Property Value IEnumerable - A collection of strings representing the supported format types. ``` -------------------------------- ### FluentPerCampaignSettings Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.PerCampaign.FluentPerCampaignSettings.html Initializes a new instance of the FluentPerCampaignSettings class with specified parameters for ID, display name, folder structure, UI version, delimiter, event handler, setting groups, and presets. ```csharp public FluentPerCampaignSettings(string id, string displayName, string folderName, string subFolder, int uiVersion, char subGroupDelimiter, PropertyChangedEventHandler? onPropertyChanged, IEnumerable settingPropertyGroups, IEnumerable presets) ``` -------------------------------- ### SelectedIndex Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.SelectedIndexWrapper.html Gets or sets the selected index of the wrapper. ```APIDOC ## SelectedIndex ### Description Gets or sets the selected index. ### Property Value int ``` -------------------------------- ### BuildAsGlobal Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.ISettingsBuilder.html Returns a Global setting instance. Use Register and Unregister for MCM to use it. ```APIDOC ## BuildAsGlobal() ### Description Returns a Global setting instance. Use Register and Unregister for MCM to use it. ### Method ``` FluentGlobalSettings BuildAsGlobal() ``` ### Returns FluentGlobalSettings ``` -------------------------------- ### FluentPerCampaignSettings FolderName Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.PerCampaign.FluentPerCampaignSettings.html Gets the folder name for storing settings. This is a sealed override. ```csharp public override sealed string FolderName { get; } ``` -------------------------------- ### LoadPreset() Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.ISettingsPreset.html This method loads a settings preset. ```APIDOC ## LoadPreset() ### Description Loads and returns the settings associated with this preset. ### Returns - **BaseSettings**: The loaded settings preset. ``` -------------------------------- ### StorageRef.Value Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.StorageRef.html Gets or sets the value stored in the StorageRef. ```APIDOC ## Value ### Description Gets or sets the value stored in the StorageRef. ### Property Value object? - The value stored in the StorageRef. ``` -------------------------------- ### Instance Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.PerSave.PerSaveSettings-1.html Provides a static, modder-friendly way to get the settings instance from any place. The type T must inherit from PerSaveSettings and have a parameterless constructor. ```APIDOC ## Property Instance A modder flriendly way to get settings from any place ### Signature ```csharp public static T? Instance { get; } ``` ### Type Parameters `T` - The type of the settings, which must inherit from `PerSaveSettings` and have a `new()` constraint. ### Property Value T - The instance of the settings class. ``` -------------------------------- ### BuildAsPerCampaign Settings Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.ISettingsBuilder.html Returns a PerCampaign setting instance. Use Register and Unregister for MCM to use it. The registered settings will be cleared before and after player joins the campaign, so do the register thing when the campaign was already joined in. ```csharp FluentPerCampaignSettings BuildAsPerCampaign()__ ``` -------------------------------- ### PropertyRef Instance Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.PropertyRef.html Gets the instance on which the property is defined. ```csharp public object Instance { get; } ``` -------------------------------- ### BuildAsPerCampaign Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.BaseSettingsBuilder.html Returns a PerCampaign setting instance. Use Register and Unregister for MCM to use it. The registered settings will be cleared before and after player joins the campaign, so do the register thing when the campaign was already joined in. ```csharp public abstract FluentPerCampaignSettings BuildAsPerCampaign() ``` -------------------------------- ### EditableMinValue Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionWithEditableMinMaxWrapper.html Gets the editable minimum value for the property. ```APIDOC ## EditableMinValue ### Description Gets the editable minimum value for the property. ### Property Value - **decimal** - The editable minimum value. ``` -------------------------------- ### CreatePreset(string, string, Action) Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.BaseSettingsBuilder.html Creates a preset for the settings. ```APIDOC ## CreatePreset(string id, string name, Action builder) ### Description Creates a preset for the settings. ### Method ```csharp abstract ISettingsBuilder CreatePreset(string id, string name, Action builder) ``` ### Parameters #### Parameters - **id** (string) - The unique identifier for the preset. - **name** (string) - The name of the preset. - **builder** (Action) - An action delegate to configure the preset. ### Returns ISettingsBuilder - The settings builder. ``` -------------------------------- ### EditableMaxValue Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionWithEditableMinMaxWrapper.html Gets the editable maximum value for the property. ```APIDOC ## EditableMaxValue ### Description Gets the editable maximum value for the property. ### Property Value - **decimal** - The editable maximum value. ``` -------------------------------- ### FluentPerCampaignSettings Methods Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.PerCampaign.FluentPerCampaignSettings.html Provides methods for creating new settings, retrieving built-in presets, and registering/unregistering settings. ```APIDOC ## FluentPerCampaignSettings Methods ### CreateNew() - **Description**: Creates a new instance of BaseSettings. - **Returns**: BaseSettings ### GetBuiltInPresets() - **Description**: Retrieves all built-in presets for the campaign settings. - **Returns**: IEnumerable ### Register() - **Description**: Registers the campaign settings. ### Unregister() - **Description**: Unregisters the campaign settings. ``` -------------------------------- ### EditableMinValue Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionWithEditableMinMaxWrapper.html Gets the editable minimum value for the property. ```csharp public decimal EditableMinValue { get; } ``` -------------------------------- ### EditableMaxValue Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionWithEditableMinMaxWrapper.html Gets the editable maximum value for the property. ```csharp public decimal EditableMaxValue { get; } ``` -------------------------------- ### BuildAsGlobal Settings Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.ISettingsBuilder.html Returns a Global setting instance. Use Register and Unregister for MCM to use it. ```csharp FluentGlobalSettings BuildAsGlobal()__ ``` -------------------------------- ### Order Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Attributes.BaseSettingPropertyAttribute.html Gets or sets the order of the setting in the settings menu. Lower values appear earlier. ```csharp public int Order { get; set; } ``` -------------------------------- ### SettingsProviderCampaignBehavior Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.SettingsProviderCampaignBehavior.html Initializes a new instance of the SettingsProviderCampaignBehavior class. ```APIDOC ## SettingsProviderCampaignBehavior(BaseSettingsProvider? baseSettingsProvider) ### Description Initializes a new instance of the SettingsProviderCampaignBehavior class. ### Parameters #### Parameters - **baseSettingsProvider** (BaseSettingsProvider) - The base settings provider. ``` -------------------------------- ### Parent Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsPropertyGroupDefinition.html Gets or sets the parent SettingsPropertyGroupDefinition of this group. ```csharp public SettingsPropertyGroupDefinition? Parent { get; set; } ``` -------------------------------- ### GroupNameRaw Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsPropertyGroupDefinition.html Gets the raw, unformatted group name. ```csharp public string GroupNameRaw { get; } ``` -------------------------------- ### FluentPerCampaignSettings Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.PerCampaign.FluentPerCampaignSettings.html Initializes a new instance of the FluentPerCampaignSettings class with specified parameters. ```APIDOC ## FluentPerCampaignSettings Constructor ### Description Initializes a new instance of the FluentPerCampaignSettings class. ### Parameters - **id** (string) - Unique identifier for the setting. - **displayName** (string) - The display name shown in the settings menu. - **folderName** (string) - The name of the folder where settings are stored. - **subFolder** (string) - The name of a subfolder within the main folder. - **uiVersion** (int) - The version of the UI. - **subGroupDelimiter** (char) - The delimiter used for sub-groups. - **onPropertyChanged** (PropertyChangedEventHandler?) - Event handler for property changes. - **settingPropertyGroups** (IEnumerable) - Collection of setting property group definitions. - **presets** (IEnumerable) - Collection of preset builders. ``` -------------------------------- ### Build Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.ISettingsPresetBuilder.html Builds and returns a new ISettingsPreset based on the provided settings. ```APIDOC ## Build(BaseSettings) ### Description Builds and returns a new ISettingsPreset based on the provided settings. ### Method Build ### Parameters #### Path Parameters - **settings** (BaseSettings) - Required - The base settings to use for building the preset. ### Returns ISettingsPreset ``` -------------------------------- ### PropertyDefinitionWithIdWrapper Id Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionWithIdWrapper.html Gets the ID of the property definition. ```csharp public string Id { get; } ``` -------------------------------- ### SettingsId Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsDefinition.html Gets the unique identifier for the settings definition. ```csharp public string SettingsId { get; } ``` -------------------------------- ### JsonSettingsPreset FromFile Method (SettingsId) Source: https://mcm.bannerlord.aragas.org/api/MCM.Implementation.JsonSettingsPreset.html Creates a JsonSettingsPreset instance by loading settings from a specified GameFile using a settings ID and a factory function. Requires settings ID, GameFile, and Func. ```csharp public static JsonSettingsPreset? FromFile(string settingsId, GameFile file, Func getNewSettings) ``` -------------------------------- ### JsonSettingsPreset Constructor with BaseSettings Source: https://mcm.bannerlord.aragas.org/api/MCM.Implementation.JsonSettingsPreset.html Initializes a new instance of JsonSettingsPreset using existing BaseSettings. Requires settings, an ID, a name, and a GameFile. ```csharp public JsonSettingsPreset(BaseSettings settings, string id, string name, GameFile file) ``` -------------------------------- ### SettingSnapshot.Path Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingSnapshot.html Gets the path associated with the setting snapshot. ```APIDOC ## Path ### Description Gets the path associated with the setting snapshot. ### Property Value string - The path. ``` -------------------------------- ### SettingSnapshot.JsonContent Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingSnapshot.html Gets the JSON content of the setting snapshot. ```APIDOC ## JsonContent ### Description Gets the JSON content stored within the setting snapshot. ### Property Value string - The JSON content. ``` -------------------------------- ### FluentPerCampaignSettings CreateNew Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.PerCampaign.FluentPerCampaignSettings.html Creates a new instance of BaseSettings. This is an override of the base class method. ```csharp public override BaseSettings CreateNew() ``` -------------------------------- ### GameDirectory Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.GameFeatures.GameDirectory.html Initializes a new instance of the GameDirectory record with the specified platform directory type and path. ```csharp public GameDirectory(PlatformDirectoryType Type, string Path) ``` -------------------------------- ### Instance Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.Global.GlobalSettings-1.html A modder-friendly way to get settings from any place. This static property provides access to the singleton instance of the settings class. ```APIDOC ## Instance Property ### Description A modder friendly way to get settings from any place. ### Property Value `T?` - The instance of the settings class. ``` -------------------------------- ### MCMSubModule OnBeforeInitialModuleScreenSetAsRoot Method Source: https://mcm.bannerlord.aragas.org/api/MCM.MCMSubModule.html Overrides the base method to execute logic before the initial module screen is set as the root. ```csharp protected override void OnBeforeInitialModuleScreenSetAsRoot() ``` -------------------------------- ### SelectedIndex Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.IPropertyDefinitionDropdown.html Gets the currently selected index of the dropdown. ```APIDOC ## SelectedIndex Property ### Description Gets the currently selected index of the dropdown. ### Property Value - **int**: The index of the selected item. ``` -------------------------------- ### Fluent API Preset Creation Source: https://mcm.bannerlord.aragas.org/articles/MCMv5/mcmv5.html Demonstrates creating a preset with various property types using the Fluent API builder. Ensure the builder is initialized correctly. ```csharp var builder = BaseSettingsBuilder.Create("Testing_v1", "Testing Fluent API Presets")! ... .CreatePreset("Test", presetBuilder => presetBuilder .SetPropertyValue("prop_1", true) .SetPropertyValue("prop_2", 2) .SetPropertyValue("prop_3", 1.5F) .SetPropertyValue("prop_4", "HueHueHue")); ``` -------------------------------- ### Type Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.ProxyRef-1.html Gets the underlying type of the value stored in the ProxyRef. ```APIDOC ## Type ### Description Underlying type of the value. ### Property Value - **Type** (Type) - The type of the value. ``` -------------------------------- ### FluentPerCampaignSettings GetBuiltInPresets Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.PerCampaign.FluentPerCampaignSettings.html Retrieves the built-in presets for the campaign settings. This is a sealed override. ```csharp public override sealed IEnumerable GetBuiltInPresets() ``` -------------------------------- ### BuildAsGlobal() Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.BaseSettingsBuilder.html Returns a Global setting instance. Use Register and Unregister for MCM to use it. ```APIDOC ## BuildAsGlobal() ### Description Returns a Global setting instance. Use Register and Unregister for MCM to use it. ### Method ```csharp abstract FluentGlobalSettings BuildAsGlobal() ``` ### Returns FluentGlobalSettings ``` -------------------------------- ### FormatTypes Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Implementation.JsonSettingsFormat.html Gets the supported format types for this settings format. ```APIDOC ## FormatTypes ### Description Retrieves the collection of format types supported by this settings format. ### Property Value IEnumerable - A collection of strings representing the supported format types. ``` -------------------------------- ### JsonSettingsPreset Name Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Implementation.JsonSettingsPreset.html Gets the display name of the settings preset. ```csharp public string Name { get; } ``` -------------------------------- ### FluentGlobalSettings Methods Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.Global.FluentGlobalSettings.html Provides methods for creating new settings instances, retrieving built-in presets, and managing the registration of settings. ```APIDOC ## FluentGlobalSettings Methods ### CreateNew() ```public override sealed BaseSettings CreateNew()``` #### Returns BaseSettings ### GetBuiltInPresets() ```public override sealed IEnumerable GetBuiltInPresets()``` #### Returns IEnumerable ### Register() ```public void Register()``` ### Unregister() ```public void Unregister()``` ``` -------------------------------- ### StorageRef.Type Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.StorageRef.html Gets the underlying type of the value stored in the StorageRef. ```APIDOC ## Type ### Description Gets the underlying type of the value stored in the StorageRef. ### Property Value Type - The underlying type of the value. ``` -------------------------------- ### GameFile Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.GameFeatures.GameFile.html Initializes a new instance of the GameFile record with the specified owner directory and file name. Use this to create a GameFile object. ```csharp public GameFile(GameDirectory Owner, string Name) ``` -------------------------------- ### PropertyRef Value Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.PropertyRef.html Gets or sets the value of the wrapped property. ```csharp public object? Value { get; set; } ``` -------------------------------- ### SettingsPresetWrapper Create Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsPresetWrapper-1.html Abstract method to create a TSetting instance from an object. Implementations must provide the logic for creating settings. ```csharp protected abstract TSetting Create(object? @object) ``` -------------------------------- ### GetPropertyDefinitionWrappers (object) Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsUtils.html Gets wrappers for property definitions from a single object. ```APIDOC ## GetPropertyDefinitionWrappers (object) ### Description Gets wrappers for property definitions from a single object. ### Method `public static IEnumerable GetPropertyDefinitionWrappers(object property)` ### Parameters #### Path Parameters - **property** (object) - Description not provided ### Returns - **IEnumerable** - An enumerable collection of IPropertyDefinitionBase wrappers. ``` -------------------------------- ### LoadPreset Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.MemorySettingsPreset.html Loads and returns the BaseSettings object associated with the preset. ```csharp public BaseSettings LoadPreset() ``` -------------------------------- ### ValueFormat Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionWithFormatWrapper.html Gets the format in which the slider's value will be displayed. ```APIDOC ## ValueFormat ### Description Gets the format in which the slider's value will be displayed. ### Property Value - **string** - The format string for the value. ``` -------------------------------- ### LoadSettings Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.PerSave.IPerSaveSettingsContainer.html Loads the current game settings from storage. This method is essential for initializing the game with previously saved configurations. ```APIDOC ## LoadSettings() ### Description Loads the current game settings from storage. This method is essential for initializing the game with previously saved configurations. ### Method void ### Endpoint N/A (Interface Method) ### Parameters None ### Request Example N/A ### Response N/A (void method) ### Response Example N/A ``` -------------------------------- ### SubGroups Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsPropertyGroupDefinition.html Gets an enumerable collection of nested SettingsPropertyGroupDefinition objects. ```csharp public IEnumerable SubGroups { get; } ``` -------------------------------- ### BaseSettings CreateNew Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.BaseSettings.html Virtual method to create a new, default instance of settings. ```csharp public virtual BaseSettings CreateNew() ``` -------------------------------- ### BuildAsPerCampaign() Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.BaseSettingsBuilder.html Returns a PerCampaign setting instance. Use Register and Unregister for MCM to use it. The registered settings will be cleared before and after player joins the campaign, so do the register thing when the campaign was already joined in. ```APIDOC ## BuildAsPerCampaign() ### Description Returns a PerCampaign setting instance. Use Register and Unregister for MCM to use it. The registered settings will be cleared before and after player joins the campaign, so do the register thing when the campaign was already joined in. ### Method ```csharp abstract FluentPerCampaignSettings BuildAsPerCampaign() ``` ### Returns FluentPerCampaignSettings ``` -------------------------------- ### PropertyDefinitionWithCustomFormatterWrapper CustomFormatter Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionWithCustomFormatterWrapper.html Gets the type of the custom formatter for the property. ```csharp public Type? CustomFormatter { get; } ``` -------------------------------- ### GameDirectory Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.GameFeatures.GameDirectory.html Initializes a new instance of the GameDirectory class with the specified platform directory type and path. ```APIDOC ## GameDirectory(PlatformDirectoryType, string) ### Description Initializes a new instance of the GameDirectory class. ### Parameters #### Path Parameters - **Type** (PlatformDirectoryType) - Description of the platform directory type. - **Path** (string) - The string representing the directory path. ``` -------------------------------- ### PropertyDefinitionButtonWrapper Content Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionButtonWrapper.html Gets the string content of the button property. ```csharp public string Content { get; } ``` -------------------------------- ### SettingsProviderCampaignBehavior Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.SettingsProviderCampaignBehavior.html Initializes a new instance of the SettingsProviderCampaignBehavior class with an optional BaseSettingsProvider. ```csharp public SettingsProviderCampaignBehavior(BaseSettingsProvider? baseSettingsProvider) ``` -------------------------------- ### DiscoveryTypes Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Properties.ISettingsPropertyDiscoverer.html Gets the types of settings properties that this discoverer can handle. ```APIDOC ## Properties ### DiscoveryTypes ```csharp IEnumerable DiscoveryTypes { get; } ``` #### Property Value `IEnumerable` - A collection of strings representing the discovery types. ``` -------------------------------- ### GameFile Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.GameFeatures.GameFile.html Initializes a new instance of the GameFile class with the specified owner directory and file name. ```APIDOC ## GameFile(GameDirectory Owner, string Name) ### Description Initializes a new instance of the GameFile class. ### Parameters #### Path Parameters - **Owner** (GameDirectory) - The game directory that owns this file. - **Name** (string) - The name of the game file. ``` -------------------------------- ### Object Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.Global.SettingsWrapper.html Gets the underlying object associated with the settings wrapper. ```APIDOC ## Object ### Description Gets the underlying object associated with the settings wrapper. ### Property Value object ``` -------------------------------- ### SettingsPresetWrapper Methods Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsPresetWrapper-1.html Provides methods for creating, loading, and saving settings presets. ```APIDOC ## Methods ### Create ```protected abstract TSetting Create(object? @object)``` #### Parameters `object` object #### Returns TSetting ### LoadPreset ```public BaseSettings LoadPreset()``` #### Returns BaseSettings ### SavePreset ```public bool SavePreset(BaseSettings settings)``` #### Parameters `settings` BaseSettings #### Returns bool ``` -------------------------------- ### PropertyRef Type Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.PropertyRef.html Gets the underlying type of the property's value. ```csharp public Type Type { get; } ``` -------------------------------- ### GetBuiltInPresets Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.Global.SettingsWrapper.html Retrieves the built-in settings presets. ```APIDOC ## GetBuiltInPresets() ### Description Retrieves the built-in settings presets. ### Returns IEnumerable ``` -------------------------------- ### PropertyRef PropertyInfo Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.PropertyRef.html Gets the PropertyInfo object that describes the wrapped property. ```csharp public PropertyInfo PropertyInfo { get; } ``` -------------------------------- ### BuildAsPerCampaign Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.ISettingsBuilder.html Returns a PerCampaign setting instance. Use Register and Unregister for MCM to use it. The registered settings will be cleared before and after player joins the campaign, so do the register thing when the campaign was already joined in. ```APIDOC ## BuildAsPerCampaign() ### Description Returns a PerCampaign setting instance. Use Register and Unregister for MCM to use it. The registered settings will be cleared before and after player joins the campaign, so do the register thing when the campaign was already joined in. ### Method ``` FluentPerCampaignSettings BuildAsPerCampaign() ``` ### Returns FluentPerCampaignSettings ``` -------------------------------- ### GetPropertyDefinitionWrappers (IReadOnlyCollection) Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsUtils.html Gets wrappers for property definitions from a read-only collection of objects. ```APIDOC ## GetPropertyDefinitionWrappers (IReadOnlyCollection) ### Description Gets wrappers for property definitions from a read-only collection of objects. ### Method `public static IEnumerable GetPropertyDefinitionWrappers(IReadOnlyCollection properties)` ### Parameters #### Path Parameters - **properties** (IReadOnlyCollection) - Description not provided ### Returns - **IEnumerable** - An enumerable collection of IPropertyDefinitionBase wrappers. ``` -------------------------------- ### CustomFormatter Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionWithCustomFormatterWrapper.html Gets the type of the custom formatter associated with this property definition. ```APIDOC ## CustomFormatter Property ### Description Gets the type of the custom formatter associated with this property definition. ### Property Value - **Type** (Type?) - The type of the custom formatter. ``` -------------------------------- ### Build Settings Preset Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.ISettingsPresetBuilder.html Builds and returns the final ISettingsPreset object using the provided BaseSettings. ```csharp ISettingsPreset Build(BaseSettings settings) ``` -------------------------------- ### SubGroupDelimiter Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsPropertyGroupDefinition.html Gets or sets the character used to delimit subgroup names. ```csharp protected char SubGroupDelimiter { get; set; } ``` -------------------------------- ### Create a Preset Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.ISettingsBuilder.html Creates a preset for settings. Presets allow users to save and load specific configurations. ```csharp ISettingsBuilder CreatePreset(string id, string name, Action builder)__ ``` -------------------------------- ### ValueFormatFunc Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionWithActionFormatWrapper.html Gets a function that formats the property's value into a string. ```APIDOC ## ValueFormatFunc ### Description Gets a function that formats the property's value into a string. This can be used for custom display logic. ### Property Value - **Func** - A function that takes an object (the property value) and returns a formatted string. ``` -------------------------------- ### SettingsDefinition Constructor (string, string, List) Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsDefinition.html Initializes a new instance of the SettingsDefinition class with an ID, display name, and a list of settings property groups. ```csharp public SettingsDefinition(string id, string displayName, List settingsPropertyGroups) ``` -------------------------------- ### DisplayName Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Attributes.BaseSettingPropertyAttribute.html Gets the display name of the setting, which appears in the settings menu. ```csharp public string DisplayName { get; } ``` -------------------------------- ### SettingsDefinition Constructor (string, string, IEnumerable) Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsDefinition.html Initializes a new instance of the SettingsDefinition class with an ID, display name, and a collection of settings properties. ```csharp public SettingsDefinition(string id, string displayName, IEnumerable settingsProperties) ``` -------------------------------- ### Dropdown SelectedValue Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.Dropdown-1.html Gets or sets the value of the currently selected item in the dropdown. ```csharp public T SelectedValue { get; set; } ``` -------------------------------- ### GroupName Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyGroupDefinitionWrapper.html Gets the name of the settings group, including SubGroup notation if present. ```APIDOC ## GroupName ### Description The name of the settings group. Includes SubGroup notation if present. ### Property Value - **string** - The name of the group. ``` -------------------------------- ### FluentGlobalSettings Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.Global.FluentGlobalSettings.html Initializes a new instance of the FluentGlobalSettings class with specified parameters for configuration and event handling. ```APIDOC ## FluentGlobalSettings Constructor ### Description Initializes a new instance of the FluentGlobalSettings class. ### Parameters - **id** (string) - Unique identifier for saving settings. - **displayName** (string) - The display name shown in the settings menu. - **folderName** (string) - The name of the folder where settings are stored. - **subFolder** (string) - The name of a subfolder within the main folder. - **format** (string) - The file format for saving settings. - **uiVersion** (int) - The version of the user interface. - **subGroupDelimiter** (char) - The delimiter used for sub-groups. - **onPropertyChanged** (PropertyChangedEventHandler?) - Event handler for property changes. - **settingPropertyGroups** (IEnumerable) - Collection of setting property group definitions. - **presets** (IEnumerable) - Collection of preset builders. ``` -------------------------------- ### Load Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Implementation.BaseJsonSettingsFormat.html Public virtual method to load settings from a file. It takes a BaseSettings object, a GameDirectory, and a filename as input, returning the loaded BaseSettings. ```csharp public virtual BaseSettings Load(BaseSettings settings, GameDirectory directory, string filename) ``` -------------------------------- ### SettingProperties Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsPropertyGroupDefinition.html Gets an enumerable collection of ISettingsPropertyDefinition objects contained within this group. ```csharp public IEnumerable SettingProperties { get; } ``` -------------------------------- ### DisplayGroupNameRaw Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsPropertyGroupDefinition.html Gets the raw display name of the group, without any formatting or overrides. ```csharp public string DisplayGroupNameRaw { get; } ``` -------------------------------- ### MemorySettingsFormat.Load Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.MemorySettingsFormat.html Loads settings from a specified file. Requires the settings object, game directory, and filename. ```csharp public BaseSettings Load(BaseSettings settings, GameDirectory directory, string filename) ``` -------------------------------- ### IsToggle Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionGroupToggleWrapper.html Gets a value indicating whether the property definition group is a toggle. ```APIDOC ## IsToggle ### Description Gets a value indicating whether the property definition group is a toggle. ### Property Value - **bool**: True if the group is a toggle, false otherwise. ``` -------------------------------- ### BaseSettings CopyAsNew Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.BaseSettings.html Virtual method to create a new instance of settings as a copy. ```csharp public virtual BaseSettings CopyAsNew() ``` -------------------------------- ### AttributePropertyDefinitionGroupToggleWrapper.IsToggle Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.AttributePropertyDefinitionGroupToggleWrapper.html Gets a value indicating whether the property definition group is a toggle. ```APIDOC ## IsToggle ### Description Gets a value indicating whether the property definition group is a toggle. ### Property Value - **bool**: True if the property definition group is a toggle; otherwise, false. ``` -------------------------------- ### ISettingsPreset LoadPreset Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.ISettingsPreset.html Loads the settings from a preset. This method returns the loaded settings as a BaseSettings object. ```csharp BaseSettings LoadPreset() ``` -------------------------------- ### UIVersion Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.PerSave.BasePerSaveSettingsWrapper.html Gets the UI version for the settings. This property is overridden from the base class. ```csharp public override int UIVersion { get; }__ ``` -------------------------------- ### SettingsProviderWrapper.SaveSettings Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsProviderWrapper.html Abstract method to save the current state of settings. Derived classes must implement the persistence logic. ```csharp public override void SaveSettings(BaseSettings settings)__ ``` -------------------------------- ### SettingSnapshot Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingSnapshot.html Initializes a new instance of the SettingSnapshot class with the specified path and JSON content. ```APIDOC ## SettingSnapshot(string Path, string JsonContent) ### Description Initializes a new instance of the SettingSnapshot class. ### Parameters #### Path string - The path associated with the setting snapshot. #### JsonContent string - The JSON content of the setting snapshot. ``` -------------------------------- ### SettingsProviderWrapper.GetSettings Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsProviderWrapper.html Abstract method to retrieve settings for a given identifier. Derived classes must implement this to load and return settings. ```csharp public override BaseSettings? GetSettings(string id)__ ``` -------------------------------- ### GetAllSettingPropertyGroupDefinitions Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsUtils.html Retrieves all settings property group definitions recursively starting from a given group. ```APIDOC ## GetAllSettingPropertyGroupDefinitions ### Description Retrieves all settings property group definitions recursively starting from a given group. ### Method `public static IEnumerable GetAllSettingPropertyGroupDefinitions(SettingsPropertyGroupDefinition settingPropertyGroup)` ### Parameters #### Path Parameters - **settingPropertyGroup** (SettingsPropertyGroupDefinition) - Description not provided ### Returns - **IEnumerable** - An enumerable collection of SettingsPropertyGroupDefinition. ``` -------------------------------- ### Load Source: https://mcm.bannerlord.aragas.org/api/MCM.Implementation.BaseJsonSettingsFormat.html Loads settings from a file, deserializing JSON content. ```APIDOC ## Load ### Description Loads settings from a file, deserializing JSON content. ### Method public virtual BaseSettings Load(BaseSettings settings, GameDirectory directory, string filename) ### Parameters #### Path Parameters - **settings** (BaseSettings) - The settings object to load into. - **directory** (GameDirectory) - The game directory where the file is located. - **filename** (string) - The name of the file to load. ### Returns - **BaseSettings** - The loaded settings object. ``` -------------------------------- ### SettingsPropertyDefinitionWrapper Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.SettingsPropertyDefinitionWrapper.html Initializes a new instance of the SettingsPropertyDefinitionWrapper class. ```APIDOC ## SettingsPropertyDefinitionWrapper(object) ### Description Initializes a new instance of the SettingsPropertyDefinitionWrapper class. ### Parameters #### object - **object** (object) - The object to wrap. ``` -------------------------------- ### SettingsProviderMissionBehavior BehaviorType Property Source: https://mcm.bannerlord.aragas.org/api/MCM.SettingsProviderMissionBehavior.html Gets the type of the mission behavior. This is an override of the base MissionBehavior property. ```csharp public override MissionBehaviorType BehaviorType { get; } ``` -------------------------------- ### SettingsDefinitionWrapper Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.SettingsDefinitionWrapper.html Initializes a new instance of the SettingsDefinitionWrapper class. ```APIDOC ## SettingsDefinitionWrapper(object) ### Description Initializes a new instance of the SettingsDefinitionWrapper class. ### Method public SettingsDefinitionWrapper(object @object) ### Parameters #### Parameters - **object** (object) - Description of the object parameter. ``` -------------------------------- ### IRef Value Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Common.IRef.html Allows getting and setting the value associated with the IRef. The value can be null. ```csharp object? Value { get; set; } ``` -------------------------------- ### OnMissionBehaviorInitialize Method Source: https://mcm.bannerlord.aragas.org/api/MCM.MCMSubModule.html Called when mission behaviors are initialized. This is the place to set up mission-specific logic. ```APIDOC ## OnMissionBehaviorInitialize(Mission) ### Description Called when mission behaviors are initialized. This is the place to set up mission-specific logic. ### Method Public override void ### Parameters - **mission** (Mission) - The mission instance being initialized. ### Code ```csharp public override void OnMissionBehaviorInitialize(Mission mission) ``` ``` -------------------------------- ### MinValue Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionWithMinMaxWrapper.html Gets the minimum value the setting can be set to. This property is used by the slider control. ```APIDOC ## MinValue ### Description The minimum value the setting can be set to. Used by the slider control. ### Property Value - **decimal** ``` -------------------------------- ### GetPresets Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Implementation.BaseSettingsContainer-1.html Retrieves a collection of available settings presets for a given settings ID. Use this to load predefined configurations. ```csharp public IEnumerable GetPresets(string settingsId) ``` -------------------------------- ### MaxValue Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Wrapper.PropertyDefinitionWithMinMaxWrapper.html Gets the maximum value the setting can be set to. This property is used by the slider control. ```APIDOC ## MaxValue ### Description The maximum value the setting can be set to. Used by the slider control. ### Property Value - **decimal** ``` -------------------------------- ### SettingSnapshot JsonContent Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingSnapshot.html Gets the JSON content associated with the setting snapshot. This property is init-only. ```csharp public string JsonContent { get; init; } ``` -------------------------------- ### BaseSettingPropertyAttribute Constructor Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Attributes.BaseSettingPropertyAttribute.html Protected constructor for initializing a BaseSettingPropertyAttribute instance with display name, order, restart requirement, and hint text. ```csharp protected BaseSettingPropertyAttribute(string displayName, int order = -1, bool requireRestart = true, string hintText = "")__ ``` -------------------------------- ### GameDirectory Type Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.GameFeatures.GameDirectory.html Gets or initializes the PlatformDirectoryType of the game directory. This property is immutable after initialization. ```csharp public PlatformDirectoryType Type { get; init; } ``` -------------------------------- ### GetFile Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.GameFeatures.IFileSystemProvider.html Retrieves a specific game file. Use this to access files within game directories. ```csharp GameFile? GetFile(GameDirectory directory, string fileName) ``` -------------------------------- ### BuildAsPerSave Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.BaseSettingsBuilder.html Returns a PerSave setting instance. Use Register and Unregister for MCM to use it. The registered settings will be cleared before and after player joins the campaign, so do the register thing when the campaign was already joined in. ```csharp public abstract FluentPerSaveSettings BuildAsPerSave() ``` -------------------------------- ### FolderName Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.PerSave.BasePerSaveSettingsWrapper.html Gets the folder name for saving settings. This property is overridden from the base class. ```csharp public override string FolderName { get; }__ ``` -------------------------------- ### FluentPerCampaignSettings SettingPropertyGroups Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.PerCampaign.FluentPerCampaignSettings.html Gets the list of setting property group definitions for this campaign setting. ```csharp public List SettingPropertyGroups { get; } ``` -------------------------------- ### BuildAsPerSave Settings Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.FluentBuilder.ISettingsBuilder.html Returns a PerSave setting instance. Use Register and Unregister for MCM to use it. The registered settings will be cleared before and after player joins the campaign, so do the register thing when the campaign was already joined in. ```csharp FluentPerSaveSettings BuildAsPerSave()__ ``` -------------------------------- ### AddSettingsProvider (Service and Implementation) Extension Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.ServiceCollectionExtensions.html Registers a settings provider implementation with the service container, allowing for a service interface and a concrete implementation type. Use this for dependency injection scenarios where you want to abstract the concrete settings provider. ```csharp public static IGenericServiceContainer AddSettingsProvider(this IGenericServiceContainer services) where TService : BaseSettingsProvider where TImplementation : class, TService ``` -------------------------------- ### FluentPerCampaignSettings DiscoveryType Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.PerCampaign.FluentPerCampaignSettings.html Gets the discovery type of the settings. This is an override of the base class property. ```csharp public override string DiscoveryType { get; } ``` -------------------------------- ### HintText Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Attributes.BaseSettingPropertyAttribute.html Gets or sets the hint text displayed at the bottom of the screen when hovering over the setting. ```csharp public string HintText { get; set; } ``` -------------------------------- ### JsonSettingsPreset Constructor with Settings ID and Factory Source: https://mcm.bannerlord.aragas.org/api/MCM.Implementation.JsonSettingsPreset.html Initializes a new instance of JsonSettingsPreset using a settings ID and a factory function to create new settings. Requires settings ID, an ID, a name, a GameFile, and a Func. ```csharp public JsonSettingsPreset(string settingsId, string id, string name, GameFile file, Func getNewSettings) ``` -------------------------------- ### OnSubModuleLoad Method Source: https://mcm.bannerlord.aragas.org/api/MCM.MCMSubModule.html Called when the sub-module is loaded. Use this for any initialization that needs to happen when the module becomes active. ```APIDOC ## OnSubModuleLoad() ### Description Called when the sub-module is loaded. Use this for any initialization that needs to happen when the module becomes active. ### Method Protected override void ### Code ```csharp protected override void OnSubModuleLoad() ``` ``` -------------------------------- ### SettingPropertyDropdownAttribute SelectedIndex Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Attributes.v2.SettingPropertyDropdownAttribute.html Gets the currently selected index for the dropdown property. This property is read-only. ```csharp public int SelectedIndex { get; }__ ``` -------------------------------- ### SettingsPropertyDefinition Constructor (Multiple Properties) Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsPropertyDefinition.html Initializes a new instance of the SettingsPropertyDefinition class with a collection of property definitions. ```csharp public SettingsPropertyDefinition(IEnumerable propertyDefinitions, IPropertyGroupDefinition propertyGroupDefinition, IRef propertyReference, char subGroupDelimiter) ``` -------------------------------- ### MCMSubModule OnMissionBehaviorInitialize Method Source: https://mcm.bannerlord.aragas.org/api/MCM.MCMSubModule.html Handles logic when a mission behavior is initialized. Accepts the Mission object. ```csharp public override void OnMissionBehaviorInitialize(Mission mission) ``` -------------------------------- ### SettingsProviderWrapper.GetPresets Method Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.SettingsProviderWrapper.html Abstract method to retrieve settings presets for a given identifier. Derived classes must implement this to provide specific preset data. ```csharp public override abstract IEnumerable GetPresets(string id)__ ``` -------------------------------- ### Values Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Xml.PropertyDropdownXmlModel.html Gets or sets the array of string values available in the dropdown. This property is of type string[]. ```csharp public string[] Values { get; set; }__ ``` -------------------------------- ### SelectedIndex Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Xml.PropertyDropdownXmlModel.html Gets or sets the index of the currently selected item in the dropdown. This property is of type int. ```csharp public int SelectedIndex { get; set; }__ ``` -------------------------------- ### FluentGlobalSettings Methods Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.Base.Global.FluentGlobalSettings.html Contains methods for creating new settings instances, retrieving built-in presets, and registering or unregistering the settings. These methods are essential for the lifecycle management of global settings. ```csharp public override sealed BaseSettings CreateNew() ``` ```csharp public override sealed IEnumerable GetBuiltInPresets() ``` ```csharp public void Register() ``` ```csharp public void Unregister() ``` -------------------------------- ### GameDirectory Path Property Source: https://mcm.bannerlord.aragas.org/api/MCM.Abstractions.GameFeatures.GameDirectory.html Gets or initializes the string path of the game directory. This property is immutable after initialization. ```csharp public string Path { get; init; } ```