Difference between revisions of "Messagebox Tutorial/GameMode And MenuMode"

imported>Haama
(→‎The basics: Clarity)
imported>Haama
(→‎The script: Updated)
Line 10: Line 10:


==The script==
==The script==
Note that these are the changes from the [[Messagebox Tutorial: GameMode And MenuMode#Example code (Multiple Menus Script from the MessageBox Tutorial)|example script]] (I would suggest opening it in a new tab/window).
Note that these are the changes from the [[MessageBox_Tutorial#Example_script|example script]] (I would suggest opening it in a new tab/window).
<pre>Short GMRun
<pre>Short GMRun
Short ExitButton
Short ExitButton
Line 29: Line 29:
   If (Choosing == 0)
   If (Choosing == 0)
     Set GMRun to 0
     Set GMRun to 0
     If (GetInSameCell YourXMarker == 0)
     Set Working to 0
      MoveTo YourXMarker
     ;Add anything that needs to be re-initialized
    Endif
     Return
   Elseif GMRun
   Elseif GMRun
     Set GMRun to 0
     Set GMRun to 0
Line 39: Line 37:
   Elseif (Choice == -1)
   Elseif (Choice == -1)
     Set Choice to GetButtonPressed
     Set Choice to GetButtonPressed
    Return
   Elseif (Choice != ExitButton)
   Elseif (Choice != ExitButton)
     Set ExitButton to 0
     Set ExitButton to 0
     Messagebox "Exiting options..."
     Messagebox "Exiting options..."
  Elseif (Choice == ExitButton)
    Set Choosing to 0
   Endif
   Endif
End
End
Line 69: Line 68:
                                                         "Cancel"
                                                         "Cancel"
End</pre>
End</pre>
==A few notes==
==A few notes==
Basically, this works by firing up a menu while in GameMode. The menu will start up the MenuMode block, which will then display the correct menu. The menu I've chosen to display for GameMode is "Exiting options…". I've done this as, if the player happens to see this menu, something has gone wrong and when the player clicks "Done" the options menu will close (I have yet to see this menu, by the way).
Basically, this works by firing up a menu while in GameMode. The menu will start up the MenuMode block, which will then display the correct menu. The menu I've chosen to display for GameMode is "Exiting options…". I've done this as, if the player happens to see this menu, something has gone wrong and when the player clicks "Done" the options menu will close (I have yet to see this menu, by the way).
Anonymous user