Skyrim

File information

Last updated

Original upload

Created by

Jaxonz

Uploaded by

jaxonz

Virus scan

Safe to use

About this mod

Create MCM menus easier

Requirements
Permissions and credits
Donations
Easier SkyUI MCM Menu Creation
Just a little help for a Skyrim's #1 mod.

MCM menus in SkyUI are a real blessing for modders, allowing us to present rich, easy-to-use configuration panels to users.
I'm so grateful for SkyUI and I'm happy to give back to the Skyrim modding community with this simple library.
I found coding MCM menus a little challenging and tedious, so I created MCM Helper to make authoring MCM menus easy. Most elements can be created with a single line of declarative code.

MCM Helper lets you replace this (example of a menu with 2 toggle options each tied to a GlobalVariable):

GlobalVariable Property giMySettingA Auto
GlobalVariable Property giMySettingB Auto

event OnPageReset(string page)
‌‌‌. . AddToggleOptionST("OPTION_A", "Option A", giMySettingA.GetValue() as Bool, 0)
. . AddToggleOptionST("OPTION_B", "Toggle B", giMySettingB.GetValue() as Bool, 0)
endEvent

state OPTION_A
. . event OnSelectST()
. . . . giMySettingA.SetValue(!giMySettingA.GetValue() as Bool) as Float)
. . . . SetTextOptionValueST(giMySettingA.GetValue() as Bool)
. . endEvent

. . event OnHighlightST()
. . . . SetInfoText("Option A useful information for users")
. . endEvent
endState

state OPTION_B
. . event OnSelectST()
. . . . giMySettingB.SetValue(!giMySettingB.GetValue() as Bool) as Float)
. . . . SetTextOptionValueST(giMySettingB.GetValue() as Bool)
. . endEvent

. . event OnHighlightST()
. . . . SetInfoText("Option B more useful information for users regarding this item")
. . endEvent
endState

with just this:

GlobalVariable Property giMySettingA Auto
GlobalVariable Property giMySettingB Auto

event OnPageReset(string page)
. . DefineMCMToggleOptionGlobal("Option A", giMySettingA, 0, "Option A useful information for users")
. . DefineMCMToggleOptionGlobal("Toggle B", giMySettingB, 0, "Option B more useful information for users regarding this item")
endEvent

MCM Helper handles all of those complexities. No longer will your MCM script have to be 1000 lines long and difficult to maintain.

Need to do something unusual or special? You still have full access to normal MCM functions or can use one of MCM Helper's integrated ModEvent callbacks.

Features


  • Provides one-line versions of Toggle, Text, Slider, Keymap and Menu widgets.
  • One-line implementation of toggle text widgets (a text option that changes value when you click on it... good for 2-3 possible values)
  • One-line paragraph of text with automatic wrapping.
  • One-line simple help topics for in-game FAQ or helpful hints.
  • One-line toggle using global variable as a bit field; allows storing up to 21 different toggle states in a single GlobalVariable.
  • GlobalVariable-bound or normal versions of each function.
  • Supports ModEvent callbacks for each function.
  • Eliminates the need for the SKI_PlayerLoadGameAlias script, a common cause of missing MCM menus.
  • Supports all SkyUI languages.

Requirements


  • SKSE 1.7.2 All functions except those to create Menu widgets work gracefully with SKSE 1.7+
  • SkyUI

Permissions


  • My preference is that you use this as-is as a resource. If you find opportunities for improvements just let me know and everyone will benefit.
  • If you do make changes for your own use, please change the file and class name so that you don't break my mods.

How to Use This In Your Code


  • Create a new script for your MCM menu extending this script.
    . . Example: Scriptname MyModMCM extends JaxonzMCMHelper
  • Declare a GlobalVariable for each widget.
    . . Example: GlobalVariable Property gvMenuSelection Auto
  • Use the the DefineMCM... one-line functions in your OnPageReset event
  • Bind your GlobalVariable properties to CK objects and you are all set!

The downloadable file includes fully documented working examples of all MCM capabilities.

Known Issues


  • I have not yet completely documented the functions. Please refer to the code in the demo mod. The JaxonzMCMHelper.psc file is also fairly well commented.
  • One item I have not yet resolved is that the MCM ShowMessage function does not work in conjunction with this script. Menus created with MCMHelper cannot use ShowMessage. I hope to fix this shortly.

Mods Using MCM Helper


Before releasing to the community, I implemented MCM Helper on my own mods, including:
  • Jaxonz Zoom
  • Jaxonz Smart Looter
  • Jaxonz Furnishing

Let us know if you use MCM Helper in your mod and I will proudly add it to the list.

Support


  • Please use the Posts tab for all support/comments/suggestions/complaints. Private messages will just be redirected here.
  • Public posting lets everyone provide help and it builds a body of information that can help answer questions without having to wait for a response.
  • Please read the first page or so of comments before posting your question. Chances are it has been asked and answered already.