SkyUI & MCM - How To Use Config Values?

Post » Fri May 24, 2013 11:06 am


I've read the MCM guides over at their Github page (I cannot post links?) and I have managed to create a page of my own with some options on it.

What I cannot figure out, and what the documentation seems to unfortunately lack, is how to actually use those configuration values in the rest of my mod?

One of my options is a Keymap Option. I'm able to get the OnOptionKeyMapChange Event and print the newly selected key to the screen (for testing), which is great. But I have a script written that fires when a currently-hard-coded key is pressed, and I'd like for it to fire when the configured key is pressed instead. I have a few Toggle Options that I would like to use to change the functionality of this script as well.

I've Googled every manner of Skyrim, SkyUI, and MCM to no avail.

User avatar
OnlyDumazzapplyhere
 
Posts: 3445
Joined: Wed Jan 24, 2007 12:43 am

Post » Fri May 24, 2013 10:15 pm

Well this is what I use.

Mind that I have a register/unregister button, hence the canRegister/IsKeyRegistered bools.

You don't need to do that if you don't want to have a register/unregister button.

EVENT OnOptionKeyMapChange(int option, int keyCode, string conflictControl, string conflictName)    IF ( option == OID )        setHotKeyMap( OID, hotkey , keyCode, isKeyRegistered)        hotkey = keyCode    ENDIFENDEVENT FUNCTION setHotKeyMap(int option, int hotkey, int KeyCode, bool canRegister)    UnregisterForKey(hotkey)    SetKeyMapOptionValue(option, KeyCode )    IF ( canRegister )        RegisterForKey(KeyCode)    ENDIFENDFUNCTION 
User avatar
Jade Payton
 
Posts: 3417
Joined: Mon Sep 11, 2006 1:01 pm


Return to V - Skyrim