Difference between revisions of "Options Menu"

No change in size ,  15:01, 12 April 2012
m
Drat! More grammar...
imported>JustinOther
m (→‎Examples: Grammar)
imported>JustinOther
m (Drat! More grammar...)
Line 16: Line 16:
Int iButton = OptionsMESG.Show() ; Shows your menu. iButton == -1 until input
Int iButton = OptionsMESG.Show() ; Shows your menu. iButton == -1 until input
If (iButton != =-1)
If (iButton != =-1)
akNewContainer.RemoveItem(GetBaseObject(), 1, True) ; Silently remove token
If (iButton == 1)  ; Mage
If (iButton == 1)  ; Mage
Debug.Notification("Mage selected")
Debug.Notification("Mage selected")
Line 23: Line 24:
Debug.Notification("Warrior selected")
Debug.Notification("Warrior selected")
EndIf
EndIf
akNewContainer.RemoveItem(GetBaseObject(), 1, True) ; Silently remove token
EndIf
EndIf
EndIf
EndIf
EndEvent</source>
EndEvent</source>


*For the next example, we'll offer sub-options for each main selection. For a multilevel menu, a function works well. Keep in mind each button can have conditions, so you could hide "Lunch" and "Dinner" if it's time for breakfast or hide "Lobster" if it's not currently available. In this case, to make it repeatable, we'll use a playable apparel item so the menu will show each time it is equipped
*For the next example, we'll offer sub-options for each main selection. For a multilevel menu, a function works well. Keep in mind each button can have conditions, so you could hide "Lunch" and "Dinner" if it's time for breakfast or hide "Lobster" if it's not currently available. In this case, to make it repeatable, we'll use a playable apparel item so the menu will show each time it is equipped.


<source lang="papyrus">ScriptName OptionsMenuScript extends ObjectReference
<source lang="papyrus">ScriptName OptionsMenuScript extends ObjectReference
Anonymous user