Adding a new page to a Mod Configuration Menu (MCM)

Post » Thu Jan 02, 2014 5:45 pm

A user of one of my mods suggested that I add some new options to my mod's Mod Configuration Menu (MCM). I felt that it would best fit under a new page, so I added a new string (the new page's name) to the Pages array in my mod's config menu quest. However, the new page isn't showing up when I load up a save that used the previous version of my mod. Does anyone know how to make it show up or do I need a clean save?

User avatar
Erin S
 
Posts: 3416
Joined: Sat Jul 29, 2006 2:06 pm

Post » Thu Jan 02, 2014 9:24 am

it's detailed here https://github.com/schlangster/skyui/wiki/MCM-Advanced-Features#wiki-Versioning

User avatar
Tanya
 
Posts: 3358
Joined: Fri Feb 16, 2007 6:01 am

Post » Thu Jan 02, 2014 3:52 pm

You will need to reset the pages array to a new, longer array. This would ideally be done either through the OnVersionUpdate event described via the link aellis provided, or else through an alias using the OnPlayerLoadGame event to update your mod, or through the OnInit of a new script you can add to your quest. You need to do something like this in one of those events, so that it fires on game load one way or another.

From a separate alias script this would look something like:

Spoiler
Event OnPlayerLoadGame()  myMenuScript.pages = new string[5]  myMenuScript.pages[0] = "page 1"  myMenuScript.pages[1] = "page 2"  myMenuScript.pages[2] = "page 3"  myMenuScript.pages[3] = "page 4"  myMenuScript.pages[4] = "new page"EndEvent
User avatar
Mr. Allen
 
Posts: 3327
Joined: Fri Oct 05, 2007 8:36 am

Post » Thu Jan 02, 2014 3:55 pm

Thanks so much for the information, aellis and egocarib! I went with OnVersionUpdate and everything works like a charm now.

User avatar
Ilona Neumann
 
Posts: 3308
Joined: Sat Aug 19, 2006 3:30 am


Return to V - Skyrim