Difference between revisions of "Options Menu"

Jump to navigation Jump to search
903 bytes added ,  11:25, 6 July 2012
→‎Multilevel, looping menu: Set up bProperty/Remote.bProperty/Global toggling in similar fashions as toggling stuff is bound to be a common task for an options menu.
imported>JustinOther
m (→‎Notes: second last Δ last)
imported>JustinOther
(→‎Multilevel, looping menu: Set up bProperty/Remote.bProperty/Global toggling in similar fashions as toggling stuff is bound to be a common task for an options menu.)
Line 99: Line 99:
Armor Property MenuARMO Auto ; Playable apparel item
Armor Property MenuARMO Auto ; Playable apparel item
Bool Property bFeatureEnabled Auto Conditional ; Toggling of this demonstrated below.
Bool Property bFeatureEnabled Auto Conditional ; Toggling of this demonstrated below.
GlobalVariable Property DragonsEnabled Auto ;  
GlobalVariable Property DragonsEnabled Auto ; Toggling of this demonstrated below.
Message Property OptionsMenu00MESG Auto
Message Property OptionsMenu00MESG Auto
Message Property OptionsMenu01MESG Auto
Message Property OptionsMenu01MESG Auto
Message Property OptionsMenu02MESG Auto
Message Property OptionsMenu02MESG Auto
YourQuestScriptName Property QuestScript Auto ; Is Conditional with a Conditional bQuickening property


Event OnEquipped(Actor akActor)
Event OnEquipped(Actor akActor)
Line 117: Line 118:
Function Menu(Int aiMessage = 0, Int aiButton = 0, Bool abMenu = True)
Function Menu(Int aiMessage = 0, Int aiButton = 0, Bool abMenu = True)
While abMenu
While abMenu
If aiButton == -1 ; Wait for input
If aiButton == -1 ; As above, can prevent problems if recycling aiButton
ElseIf aiMessage == 0
ElseIf aiMessage == 0
aiButton = OptionsMenu00MESG.Show()
aiButton = OptionsMenu00MESG.Show()
If aiButton == 0 ; This button has a GetVMScriptVariable condition so it only shows if bFeatureEnabled == True
If aiButton < 2 ; Toggle script property. Buttons have opposite GetVMScriptVariable conditions so only the applicable option is given.
bFeatureEnabled = False
bFeatureEnabled = !bFeatureEnabled ; Set boolean to whatever it is not
ElseIf aiButton == 1 ; This button has a GetVMScriptVariable condition so it only shows if bFeatureEnabled == False
If bFeatureEnabled ; == True
bFeatureEnabled = True
Debug.Trace("Featured enabled. Set things up.")
ElseIf aiButton == 2 || aiButton == 3 ; Toggle DragonsEnabled. Buttons have opposite conditions.
Else ; If bFeatureEnabled == False
DragonsEnabled.SetValue((!DragonsEnabled.GetValue() As Bool) As Int)
Debug.Trace("Featured disabled. Stop doing stuff and clean up.")
ElseIf aiButton == 4
EndIf
ElseIf aiButton == 5
ElseIf aiButton < 4 ; Toggle quest property. Buttons have opposite conditions checking the property value with GetVMQuestVariable.
QuestScript.bQuickening = !QuestScript.bQuickening ; Set boolean to whatever it is not
If QuestScript.bQuickening ; == True
Debug.Trace("Start polling.")
Else ; If QuestScript.bQuickening ; == False
Debug.Trace("Stop polling.")
EndIf
ElseIf aiButton < 6 ; Toggle DragonsEnabled. Buttons have opposite conditions as above, but checking the global's value with GetGlobalValue.
DragonsEnabled.SetValue((!DragonsEnabled.GetValue() As Bool) As Int) ; If 1, set to 0. If 0, set to 1
If DragonsEnabled.GetValue() ; != 0
Debug.Trace("Dragons enabled.")
Else ; If DragonsEnabled.GetValue() ; == 0
Debug.Trace("Dragons disabled.")
EndIf
ElseIf aiButton == 6
ElseIf aiButton == 6
ElseIf aiButton == 7
ElseIf aiButton == 7
Anonymous user

Navigation menu