Difference between revisions of "MessageBox Tutorial"
Jump to navigation
Jump to search
m
→Running the same choice for multiple frames: Clarity
imported>Haama m (→Keeping multiple menus separated: Clarity) |
imported>Haama m (→Running the same choice for multiple frames: Clarity) |
||
|
===Running the same choice for multiple frames===
So far, we've
<pre>...
elseif (Choosing == 1)
<pre>...
elseif (Choosing == -1)
messagebox "What would you like to do?" "
set Choosing to 1
set Choice to GetButtonPressed
if (Choice == -1)
return
elseif (Choice == 0) ;
set InvPos to (InvPos + 1)
set pInvObj to (player.GetInventoryObject
set FoodCount to (FoodCount + 1)
endif
...
elseif (Choice == 1) ;Nothing
endif
...</pre>
"
<pre>...
elseif (Choosing == -1)
messagebox "What would you like to do?" "
set Choosing to 1
set Choice to -1
if (Choice == -1)
set Choice to GetButtonPressed
elseif (Choice == 0) ;
set InvPos to (InvPos + 1)
set pInvObj to (player.GetInventoryObject
set FoodCount to (FoodCount + 1)
endif
...
elseif (Choice == 1) ;Nothing
endif
...</pre>
Note that Choice is reset to -1 after displaying a menu. Otherwise, Choice would still be the same as for the last menu (
==Creating Your New Menu==
| |||