Class Core.Settings.SettingGroup

A SettingGroup is a collection of Setting instances.

Settings must belong to a group to exist in an addon context. Groups are mostly used to organize settings in a logical way and present them to players in a user-friendly manner.

If an addon doesn't include any groups, all settings will be placed in a general group.

Methods

core.settings.settinggroup:addSetting (setting) Adds a setting to the group.
core.settings.settinggroup:all () Gets all settings in this group.
core.settings.settinggroup:allAccessibleByCommand () Gets all settings in this group that are accessible by a command.
core.settings.settinggroup:getSetting (id) Gets a setting in this group by its id.
core.settings.settinggroup:getSettingValue (id) Gets a setting value in this group by its id.
core.settings.settinggroup:hasSettings () Determines whether this group has settings.
core.settings.settinggroup:hasSettingsAccessibleByCommand () Determines whether this group has at least one settings that's accessible by a command.
core.settings.settinggroup:setId (value) Sets the setting group id.
core.settings.settinggroup:setLabel (value) Sets the setting group label.

Metamethods

core.settings.settinggroup:__construct () SettingGroup constructor.


Methods

core.settings.settinggroup:addSetting (setting)
Adds a setting to the group.

Parameters:

Returns:

    Core.Settings.SettingGroup self
core.settings.settinggroup:all ()
Gets all settings in this group.

Returns:

    table[Core.Settings.Setting] All the settings in this group
core.settings.settinggroup:allAccessibleByCommand ()
Gets all settings in this group that are accessible by a command.

Returns:

    table[Core.Settings.Setting] All the settings in this group that are accessible by a command
core.settings.settinggroup:getSetting (id)
Gets a setting in this group by its id.

It's important to pass the setting id, not the fully qualified id.

Parameters:

Returns:

    Core.Settings.Setting or nil The setting instance
core.settings.settinggroup:getSettingValue (id)
Gets a setting value in this group by its id.

It's important to pass the setting id, not the fully qualified id.

If the setting doesn't exist, this method won't throw an error, but return nil.

Parameters:

Returns:

    any or nil The setting value
core.settings.settinggroup:hasSettings ()
Determines whether this group has settings.

Returns:

    boolean Whether this group has settings
core.settings.settinggroup:hasSettingsAccessibleByCommand ()
Determines whether this group has at least one settings that's accessible by a command.

Returns:

    boolean Whether this group has at least one settings that's accessible by a command
core.settings.settinggroup:setId (value)
Sets the setting group id.

Parameters:

  • value string The setting group's id

Returns:

    Core.Settings.SettingGroup self
core.settings.settinggroup:setLabel (value)
Sets the setting group label.

Parameters:

  • value string The setting group's label

Returns:

    Core.Settings.SettingGroup self

Metamethods

core.settings.settinggroup:__construct ()
SettingGroup constructor.
generated by LDoc 1.5.0 Last updated 2024-09-11 16:27:53