Difference between revisions of "Options Menu"
Jump to navigation
Jump to search
→Examples: Enable/DisablePlayerControls(abMenu = True), with v1.6.89, unequips the player's weapon. Reverted to 'False, False, False, False, False, True'
imported>JustinOther m |
imported>JustinOther (→Examples: Enable/DisablePlayerControls(abMenu = True), with v1.6.89, unequips the player's weapon. Reverted to 'False, False, False, False, False, True') |
||
Line 36: | Line 36: | ||
Event OnRead() | Event OnRead() | ||
Game.DisablePlayerControls( | Game.DisablePlayerControls(False, False, False, False, False, True) ; Momentarily disable other menus | ||
Game.EnablePlayerControls( | Game.EnablePlayerControls(False, False, False, False, False, True) ; Undo DisablePlayerControls | ||
Menu() | Menu() | ||
EndEvent | EndEvent | ||
Line 43: | Line 43: | ||
Function Menu(Bool abMenu = True, Int aiButton = 0) | Function Menu(Bool abMenu = True, Int aiButton = 0) | ||
While abMenu | While abMenu | ||
If aiButton != -1 ; Wait for input | If aiButton != -1 ; Wait for input (this can prevent problems if recycling the aiButton argument in submenus) | ||
aiButton = MainMenuMESG.Show() ; Main Menu | aiButton = MainMenuMESG.Show() ; Main Menu | ||
abMenu = False ; End the function | abMenu = False ; End the function | ||
Line 79: | Line 79: | ||
Event OnEquipped(Actor akActor) | Event OnEquipped(Actor akActor) | ||
If akActor == PlayerREF | If akActor == PlayerREF | ||
Game.DisablePlayerControls( | Game.DisablePlayerControls(False, False, False, False, False, True) ; Momentarily disable other menus | ||
PlayerREF.EquipItem(MenuARMO, True, True) ; Prevent unequip/reequip in favorites until the current menu is resolved | PlayerREF.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 | ||
PlayerREF.UnequipItem(MenuARMO, False, True) ; Silently unequip item | PlayerREF.UnequipItem(MenuARMO, False, True) ; Silently unequip item | ||
Game.EnablePlayerControls( | Game.EnablePlayerControls(False, False, False, False, False, True) ; Undo DisablePlayerControls | ||
Menu() | Menu() | ||
EndIf | EndIf |