-
Notifications
You must be signed in to change notification settings - Fork 169
MCM API Reference
- OnConfigInit
- OnConfigRegister
- OnConfigOpen
- OnConfigClose
- OnPageReset
- OnOptionHighlight
- OnOptionDefault
- OnOptionSelect
- OnOptionSliderOpen, OnOptionSliderAccept
- OnOptionMenuOpen, OnOptionMenuAccept
- OnOptionColorOpen, OnOptionColorAccept
- OnOptionKeyMapChange
- OnHighlightST
- OnDefaultST
- OnSelectST
- OnSliderOpenST, OnSliderAcceptST
- OnMenuOpenST, OnMenuAcceptST
- OnColorOpenST, OnColorAcceptST
- OnKeyMapChangeST
- SetCursorPosition
- SetCursorFillMode
- AddEmptyOption, AddHeaderOption, AddTextOption, AddToggleOption, AddSliderOption, AddMenuOption, AddColorOption, AddKeyMapOption
- LoadCustomContent, UnloadCustomContent
- SetOptionFlags
- SetTextOptionValue, SetToggleOptionValue, SetSliderOptionValue, SetMenuOptionValue, SetColorOptionValue, SetKeyMapOptionValue
- ShowMessage
- ForcePageReset
- SetSliderDialogStartValue, SetSliderDialogDefaultValue, SetSliderDialogRange, SetSliderDialogInterval
- AddTextOptionST, AddToggleOptionST, AddSliderOptionST, AddMenuOptionST, AddColorOptionST, AddKeyMapOptionST
- SetOptionFlagsST
- SetTextOptionValueST, SetToggleOptionValueST, SetSliderOptionValueST, SetMenuOptionValueST, SetColorOptionValueST, SetKeyMapOptionValueST
The name of your mod as it appears in the list on the left side of the control panel.
Set this in script properties panel in the Creation Kit, or in the script itself.
The names of your sub-pages that appear after your mod has been selected.
Set these in the script properties in the Creation Kit, or in the script itself.
Holds the name of the page that's currently active. Read only.
Use this to get the active page name in events that aren't passed the page name as an argument.
Called when the config menu is initialized.
Called when the config menu registered successfully.
Called when the config menu is opened.
Called when the config menu is closed.
Called when a version update of this script has been detected.
- version - The new version.
Called when a new page is selected, including the initial empty page.
- page - The name of the the current page, or "" if no page is selected.
Position the cursor and add options to the current page. Each added option is assigned a unique option ID.
Called when highlighting an option.
- option - The option ID.
Use SetInfoText to show information about the currently highlighted option.
Called when resetting an option to its default value.
- option - The option ID.
Reset any internal state of the selected option to its default value, then use the option setters to apply the changes to the active page.
Called when a non-interactive option has been selected.
- option - The option ID.
Modify the internal state of the selected option then use the option setters to apply the changes to the active page.
Called when a slider option has been selected.
- option - The option ID.
Set the slider parameters for the selected option.
Called when a new slider value has been accepted.
- option - The option ID.
- value - The accepted value.
Modify the internal state of the selcted option, then use the option setters to apply the changes to the active page.
Called when a menu option has been selected.
- option - The option ID.
Set the menu parameters for the selected option.
Called when a menu entry has been accepted.
- option - The option ID.
- index - The index of the accepted menu entry.
Modify the internal state of the selected option, then use the option setters to apply the changes to the active page.
Called when a color option has been selected.
- option - The option ID.
Set the color swatch parameter for the selected option.
Called when a new color has been accepted.
- option - The option ID.
- color - The accepted color (0xRRGGBB).
Modify the internal state of the selected option, then use the option setters to apply the changes to the active page.
Called when a key has been remapped.
- option - The option ID.
- keyCode - The new keycode.
- conflictControl - The conflicting control if the keycode was already in use; "" otherwise.
- conflictName - ModName of the conflicting mod; "" if there was no conflict or if conflicting with a vanilla control.
Modify the internal state of the selected option, then use the option setters to apply the changes to the active page.
It's up to you to react to any conflicts by checking conflictControl
and conflictName
.
Called when highlighting a state option.
Called when resetting a state option to its default value.
Called when a non-interactive state option has been selected.
Called when a slider state option has been selected.
Called when a new slider state value has been accepted.
Called when a menu state option has been selected.
Called when a menu entry has been accepted for this state option.
Called when a color state option has been selected.
Called when a new color has been accepted for this state option.
Called when a key has been remapped for this state option.
Returns the static version of this script. Not to be mistaken for the mod version.
Override this function to return the current revision of your script if you want to use the built-in updating mechanism.
If an update has been detected, OnVersionUpdate is executed.
The static version of this script.
Returns the control mapped to the given keycode.
Override this function to check the given keycode against any custom controls you're using in your config menu. This enables other mods to react to keymap conflicts.
- keyCode - The checked keycode.
The name of the mapped control, or "" if the keycode was unmapped.
Sets the title text of the control panel.
If the title is not set with this function, it defaults to the name of the current page, or the mod name if no pages are defined.
- text - The new title text.
Sets the text for the info text field below the option panel.
- text - The new info text. Supports multi-line; use \n to start a new line.
Sets the position of the cursor used for the option setters.
The options are displayed in a grid with 2 columns and 64 rows, with a total of 128 cells. They are indexed 0 to 127, left-to-right, top-to-bottom.
Default cursor position is 0 (top-left).
- position - The new cursor position.
- top-right:
SetCursorPosition(1)
- bottom-left:
SetCursorPosition(126)
- bottom-right:
SetCursorPosition(127)
Sets the fill direction of the cursor used for the option setters.
Accepted values are LEFT_TO_RIGHT
and TOP_TO_BOTTOM
.
For LEFT_TO_RIGHT
, the fill order is n, n+1, n+2, ..., i.e. fill up the current row, then move to the next one.
For TOP_TO_BOTTOM
, the fill order is n, n+2, n+4, ..., i.e. fill the next entry in the current column.
- fillMode - The new fill mode.
Adds an empty option, which can be used for padding instead of manually re-positioning the cursor.
The option ID.
Adds a header option to group several options together.
- text - The header text.
- flags (optional) - See SetOptionFlags.
The option ID.
Adds a generic text/value option.
- text - The option text.
- value - The option value.
- flags (optional) - See SetOptionFlags.
The option ID.
Adds a check box option that can be toggled on and off.
- text - The option text.
- checked - The initial state of the check box.
- flags (optional) - See SetOptionFlags.
The option ID.
Adds an option that opens a slider dialog when selected.
- text - The option text.
- value - The initial value of the slider.
- formatString (optional) - If a non-empty format string is passed, it will be used to format the value instead of just displaying a raw number.
{N}
in the format string is substited for the value rounded to N decimal places. - flags (optional) - See SetOptionFlags.
Additional slider parameters are set in OnOptionSliderOpen when the slider is opened.
The option ID.
-
AddSliderOption("Frequency", 1.234, "Every {2} hours")
=> "Every 1.23 hours" -
AddSliderOption("Rounded", 1.234, "{0}")
=> "1"
Adds an option that opens a menu dialog when selected.
- text - The option text.
- value - The initial displayed option value.
- flags (optional) - See SetOptionFlags.
The menu parameters are set in OnOptionMenuOpen when the dialog is opened.
The option ID.
Adds an option that opens a color swatch dialog when selected.
- text - The option text.
- color - The initial color value (0xRRGGBB).
- flags (optional) - See SetOptionFlags.
The color swatch parameters are set in OnOptionColorOpen when the dialog is opened.
The option ID.
Adds a key mapping option.
- text - The option text.
- keyCode - The initial SKSE keycode. Will be shown as an image depicting the button.
- flags (optional) - See SetOptionFlags.
The option ID.
Loads an external file.
Once custom content has been loaded, it's shown in the option panel and the option list is hidden.
To clear the custom content and show the option list again, use UnloadCustomContent.
- source - The path to the loaded file relative to Data/Interface/. Supported formats are .swf, for animated/interactive content, and .dds for images.
- x (optional) - The horizontal offset relative to the top-left corner of the option panel.
- y (optional) - The vertical offset relative to the top-left corner of the option panel.
Clears any custom content and re-enables the original option list.
Has to be called manually after LoadCustomContent was used.
- option - The option ID.
- value - The new option value.
- noUpdate (optional) - If true, the option display is not immediately updated, so several setter calls can be grouped together.
OnOptionSelect, OnOptionDefault
- option - The option ID.
- checked - The new check box state.
- noUpdate (optional) - If true, the option display is not immediately updated, so several setter calls can be grouped together.
OnOptionSelect, OnOptionDefault
- option - The option ID.
- value - The new option value.
- formatString (optional) - The new format string.
- noUpdate (optional) - If true, the option display is not immediately updated, so several setter calls can be grouped together.
OnOptionSliderAccept, OnOptionDefault
- option - The option ID.
- value - The new option value.
- noUpdate (optional) - If true, the option display is not immediately updated, so several setter calls can be grouped together.
OnOptionMenuAccept, OnOptionDefault
- option - The option ID.
- color - The new color (0xRRGGBB).
- noUpdate (optional) - If true, the option display is not immediately updated, so several setter calls can be grouped together.
OnOptionColorAccept, OnOptionDefault
- option - The option ID.
- keyCode - The new keycode.
- noUpdate (optional) - If true, the option display is not immediately updated, so several setter calls can be grouped together.
OnOptionKeyMapChange, OnOptionDefault
Sets the option flags.
Accepted flags are
-
OPTION_FLAG_NONE
, to clear the flags; -
OPTION_FLAG_DISABLED
, to grey out and disable the option.
- option - The option ID.
- flags - The new option flags.
- noUpdate (optional) - If true, the option display is not immediately updated, so several setter calls can be grouped together.
-
SetOptionFlags(x, OPTION_FLAG_DISABLED)
to disable an option. -
SetOptionFlags(x, OPTION_FLAG_NONE)
to re-enable it.
OnOptionSelect, OnOptionSliderAccept, OnOptionMenuAccept, OnOptionColorAccept, OnOptionKeyMapChange, OnOptionDefault
- value - The starting value of the slider, which should be set to the current value.
- value - The default value of the slider.
- minValue - The smallest valid slider value.
- maxValue - The largest valid slider value.
- value - The stepping interval for changing slider values.
- value - The index of the initially selected menu entry.
- value - The index of the default menu entry.
- options - The list entries for the menu dialog.
- color - The intially selected color (0xRRGGBB).
- value - The default color (0xRRGGBB).
Shows a message dialog.
This function works similar to Message.Show
, so it will pause the script and wait until the user closed the dialog. The return value indicates whether the dialog was accepted or canceled.
- message - The message string. Use \n for line breaks.
- withCancel (optional) - Show accept and cancel options. Otherwise, only the accept button is visible.
- acceptLabel (optional) - The text label used for the accept button. Default is localized
Accept
. - cancelLabel (optional) - The text label used for the cancel button. Default is localized
Cancel
.
true
if the user accepted the dialog, false
if it was canceled.
OnOptionSelect, OnOptionSliderAccept, OnOptionMenuAccept, OnOptionColorAccept, OnOptionKeyMapChange, OnOptionDefault
Forces OnPageReset to be executed again after the current event has completed.
OnOptionSelect, OnOptionSliderAccept, OnOptionMenuAccept, OnOptionColorAccept, OnOptionKeyMapChange, OnOptionDefault
Adds a generic text/value state option.
- stateName - The state option name.
- text - The option text.
- value - The option value.
- flags (optional) - See SetOptionFlags.
Adds a check box state option that can be toggled on and off.
- stateName - The state option name.
- text - The option text.
- checked - The initial state of the check box.
- flags (optional) - See SetOptionFlags.
AddSliderOptionST(string stateName, string text, float value, string formatString = "{0}", int flags = 0)
Adds a state option that opens a slider dialog when selected.
- stateName - The state option name.
- text - The option text.
- value - The initial value of the slider.
- formatString (optional) - If a non-empty format string is passed, it will be used to format the value instead of just displaying a raw number.
{N}
in the format string is substited for the value rounded to N decimal places. - flags (optional) - See SetOptionFlags.
Additional slider parameters are set in OnOptionSliderOpen when the slider is opened.
Adds a state option that opens a menu dialog when selected.
- stateName - The state option name.
- text - The option text.
- value - The initial displayed option value.
- flags (optional) - See SetOptionFlags.
The menu parameters are set in OnOptionMenuOpen when the dialog is opened.
Adds a state option that opens a color swatch dialog when selected.
- stateName - The state option name.
- text - The option text.
- color - The initial color value (0xRRGGBB).
- flags (optional) - See SetOptionFlags.
The color swatch parameters are set in OnOptionColorOpen when the dialog is opened.
Adds a key mapping state option.
- stateName - The state option name.
- text - The option text.
- keyCode - The initial SKSE keycode. Will be shown as an image depicting the button.
- flags (optional) - See SetOptionFlags.