Class GameConfigSection
Represents a section of the game config and contains helper functions for accessing and setting values.
Assembly: Dalamud.dll​
public class GameConfigSection
Properties​
ConfigCount​
Gets the number of config entries contained within the section. Some entries may be empty with no data.
public uint ConfigCount { get; }
SectionName​
Gets the name of the config section.
public string SectionName { get; }
Methods​
TryGetBool(string, out bool)​
Attempts to get a boolean config option.
public bool TryGetBool(string name, out bool value)
Returns​
System.Boolean: A value representing the success.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
System.Boolean | value | The returned value of the config option. |
TryGet(string, out bool)​
Attempts to get a boolean config option.
public bool TryGet(string name, out bool value)
Returns​
System.Boolean: A value representing the success.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
System.Boolean | value | The returned value of the config option. |
GetBool(string)​
Get a boolean config option.
public bool GetBool(string name)
Returns​
System.Boolean: Value of the config option.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
Exceptions​
Dalamud.Game.Config.ConfigOptionNotFoundException
Thrown if the config option is not found.
Set(string, bool)​
Set a boolean config option. Note: Not all config options will be be immediately reflected in the game.
public void Set(string name, bool value)
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
System.Boolean | value | New value of the config option. |
Exceptions​
Dalamud.Game.Config.ConfigOptionNotFoundException
Throw if the config option is not found.
System.Diagnostics.UnreachableException
Thrown if the name of the config option is found, but the struct was not.
TryGetUInt(string, out uint)​
Attempts to get an unsigned integer config value.
public bool TryGetUInt(string name, out uint value)
Returns​
System.Boolean: A value representing the success.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
System.UInt32 | value | The returned value of the config option. |
TryGet(string, out uint)​
Attempts to get an unsigned integer config value.
public bool TryGet(string name, out uint value)
Returns​
System.Boolean: A value representing the success.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
System.UInt32 | value | The returned value of the config option. |
GetUInt(string)​
Get an unsigned integer config option.
public uint GetUInt(string name)
Returns​
System.UInt32: Value of the config option.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
Exceptions​
Dalamud.Game.Config.ConfigOptionNotFoundException
Thrown if the config option is not found.
Set(string, uint)​
Set an unsigned integer config option. Note: Not all config options will be be immediately reflected in the game.
public void Set(string name, uint value)
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
System.UInt32 | value | New value of the config option. |
Exceptions​
Dalamud.Game.Config.ConfigOptionNotFoundException
Throw if the config option is not found.
System.Diagnostics.UnreachableException
Thrown if the name of the config option is found, but the struct was not.
TryGetFloat(string, out float)​
Attempts to get a float config value.
public bool TryGetFloat(string name, out float value)
Returns​
System.Boolean: A value representing the success.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
System.Single | value | The returned value of the config option. |
TryGet(string, out float)​
Attempts to get a float config value.
public bool TryGet(string name, out float value)
Returns​
System.Boolean: A value representing the success.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
System.Single | value | The returned value of the config option. |
GetFloat(string)​
Get a float config option.
public float GetFloat(string name)
Returns​
System.Single: Value of the config option.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
Exceptions​
Dalamud.Game.Config.ConfigOptionNotFoundException
Thrown if the config option is not found.
Set(string, float)​
Set a float config option. Note: Not all config options will be be immediately reflected in the game.
public void Set(string name, float value)
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
System.Single | value | New value of the config option. |
Exceptions​
Dalamud.Game.Config.ConfigOptionNotFoundException
Throw if the config option is not found.
System.Diagnostics.UnreachableException
Thrown if the name of the config option is found, but the struct was not.
TryGetString(string, out string)​
Attempts to get a string config value.
public bool TryGetString(string name, out string value)
Returns​
System.Boolean: A value representing the success.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
System.String | value | The returned value of the config option. |
TryGet(string, out string)​
Attempts to get a string config value.
public bool TryGet(string name, out string value)
Returns​
System.Boolean: A value representing the success.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
System.String | value | The returned value of the config option. |
GetString(string)​
Get a string config option.
public string GetString(string name)
Returns​
System.String: Value of the config option.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
Exceptions​
Dalamud.Game.Config.ConfigOptionNotFoundException
Thrown if the config option is not found.
TryGetStringAsEnum<T>(string, out T)​
Attempts to get a string config value as an enum value.
public bool TryGetStringAsEnum<T>(string name, out T value) where T : struct, Enum
Returns​
System.Boolean: A value representing the success.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
<T> | value | The returned value of the config option. |
Type Parameters​
| Name | Description |
|---|---|
T | Type of the enum. Name of each enum fields are compared against. |
Set(string, string)​
Set a string config option. Note: Not all config options will be be immediately reflected in the game.
public void Set(string name, string value)
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the config option. |
System.String | value | New value of the config option. |
Exceptions​
Dalamud.Game.Config.ConfigOptionNotFoundException
Throw if the config option is not found.
System.Diagnostics.UnreachableException
Thrown if the name of the config option is found, but the struct was not.
TryGetProperties(string, out UIntConfigProperties?)​
Attempts to get the properties of a UInt option from the config section.
public bool TryGetProperties(string name, out UIntConfigProperties? properties)
Returns​
System.Boolean: A value representing the success.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the option to get the properties of. |
| Dalamud.Game.Config.UIntConfigProperties | properties | Details of the option: Minimum, Maximum, and Default values. |
TryGetProperties(string, out FloatConfigProperties?)​
Attempts to get the properties of a Float option from the config section.
public bool TryGetProperties(string name, out FloatConfigProperties? properties)
Returns​
System.Boolean: A value representing the success.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the option to get the properties of. |
| Dalamud.Game.Config.FloatConfigProperties | properties | Details of the option: Minimum, Maximum, and Default values. |
TryGetProperties(string, out StringConfigProperties?)​
Attempts to get the properties of a String option from the config section.
public bool TryGetProperties(string name, out StringConfigProperties? properties)
Returns​
System.Boolean: A value representing the success.
Parameters​
| Type | Name | Description |
|---|---|---|
System.String | name | Name of the option to get the properties of. |
| Dalamud.Game.Config.StringConfigProperties | properties | Details of the option: Minimum, Maximum, and Default values. |