
-- Should match enums from code!
local PLAYER_SELECTION_BACKGROUND              = -2 -- Special, string not table
local PLAYER_SELECTION_BUTTON_MASK             = -1 -- Special, string not table
local PLAYER_SELECTION_CREATE_PILOT_BUTTON     = 0
local PLAYER_SELECTION_CLONE_BUTTON            = 1
local PLAYER_SELECTION_DELETE_BUTTON           = 2
local PLAYER_SELECTION_SCROLL_LIST_UP_BUTTON   = 3
local PLAYER_SELECTION_SCROLL_LIST_DOWN_BUTTON = 4
local PLAYER_SELECTION_ACCEPT_BUTTON           = 5
local PLAYER_SELECTION_SINGLE_BUTTON           = 6
local PLAYER_SELECTION_MULTI_BUTTON            = 7

local iBackgroundRealWidth  = 2048
local iBackgroundRealHeight = 1024 + 128

local iBackgroundOffsetX = (iBackgroundRealWidth  - ScreenWidth ) * -0.5
local iBackgroundOffsetY = (iBackgroundRealHeight - ScreenHeight) * -0.5

local iPilotSelectBasePosUpperRowX = 512 + 64 + 47     + iBackgroundOffsetX
local iPilotSelectBasePosUpperRowY = 128 + 64 + 48 - 9 + iBackgroundOffsetY

local iPilotSelectBasePosLowerRowX = iPilotSelectBasePosUpperRowX
local iPilotSelectBasePosLowerRowY = iPilotSelectBasePosUpperRowY + 393

local iPilotSelectButtonWidthUpper = 110
local iPilotSelectButtonWidthLower = 116

-- Failure to specify an override value means 'use default value'.
local tblPlayerSelection_Overrides =
{
    [PLAYER_SELECTION_BACKGROUND             ] = "p_select_background",
    [PLAYER_SELECTION_BUTTON_MASK            ] = "p_select_btn_mask",
    
    [PLAYER_SELECTION_CREATE_PILOT_BUTTON    ] = {"p_select_create", iPilotSelectBasePosLowerRowX + iPilotSelectButtonWidthLower * 0    , iPilotSelectBasePosLowerRowY},
    [PLAYER_SELECTION_CLONE_BUTTON           ] = {"p_select_clone" , iPilotSelectBasePosLowerRowX + iPilotSelectButtonWidthLower * 1 + 1, iPilotSelectBasePosLowerRowY}, -- Shifty this because of a per-pixel diff in the overlays
    [PLAYER_SELECTION_DELETE_BUTTON          ] = {"p_select_delete", iPilotSelectBasePosLowerRowX + iPilotSelectButtonWidthLower * 2 - 1, iPilotSelectBasePosLowerRowY}, -- Same here
    --[PLAYER_SELECTION_SCROLL_LIST_UP_BUTTON  ] = {"p_select_scrollup"},
    --[PLAYER_SELECTION_SCROLL_LIST_DOWN_BUTTON] = {"p_select_scrolldown"},
    [PLAYER_SELECTION_ACCEPT_BUTTON          ] = {"p_select_accept", iPilotSelectBasePosLowerRowX + 642                             , iPilotSelectBasePosLowerRowY},
    [PLAYER_SELECTION_SINGLE_BUTTON          ] = {"p_select_single", iPilotSelectBasePosUpperRowX + iPilotSelectButtonWidthUpper * 0, iPilotSelectBasePosUpperRowY},
    [PLAYER_SELECTION_MULTI_BUTTON           ] = {"p_select_multi" , iPilotSelectBasePosUpperRowX + iPilotSelectButtonWidthUpper * 1, iPilotSelectBasePosUpperRowY},
    
    DisableTextLabels = true
}

-- The table MUST be named MenuUI_Overrides
MenuUI_Overrides = {}

-- Center the screen onto the texture's center
MenuUI_Overrides.BackgroundOffsetX = iBackgroundOffsetX
MenuUI_Overrides.BackgroundOffsetY = iBackgroundOffsetY
MenuUI_Overrides.PlayerSelection   = tblPlayerSelection_Overrides
-- Is this even needed/implemented?
--MenuUI_Overrides.UnlockMainMenuUI  = true -- Allow all resolutions, not just 1024 or 640

