Delzaron Posted June 28, 2015 Posted June 28, 2015 Hi I met a problem. I suceed to create a small MCM menu for AFS mod, but with only one page. Now i wish to add more things to thaht MCM menu, but I dont know how to create more pages. Tutorials I found dont help for that. Thanks in advance.
Content Consumer Posted June 28, 2015 Posted June 28, 2015 Sort of like this: event OnConfigInit() Pages = new string[3] Pages[0] = "Page One" Pages[1] = "Page Two" Pages[2] = "Page Three" endevent if page == "Page One" ;stuff goes here elseif page == "Page Two" ;stuff goes here elseif page == "Page Three" ;stuff goes here The MCM git page is a good resource: LINK
Delzaron Posted July 18, 2015 Author Posted July 18, 2015 I dont suceed... everytime I tried, it crash. This is my former script Event OnPageReset(string page) {Called when a new page is selected, including the initial empty page} SetCursorFillMode(TOP_TO_BOTTOM) if playerref.isinfaction(AFSKoldunFaction) == true KoldunVal = true elseif playerref.isinfaction(AFSPrimalFaction) == true PrimalVal = true elseif playerref.isinfaction(HagravenFaction) == true HagravenVal = true elseif playerref.isinfaction(playerwerewolfFaction) == true WerewolfVal = true else KoldunVal = False PrimalVal = False HagravenVal = False WerewolfVal = False endif KoldunOID = AddToggleOption("Koldun", KoldunVal) PrimalOID = AddToggleOption("Primal", PrimalVal) HagravenOID = AddToggleOption("Hagraven", HagravenVal) WerewolfOID = AddToggleOption("Werewolf", WerewolfVal); VampireLordVal = Game.getPlayer().hasSpell(VampireLord); VampireLordOID = AddToggleOption("Vampire Lord", VampireLordVal)endEventEvent OnOptionSelect(int option) {called when a non-interactive option has been selected} GotoState("busy") if (option == KoldunOID) SetToggleOptionValue(KoldunOID, !KoldunVal) if (KoldunVal == false) afs4Koldun.start() endif KoldunVal = !KoldunVal elseif (option == PrimalOID) SetToggleOptionValue(PrimalOID, !PrimalVal) if (PrimalVal == false) afs4Primal.start() endif elseif (option == HagravenOID) SetToggleOptionValue(HagravenOID, !HagravenVal) if (HagravenVal == false) afs4Hagraven.start() endif elseif (option == WerewolfOID) SetToggleOptionValue(WerewolfOID, !WerewolfVal) if (WerewolfVal == false) afs2Werewolf.start() endif EndIf GotoState("ready")endEventState busy Event OnPageReset(string page) SetCursorFillMode(TOP_TO_BOTTOM) AddHeaderOption("Scripts from previous usage of this menu") AddHeaderOption("haven't finished running, please exit and") AddHeaderOption("wait a few seconds") endEvent Event OnOptionHighlight(int option) SetInfoText("Please unpause the game and allow the scripted changes to occur, the MCM menu will be unresponsive untill you do") endEventendStateGlobalVariable Property PlayerIsVampire autoQuest Property AFS4Koldun autoQuest Property AFS4Primal autoQuest Property AFS4Hagraven autoQuest Property AFS4Briar autoQuest Property AFS2Werewolf autoFaction property AFSKoldunFaction autoFaction property AFSPrimalFaction autoFaction property HagravenFaction autoFaction property PlayerWerewolfFaction autoActor property Playerref autoSpell Property VampireLord autoint VampireOIDint VampireLordOIDint KoldunOIDint PrimalOIDint HagravenOIDint WerewolfOIDbool KoldunValbool PrimalValbool HagravenValbool BriarValbool WerewolfValbool VampireLordVal The idea is too add this : event OnConfigInit() Pages = new string[2] Pages[0] = "Page One" Pages[1] = "Page Two" endevent The problem is simple : where I put this : if page == "Page One" ;stuff goes here elseif page == "Page Two" ;stuff goes here
Sailing Rebel Posted July 18, 2015 Posted July 18, 2015 The problem is simple : where I put this : if page == "Page One" ;stuff goes here elseif page == "Page Two" ;stuff goes here Event OnPageReset(string page) If page == "Page One" ElseIf page == "Page Two" EndIf EndEvent
Delzaron Posted July 18, 2015 Author Posted July 18, 2015 I hqve to qdd it to the Statebusy ? State busy Event OnPageReset(string page) Here ? SetCursorFillMode(TOP_TO_BOTTOM) AddHeaderOption("Scripts from previous usage of this menu") AddHeaderOption("haven't finished running, please exit and") AddHeaderOption("wait a few seconds") endEvent Event OnOptionHighlight(int option) SetInfoText("Please unpause the game and allow the scripted changes to occur, the MCM menu will be unresponsive untill you do") endEventendState
Sailing Rebel Posted July 19, 2015 Posted July 19, 2015 I hqve to qdd it to the Statebusy ? Only if you need different page content for the busy state. Otherwise don't use states for the MCM.
Delzaron Posted July 19, 2015 Author Posted July 19, 2015 I dont understand ? I only need two pages : one the the stuff I made, and one for a LAL fix (become a forsworn friend)... Thats all...
Sailing Rebel Posted July 19, 2015 Posted July 19, 2015 Event OnPageReset(string page) If page == "Page One" ;Options for page one AddHeaderOption("Page One Options") ElseIf page == "Page Two" ;Options for page two AddHeaderOption("Page Two Options") EndIf EndEvent State Busy Event OnPageReset(string page) ;Options on single page SetCursorFillMode(TOP_TO_BOTTOM) AddHeaderOption("Scripts from previous usage of this menu") AddHeaderOption("haven't finished running, please exit and") AddHeaderOption("wait a few seconds") EndEvent EndState
Delzaron Posted July 19, 2015 Author Posted July 19, 2015 Thanks, bu how I integrate my script into this ? Where you put the ;option for page one line ?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.