1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
MAIN_MENU_CATEGORY_ENABLED = 0
MAIN_MENU_CATEGORY_DISABLED_WHILE_DEAD = 1
MAIN_MENU_CATEGORY_DISABLED_WHILE_IN_COMBAT = 2
MAIN_MENU_CATEGORY_DISABLED_WHILE_REVIVING = 3
MAIN_MENU_CATEGORY_DISABLED_WHILE_SWIMMING = 4
MAIN_MENU_CATEGORY_DISABLED_WHILE_WEREWOLF = 5
MAIN_MENU_CATEGORY_DISABLED_WHILE_PASSENGER = 6
--Main Menu Categories
MENU_CATEGORY_MARKET = 1
MENU_CATEGORY_CROWN_CRATES = 2
MENU_CATEGORY_INVENTORY = 3
MENU_CATEGORY_CHARACTER = 4
MENU_CATEGORY_SKILLS = 5
MENU_CATEGORY_CHAMPION = 6
MENU_CATEGORY_JOURNAL = 7
MENU_CATEGORY_COLLECTIONS = 8
MENU_CATEGORY_MAP = 9
MENU_CATEGORY_GROUP = 10
MENU_CATEGORY_CONTACTS = 11
MENU_CATEGORY_GUILDS = 12
MENU_CATEGORY_ALLIANCE_WAR = 13
MENU_CATEGORY_MAIL = 14
MENU_CATEGORY_NOTIFICATIONS = 15
MENU_CATEGORY_HELP = 16
MENU_CATEGORY_ACTIVITY_FINDER = 17
MENU_CATEGORY_GIFT_INVENTORY = 18
--
--[[ MainMenu Singleton ]] --
--
return mainMenu
end
self . playerStateTable = { }
local PLAYER_IS_DEAD = false
local PLAYER_IS_ALIVE = true
local PLAYER_IS_SWIMMING = true
EVENT_MANAGER : RegisterForEvent ( "MainMenu_Manager" , EVENT_PLAYER_DEAD , function ( ) self : OnPlayerAliveStateChanged ( PLAYER_IS_DEAD ) end )
EVENT_MANAGER : RegisterForEvent ( "MainMenu_Manager" , EVENT_PLAYER_ALIVE , function ( ) self : OnPlayerAliveStateChanged ( PLAYER_IS_ALIVE ) end )
EVENT_MANAGER : RegisterForEvent ( "MainMenu_Manager" , EVENT_PLAYER_COMBAT_STATE , function ( eventCode , inCombat ) self : OnPlayerCombatStateChanged ( inCombat ) end )
EVENT_MANAGER : RegisterForEvent ( "MainMenu_Manager" , EVENT_WEREWOLF_STATE_CHANGED , function ( eventCode , isWerewolf ) self : OnPlayerWerewolfStateChanged ( isWerewolf ) end )
EVENT_MANAGER : RegisterForEvent ( "MainMenu_Manager" , EVENT_MOUNTED_STATE_CHANGED , function ( eventCode , isMounted ) self : OnMountedStateChanged ( isMounted ) end )
local PLAYER_IS_REVIVING = true
EVENT_MANAGER : RegisterForEvent ( "MainMenu_Manager" , EVENT_PLAYER_REINCARNATED , function ( ) self : OnPlayerRevivingStateChanged ( not PLAYER_IS_REVIVING ) end )
EVENT_MANAGER : RegisterForEvent ( "MainMenu_Manager" , EVENT_PLAYER_SWIMMING , function ( ) self : OnPlayerSwimmingStateChanged ( PLAYER_IS_SWIMMING ) end )
EVENT_MANAGER : RegisterForEvent ( "MainMenu_Manager" , EVENT_PLAYER_NOT_SWIMMING , function ( ) self : OnPlayerSwimmingStateChanged ( not PLAYER_IS_SWIMMING ) end )
EVENT_MANAGER : RegisterForEvent ( "MainMenu_Manager" , EVENT_PLAYER_ACTIVATED , function ( ) self : RefreshPlayerState ( ) end )
end
self . playerStateTable . isDead = not isAlive
end
self . playerStateTable . inCombat = inCombat
end
self . playerStateTable . isReviving = isReviving
end
self . playerStateTable . isSwimming = isSwimming
end
self . playerStateTable . isWerewolf = isWerewolf
end
end
end
local stateTable = self . playerStateTable
end
end
return self . playerStateTable . isDead
end
return self . playerStateTable . inCombat
end
return self . playerStateTable . isReviving
end
return self . playerStateTable . isSwimming
end
return self . playerStateTable . isWerewolf
end
return self . playerStateTable . isPassenger
end
--[[
Blocking Scenes prevent the menu from showing other scenes while the blocking scene is activated. If
the player attempts to change the scene while the blocking scene is active, the requested scene is
stored and then only shown once the blocking scene has been cleared.
Blocking scenes should call SetBlockingScene and specify a callback when shown, and call ClearBlockingScene when hidden.
Only one blocking scene should be active at any given time.
Note: nextSceneData is a table that can contain the following information:
category: Integer ID for the menu category. Must be specified if sceneName is not.
sceneName: The name of the scene. Must be specified if category is not.
sceneGroup: The scene group that the scene is a part of. category and sceneName must both be specified if this is used
]] --
self : FireCallbacks ( "OnBlockingSceneActivated" , self . activatedByMouseClick , self . nextSceneData . sceneGroup ~= nil )
end
-- Call this when the blocking scene is shown
assert ( self . blockingSceneName == nil and sceneName ) -- Can't set more than one blocking scene at a time, or can't set one without a name
self . blockingSceneName = sceneName
end
-- Call this when the blocking scene is hidden
local nextSceneData = self . nextSceneData
local showBaseScene = self . showBaseScene
self . blockingSceneName = nil
end
self . blockingSceneName = nil
end
-- Call this if you want to cancel the scene to show when the blocking scene is cleared.
self . nextSceneData = nil
self . showBaseScene = nil
self . activatedByMouseClick = nil
end
-- Don't call this directly; intended to be a private method
if self . blockingSceneName then
self . blockingSceneName = nil
end
end
local function MainMenu_Manager_ActivatedBlockingScene_Internal ( self , sceneData , isBaseScene , activatedByMouseClick )
self . nextSceneData = sceneData or { }
self . showBaseScene = isBaseScene
self . activatedByMouseClick = activatedByMouseClick
end
end
end
return self . blockingSceneName ~= nil
end
end
return self . blockingSceneName
end
end
EVENT_MANAGER : RegisterForEvent ( "MainMenu_Manager" , EVENT_GAMEPAD_PREFERRED_MODE_CHANGED , OnGamepadPreferredModeChanged ) |