Difference between revisions of "Messagebox Tutorial/Set Variables"

Jump to navigation Jump to search
Removed returns, minor edits
imported>Haama
(Added Generalization disclaimer)
imported>Haama
(Removed returns, minor edits)
Line 24: Line 24:
           if (Choice == -1)
           if (Choice == -1)
             set Choice to GetButtonPressed
             set Choice to GetButtonPressed
            return
           elseif (Choice == 0) ;10 fewer
           elseif (Choice == 0) ;10 fewer
             set NumNewIngsDefault to (NumNewIngsDefault - 10)
             set NumNewIngsDefault to (NumNewIngsDefault - 10)
             set Choosing to -22
             set Choosing to -22
            return
           elseif (Choice == 1) ;5 fewer
           elseif (Choice == 1) ;5 fewer
             set NumNewIngsDefault to (NumNewIngsDefault - 5)
             set NumNewIngsDefault to (NumNewIngsDefault - 5)
             set Choosing to -22
             set Choosing to -22
            return
           elseif (Choice == 7) ;5 more
           elseif (Choice == 7) ;5 more
             set NumNewIngsDefault to (NumNewIngsDefault + 5)
             set NumNewIngsDefault to (NumNewIngsDefault + 5)
             set Choosing to -22
             set Choosing to -22
            return
           elseif (Choice == 8) ;10 more
           elseif (Choice == 8) ;10 more
             set NumNewIngsDefault to (NumNewIngsDefault + 10)
             set NumNewIngsDefault to (NumNewIngsDefault + 10)
             set Choosing to -22
             set Choosing to -22
            return
           elseif (Choice == 2) ;-2
           elseif (Choice == 2) ;-2
             set NumNewIngsDefault to (NumNewIngsDefault - 2)
             set NumNewIngsDefault to (NumNewIngsDefault - 2)
             set Choosing to -21
             set Choosing to -21
            return
           elseif (Choice == 3) ;-1
           elseif (Choice == 3) ;-1
             set NumNewIngsDefault to (NumNewIngsDefault - 1)
             set NumNewIngsDefault to (NumNewIngsDefault - 1)
             set Choosing to -21
             set Choosing to -21
            return
           elseif (Choice == 4) ;Cancel
           elseif (Choice == 4) ;Cancel
             set Choosing to -21
             set Choosing to -21
            return   
           elseif (Choice == 5) ;+1
           elseif (Choice == 5) ;+1
             set NumNewIngsDefault to (NumNewIngsDefault + 1)
             set NumNewIngsDefault to (NumNewIngsDefault + 1)
             set Choosing to -21
             set Choosing to -21
            return
           elseif (Choice == 6) ;+2
           elseif (Choice == 6) ;+2
             set NumNewIngsDefault to (NumNewIngsDefault + 2)
             set NumNewIngsDefault to (NumNewIngsDefault + 2)
             set Choosing to -21
             set Choosing to -21
            return
           elseif (Choice == 9) ;Return to previous menu
           elseif (Choice == 9) ;Return to previous menu
             set Choosing to -2
             set Choosing to -2
            return
           endif
           endif
...</pre>
...</pre>
Line 75: Line 64:
                     (Currently %g)", NumNewIngsDefault,
                     (Currently %g)", NumNewIngsDefault,
...</pre>
...</pre>
You have 2 options for the other, variable-changing options ('''''-2''''', '''''-1''''', '''''+1''''', '''''+2'''''):
You have a few options for the other, variable-changing options ('''''-2''''', '''''-1''''', '''''+1''''', '''''+2'''''):
*Place the check(s) inside each of those '''''Choice''''' sections, as such:
*Place the check(s) inside each of those '''''Choice''''' sections, as such:
<pre>...
<pre>...
Line 84: Line 73:
             endif
             endif
             set Choosing to -21
             set Choosing to -21
            return
...</pre>
...</pre>
*Place the check(s) in a menu that all of them run through. In this case, all of these '''''Choice'''''s run through '''''Choosing == -21''''', so all of the checks(s) can be placed immediately before the [[MessageBox]] function of that menu, as such:
*Place the check(s) right after all of the '''Choices''':
<pre>...
<pre>...
         elseif (Choosing == -21)
         elseif (Choosing == -21)
Anonymous user

Navigation menu