Class Core.Settings.Setting
A setting is basically a configuration value that can be changed by players.
Although a setting instance uses Core.Configuration internally for storage purposes, it's not meant to be used as a configuration value. Configuration values are wider and can be used in many ways, like saving UI states and even addon data. Settings are meant to allow players to change the behavior of the addon.
Local Functions
core.settings.setting.getConfigurationMethod () | Gets the configuration method to be used when saving the setting. |
core.settings.setting.getKey () | Gets the setting key, used to store the setting value in the configuration. |
Methods
core.settings.setting:getCommandHelpContent () | Gets a text that explains how to use the setting in a command. |
core.settings.setting:getFullyQualifiedId () | Gets the setting fully qualified id. |
core.settings.setting:getValue () | Gets the setting stored value. |
core.settings.setting:isTrue () | Determines whether the setting stored value evaluates to true. |
core.settings.setting:setAccessibleByCommand (value) | Sets whether the setting is accessible by a command. |
core.settings.setting:setDefault (value) | Sets the default value of this setting. |
core.settings.setting:setDescription (value) | Sets the setting description. |
core.settings.setting:setGroup (value) | Sets the setting group. |
core.settings.setting:setId (value) | Sets the setting id. |
core.settings.setting:setLabel (value) | Sets the setting label. |
core.settings.setting:setScope (value) | Sets the setting scope. |
core.settings.setting:setType (value) | Sets the setting type. |
core.settings.setting:setValue (value) | Sets the setting value and saves it. |
Metamethods
core.settings.setting:__construct () | Setting constructor. |
Local Functions
Methods- core.settings.setting.getConfigurationMethod ()
-
Gets the configuration method to be used when saving the setting.
The configuration method varies between global and player settings, so this method returns the proper method to be used in this instance.
Returns:
-
string
The configuration method
- core.settings.setting.getKey ()
-
Gets the setting key, used to store the setting value in the configuration.
Returns:
-
string
The setting key
Methods
- core.settings.setting:getCommandHelpContent ()
-
Gets a text that explains how to use the setting in a command.
Returns:
-
string
The command help content
- core.settings.setting:getFullyQualifiedId ()
-
Gets the setting fully qualified id.
The fully qualified id is the setting id prefixed by the group id.
Returns:
-
string
The setting fully qualified id
- core.settings.setting:getValue ()
-
Gets the setting stored value.
Returns:
-
any
The setting stored value
- core.settings.setting:isTrue ()
-
Determines whether the setting stored value evaluates to true.
This is a helper method that returns true if the stored value is any kind of value that should be considered true using Support.Bool.
Returns:
-
boolean
Whether the setting stored value evaluates to true
See also:
- core.settings.setting:setAccessibleByCommand (value)
-
Sets whether the setting is accessible by a command.
Parameters:
- value boolean Whether the setting is accessible by a command
Returns:
- core.settings.setting:setDefault (value)
-
Sets the default value of this setting.
Parameters:
- value mixed The setting's default value
Returns:
- core.settings.setting:setDescription (value)
-
Sets the setting description.
Parameters:
- value string The setting's description
Returns:
- core.settings.setting:setGroup (value)
-
Sets the setting group.
Parameters:
- value Core.Settings.SettingGroup The setting's group
Returns:
- core.settings.setting:setId (value)
-
Sets the setting id.
Parameters:
- value string The setting's id
Returns:
- core.settings.setting:setLabel (value)
-
Sets the setting label.
Parameters:
- value string The setting's label
Returns:
- core.settings.setting:setScope (value)
-
Sets the setting scope.
Parameters:
- value string The setting's scope, listed in Setting.constants
Returns:
- core.settings.setting:setType (value)
-
Sets the setting type.
Parameters:
- value string The setting's type, listed in Setting.constants
Returns:
- core.settings.setting:setValue (value)
-
Sets the setting value and saves it.
Parameters:
- value any The setting value
Returns: