2024-08-06 06:26:49 -04:00
|
|
|
local f0_local0 = function(arg0, arg1, arg2)
|
|
|
|
assert(arg0.CreateAClassButton)
|
|
|
|
assert(arg0.MissionSelect)
|
2024-08-06 05:52:32 -04:00
|
|
|
local f1_local0 = LUI.DataSourceInGlobalModel.new("frontEnd.lobby.findMatchButtonWaitStatus")
|
2024-08-06 06:26:49 -04:00
|
|
|
arg0:SubscribeToModel(f1_local0:GetModel(arg1), function()
|
|
|
|
local f2_local0 = f1_local0:GetValue(arg1)
|
2024-08-06 05:52:32 -04:00
|
|
|
local f2_local1 = "Browse for Custom Servers"
|
|
|
|
if f2_local0 == "" then
|
2024-08-06 06:26:49 -04:00
|
|
|
arg0.MissionSelect:SetButtonDisabled(false)
|
2024-08-06 05:52:32 -04:00
|
|
|
else
|
2024-08-06 06:26:49 -04:00
|
|
|
arg0.MissionSelect:SetButtonDisabled(true)
|
2024-08-06 05:52:32 -04:00
|
|
|
f2_local1 = f2_local0
|
|
|
|
end
|
2024-08-06 06:26:49 -04:00
|
|
|
arg0.MissionSelect.buttonDescription = f2_local1
|
|
|
|
arg0.ButtonDescription:processEvent({
|
2024-08-06 05:52:32 -04:00
|
|
|
name = "update_button_description",
|
|
|
|
text = f2_local1
|
|
|
|
})
|
|
|
|
end)
|
2024-08-06 06:26:49 -04:00
|
|
|
if not Onboarding.RigTutorial:WasCompleted(arg1) then
|
|
|
|
arg0.CreateAClassButton.listDefaultFocus = 0
|
2024-08-06 05:52:32 -04:00
|
|
|
end
|
2024-08-06 06:26:49 -04:00
|
|
|
if not CONDITIONS.IsQuarterMasterAllowed(arg0) then
|
|
|
|
arg0.Barracks:SetAnchorsAndPosition(0, 0, 0, 1, 0, 0, _1080p * 120, _1080p * 150)
|
|
|
|
arg0.ButtonDescription:SetAnchorsAndPosition(0, 0, 0, 1, 0, 0, _1080p * 160, _1080p * 190)
|
2024-08-06 05:52:32 -04:00
|
|
|
end
|
2024-08-03 08:15:37 -04:00
|
|
|
end
|
|
|
|
|
2024-08-06 05:52:32 -04:00
|
|
|
function MissionsVerticalLayout(menu, controller)
|
|
|
|
local self = LUI.UIVerticalList.new()
|
|
|
|
self:SetAnchorsAndPosition(0, 1, 0, 1, 0, 500 * _1080p, 0, 330 * _1080p)
|
|
|
|
self.id = "MissionsVerticalLayout"
|
|
|
|
self._animationSets = {}
|
|
|
|
self._sequences = {}
|
2024-08-06 06:26:49 -04:00
|
|
|
local controllerIndex = controller and controller.controllerIndex
|
|
|
|
if not controllerIndex and not Engine.InFrontend() then
|
|
|
|
controllerIndex = self:getRootController()
|
2024-08-06 05:52:32 -04:00
|
|
|
end
|
2024-08-06 06:26:49 -04:00
|
|
|
assert(controllerIndex)
|
|
|
|
|
2024-08-06 05:52:32 -04:00
|
|
|
self:SetSpacing(10 * _1080p)
|
|
|
|
local MissionSelect = nil
|
|
|
|
|
|
|
|
MissionSelect = MenuBuilder.BuildRegisteredType("GenericButton", {
|
2024-08-06 06:26:49 -04:00
|
|
|
controllerIndex = controllerIndex
|
2024-08-06 05:52:32 -04:00
|
|
|
})
|
|
|
|
MissionSelect.id = "MissionSelect"
|
|
|
|
MissionSelect.buttonDescription = "Browse for Custom Servers"
|
|
|
|
MissionSelect.Text:setText(ToUpperCase("Server Browser"), 0)
|
|
|
|
MissionSelect:SetAnchorsAndPosition(0, 0, 0, 1, 0, _1080p * -4, 0, _1080p * 30)
|
|
|
|
self:addElement(MissionSelect)
|
|
|
|
self.MissionSelect = MissionSelect
|
|
|
|
|
|
|
|
local MissionTeams = nil
|
|
|
|
|
|
|
|
MissionTeams = MenuBuilder.BuildRegisteredType("GenericButton", {
|
2024-08-06 06:26:49 -04:00
|
|
|
controllerIndex = controllerIndex
|
2024-08-06 05:52:32 -04:00
|
|
|
})
|
|
|
|
MissionTeams.id = "MissionTeams"
|
|
|
|
MissionTeams.buttonDescription = Engine.Localize("LUA_MENU_DESC_MISSION_TEAMS")
|
|
|
|
MissionTeams.Text:setText(ToUpperCase(Engine.Localize("MENU_MISSION_TEAMS")), 0)
|
|
|
|
MissionTeams:SetAnchorsAndPosition(0, 0, 0, 1, 0, _1080p * -4, _1080p * 40, _1080p * 70)
|
|
|
|
self:addElement(MissionTeams)
|
|
|
|
self.MissionTeams = MissionTeams
|
|
|
|
|
|
|
|
local CreateAClassButton = nil
|
|
|
|
|
|
|
|
CreateAClassButton = MenuBuilder.BuildRegisteredType("CreateAClassButton", {
|
2024-08-06 06:26:49 -04:00
|
|
|
controllerIndex = controllerIndex
|
2024-08-06 05:52:32 -04:00
|
|
|
})
|
|
|
|
CreateAClassButton.id = "CreateAClassButton"
|
|
|
|
CreateAClassButton:SetAnchorsAndPosition(0, 0, 0, 1, 0, _1080p * -4, _1080p * 80, _1080p * 110)
|
|
|
|
self:addElement(CreateAClassButton)
|
|
|
|
self.CreateAClassButton = CreateAClassButton
|
|
|
|
|
|
|
|
local f3_local6 = nil
|
|
|
|
if CONDITIONS.IsQuarterMasterAllowed(self) then
|
|
|
|
f3_local6 = MenuBuilder.BuildRegisteredType("QuartermasterButton", {
|
2024-08-06 06:26:49 -04:00
|
|
|
controllerIndex = controllerIndex
|
2024-08-06 05:52:32 -04:00
|
|
|
})
|
|
|
|
f3_local6.id = "Armory"
|
|
|
|
f3_local6:SetAnchorsAndPosition(0, 0, 0, 1, 0, _1080p * -4, _1080p * 120, _1080p * 150)
|
|
|
|
self:addElement(f3_local6)
|
|
|
|
self.Armory = f3_local6
|
|
|
|
end
|
|
|
|
local Barracks = nil
|
|
|
|
|
|
|
|
Barracks = MenuBuilder.BuildRegisteredType("BarracksButton", {
|
2024-08-06 06:26:49 -04:00
|
|
|
controllerIndex = controllerIndex
|
2024-08-06 05:52:32 -04:00
|
|
|
})
|
|
|
|
Barracks.id = "Barracks"
|
|
|
|
Barracks:SetAnchorsAndPosition(0, 0, 0, 1, 0, _1080p * -4, _1080p * 160, _1080p * 190)
|
|
|
|
self:addElement(Barracks)
|
|
|
|
self.Barracks = Barracks
|
|
|
|
|
|
|
|
local f3_local8 = nil
|
|
|
|
if CONDITIONS.AreContractsEnabled(self) then
|
|
|
|
f3_local8 = MenuBuilder.BuildRegisteredType("ContractsButton", {
|
2024-08-06 06:26:49 -04:00
|
|
|
controllerIndex = controllerIndex
|
2024-08-06 05:52:32 -04:00
|
|
|
})
|
|
|
|
f3_local8.id = "Contracts"
|
|
|
|
f3_local8:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 200, _1080p * 260)
|
|
|
|
self:addElement(f3_local8)
|
|
|
|
self.Contracts = f3_local8
|
|
|
|
end
|
|
|
|
local ButtonDescription = nil
|
|
|
|
|
|
|
|
ButtonDescription = MenuBuilder.BuildRegisteredType("ButtonDescriptionText", {
|
2024-08-06 06:26:49 -04:00
|
|
|
controllerIndex = controllerIndex
|
2024-08-06 05:52:32 -04:00
|
|
|
})
|
|
|
|
ButtonDescription.id = "ButtonDescription"
|
|
|
|
ButtonDescription.Description:SetRight(_1080p * 415, 0)
|
|
|
|
ButtonDescription:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 504, _1080p * 270, _1080p * 370)
|
|
|
|
self:addElement(ButtonDescription)
|
|
|
|
self.ButtonDescription = ButtonDescription
|
|
|
|
|
|
|
|
self._animationSets.DefaultAnimationSet = function()
|
|
|
|
self._sequences.DefaultSequence = function()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
CreateAClassButton:RegisterAnimationSequence("ContractsKillswitched", {{function()
|
|
|
|
return self.CreateAClassButton:SetAnchorsAndPosition(0, 0, 0, 1, 0, 0, _1080p * 80, _1080p * 110, 0)
|
|
|
|
end}})
|
|
|
|
if CONDITIONS.IsQuarterMasterAllowed(self) then
|
|
|
|
f3_local6:RegisterAnimationSequence("ContractsKillswitched", {{function()
|
|
|
|
return self.Armory:SetAnchorsAndPosition(0, 0, 0, 1, 0, 0, _1080p * 120, _1080p * 150, 0)
|
|
|
|
end}})
|
|
|
|
end
|
|
|
|
Barracks:RegisterAnimationSequence("ContractsKillswitched", {{function()
|
|
|
|
return self.Barracks:SetAnchorsAndPosition(0, 0, 0, 1, 0, 0, _1080p * 160, _1080p * 190, 0)
|
|
|
|
end}})
|
|
|
|
ButtonDescription:RegisterAnimationSequence("ContractsKillswitched", {{function()
|
|
|
|
return self.ButtonDescription:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 504, _1080p * 201, _1080p * 301,
|
|
|
|
0)
|
|
|
|
end}})
|
|
|
|
self._sequences.ContractsKillswitched = function()
|
|
|
|
CreateAClassButton:AnimateSequence("ContractsKillswitched")
|
|
|
|
if CONDITIONS.IsQuarterMasterAllowed(self) then
|
|
|
|
f3_local6:AnimateSequence("ContractsKillswitched")
|
|
|
|
end
|
|
|
|
Barracks:AnimateSequence("ContractsKillswitched")
|
|
|
|
ButtonDescription:AnimateSequence("ContractsKillswitched")
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
self._animationSets.DefaultAnimationSet()
|
|
|
|
MissionSelect:addEventHandler("button_action", function(f11_arg0, f11_arg1)
|
2024-08-06 06:26:49 -04:00
|
|
|
local f11_local0 = f11_arg1.controller or controllerIndex
|
2024-08-06 05:52:32 -04:00
|
|
|
ACTIONS.OpenMenu("SystemLinkMenu", true, f11_local0)
|
|
|
|
end)
|
|
|
|
MissionTeams:addEventHandler("button_action", function(f12_arg0, f12_arg1)
|
2024-08-06 06:26:49 -04:00
|
|
|
ACTIONS.OpenMenu("MissionTeamSelect", true, f12_arg1.controller or controllerIndex)
|
2024-08-06 05:52:32 -04:00
|
|
|
end)
|
2024-08-06 06:26:49 -04:00
|
|
|
f0_local0(self, controllerIndex, controller)
|
2024-08-06 05:52:32 -04:00
|
|
|
return self
|
2024-08-03 08:15:37 -04:00
|
|
|
end
|
|
|
|
|
2024-08-06 05:52:32 -04:00
|
|
|
MenuBuilder.m_types["MissionsVerticalLayout"] = MissionsVerticalLayout
|