mwseMCMExclusionsPage⚓︎
An ExclusionsPage is a highly specialized page used for making whitelists/blacklists. It is made up of two lists: The righthand list displays objects that are filtered using custom settings. It could be a list of NPCs, weapons, plugins, etc. Clicking on an item in the righthand list will transfer it to the lefthand list and add it to the config table. Each list can be searched using a search bar, and buttons can be added for different filters to appear in the lefthand list.
This type inherits the following: mwseMCMPage, mwseMCMCategory, 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
⚓︎
Unused in this page type.
Returns:
result
(table)
componentType
⚓︎
The type of this component.
Returns:
result
("Page")
config
⚓︎
The config to use when creating a mwseMCMTableVariable
for this ExclusionsPage
. If provided, it will override the config stored in parentComponent
. Otherwise, the value in parentComponent
will be used.
Returns:
result
(table, nil)
configKey
⚓︎
The configKey
used to create a new mwseMCMTableVariable
. If this is provided, along with a config
(which may be inherited from the parentComponent
), then a new mwseMCMTableVariable
variable will be created for this ExclusionsPage
.
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
⚓︎
The defaultConfig
to use when creating a mwseMCMTableVariable
for this ExclusionsPage
. If provided, it will override the defaultConfig
stored in parentComponent
. Otherwise, the value in parentComponent
will be used.
Returns:
result
(table, nil)
defaultSetting
⚓︎
If defaultSetting
wasn't passed in the variable
table, can be passed here. The new variable will be initialized to this value. If not provided, then the value in defaultConfig
will be used, if possible.
Returns:
result
(table<string, boolean>, nil)
description
⚓︎
Displayed at the top of the page above the lists.
Returns:
result
(string, nil)
elements
⚓︎
This dictionary-style table holds all the UI elements of the Exclusions Page, for easy access.
Returns:
result
(mwseMCMExclusionsPageElements)
filters
⚓︎
A list of filters. Filters control which items will appear in the lists of the Exclusions Page.
Returns:
result
(mwseMCMExclusionsPageFilter[])
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 label field is displayed in the tab for that page at the top of the menu. Defaults to: "Page {number}".
Returns:
result
(string)
leftListLabel
⚓︎
The label on the left list. The default is a localised version of "Blocked".
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)
noScroll
⚓︎
Unused in this page type.
Returns:
result
(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
⚓︎
Unused in this page type.
Returns:
result
(nil)
rightListLabel
⚓︎
The label on the right list. The default is a localised version of "Allowed".
Returns:
result
(string)
sCancel
⚓︎
Set to the value of sCancel
GMST.
Returns:
result
(string)
showAllBlocked
⚓︎
If true, the left list shows all items in the blocked table, regardless of the filter being used.
Returns:
result
(boolean)
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)
showHeader
⚓︎
The page's label will only be created if set to true.
Returns:
result
(boolean)
showReset
⚓︎
When set to true, the Page will have a Reset button. Clicking on it will set the variable.value
of all the setting on the page to their respective defaultSetting
values.
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)
tabUID
⚓︎
The unique UI identifier for the tab button that opens this page. To be used with findChild or tes3ui.findMenu.
Returns:
result
(integer)
toggleText
⚓︎
The text for the button that toggles filtered items from one list to another. The default is a localised version of "Toggle Filtered".
Returns:
result
(string)
variable
⚓︎
The Variable used to store blocked list entries.
Returns:
result
(mwseMCMVariable)
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)
clickFilter
⚓︎
This method sets the state of clicked filter button to tes3.uiState.active
, and all the other filter buttons to tes3.uiState.normal
.
myObject:clickFilter(filter)
Parameters:
filter
(tes3uiElement)
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)
createDescription
⚓︎
If the description
for this page is set, this method will create a label with the description
as text and add it to self.elements.description
.
myObject:createDescription(parentBlock)
Parameters:
parentBlock
(tes3uiElement)
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)
createFiltersSection
⚓︎
Creates a button for each of the filters as children of filterList
UI element. If the Cxclusions Page has only one filter, this section won't be visible.
myObject:createFiltersSection(parentBlock)
Parameters:
parentBlock
(tes3uiElement)
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)
createList
⚓︎
Creates one complete list of the Exclusions Page. That includes the list label, a search bar and its scroll pane.
myObject:createList(parentBlock, listId)
Parameters:
parentBlock
(tes3uiElement)listId
(string): One of the following:"leftList"
or"rightList"
.
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)
createResetButton
⚓︎
Creates the Page's Reset button.
myObject:createResetButton(parentBlock)
Parameters:
parentBlock
(tes3uiElement)
createResetButtonContainer
⚓︎
Creates parent UI element for the Page's Reset button.
myObject:createResetButtonContainer(parentBlock)
Parameters:
parentBlock
(tes3uiElement)
createSearchBar
⚓︎
Creates one a search bar on the given list. It consists of thin border UI element stored in self.elements.searchBar[listName]
and text input UI element stored in self.elements.searchBarInput[listName]
.
myObject:createSearchBar(parentBlock, listName)
Parameters:
parentBlock
(tes3uiElement)listName
(string): One of the following:"leftList"
or"rightList"
.
createSections
⚓︎
This method creates the sections
UI element and stores it in self.elements.sections
.
myObject:createSections(parentBlock)
Parameters:
parentBlock
(tes3uiElement)
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()
distributeLeft
⚓︎
This method adds the given items to the left list if they are in the blocked list of the variable.
myObject:distributeLeft(items)
Parameters:
items
(string[])
distributeRight
⚓︎
This method adds the given items to the right list if they are not in the blocked list of the variable.
myObject:distributeRight(items)
Parameters:
items
(string[])
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 Exclusions Page.
local page = myObject:new({ showHeader = ..., label = ..., variable = ..., config = ..., defaultConfig = ..., configKey = ..., defaultSetting = ..., filters = ..., description = ..., toggleText = ..., leftListLabel = ..., rightListLabel = ..., showAllBlocked = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., inGameOnly = ..., class = ..., componentType = ..., parentComponent = ... })
Parameters:
data
(table): Optional.showHeader
(boolean): Default:false
. The page's label will only be created if set to true.label
(string): The label field is displayed in the tab for that page at the top of the menu. Defaults to: "Page {number}".variable
(mwseMCMVariable, mwseMCMSettingNewVariable): Optional. The Variable used to store blocked list entries.config
(table): Default:parentComponent.config
. The config to use when creating amwseMCMTableVariable
for thisExclusionsPage
. 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 thisExclusionsPage
. 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 thisExclusionsPage
.defaultSetting
(table<string, boolean>): 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.filters
(mwseMCMExclusionsPageFilter[]): A list of filters. Filters control which items will appear in the lists of the Exclusions Page. At least one filter is required. See the filter page for description.description
(string): Optional. Displayed at the top of the page above the lists.toggleText
(string): Optional. The text for the button that toggles filtered items from one list to another. The default is a localised version of "Toggle Filtered".leftListLabel
(string): Optional. The label on the left list. The default is a localised version of "Blocked".rightListLabel
(string): Optional. The label on the right list. The default is a localised version of "Allowed".showAllBlocked
(boolean): Default:false
. When set to true, the left list shows all items in the blocked table, regardless of the filter being used.indent
(integer): Default:6
. 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
.class
(string): Optional.componentType
(string): Optional.parentComponent
(mwseMCMComponent): Optional.
Returns:
page
(mwseMCMExclusionsPage)
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.
resetSearchBars
⚓︎
This method clears inputted text from both search bars.
myObject:resetSearchBars()
resetToDefault
⚓︎
This method will reset the settings to the default value for all the nested components in this Category.
myObject:resetToDefault()
toggle
⚓︎
Toggles the e.source
UI element from one list to the other. Updates the variable value accordingly.
myObject:toggle(e)
Parameters:
e
(tes3uiEventData)
toggleFiltered
⚓︎
Toggles the filtered items from the given list to the other.
myObject:toggleFiltered(listName)
Parameters:
listName
(string): One of the following:"leftList"
or"rightList"
.
update
⚓︎
This method calls update
methods on all the components in this Category.
myObject:update()
updateSearch
⚓︎
Hides the items in given list that don't contain the currently inputted search text.
myObject:updateSearch(listName)
Parameters:
listName
(string): One of the following:"leftList"
or"rightList"
.