Difference between revisions of "Options Menu"

39 bytes added ,  15:21, 13 April 2012
m
GetBaseObject() replaced with MenuARMO
imported>ShadeMe
(Added to the Tutorials categories)
imported>JustinOther
m (GetBaseObject() replaced with MenuARMO)
Line 7: Line 7:
<source lang="papyrus">ScriptName OptionsMenuScript extends ObjectReference
<source lang="papyrus">ScriptName OptionsMenuScript extends ObjectReference


Armor Property MenuARMO Auto
Message Property OptionsMESG Auto
Message Property OptionsMESG Auto


Line 14: Line 15:
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) ; Wait for input
If (iButton != -1) ; Wait for input
akNewContainer.RemoveItem(GetBaseObject(), 1, True) ; Silently remove token
Game.GetPlayer().RemoveItem(MenuARMO, 1, True) ; Silently remove token
If (iButton == 0)  ; Mage
If (iButton == 0)  ; Mage
Debug.Notification("Mage selected")
Debug.Notification("Mage selected")
Line 31: Line 32:
<source lang="papyrus">ScriptName OptionsMenuScript extends ObjectReference
<source lang="papyrus">ScriptName OptionsMenuScript extends ObjectReference


Armor Property MenuARMO Auto
Message Property MainMenuMESG Auto
Message Property MainMenuMESG Auto
Message Property BreakfastMESG Auto
Message Property BreakfastMESG Auto
Line 40: Line 42:
If akActor == Game.GetPlayer()
If akActor == Game.GetPlayer()
Game.DisablePlayerControls(False, False, False, False, False, True) ; Momentarily disable other menus
Game.DisablePlayerControls(False, False, False, False, False, True) ; Momentarily disable other menus
Game.GetPlayer().EquipItem(GetBaseObject(), True, True) ; Prevent unequip/reequip in favorites until the current menu is resolved
Game.GetPlayer().EquipItem(MenuARMO, True, True) ; Prevent unequip/reequip in favorites until the current menu is resolved
Utility.Wait(0.01) ; This ensures equipping the token from the favorites menu works
Utility.Wait(0.01) ; This ensures equipping the token from the favorites menu works
Game.GetPlayer().UnequipItem(GetBaseObject(), False, True) ; Silently unequip item
Game.GetPlayer().UnequipItem(MenuARMO, False, True) ; Silently unequip item
Game.EnablePlayerControls(False, False, False, False, False, True) ; Undo DisablePlayerControls
Game.EnablePlayerControls(False, False, False, False, False, True) ; Undo DisablePlayerControls
Menu()
Menu()
Anonymous user