Skip to content

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")

createContentsContainer⚓︎

This method creates the contents of a component. Not every component implements this method.

Returns:


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:


filters⚓︎

A list of filters. Filters control which items will appear in the lists of the Exclusions Page.

Returns:


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:


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:


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)

showHeader⚓︎

The page's label will only be created if set to true.

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:


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:


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:


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. If defaultSetting wasn't passed in the variable 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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


createButton⚓︎

Creates a new nested Button.

local button = myObject:createButton({ label = ..., buttonText  = ..., description = ..., leftSide  = ..., variable = ..., defaultSetting = ..., 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 Button.
    • defaultSetting (unknown): Optional. If defaultSetting wasn't passed in the variable table, can be passed here. The new variable will be initialized to this value.
    • 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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


createCategory⚓︎

Creates a new nested Category.

local category = myObject:createCategory({ 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 category label.
    • description (string): Optional. If in a Sidebar Page, the description will be shown on mouseover.
    • components (mwseMCMComponent.getComponent.componentData[]): Optional. Use this if you want to directly create all the nested components in this Category. This table is described at getComponent.
    • indent (integer): Default: 12. The left padding size in pixels. Only used if the childIndent 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 the childSpacing 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 in self.elements.

Returns:


createContentsContainer⚓︎

Creates UI element tree for this Category.

myObject:createContentsContainer(parentBlock)

Parameters:


createCycleButton⚓︎

Creates a new nested mwseMCMCycleButton.

local button = myObject:createCycleButton({ label = ..., description = ..., options = ..., leftSide  = ..., variable = ..., defaultSetting = ..., 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): A variable for this cycle button.
    • defaultSetting (unknown): Optional. If defaultSetting wasn't passed in the variable table, can be passed here. The new variable will be initialized to this value.
    • 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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


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:


createDropdown⚓︎

Creates a new nested Dropdown.

local dropdown = myObject:createDropdown({ label = ..., description = ..., options = ..., variable = ..., defaultSetting = ..., 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): A variable for this setting.
    • defaultSetting (unknown): Optional. If defaultSetting wasn't passed in the variable table, can be passed here. The new variable will be initialized to this value.
    • 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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


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:


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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


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. If defaultSetting wasn't passed in the variable 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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


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:


createKeyBinder⚓︎

Creates a new nested KeyBinder.

local button = myObject:createKeyBinder({ label = ..., description = ..., allowCombinations  = ..., allowMouse  = ..., keybindName = ..., leftSide  = ..., variable = ..., defaultSetting = ..., 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): A variable for this KeyBinder.
    • defaultSetting (mwseKeyCombo): Optional. If defaultSetting wasn't passed in the variable table, can be passed here. The new variable will be initialized to this value.
    • 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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


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:


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:


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".

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. If defaultSetting wasn't passed in the variable 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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


createOnOffButton⚓︎

Creates a new nested OnOffButton.

local button = myObject:createOnOffButton({ label = ..., description = ..., leftSide  = ..., variable = ..., defaultSetting = ..., 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): A variable of given class for this Button.
    • defaultSetting (boolean): Default: false. If defaultSetting wasn't passed in the variable table, can be passed here. The new variable will be initialized to this value.
    • 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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


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:


createParagraphField⚓︎

Creates a new nested ParagraphField.

local paragraphField = myObject:createParagraphField({ label = ..., buttonText = ..., variable = ..., 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): Creates a variable of given class for this setting.
    • 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 method
    • 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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


createPercentageSlider⚓︎

Creates a new nested PercentageSlider.

local slider = myObject:createPercentageSlider({ label = ..., variable = ..., defaultSetting = ..., 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): A variable for this setting.
    • defaultSetting (unknown): Optional. If defaultSetting wasn't passed in the variable table, can be passed here. The new variable will be initialized to this value.
    • 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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


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:


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.getComponent.componentData[]): Optional. Use this if you want to directly create all the nested components in this Category. This table is described at getComponent.
    • indent (integer): Default: 12. The left padding size in pixels. Only used if the childIndent 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 the childSpacing 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 in self.elements.

Returns:


createSlider⚓︎

Creates a new nested Slider.

local slider = myObject:createSlider({ label = ..., variable = ..., defaultSetting = ..., 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): A variable for this setting.
    • defaultSetting (unknown): Optional. If defaultSetting wasn't passed in the variable table, can be passed here. The new variable will be initialized to this value.
    • 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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:

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:


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:


createTextField⚓︎

Creates a new nested TextField.

local textField = myObject:createTextField({ label = ..., buttonText = ..., variable = ..., 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): A variable for this setting.
    • 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 call self: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 the self.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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


createYesNoButton⚓︎

Creates a new nested YesNoButton.

local button = myObject:createYesNoButton({ label = ..., description = ..., leftSide  = ..., variable = ..., defaultSetting = ..., 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): A variable for this Button.
    • defaultSetting (boolean): Default: false. If defaultSetting wasn't passed in the variable table, can be passed here. The new variable will be initialized to this value.
    • 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 the childIndent 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 the childSpacing 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 in self.elements.

Returns:


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()

getComponent⚓︎

Creates a new Component of given class or returns the given Component.

local component = myObject:getComponent({ class = ..., label = ..., indent = ..., childIndent = ..., paddingBottom = ..., childSpacing = ..., inGameOnly = ..., postCreate = ..., parentComponent = ... })

Parameters:

  • componentData (mwseMCMComponent, table)
    • class (string): The component type to get. On of the following:
      • "Template"
      • "ExclusionsPage"
      • "FilterPage"
      • "MouseOverPage"
      • "Page"
      • "SideBarPage"
      • "Category"
      • "SideBySideBlock"
      • "ActiveInfo"
      • "Hyperlink"
      • "Info"
      • "MouseOverInfo"
      • "Setting"
      • "Button"
      • "OnOffButton"
      • "YesNoButton"
      • "CycleButton"
      • "KeyBinder"
      • "Dropdown"
      • "TextField"
      • "ParagraphField"
      • "Slider"
      • "DecimalSlider"
      • "PercentageSlider"
    • label (string): Optional. The label text to set for the new component. Not all component types have a label.
    • indent (integer): Default: 12. The left padding size in pixels. Only used if the childIndent 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 the childSpacing 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 in self.elements.
    • parentComponent (mwseMCMComponent): Optional.

Returns:


new⚓︎

Creates a new Exclusions Page.

local page = myObject:new({ showHeader = ..., label = ..., variable = ..., 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): The Variable used to store blocked list entries.
    • 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 the childIndent 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 the childSpacing 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:


prepareData⚓︎

Prepares the provided parameters table and sets the parentComponent field to mwseMCMComponent.

local data = myObject:prepareData(data)

Parameters:

  • data (string, mwseMCMComponent.new.data): Optional.

Returns:

  • data (mwseMCMComponent.new.data)

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()

toggle⚓︎

Toggles the e.source UI element from one list to the other. Updates the variable value accordingly.

myObject:toggle(e)

Parameters:


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".