mwseMCMCategory⚓︎
A Category has a header and a list of components. Components within a category are indented. The Categories can be nested indefinitely. A Category is a good way to organize settings within a page.
This type inherits the following: mwseMCMComponent
Properties⚓︎
childIndent
⚓︎
The left padding size in pixels. Used on all the child components.
Returns:
result
(integer, nil)
childSpacing
⚓︎
The bottom border size in pixels. Used on all the child components.
Returns:
result
(integer, nil)
class
⚓︎
Every MCM component has a unique string indentifier specific to that component. These strings are the filename of the file implementing a component. These are found in core\\mcm\\components
.
Returns:
result
(string)
components
⚓︎
An array of all the components in this Category.
Returns:
result
(mwseMCMCategory[], mwseMCMSetting[], mwseMCMInfo[])
componentType
⚓︎
The type of this component.
Returns:
result
("Category")
config
⚓︎
If provided, this config
will be used to generate mwseMCMTableVariable
s for any mwseMCMSetting
s made inside this Category
/Page
. Subtables of this config
can be accessed by passing a configKey
to any Category
that is nested inside this one.
Returns:
result
(table, nil)
configKey
⚓︎
This can be used to access subtables of the config
and defaultConfig
stored in this component's parentComponent
. This ensures that the config
and defaultConfig
stay synchronized.
Returns:
result
(string, number, nil)
createContentsContainer
⚓︎
This method creates the contents of a component. Not every component implements this method.
Returns:
result
(nil, fun(self: mwseMCMComponent, outerContainer: tes3uiElement))
defaultConfig
⚓︎
Stores a default config that should be used by this mod's Setting
s. This will initialize the defaultSetting
field of any mwseMCMTableVariable
s created for this mod. Sub-configs can be accessed by passing a configKey
to any Category
that is nested inside this one.
Returns:
result
(table, nil)
description
⚓︎
If in a Sidebar Page, the description will be shown on mouseover.
Returns:
result
(string, nil)
elements
⚓︎
This dictionary-style table holds all the UI elements of the Category, for easy access.
Returns:
result
(mwseMCMCategoryElements)
indent
⚓︎
The left padding size in pixels. Only used if the childIndent
isn't set on the parent component.
Returns:
result
(integer)
inGameOnly
⚓︎
If true
, then this component, as well as any nested components, will only be shown when in game. i.e., after a save has been loaded.
If false
or nil
, then this component will be hidden if all subcomponents are disabled (e.g., if all subcomponents have inGameOnly == true
and a save hasn't been loaded).
Returns:
result
(boolean)
label
⚓︎
The category label.
Returns:
result
(string)
mouseOvers
⚓︎
This array of UI elements will have an event handler registered to trigger "MCM:MouseOver" event. For more info, see registerMouseOverElements method.
Returns:
result
(tes3uiElement[], nil)
paddingBottom
⚓︎
The bottom border size in pixels. Only used if the childSpacing
is unset on the parent component.
Returns:
result
(integer)
parentComponent
⚓︎
Returns:
result
(mwseMCMComponent, nil)
postCreate
⚓︎
Custom formatting function to make adjustments to any element saved in self.elements
.
Returns:
result
(nil, fun(self: mwseMCMComponent))
sCancel
⚓︎
Set to the value of sCancel
GMST.
Returns:
result
(string)
showDefaultSetting
⚓︎
If true
, then each Setting
created inside this Page
/Category
will have showDefaultSetting = true
. \z
This is equivalent to manually writing showDefaultSetting = true
in the constructor of each Setting
created in this Page
/Category
.
Returns:
result
(boolean)
sNo
⚓︎
Set to the value of sNo
GMST.
Returns:
result
(string)
sOff
⚓︎
Set to the value of sOff
GMST.
Returns:
result
(string)
sOK
⚓︎
Set to the value of sOK
GMST.
Returns:
result
(string)
sOn
⚓︎
Set to the value of sOn
GMST.
Returns:
result
(string)
sYes
⚓︎
Set to the value of sYes
GMST.
Returns:
result
(string)
Methods⚓︎
checkDisabled
⚓︎
Returns true if the component should be disabled.
Componets with a variable:
- True if the Component's variable has
inGameOnly
field set to true, and the game is on the main menu. For components with multiple subcomponent (Category), the check is done for each subcomponent.
Components without a variable:
- True if the Component's
inGameOnly
field is set to true, and the game is on the main menu.
local result = myObject:checkDisabled()
Returns:
result
(boolean)
create
⚓︎
This method creates the UI elements that comprise a component. To call this method, the mwseMCMComponent-derived type needs to have createContentsContainer
method implemented.
myObject:create(parentBlock)
Parameters:
parentBlock
(tes3uiElement)
createActiveInfo
⚓︎
Creates a new nested ActiveInfo.
local info = myObject:createActiveInfo({ label = ..., text = ..., description = ..., variable = ..., defaultSetting = ..., inGameOnly = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table, string): Optional. If passing only a string, it will be used as the ActiveInfo's label.label
(string): Optional. The ActiveInfo's label.text
(string): Optional. The ActiveInfo's text.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value.inGameOnly
(boolean): Default:false
.indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMActiveInfo)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
info
(mwseMCMActiveInfo)
createButton
⚓︎
Creates a new nested Button.
local button = myObject:createButton({ label = ..., buttonText = ..., description = ..., leftSide = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. Text shown next to the button.buttonText
(string): Optional. Text shown inside the button.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.leftSide
(boolean): Default:true
. If true, the button will be created on the left and label on the right.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.callback
(fun(self: mwseMCMButton)): Optional. The custom function called when the player interacts with this Button.inGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMButton)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
button
(mwseMCMButton)
createCategory
⚓︎
Creates a new nested Category.
local category = myObject:createCategory({ label = ..., description = ..., config = ..., defaultConfig = ..., configKey = ..., showDefaultSetting = ..., components = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., inGameOnly = ..., postCreate = ... })
Parameters:
data
(table, string): Optional. If passing only a string, it will be used as label.label
(string): Optional. The category label.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.config
(table): Optional. If provided, thisconfig
will be used to generatemwseMCMTableVariable
s for anymwseMCMSetting
s made inside thisCategory
/Page
. i.e., this parameter provides an alternative to explicitly constructing new variables. Subtables of thisconfig
can be accessed by passing aconfigKey
to anyCategory
that is nested inside this one.defaultConfig
(table): Optional. Stores a default config that should be used by this mod'sSetting
s. This will initialize thedefaultSetting
field of anymwseMCMTableVariable
s created for this mod. Sub-configs can be accessed by passing aconfigKey
to anyCategory
that is nested inside this one.configKey
(string, number): Optional. This can be used to access subtables of theconfig
anddefaultConfig
stored in this component'sparentComponent
. This ensures that theconfig
anddefaultConfig
stay synchronized.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, then eachSetting
created inside thisPage
/Category
will haveshowDefaultSetting = true
. This is equivalent to manually writingshowDefaultSetting = true
in the constructor of eachSetting
created in thisPage
/Category
.components
(mwseMCMComponent.new.data[]): Optional. Use this if you want to directly create all the nested components in this Category. This table is described at each Component'snew
method.indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.inGameOnly
(boolean): Default:false
.postCreate
(fun(self: mwseMCMComponent)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
category
(mwseMCMCategory)
createColorPicker
⚓︎
Creates a new nested mwseMCMColorPicker.
local picker = myObject:createColorPicker({ label = ..., description = ..., alpha = ..., vertical = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. Text shown on the top of the picker.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.alpha
(boolean): Default:false
. Iftrue
the picker will also allow picking an alpha value.vertical
(boolean): Default:false
. Iftrue
, saturation, hue and alpha bars and color previews are created in the second row below the main picker. Iffalse
they are created in the same row as the main picker. Color picker is a large widget and as such, might not fit into a sidebar page or a filter page. It's useful to passvertical = true
to make it fit on those pages.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(mwseColorTable, mwseColorATable): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.callback
(fun(self: mwseMCMColorPicker)): Optional. The custom function called when the player interacts with this Color picker.inGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMColorPicker)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
picker
(mwseMCMColorPicker)
createColorPickerButton
⚓︎
Creates a new nested mwseMCMColorPickerButton.
local pickerButton = myObject:createColorPickerButton({ label = ..., description = ..., alpha = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. Text shown on the top of the button.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.alpha
(boolean): Default:false
. Iftrue
the picker will also allow picking an alpha value.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(mwseColorTable, mwseColorATable): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.callback
(fun(self: mwseMCMColorPickerButton)): Optional. The custom function called when the player interacts with this Color picker button.inGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMColorPickerButton)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
pickerButton
(mwseMCMColorPickerButton)
createContentsContainer
⚓︎
Creates UI element tree for this Category.
myObject:createContentsContainer(parentBlock)
Parameters:
parentBlock
(tes3uiElement)
createCycleButton
⚓︎
Creates a new nested mwseMCMCycleButton.
local button = myObject:createCycleButton({ label = ..., description = ..., options = ..., leftSide = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. Text shown next to the button.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.options
(tes3uiCycleButtonOption[]): This table holds the text and variable value for each of the cycle button's options.leftSide
(boolean): Default:true
. If true, the button will be created on the left and label on the right.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.callback
(fun(self: mwseMCMCycleButton)): Optional. The custom function called when the player interacts with this cycle button.inGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMCycleButton)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
button
(mwseMCMCycleButton)
createDropdown
⚓︎
Creates a new nested Dropdown.
local dropdown = myObject:createDropdown({ label = ..., description = ..., options = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., idleColor = ..., overColor = ..., pressedColor = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. The text shown above the dropdown.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.options
(mwseMCMDropdownOption[]): This table holds the text and variable value for each of the dropdown's options.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.idleColor
(number[]): Default:tes3ui.getPalette(tes3.palette.normalColor)
. The idle color for dropdown. Needs to be an RGB trio in the range [0.0, 1.0].overColor
(number[]): Default:tes3ui.getPalette(tes3.palette.normalOverColor)
. The color used when the mouse if hovering over the dropdown. Needs to be an RGB trio in the range [0.0, 1.0].pressedColor
(number[]): Default:tes3ui.getPalette(tes3.palette.normalPressedColor)
. The color used when the dropdown is being pressed. Needs to be an RGB trio in the range [0.0, 1.0].callback
(fun(self: mwseMCMDropdown)): Optional. The custom function called when the player interacts with this Setting.inGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMDropdown)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
dropdown
(mwseMCMDropdown)
createHyperlink
⚓︎
Creates a new nested Hyperlink.
local hyperlink = myObject:createHyperlink({ text = ..., description = ..., url = ..., label = ..., inGameOnly = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table)text
(string): The Hyperlink's text.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.url
(string): The URL for this hyperlink.label
(string): Optional. The Hyperlink's label. Shown above the Hyperlink's text.inGameOnly
(boolean): Default:false
.indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMHyperlink)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
hyperlink
(mwseMCMHyperlink)
createInfo
⚓︎
Creates a new nested Info.
local info = myObject:createInfo({ label = ..., text = ..., description = ..., variable = ..., defaultSetting = ..., inGameOnly = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table, string): Optional. If passing only a string, it will be used as the Info's label.label
(string): Optional. The Info's label.text
(string): Optional. The Info's text.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value.inGameOnly
(boolean): Default:false
.indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMInfo)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
info
(mwseMCMInfo)
createInnerContainer
⚓︎
Creates component's innerContainer UI element inside given parentBlock
, and stores it in the self.elements.innerContainer
. The innerContainer will add self.indent
additional padding on the left if the component has a label.
myObject:createInnerContainer(parentBlock)
Parameters:
parentBlock
(tes3uiElement)
createKeyBinder
⚓︎
Creates a new nested KeyBinder.
local button = myObject:createKeyBinder({ label = ..., description = ..., allowCombinations = ..., allowMouse = ..., keybindName = ..., leftSide = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. Text shown next to the button.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.allowCombinations
(boolean): Default:true
. If true, the KeyBinder will let the user use modification keys: Shift, Ctrl, and Alt when rebinding.allowMouse
(boolean): Default:false
. If true, the KeyBinder will let the user use mouse buttons and scroll wheel in this keybinder. In that case the variable will have mwseKeyMouseCombo layout, mwseKeyCombo otherwise.keybindName
(string): Optional. The keybind name. Shown in the popup menu header. This string is formatted into a localized version of "SET %s KEYBIND.". If none is provided the popup has "SET NEW KEYBIND." as header text.leftSide
(boolean): Default:true
. If true, the button will be created on the left and label on the right.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.callback
(fun(self: mwseMCMKeyBinder)): Optional. The custom function called when the player interacts with this KeyBinder.inGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMKeyBinder)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
button
(mwseMCMKeyBinder)
createLabel
⚓︎
Creates component's label UI element.
First, it calls self:createLabelBlock
and creates the label element inside new labelBlock
. Stores both new UI elements in the self.elements
and self.mouseOvers
.
myObject:createLabel(parentBlock)
Parameters:
parentBlock
(tes3uiElement)
createLabelBlock
⚓︎
Creates component's labelBlock UI element inside given parentBlock
, and stores it in the self.elements.labelBlock
and self.mouseOvers
.
myObject:createLabelBlock(parentBlock)
Parameters:
parentBlock
(tes3uiElement)
createMouseBinder
⚓︎
Creates a new nested MouseBinder.
local button = myObject:createMouseBinder({ label = ..., description = ..., allowCombinations = ..., allowButtons = ..., allowWheel = ..., keybindName = ..., leftSide = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. Text shown next to the button.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.allowCombinations
(boolean): Default:true
. If true, the MouseBinder will let the user use modification keys: Shift, Ctrl, and Alt when rebinding.allowButtons
(boolean): Default:true
. If true, the MouseBinder will let the user bind mouse buttons.allowWheel
(boolean): Default:false
. If true, the MouseBinder will let the user bind mouse wheel scroll up or down.keybindName
(string): Optional. The keybind name. Shown in the popup menu header. This string is formatted into a localized version of "SET %s KEYBIND.". If none is provided the popup has "SET NEW KEYBIND." as header text.leftSide
(boolean): Default:true
. If true, the button will be created on the left and label on the right.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.callback
(fun(self: mwseMCMMouseBinder)): Optional. The custom function called when the player interacts with this MouseBinder.inGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMMouseBinder)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
button
(mwseMCMMouseBinder)
createMouseOverInfo
⚓︎
Creates a new nested MouseOverInfo.
local info = myObject:createMouseOverInfo({ label = ..., text = ..., description = ..., variable = ..., defaultSetting = ..., inGameOnly = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table, string): Optional. If passing only a string, it will be used as the MouseOverInfo's label.label
(string): Optional. The MouseOverInfo's label.text
(string): Optional. The MouseOverInfo's text.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value.inGameOnly
(boolean): Default:false
.indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMMouseOverInfo)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
info
(mwseMCMMouseOverInfo)
createOnOffButton
⚓︎
Creates a new nested OnOffButton.
local button = myObject:createOnOffButton({ label = ..., description = ..., leftSide = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. Text shown next to the button.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.leftSide
(boolean): Default:true
. If true, the button will be created on the left and label on the right.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.callback
(fun(self: mwseMCMOnOffButton)): Optional. The custom function called when the player interacts with this Button.inGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMOnOffButton)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
button
(mwseMCMOnOffButton)
createOuterContainer
⚓︎
Creates component's outerContainer UI element inside given parentBlock
, and stores it in the self.elements.outerContainer
and self.mouseOvers
. The outerContainer holds all the other UI elements that comprise a component.
myObject:createOuterContainer(parentBlock)
Parameters:
parentBlock
(tes3uiElement)
createParagraphField
⚓︎
Creates a new nested ParagraphField.
local paragraphField = myObject:createParagraphField({ label = ..., buttonText = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., numbersOnly = ..., description = ..., height = ..., sNewValue = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. Text shown above the text field.buttonText
(string): Optional. The text shown on the button next to the input field. The default text is a localized version of: "Submit".variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.numbersOnly
(boolean): Default:false
. If true, only numbers will be allowed in this TextField.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.height
(integer): Optional. Fixes the height of the paragraph field to a custom value.sNewValue
(string): Optional. The message shown after a new value is submitted. This can be formatted with a '%s' which will be replaced with the new value. The default text is a localized version of: "New value: '%s'".callback
(fun(self: mwseMCMParagraphField)): Optional. This allows overriding the default implementation of this methodinGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMParagraphField)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
paragraphField
(mwseMCMParagraphField)
createPercentageSlider
⚓︎
Creates a new nested PercentageSlider
.
local slider = myObject:createPercentageSlider({ label = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., min = ..., max = ..., step = ..., jump = ..., decimalPlaces = ..., description = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., convertToLabelValue = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. Text shown above the slider. If left as a normal string, it will be shown in the form: [label
]: [self.variable.value
]. If the string contains a '%s' format operator, the value will be formatted into it.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.min
(number): Default:0
. Minimum value of slider.max
(number): Default:1
. Maximum value of slider.step
(number): Default:0.01
. How far the slider moves when you press the arrows.jump
(number): Default:0.05
. How far the slider jumps when you click an area inside the slider.decimalPlaces
(integer): Default:0
. The number of decimal places of precision. Must be a nonnegative integer.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.callback
(fun(self: mwseMCMPercentageSlider)): Optional. The custom function called when the player interacts with this Setting.inGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.convertToLabelValue
(fun(self: mwseMCMPercentageSlider, variableValue: number): number, string): Optional. Define a custom formatting function for displaying variable values.postCreate
(fun(self: mwseMCMPercentageSlider)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
slider
(mwseMCMPercentageSlider)
createSideBySideBlock
⚓︎
Creates a new nested Side-by-side block.
local category = myObject:createSideBySideBlock({ label = ..., description = ..., components = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., inGameOnly = ..., postCreate = ... })
Parameters:
data
(table, string): Optional. If passing only a string, it will be used as label.label
(string): Optional. The block label.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.components
(mwseMCMComponent.new.data[]): Optional. Use this if you want to directly create all the nested components in this Category. This table is described at each Component'snew
method.indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.inGameOnly
(boolean): Default:false
.postCreate
(fun(self: mwseMCMSideBySideBlock)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
category
(mwseMCMSideBySideBlock)
createSlider
⚓︎
Creates a new nested Slider.
local slider = myObject:createSlider({ label = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., min = ..., max = ..., step = ..., jump = ..., decimalPlaces = ..., description = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., convertToLabelValue = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. Text shown above the slider. If left as a normal string, it will be shown in the form: [label
]: [self.variable.value
]. If the string contains a '%s' format operator, the value will be formatted into it.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.min
(number): Default:0
. Minimum value of slider.max
(number): Default:100
. Maximum value of slider.step
(number): Default:1
. How far the slider moves when you press the arrows.jump
(number): Default:5
. How far the slider jumps when you click an area inside the slider.decimalPlaces
(integer): Default:0
. The number of decimal places of precision. Must be a nonnegative integer.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.callback
(fun(self: mwseMCMSlider)): Optional. The custom function called when the player interacts with this Setting.inGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.convertToLabelValue
(fun(self: mwseMCMSlider, variableValue: number): number, string): Optional. Define a custom formatting function for displaying variable values.postCreate
(fun(self: mwseMCMSlider)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
slider
(mwseMCMSlider)
Example: DistanceSlider
The following example shows how the convertToLabelValue
parameter can be used to create a slider for a config setting that handles distances. The config setting will be stored using game units, but the displayed value will be in real-world units. Recall that 1 game unit corresponds to 22.1 feet, and 1 foot is 0.3048 meters.
--- @type tes3uiElement, table
local myPage, myConfig
mwse.mcm.createSlider{
parent = myPage,
label = "My distance slider",
variable = mwse.mcm.createTableVariable{ id = "distance", table = myConfig },
convertToLabelValue = function(self, variableValue)
local feet = variableValue / 22.1
local meters = 0.3048 * feet
if self.decimalPlaces == 0 then
return string.format("%i ft (%.2f m)", feet, meters)
end
return string.format(
-- if `decimalPlaces == 1, then this string will simplify to
-- "%.1f ft (%.3f m)"
string.format("%%.%uf ft (%%.%uf m)", self.decimalPlaces, self.decimalPlaces + 2),
feet, meters
)
end,
max = 22.1 * 10, -- max is 10 feet
step = 22.1, -- increment by 1 foot
jump = 22.1 * 5,
}
Example: SkillSlider
Here is an (admittedly less practical) example to help highlight the different ways convertToLabelValue
can be used. In this example, it will be used to create a slider that stores a tes3.skill
constant in the config, and then displays the name of the corresponding skill.
--- @type tes3uiElement, table
local myPage, myConfig
mwse.mcm.createSlider{
parent = myPage,
label = "My skill slider",
variable = mwse.mcm.createTableVariable{ id = "skillId", table = myConfig },
convertToLabelValue = function(self, variableValue)
local skillName = tes3.getSkillName(math.round(variableValue))
if skillName then
return skillName
end
return "N/A"
end,
max = 26 -- there are 27 skills and indexing starts at 0
}
Example: DecimalSlider
The following example shows how to create a slider that keeps the variable value a floating point number with precision of 2 decimal places.
--- @type tes3uiElement, table
local myPage, myConfig
mwse.mcm.createSlider{
parent = myPage,
label = "My slider",
variable = mwse.mcm.createTableVariable{ id = "someval", table = myConfig },
min = 0.00,
max = 1.00,
step = 0.01,
jump = 0.05,
decimalPlaces = 2
}
createSubcomponents
⚓︎
Creates UI element tree for all the given components by calling component:create
.
myObject:createSubcomponents(parentBlock, components)
Parameters:
parentBlock
(tes3uiElement)components
(mwseMCMComponent.new.data[]): This table is described at each Component'snew
method.
createSubcomponentsContainer
⚓︎
Creates Category's subcomponentsContainer UI element inside given parentBlock
, and stores it in the self.elements.subcomponentsContainer
. This is the parent UI element for all the UI elements of MCM Components that are in this Category.
myObject:createSubcomponentsContainer(parentBlock)
Parameters:
parentBlock
(tes3uiElement)
createTextField
⚓︎
Creates a new nested TextField.
local textField = myObject:createTextField({ label = ..., buttonText = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., numbersOnly = ..., description = ..., press = ..., sNewValue = ..., minHeight = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. Text shown above the text field.buttonText
(string): Optional. The text shown on the button next to the input field. The default text is a localized version of: "Submit".variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.numbersOnly
(boolean): Default:false
. If true, only numbers will be allowed in this TextField.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.press
(fun(self: mwseMCMTextField)): Optional. This allows overriding the default implementation of this method. Can be overriden to add a confirmation message before updating. This function should callself:update()
at the end.sNewValue
(string): Optional. The message shown after a new value is submitted. This can be formatted with a '%s' which will be replaced with the new value. The default text is a localized version of: "New value: '%s'".minHeight
(integer): Optional. The minimum height set on theself.element.border
UI element.callback
(fun(self: mwseMCMTextField)): Optional. This allows overriding the default implementation of this method. See its description.inGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMTextField)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
textField
(mwseMCMTextField)
createYesNoButton
⚓︎
Creates a new nested YesNoButton.
local button = myObject:createYesNoButton({ label = ..., description = ..., leftSide = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., converter = ..., defaultSetting = ..., showDefaultSetting = ..., callback = ..., inGameOnly = ..., restartRequired = ..., restartRequiredMessage = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., postCreate = ... })
Parameters:
data
(table)label
(string): Optional. Text shown next to the button.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.leftSide
(boolean): Default:true
. If true, the button will be created on the left and label on the right.variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. A variable for this setting. If not provided, this setting will try to create a variable using theconfig
andconfigKey
parameters, if possible.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override the config stored inparentComponent
. Otherwise, the value inparentComponent
will be used.defaultConfig
(table): Default:parentComponent.defaultConfig
. ThedefaultConfig
to use when creating amwseMCMTableVariable
for thisSetting
. If provided, it will override thedefaultConfig
stored inparentComponent
. Otherwise, the value inparentComponent
will be used.configKey
(string, number): Optional. TheconfigKey
used to create a newmwseMCMTableVariable
. If this is provided, along with aconfig
(which may be inherited from theparentComponent
), then a newmwseMCMTableVariable
variable will be created for this setting.converter
(fun(newValue: unknown): unknown): Optional. A converter to use for this component'svariable
.defaultSetting
(unknown): Optional. IfdefaultSetting
wasn't passed in thevariable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value indefaultConfig
will be used, if possible.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, and in a Sidebar Page, then thedefaultSetting
of this setting'svariable
will be shown below itsdescription
. ThedefaultSetting
will be formatted in accordance with theconvertToLabelValue
function. Note: This parameter does not update thedescription
field.callback
(fun(self: mwseMCMYesNoButton)): Optional. The custom function called when the player interacts with this Button.inGameOnly
(boolean): Default:false
. If true, the setting is disabled while the game is on main menu.restartRequired
(boolean): Default:false
. If true, updating this Setting will notify the player to restart the game.restartRequiredMessage
(string): Optional. The message shown if restartRequired is triggered. The default text is a localized version of: "The game must be restarted before this change will come into effect."indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.postCreate
(fun(self: mwseMCMYesNoButton)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.
Returns:
button
(mwseMCMYesNoButton)
disable
⚓︎
This method disables the component's UI elements. That includes: changing the color of the UI elements to the tes3.palette.disabledColor
and setting button widget state to tes3.uiState.disabled
.
myObject:disable()
enable
⚓︎
Enables the component's UI elements. That includes: changing the color of the UI elements to the tes3.palette.normalColor
and registering handlers for tes3.uiEvent.mouseClick
for buttons.
myObject:enable()
getMouseOverText
⚓︎
Retrieves the text that this component should display in any related mouseOverInfo
s. This method currently utilized to display this component's description whenever the component is in a SideBarPage
.
Primarily intended for internal use.
local text = myObject:getMouseOverText()
Returns:
text
(string, nil): The text to display. Returningnil
means that themouseOverInfo
should display text from a different source. e.g. from thedescription
of the relevantSideBarPage
.
new
⚓︎
Creates a new Category.
local category = myObject:new({ label = ..., description = ..., config = ..., defaultConfig = ..., configKey = ..., showDefaultSetting = ..., components = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., inGameOnly = ..., postCreate = ..., class = ..., componentType = ..., parentComponent = ... })
Parameters:
data
(table): Optional.label
(string): Optional. The category label.description
(string): Optional. If in a Sidebar Page, the description will be shown on mouseover.config
(table): Optional. If provided, thisconfig
will be used to generatemwseMCMTableVariable
s for anymwseMCMSetting
s made inside thisCategory
/Page
. I.e., this parameter provides an alternative to explicitly constructing new variables. Subtables of thisconfig
can be accessed by passing aconfigKey
to anyCategory
that is nested inside this one.defaultConfig
(table): Optional. Stores a default config that should be used by this mod'sSetting
s. This will initialize thedefaultSetting
field of anymwseMCMTableVariable
s created for this mod. Sub-configs can be accessed by passing aconfigKey
to anyCategory
that is nested inside this one.configKey
(string, number): Optional. This can be used to access subtables of theconfig
anddefaultConfig
stored in this component'sparentComponent
. This ensures that theconfig
anddefaultConfig
stay synchronized.showDefaultSetting
(boolean): Default:parentComponent.showDefaultSetting
. Iftrue
, then eachSetting
created inside thisPage
/Category
will haveshowDefaultSetting = true
. This is equivalent to manually writingshowDefaultSetting = true
in the constructor of eachSetting
created in thisPage
/Category
.components
(mwseMCMComponent.new.data[]): Optional. Use this if you want to directly create all the nested components in this Category. This table is described at each Component'snew
method.indent
(integer): Default:12
. The left padding size in pixels. Only used if thechildIndent
isn't set on the parent component.childIndent
(integer): Optional. The left padding size in pixels. Used on all the child components.paddingBottom
(integer): Default:4
. The bottom border size in pixels. Only used if thechildSpacing
is unset on the parent component.childSpacing
(integer): Optional. The bottom border size in pixels. Used on all the child components.inGameOnly
(boolean): Default:false
.postCreate
(fun(self: mwseMCMComponent)): Optional. Can define a custom formatting function to make adjustments to any element saved inself.elements
.class
(string): Optional.componentType
(string): Optional.parentComponent
(mwseMCMComponent): Optional.
Returns:
category
(mwseMCMCategory)
printComponent
⚓︎
Prints the component table to the mwse.log
. If a component is passed, it will be printed. If called without arguments, the component it was called on will be printed.
myObject:printComponent(component)
Parameters:
component
(table): Default:self
.
registerMouseOverElements
⚓︎
Registers an event handler on each given UI element for the tes3.uiEvent.mouseOver
and tes3.uiEvent.mouseLeave
that will trigger "MCM:MouseOver" event. That event is used by the MCM to update the sidebar on the mwseMCMSideBarPage.
myObject:registerMouseOverElements(mouseOverList)
Parameters:
mouseOverList
(tes3uiElement[]): Optional. If this argument isn't passed, does nothing.
resetToDefault
⚓︎
This method will reset the settings to the default value for all the nested components in this Category.
myObject:resetToDefault()
update
⚓︎
This method calls update
methods on all the components in this Category.
myObject:update()