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 |
--------------------------------------------
--Battleground Scoreboard End Of Game Scene
--------------------------------------------
local LEAVE_BATTLEGROUND_KEYBIND_COOLDOWN_MS = 2000
local KEYBIND_BUTTON_SPACING_X = 10
BATTLEGROUND_SCOREBOARD_END_OF_GAME_SCENE = ZO_Scene : New ( "battleground_scoreboard_end_of_game" , SCENE_MANAGER )
BATTLEGROUND_SCOREBOARD_END_OF_GAME_SCENE : RegisterCallback ( "StateChange" , function ( oldState , newState )
if newState == SCENE_SHOWING then
end
end )
-- the loot history fragments may not exist depending on the platform
if GAMEPAD_LOOT_HISTORY_FRAGMENT then
end
if KEYBOARD_LOOT_HISTORY_FRAGMENT then
end
-- End game doesn't close the UI when gamepad mode switches, but it shares the same fragment as in game,
-- so only in end game do we want to make sure that the match info gets refreshed on switching fragments
end
-- prevent people from accidentally leaving the BG because they are fighting to the bitter end
end
end
EVENT_MANAGER : RegisterForEvent ( "BattlegroundScoreboardEndOfGame" , EVENT_GAMEPAD_PREFERRED_MODE_CHANGED , OnGamepadModeChanged )
EVENT_MANAGER : RegisterForEvent ( "BattlegroundScoreboardEndOfGame" , EVENT_BATTLEGROUND_STATE_CHANGED , OnBattlegroundStateChanged )
SYSTEMS : RegisterKeyboardRootScene ( "battleground_scoreboard_end_of_game" , BATTLEGROUND_SCOREBOARD_END_OF_GAME_SCENE )
SYSTEMS : RegisterGamepadRootScene ( "battleground_scoreboard_end_of_game" , BATTLEGROUND_SCOREBOARD_END_OF_GAME_SCENE )
SCENE_MANAGER : SetSceneRestoresBaseSceneOnGameMenuToggle ( "battleground_scoreboard_end_of_game" , true )
end
local keybindButtonIndex = 1
local previousKeybindControl
-- Make and anchor the button
local keybindControl = CreateControlFromVirtual ( "$(parent)KeybindButton" .. keybindButtonIndex , keybindContainer , "ZO_KeybindButton" )
if previousKeybindControl then
else
end
-- Keep track of the control for gamepad switching
-- Keep track of the keybind mapping to handle the key being pressed
keybindButtonIndex = keybindButtonIndex + 1
previousKeybindControl = keybindControl
return keybindControl
end
self . playerOptionsButton = CreateKeybindButton ( "BATTLEGROUND_SCOREBOARD_PLAYER_OPTIONS" , function ( ) BATTLEGROUND_SCOREBOARD_FRAGMENT : ShowGamepadPlayerMenu ( ) end , GetString ( SI_BATTLEGROUND_SCOREBOARD_PLAYER_OPTIONS_KEYBIND ) )
self . leaveBattlegroundKeybind = CreateKeybindButton ( "LEAVE_BATTLEGROUND" , function ( ) self : OnLeaveBattlegroundPressed ( ) end , GetString ( SI_BATTLEGROUND_SCOREBOARD_END_OF_GAME_LEAVE_KEYBIND ) )
self . previousPlayerButton = CreateKeybindButton ( "BATTLEGROUND_SCOREBOARD_PREVIOUS" , function ( ) BATTLEGROUND_SCOREBOARD_FRAGMENT : SelectPreviousPlayerData ( ) end , GetString ( SI_BATTLEGROUND_SCOREBOARD_PREVIOUS_PLAYER_KEYBIND ) )
self . nextPlayerButton = CreateKeybindButton ( "BATTLEGROUND_SCOREBOARD_NEXT" , function ( ) BATTLEGROUND_SCOREBOARD_FRAGMENT : SelectNextPlayerData ( ) end , GetString ( SI_BATTLEGROUND_SCOREBOARD_NEXT_PLAYER_KEYBIND ) )
end
local narrationData = { }
if playerOptionsNarrationData then
end
local leaveBattlegroundNarrationData = self . leaveBattlegroundKeybind : GetKeybindButtonNarrationData ( )
if leaveBattlegroundNarrationData then
end
if previousPlayerNarrationData then
end
if nextPlayerNarrationData then
end
return narrationData
end
do
local KEYBOARD_PLATFORM_STYLE =
{
timerFont = "ZoFontWinH2" ,
keybindButtonTemplate = "ZO_KeybindButton_Keyboard_Template" ,
hasPlayerOptionsButton = false ,
}
local GAMEPAD_PLATFORM_STYLE =
{
timerFont = "ZoFontGamepad42" ,
keybindButtonTemplate = "ZO_KeybindButton_Gamepad_Template" ,
hasPlayerOptionsButton = true ,
}
self . platformStyle = ZO_PlatformStyle : New ( function ( style ) self : ApplyPlatformStyle ( style ) end , KEYBOARD_PLATFORM_STYLE , GAMEPAD_PLATFORM_STYLE )
end
end
-- We need this because of modifyTextType
end
if style . hasPlayerOptionsButton then
self . leaveBattlegroundKeybind : SetAnchor ( LEFT , self . playerOptionsButton , RIGHT , KEYBIND_BUTTON_SPACING_X , 0 )
else
end
end
end
local groupToAdd , groupToRemove
groupToAdd = FRAGMENT_GROUP . BATTLEGROUND_MATCH_INFO_GAMEPAD_GROUP
groupToRemove = FRAGMENT_GROUP . BATTLEGROUND_MATCH_INFO_KEYBOARD_GROUP
else
groupToAdd = FRAGMENT_GROUP . BATTLEGROUND_MATCH_INFO_KEYBOARD_GROUP
groupToRemove = FRAGMENT_GROUP . BATTLEGROUND_MATCH_INFO_GAMEPAD_GROUP
end
end
end
end
return true
end
end
return false
end
--[[ xml functions ]] --
end |