Jump to content

How to made several MCM pages ?


Delzaron

Recommended Posts

Posted

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.

Posted

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

  • 3 weeks later...
Posted

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)
endEvent

Event 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")
endEvent

State 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")
    endEvent
endState


GlobalVariable Property PlayerIsVampire auto

Quest Property AFS4Koldun auto
Quest Property AFS4Primal auto
Quest Property AFS4Hagraven auto
Quest Property AFS4Briar auto
Quest Property AFS2Werewolf auto

Faction property AFSKoldunFaction auto
Faction property AFSPrimalFaction auto
Faction property HagravenFaction auto
Faction property PlayerWerewolfFaction auto

Actor property Playerref auto

Spell Property VampireLord auto

int VampireOID
int VampireLordOID
int KoldunOID
int PrimalOID
int HagravenOID
int WerewolfOID


bool KoldunVal
bool PrimalVal
bool HagravenVal
bool BriarVal
bool WerewolfVal
bool 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
 
Posted

 

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
Posted

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")
    endEvent
endState

Posted

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...

Posted

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

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...