t7x/data/ui_scripts/frontend_menus/DataSources_StartMenuTabs.lua

218 lines
5.4 KiB
Lua
Raw Normal View History

2023-04-12 17:39:36 -04:00
DataSources.StartMenuTabs = ListHelper_SetupDataSource("StartMenuTabs", function(f44_arg0)
2023-04-11 15:04:04 -04:00
local f44_local0 = {}
2023-04-12 17:39:36 -04:00
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
tabIcon = CoD.buttonStrings.shoulderl
},
properties = {
m_mouseDisabled = true
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
if Engine.IsDemoPlaying() then
local f44_local1 = "CoD.StartMenu_GameOptions"
if Engine.IsZombiesGame() then
f44_local1 = "CoD.StartMenu_GameOptions_ZM"
end
2023-04-12 17:39:36 -04:00
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
2023-04-12 17:39:36 -04:00
tabName = Engine.Localize("MENU_THEATER_CAPS"),
2023-04-11 15:04:04 -04:00
tabWidget = f44_local1,
tabIcon = ""
},
properties = {
tabId = "gameOptions"
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
elseif Engine.IsInGame() then
if IsGameTypeDOA() and not InSafehouse() then
2023-04-12 17:39:36 -04:00
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
tabName = "DOA",
tabWidget = "CoD.StartMenu_GameOptions_DOA",
tabIcon = ""
},
properties = {
tabId = "gameOptions"
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
elseif CoD.isCampaign then
2023-04-12 17:39:36 -04:00
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
2023-04-12 17:39:36 -04:00
tabName = SessionModeToUnlocalizedSessionModeCaps(Engine.CurrentSessionMode()),
2023-04-11 15:04:04 -04:00
tabWidget = "CoD.StartMenu_GameOptions_CP",
tabIcon = ""
},
properties = {
tabId = "gameOptions"
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
if not Engine.IsCampaignModeZombies() then
2023-04-12 17:39:36 -04:00
if CoD.isSafehouse and CoD.isOnlineGame() and not IsInTrainingSim(f44_arg0) and Dvar.ui_safehousebarracks:get() and not IsPlayerAGuest(f44_arg0) then
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
tabName = "CPUI_BARRACKS_CAPS",
tabWidget = "CoD.CombatRecordCP_Contents",
tabIcon = ""
},
properties = {
tabId = "combatRecord"
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
end
2023-04-12 17:39:36 -04:00
if HighestMapReachedGreaterThan(f44_arg0, 1) or LUI.DEV ~= nil then
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
tabName = "CPUI_TACTICAL_MODE_CAPS",
tabWidget = "CoD.StartMenu_TacticalMode",
tabIcon = ""
},
properties = {
tabId = "tacticalMode"
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
end
2023-04-12 17:39:36 -04:00
if not CoD.isSafehouse and not IsPlayerAGuest(f44_arg0) then
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
tabName = "CPUI_ACCOLADES",
tabWidget = "CoD.MissionRecordVault_Challenges",
tabIcon = ""
},
properties = {
tabId = "accolades"
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
end
end
elseif Engine.IsZombiesGame() then
2023-04-12 17:39:36 -04:00
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
2023-04-12 17:39:36 -04:00
tabName = SessionModeToUnlocalizedSessionModeCaps(Engine.CurrentSessionMode()),
2023-04-11 15:04:04 -04:00
tabWidget = "CoD.StartMenu_GameOptions_ZM",
tabIcon = ""
},
properties = {
tabId = "gameOptions"
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
else
2023-04-12 17:39:36 -04:00
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
2023-04-12 17:39:36 -04:00
tabName = SessionModeToUnlocalizedSessionModeCaps(Engine.CurrentSessionMode()),
2023-04-11 15:04:04 -04:00
tabWidget = "CoD.StartMenu_GameOptions",
tabIcon = ""
},
properties = {
tabId = "gameOptions"
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
end
else
2023-04-12 17:39:36 -04:00
if not IsPlayerAGuest(f44_arg0) then
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
tabName = "MENU_TAB_IDENTITY_CAPS",
tabWidget = "CoD.StartMenu_Identity",
tabIcon = ""
},
properties = {
tabId = "identity",
disabled = Dvar.ui_execdemo_gamescom:get()
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
end
2023-04-12 17:39:36 -04:00
if not IsLobbyNetworkModeLAN() and not Dvar.ui_execdemo:get() and not Engine.IsCampaignModeZombies() and not IsPlayerAGuest(f44_arg0) then
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
tabName = "MENU_TAB_CHALLENGES_CAPS",
tabWidget = "CoD.StartMenu_Challenges",
tabIcon = ""
},
properties = {
tabId = "challenges"
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
local f44_local1 = CoD.isPC
if f44_local1 then
f44_local1 = false --Mods_IsUsingMods()
end
2023-04-12 17:39:36 -04:00
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
tabName = "MENU_TAB_BARRACKS_CAPS",
tabWidget = "CoD.StartMenu_Barracks",
tabIcon = "",
disabled = f44_local1
},
properties = {
tabId = "barracks"
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
if CommunityOptionsEnabled() then
local f44_local2 = CoD.perController[f44_arg0].openMediaTabAfterClosingGroups
CoD.perController[f44_arg0].openMediaTabAfterClosingGroups = false
2023-04-12 17:39:36 -04:00
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
tabName = "MENU_TAB_MEDIA_CAPS",
tabWidget = "CoD.StartMenu_Media",
tabIcon = ""
},
properties = {
tabId = "media",
selectIndex = f44_local2
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
end
end
end
if IsGameTypeDOA() and Engine.IsInGame() and not InSafehouse() then
local f44_local1 = table.insert
local f44_local2 = f44_local0
local f44_local3 = {
models = {
tabName = "MENU_TAB_OPTIONS_CAPS",
tabWidget = "CoD.StartMenu_Options_DOA",
tabIcon = ""
}
}
local f44_local4 = {
tabId = "options"
}
local f44_local5 = Dvar.ui_execdemo:get()
if f44_local5 then
f44_local5 = not Engine.IsInGame()
end
f44_local4.selectIndex = f44_local5
f44_local3.properties = f44_local4
2023-04-12 17:39:36 -04:00
f44_local1(f44_local2, f44_local3)
2023-04-11 15:04:04 -04:00
else
local f44_local1 = table.insert
local f44_local2 = f44_local0
local f44_local3 = {
models = {
tabName = "MENU_TAB_OPTIONS_CAPS",
tabWidget = "CoD.StartMenu_Options",
tabIcon = ""
}
}
local f44_local4 = {
tabId = "options"
}
local f44_local5 = Dvar.ui_execdemo_gamescom:get()
if f44_local5 then
f44_local5 = not Engine.IsInGame()
end
f44_local4.selectIndex = f44_local5
f44_local3.properties = f44_local4
2023-04-12 17:39:36 -04:00
f44_local1(f44_local2, f44_local3)
2023-04-11 15:04:04 -04:00
end
2023-04-12 17:39:36 -04:00
table.insert(f44_local0, {
2023-04-11 15:04:04 -04:00
models = {
tabIcon = CoD.buttonStrings.shoulderr
},
properties = {
m_mouseDisabled = true
}
2023-04-12 17:39:36 -04:00
})
2023-04-11 15:04:04 -04:00
return f44_local0
2023-04-12 17:39:36 -04:00
end, true)