format ui scripts

This commit is contained in:
quaK 2024-08-06 12:52:32 +03:00
parent 7835bb0477
commit 364813c486
13 changed files with 1907 additions and 2091 deletions

View File

@ -1,11 +1,11 @@
local CPMainMenu_original = MenuBuilder.m_types["CPMainMenu"] local CPMainMenu_original = MenuBuilder.m_types["CPMainMenu"]
function CPMainMenuStub( menu, controller ) function CPMainMenuStub(menu, controller)
ret = CPMainMenu_original( menu, controller ) ret = CPMainMenu_original(menu, controller)
-- play music immediately -- play music immediately
Engine.PlayMusic( CoD.Music.MainCPMusic ) Engine.PlayMusic(CoD.Music.MainCPMusic)
return ret return ret
end end
MenuBuilder.m_types["CPMainMenu"] = CPMainMenuStub MenuBuilder.m_types["CPMainMenu"] = CPMainMenuStub

View File

@ -1,201 +1,201 @@
local f0_local0 = function ( f1_arg0, f1_arg1 ) local f0_local0 = function(f1_arg0, f1_arg1)
Engine.Exec( "xblive_privatematch 0" ) Engine.Exec("xblive_privatematch 0")
utils.cp.AliensUtils.AliensRunConfig( f1_arg1.controller ) utils.cp.AliensUtils.AliensRunConfig(f1_arg1.controller)
LUI.FlowManager.RequestAddMenu( "SystemLinkMenu", false, f1_arg1.controller, false, {}, true ) LUI.FlowManager.RequestAddMenu("SystemLinkMenu", false, f1_arg1.controller, false, {}, true)
end end
local f0_local1 = function ( f2_arg0, f2_arg1 ) local f0_local1 = function(f2_arg0, f2_arg1)
f0_local0( f2_arg0, f2_arg1 ) f0_local0(f2_arg0, f2_arg1)
end end
local f0_local2 = function ( f3_arg0, f3_arg1 ) local f0_local2 = function(f3_arg0, f3_arg1)
Engine.Exec( MPConfig.default_xboxlive, f3_arg1.controller ) Engine.Exec(MPConfig.default_xboxlive, f3_arg1.controller)
Engine.SetDvarBool( "xblive_privatematch", true ) Engine.SetDvarBool("xblive_privatematch", true)
SetIsAliensSolo( true ) SetIsAliensSolo(true)
Engine.SetDvarInt( "party_maxplayers", 1 ) Engine.SetDvarInt("party_maxplayers", 1)
Engine.Exec( "xstartprivatematch" ) Engine.Exec("xstartprivatematch")
LUI.FlowManager.RequestAddMenu( "CPPrivateMatchMenu", false, f3_arg1.controller, false, { LUI.FlowManager.RequestAddMenu("CPPrivateMatchMenu", false, f3_arg1.controller, false, {
showPlayNowButton = true, showPlayNowButton = true,
isPublicMatch = false isPublicMatch = false
} ) })
end end
local f0_local3 = function ( f4_arg0, f4_arg1 ) local f0_local3 = function(f4_arg0, f4_arg1)
Engine.Exec( MPConfig.default_xboxlive, f4_arg1.controller ) Engine.Exec(MPConfig.default_xboxlive, f4_arg1.controller)
Engine.SetDvarBool( "xblive_privatematch", true ) Engine.SetDvarBool("xblive_privatematch", true)
SetIsAliensSolo( false ) SetIsAliensSolo(false)
Engine.Exec( "xstartprivatematch" ) Engine.Exec("xstartprivatematch")
LUI.FlowManager.RequestAddMenu( "CPPrivateMatchMenu", false, f4_arg1.controller, false, { LUI.FlowManager.RequestAddMenu("CPPrivateMatchMenu", false, f4_arg1.controller, false, {
showPlayNowButton = true, showPlayNowButton = true,
isPublicMatch = false isPublicMatch = false
} ) })
end end
local f0_local4 = function ( f5_arg0, f5_arg1, f5_arg2 ) local f0_local4 = function(f5_arg0, f5_arg1, f5_arg2)
assert( f5_arg0.PublicMatch ) assert(f5_arg0.PublicMatch)
assert( f5_arg0.SoloMatch ) assert(f5_arg0.SoloMatch)
assert( f5_arg0.CustomMatch ) assert(f5_arg0.CustomMatch)
local f5_local0 = LUI.DataSourceInGlobalModel.new( "frontEnd.lobby.areWeGameHost" ) local f5_local0 = LUI.DataSourceInGlobalModel.new("frontEnd.lobby.areWeGameHost")
local f5_local1 = DataSources.frontEnd.lobby.memberCount local f5_local1 = DataSources.frontEnd.lobby.memberCount
local f5_local2 = function () local f5_local2 = function()
return Lobby.IsInPrivateParty() and not Lobby.IsPrivatePartyHost() return Lobby.IsInPrivateParty() and not Lobby.IsPrivatePartyHost()
end end
local f5_local3 = function () local f5_local3 = function()
local f7_local0 = f5_local2() local f7_local0 = f5_local2()
f5_arg0.PublicMatch:SetButtonDisabled( f7_local0 ) f5_arg0.PublicMatch:SetButtonDisabled(f7_local0)
f5_arg0.CustomMatch:SetButtonDisabled( f7_local0 ) f5_arg0.CustomMatch:SetButtonDisabled(f7_local0)
end end
f5_arg0:SubscribeToModel( f5_local0:GetModel( f5_arg1 ), f5_local3 ) f5_arg0:SubscribeToModel(f5_local0:GetModel(f5_arg1), f5_local3)
f5_arg0:SubscribeToModel( f5_local1:GetModel( f5_arg1 ), f5_local3 ) f5_arg0:SubscribeToModel(f5_local1:GetModel(f5_arg1), f5_local3)
f5_arg0:SubscribeToModel( DataSources.frontEnd.lobby.isSolo:GetModel( f5_arg1 ), function () f5_arg0:SubscribeToModel(DataSources.frontEnd.lobby.isSolo:GetModel(f5_arg1), function()
local f8_local0 = DataSources.frontEnd.lobby.isSolo:GetValue( f5_arg1 ) local f8_local0 = DataSources.frontEnd.lobby.isSolo:GetValue(f5_arg1)
if f8_local0 ~= nil then if f8_local0 ~= nil then
f5_arg0.SoloMatch:SetButtonDisabled( not f8_local0 ) f5_arg0.SoloMatch:SetButtonDisabled(not f8_local0)
end end
end ) end)
f5_arg0.PublicMatch:addEventHandler( "button_action", f0_local1 ) f5_arg0.PublicMatch:addEventHandler("button_action", f0_local1)
f5_arg0.SoloMatch:addEventHandler( "button_action", f0_local2 ) f5_arg0.SoloMatch:addEventHandler("button_action", f0_local2)
f5_arg0.Loadout:addEventHandler( "button_action", function ( f9_arg0, f9_arg1 ) f5_arg0.Loadout:addEventHandler("button_action", function(f9_arg0, f9_arg1)
LUI.FlowManager.RequestAddMenu( "CPLoadoutMenu", true, f9_arg1.controller ) LUI.FlowManager.RequestAddMenu("CPLoadoutMenu", true, f9_arg1.controller)
end ) end)
f5_arg0.Barracks:addEventHandler( "button_action", function ( f10_arg0, f10_arg1 ) f5_arg0.Barracks:addEventHandler("button_action", function(f10_arg0, f10_arg1)
LUI.FlowManager.RequestAddMenu( "Headquarters", true, f10_arg1.controller ) LUI.FlowManager.RequestAddMenu("Headquarters", true, f10_arg1.controller)
end ) end)
f5_arg0.Armory:addEventHandler( "button_action", function ( f11_arg0, f11_arg1 ) f5_arg0.Armory:addEventHandler("button_action", function(f11_arg0, f11_arg1)
if not Engine.IsUserAGuest( f11_arg1.controller ) then if not Engine.IsUserAGuest(f11_arg1.controller) then
ACTIONS.OpenMenu( "Armory", true, f11_arg1.controller ) ACTIONS.OpenMenu("Armory", true, f11_arg1.controller)
end end
end ) end)
f5_arg0.CustomMatch:addEventHandler( "button_action", f0_local3 ) f5_arg0.CustomMatch:addEventHandler("button_action", f0_local3)
f5_arg0.ContractsButton:addEventHandler( "button_action", function ( f12_arg0, f12_arg1 ) f5_arg0.ContractsButton:addEventHandler("button_action", function(f12_arg0, f12_arg1)
ACTIONS.OpenMenu( "ContractMenu", true, f12_arg1.controller or f5_arg1 ) ACTIONS.OpenMenu("ContractMenu", true, f12_arg1.controller or f5_arg1)
end ) end)
f5_arg0.ModsButton:addEventHandler( "button_action", function ( arg0, arg1 ) f5_arg0.ModsButton:addEventHandler("button_action", function(arg0, arg1)
LUI.FlowManager.RequestAddMenu( "ModSelectMenu", true, arg1.controller, false ) LUI.FlowManager.RequestAddMenu("ModSelectMenu", true, arg1.controller, false)
end ) end)
end end
function CPMainMenuButtons( menu, controller ) function CPMainMenuButtons(menu, controller)
local VNavigator = LUI.UIVerticalNavigator.new() local VNavigator = LUI.UIVerticalNavigator.new()
VNavigator:SetAnchorsAndPosition( 0, 1, 0, 1, 0, 500 * _1080p, 0, 400 * _1080p ) VNavigator:SetAnchorsAndPosition(0, 1, 0, 1, 0, 500 * _1080p, 0, 400 * _1080p)
VNavigator.id = "CPMainMenuButtons" VNavigator.id = "CPMainMenuButtons"
local f14_local1 = controller and controller.controllerIndex local f14_local1 = controller and controller.controllerIndex
if not f14_local1 and not Engine.InFrontend() then if not f14_local1 and not Engine.InFrontend() then
f14_local1 = VNavigator:getRootController() f14_local1 = VNavigator:getRootController()
end end
assert( f14_local1 ) assert(f14_local1)
local f14_local2 = VNavigator local f14_local2 = VNavigator
local ButtonDescription = nil local ButtonDescription = nil
ButtonDescription = MenuBuilder.BuildRegisteredType( "ButtonDescriptionText", { ButtonDescription = MenuBuilder.BuildRegisteredType("ButtonDescriptionText", {
controllerIndex = f14_local1 controllerIndex = f14_local1
} ) })
ButtonDescription.id = "ButtonDescription" ButtonDescription.id = "ButtonDescription"
ButtonDescription:SetRGBFromTable( SWATCHES.genericButton.textDisabled, 0 ) ButtonDescription:SetRGBFromTable(SWATCHES.genericButton.textDisabled, 0)
ButtonDescription.Description:SetRight( _1080p * 415, 0 ) ButtonDescription.Description:SetRight(_1080p * 415, 0)
ButtonDescription:SetAnchorsAndPosition( 0, 0, 0, 1, 0, 0, _1080p * 336, _1080p * 394 ) ButtonDescription:SetAnchorsAndPosition(0, 0, 0, 1, 0, 0, _1080p * 336, _1080p * 394)
VNavigator:addElement( ButtonDescription ) VNavigator:addElement(ButtonDescription)
VNavigator.ButtonDescription = ButtonDescription VNavigator.ButtonDescription = ButtonDescription
local PublicMatch = nil local PublicMatch = nil
PublicMatch = MenuBuilder.BuildRegisteredType( "MenuButton", { PublicMatch = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f14_local1 controllerIndex = f14_local1
} ) })
PublicMatch.id = "PublicMatch" PublicMatch.id = "PublicMatch"
PublicMatch.buttonDescription = "Browse for Custom Servers" PublicMatch.buttonDescription = "Browse for Custom Servers"
PublicMatch.Text:setText( ToUpperCase( "Server Browser" ), 0 ) PublicMatch.Text:setText(ToUpperCase("Server Browser"), 0)
PublicMatch:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 340, 0, _1080p * 30 ) PublicMatch:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, 0, _1080p * 30)
VNavigator:addElement( PublicMatch ) VNavigator:addElement(PublicMatch)
VNavigator.PublicMatch = PublicMatch VNavigator.PublicMatch = PublicMatch
local SoloMatch = nil local SoloMatch = nil
SoloMatch = MenuBuilder.BuildRegisteredType( "MenuButton", { SoloMatch = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f14_local1 controllerIndex = f14_local1
} ) })
SoloMatch.id = "SoloMatch" SoloMatch.id = "SoloMatch"
SoloMatch.buttonDescription = Engine.Localize( "LUA_MENU_ZM_SOLO_MATCH_DESC" ) SoloMatch.buttonDescription = Engine.Localize("LUA_MENU_ZM_SOLO_MATCH_DESC")
SoloMatch.Text:setText( ToUpperCase( Engine.Localize( "LUA_MENU_SOLO_MATCH_CAPS" ) ), 0 ) SoloMatch.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_SOLO_MATCH_CAPS")), 0)
SoloMatch:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 340, _1080p * 40, _1080p * 70 ) SoloMatch:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 40, _1080p * 70)
VNavigator:addElement( SoloMatch ) VNavigator:addElement(SoloMatch)
VNavigator.SoloMatch = SoloMatch VNavigator.SoloMatch = SoloMatch
local CustomMatch = nil local CustomMatch = nil
CustomMatch = MenuBuilder.BuildRegisteredType( "MenuButton", { CustomMatch = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f14_local1 controllerIndex = f14_local1
} ) })
CustomMatch.id = "CustomMatch" CustomMatch.id = "CustomMatch"
CustomMatch.buttonDescription = Engine.Localize( "LUA_MENU_ZM_CUSTOM_MATCH_DESC" ) CustomMatch.buttonDescription = Engine.Localize("LUA_MENU_ZM_CUSTOM_MATCH_DESC")
CustomMatch.Text:setText( ToUpperCase( Engine.Localize( "LUA_MENU_CUSTOM_GAME_CAPS" ) ), 0 ) CustomMatch.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_CUSTOM_GAME_CAPS")), 0)
CustomMatch:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 340, _1080p * 80, _1080p * 110 ) CustomMatch:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 80, _1080p * 110)
VNavigator:addElement( CustomMatch ) VNavigator:addElement(CustomMatch)
VNavigator.CustomMatch = CustomMatch VNavigator.CustomMatch = CustomMatch
local Loadout = nil local Loadout = nil
Loadout = MenuBuilder.BuildRegisteredType( "MenuButton", { Loadout = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f14_local1 controllerIndex = f14_local1
} ) })
Loadout.id = "Loadout" Loadout.id = "Loadout"
Loadout.buttonDescription = Engine.Localize( "LUA_MENU_ZM_LOADOUT_DESC" ) Loadout.buttonDescription = Engine.Localize("LUA_MENU_ZM_LOADOUT_DESC")
Loadout.Text:setText( Engine.Localize( "LUA_MENU_ZM_LOADOUT_CAPS" ), 0 ) Loadout.Text:setText(Engine.Localize("LUA_MENU_ZM_LOADOUT_CAPS"), 0)
Loadout:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 340, _1080p * 120, _1080p * 150 ) Loadout:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 120, _1080p * 150)
VNavigator:addElement( Loadout ) VNavigator:addElement(Loadout)
VNavigator.Loadout = Loadout VNavigator.Loadout = Loadout
local Barracks = nil local Barracks = nil
Barracks = MenuBuilder.BuildRegisteredType( "MenuButton", { Barracks = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f14_local1 controllerIndex = f14_local1
} ) })
Barracks.id = "Barracks" Barracks.id = "Barracks"
Barracks.buttonDescription = Engine.Localize( "LUA_MENU_ZM_BARRACKS_DESC" ) Barracks.buttonDescription = Engine.Localize("LUA_MENU_ZM_BARRACKS_DESC")
Barracks.Text:setText( ToUpperCase( Engine.Localize( "LUA_MENU_ZM_BARRACKS_CAPS" ) ), 0 ) Barracks.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_ZM_BARRACKS_CAPS")), 0)
Barracks:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 340, _1080p * 160, _1080p * 190 ) Barracks:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 160, _1080p * 190)
VNavigator:addElement( Barracks ) VNavigator:addElement(Barracks)
VNavigator.Barracks = Barracks VNavigator.Barracks = Barracks
local Armory = nil local Armory = nil
Armory = MenuBuilder.BuildRegisteredType( "MenuButton", { Armory = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f14_local1 controllerIndex = f14_local1
} ) })
Armory.id = "Armory" Armory.id = "Armory"
Armory.buttonDescription = Engine.Localize( "LUA_MENU_ZM_SURVIVAL_DEPOT_DESC" ) Armory.buttonDescription = Engine.Localize("LUA_MENU_ZM_SURVIVAL_DEPOT_DESC")
Armory.Text:setText( ToUpperCase( Engine.Localize( "LUA_MENU_ZM_SURVIVAL_DEPOT" ) ), 0 ) Armory.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_ZM_SURVIVAL_DEPOT")), 0)
Armory:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 340, _1080p * 200, _1080p * 230 ) Armory:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 200, _1080p * 230)
VNavigator:addElement( Armory ) VNavigator:addElement(Armory)
VNavigator.Armory = Armory VNavigator.Armory = Armory
local ModsButton = nil local ModsButton = nil
ModsButton = MenuBuilder.BuildRegisteredType( "MenuButton", { ModsButton = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f14_local1 controllerIndex = f14_local1
} ) })
ModsButton.id = "ModsButton" ModsButton.id = "ModsButton"
ModsButton.buttonDescription = Engine.Localize( "LUA_MENU_MODS_DESC" ) ModsButton.buttonDescription = Engine.Localize("LUA_MENU_MODS_DESC")
ModsButton.Text:setText( ToUpperCase( Engine.Localize( "LUA_MENU_MODS_CAPS" ) ), 0 ) ModsButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_MODS_CAPS")), 0)
ModsButton:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 340, _1080p * 240, _1080p * 270 ) ModsButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 240, _1080p * 270)
VNavigator:addElement( ModsButton ) VNavigator:addElement(ModsButton)
VNavigator.ModsButton = ModsButton VNavigator.ModsButton = ModsButton
local ContractsButton = nil local ContractsButton = nil
ContractsButton = MenuBuilder.BuildRegisteredType( "ContractsButtonCP", { ContractsButton = MenuBuilder.BuildRegisteredType("ContractsButtonCP", {
controllerIndex = f14_local1 controllerIndex = f14_local1
} ) })
ContractsButton.id = "ContractsButton" ContractsButton.id = "ContractsButton"
ContractsButton:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 340, _1080p * 280, _1080p * 340 ) ContractsButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 280, _1080p * 340)
VNavigator:addElement( ContractsButton ) VNavigator:addElement(ContractsButton)
VNavigator.ContractsButton = ContractsButton VNavigator.ContractsButton = ContractsButton
f0_local4( VNavigator, f14_local1, controller ) f0_local4(VNavigator, f14_local1, controller)
return VNavigator return VNavigator
end end
MenuBuilder.m_types["CPMainMenuButtons"] = CPMainMenuButtons MenuBuilder.m_types["CPMainMenuButtons"] = CPMainMenuButtons

View File

@ -1,178 +1,178 @@
local f0_local1 = function ( f2_arg0 ) local f0_local1 = function(f2_arg0)
f2_arg0.ResumeButton:SetButtonDisabled( not Engine.CanResumeGame( f2_arg0._controllerIndex ) ) f2_arg0.ResumeButton:SetButtonDisabled(not Engine.CanResumeGame(f2_arg0._controllerIndex))
if not CONDITIONS.IsTrialLicense( f2_arg0 ) then if not CONDITIONS.IsTrialLicense(f2_arg0) then
local f2_local0 = f2_arg0.MissionSelectButton local f2_local0 = f2_arg0.MissionSelectButton
local f2_local1 = f2_local0 local f2_local1 = f2_local0
f2_local0 = f2_local0.SetButtonDisabled f2_local0 = f2_local0.SetButtonDisabled
local f2_local2 = Engine.IsTrialLicense() local f2_local2 = Engine.IsTrialLicense()
if not f2_local2 then if not f2_local2 then
if not Engine.IsDevelopmentBuild() and not Engine.GetDvarBool( "mis_cheat" ) then if not Engine.IsDevelopmentBuild() and not Engine.GetDvarBool("mis_cheat") then
f2_local2 = not f0_local0( f2_arg0._controllerIndex ) f2_local2 = not f0_local0(f2_arg0._controllerIndex)
else else
f2_local2 = false f2_local2 = false
end end
end end
f2_local0( f2_local1, f2_local2 ) f2_local0(f2_local1, f2_local2)
end end
end end
local f0_local2 = function ( f3_arg0, f3_arg1 ) local f0_local2 = function(f3_arg0, f3_arg1)
LUI.FlowManager.RequestPopupMenu( nil, "FakeLoadingScreenOverlay", true, 0, false, { LUI.FlowManager.RequestPopupMenu(nil, "FakeLoadingScreenOverlay", true, 0, false, {
onLoadCompleteFunc = function () onLoadCompleteFunc = function()
Engine.SetDvarString( "ui_char_museum_mode", "credits_1" ) Engine.SetDvarString("ui_char_museum_mode", "credits_1")
Engine.Exec( "profile_difficultyLoad" ) Engine.Exec("profile_difficultyLoad")
Engine.Exec( "profile_specialistModeLoad" ) Engine.Exec("profile_specialistModeLoad")
Engine.Exec( "profile_yoloModeLoad" ) Engine.Exec("profile_yoloModeLoad")
Engine.Exec( "loadgame_continue" ) Engine.Exec("loadgame_continue")
Engine.Exec( "updategamerprofile" ) Engine.Exec("updategamerprofile")
end end
} ) })
LUI.FlowManager.RequestLeaveMenu( f3_arg0 ) LUI.FlowManager.RequestLeaveMenu(f3_arg0)
end end
local f0_local3 = function ( f5_arg0, f5_arg1 ) local f0_local3 = function(f5_arg0, f5_arg1)
LUI.FlowManager.RequestPopupMenu( nil, "FakeLoadingScreenOverlay", true, 0, false, { LUI.FlowManager.RequestPopupMenu(nil, "FakeLoadingScreenOverlay", true, 0, false, {
onLoadCompleteFunc = function () onLoadCompleteFunc = function()
Engine.Exec( "set ui_play_credits 1; map shipcrib_epilogue" ) Engine.Exec("set ui_play_credits 1; map shipcrib_epilogue")
end end
} ) })
end end
--MenuBuilder.registerType( "ResumeGamePopup", function ( f7_arg0, f7_arg1 ) -- MenuBuilder.registerType( "ResumeGamePopup", function ( f7_arg0, f7_arg1 )
-- return MenuBuilder.BuildRegisteredType( "PopupYesNo", { -- return MenuBuilder.BuildRegisteredType( "PopupYesNo", {
-- message = Engine.Localize( "@MENU_RESUMEGAME_Q" ), -- message = Engine.Localize( "@MENU_RESUMEGAME_Q" ),
-- yesAction = f0_local2 -- yesAction = f0_local2
-- } ) -- } )
--end ) -- end )
local f0_local4 = function ( f8_arg0, f8_arg1, f8_arg2 ) local f0_local4 = function(f8_arg0, f8_arg1, f8_arg2)
assert( f8_arg0.ResumeButton ) assert(f8_arg0.ResumeButton)
assert( f8_arg0.NewButton ) assert(f8_arg0.NewButton)
assert( f8_arg0.CreditsButton ) assert(f8_arg0.CreditsButton)
if not CONDITIONS.IsTrialLicense( f8_arg0 ) then if not CONDITIONS.IsTrialLicense(f8_arg0) then
assert( f8_arg0.MissionSelectButton ) assert(f8_arg0.MissionSelectButton)
end end
f8_arg0._controllerIndex = f8_arg1 f8_arg0._controllerIndex = f8_arg1
f8_arg0.ResumeButton:addEventHandler( "button_action", function ( f9_arg0, f9_arg1 ) f8_arg0.ResumeButton:addEventHandler("button_action", function(f9_arg0, f9_arg1)
Engine.SetDvarString( "start", "" ) Engine.SetDvarString("start", "")
LUI.FlowManager.RequestPopupMenu( f9_arg0, "ResumeGamePopup", false, f9_arg1.controller, false ) LUI.FlowManager.RequestPopupMenu(f9_arg0, "ResumeGamePopup", false, f9_arg1.controller, false)
end ) end)
f8_arg0.NewButton:addEventHandler( "button_action", function ( f10_arg0, f10_arg1 ) f8_arg0.NewButton:addEventHandler("button_action", function(f10_arg0, f10_arg1)
Engine.SetDvarString( "start", "" ) Engine.SetDvarString("start", "")
if Engine.CanResumeGame( f8_arg1 ) then if Engine.CanResumeGame(f8_arg1) then
LUI.FlowManager.RequestPopupMenu( f8_arg0, "overwrite_warning_menu", true, f10_arg1.controller ) LUI.FlowManager.RequestPopupMenu(f8_arg0, "overwrite_warning_menu", true, f10_arg1.controller)
else else
LUI.FlowManager.RequestPopupMenu( f8_arg0, "popmenu_autosave_warning", true, f10_arg1.controller ) LUI.FlowManager.RequestPopupMenu(f8_arg0, "popmenu_autosave_warning", true, f10_arg1.controller)
end end
end ) end)
if not CONDITIONS.IsTrialLicense( f8_arg0 ) then if not CONDITIONS.IsTrialLicense(f8_arg0) then
f8_arg0.MissionSelectButton:addEventHandler( "button_action", function ( f11_arg0, f11_arg1 ) f8_arg0.MissionSelectButton:addEventHandler("button_action", function(f11_arg0, f11_arg1)
Engine.SetDvarString( "start", "" ) Engine.SetDvarString("start", "")
LUI.FlowManager.RequestAddMenu( "LevelSelectMenu", true, f11_arg1.controller, false ) LUI.FlowManager.RequestAddMenu("LevelSelectMenu", true, f11_arg1.controller, false)
end ) end)
end end
f8_arg0.CreditsButton:addEventHandler( "button_action", f0_local3 ) f8_arg0.CreditsButton:addEventHandler("button_action", f0_local3)
f0_local1( f8_arg0 ) f0_local1(f8_arg0)
f8_arg0:addEventHandler( "update_save_game_available_complete", f0_local1 ) f8_arg0:addEventHandler("update_save_game_available_complete", f0_local1)
if Engine.GetDvarFloat( "r_filmGrainAtten" ) == 0.25 then if Engine.GetDvarFloat("r_filmGrainAtten") == 0.25 then
Engine.SetDvarFloat( "r_filmGrainAtten", 1 ) Engine.SetDvarFloat("r_filmGrainAtten", 1)
Engine.ExecNow( "profile_setFilmGrain " .. tostring( 1 ), f8_arg1 ) Engine.ExecNow("profile_setFilmGrain " .. tostring(1), f8_arg1)
end end
f8_arg0.ModsButton:addEventHandler( "button_action", function ( arg0, arg1 ) f8_arg0.ModsButton:addEventHandler("button_action", function(arg0, arg1)
LUI.FlowManager.RequestAddMenu( "ModSelectMenu", true, arg1.controller, false ) LUI.FlowManager.RequestAddMenu("ModSelectMenu", true, arg1.controller, false)
end ) end)
end end
function CampaignMenuButtons( menu, controller ) function CampaignMenuButtons(menu, controller)
local self = LUI.UIVerticalList.new() local self = LUI.UIVerticalList.new()
self:SetAnchorsAndPosition( 0, 1, 0, 1, 0, 500 * _1080p, 0, 440 * _1080p ) self:SetAnchorsAndPosition(0, 1, 0, 1, 0, 500 * _1080p, 0, 440 * _1080p)
self.id = "CampaignMenuButtons" self.id = "CampaignMenuButtons"
local f12_local1 = controller and controller.controllerIndex local f12_local1 = controller and controller.controllerIndex
if not f12_local1 and not Engine.InFrontend() then if not f12_local1 and not Engine.InFrontend() then
f12_local1 = self:getRootController() f12_local1 = self:getRootController()
end end
assert( f12_local1 ) assert(f12_local1)
local f12_local2 = self local f12_local2 = self
self:SetSpacing( 10 * _1080p ) self:SetSpacing(10 * _1080p)
local ResumeButton = nil local ResumeButton = nil
ResumeButton = MenuBuilder.BuildRegisteredType( "MenuButton", { ResumeButton = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f12_local1 controllerIndex = f12_local1
} ) })
ResumeButton.id = "ResumeButton" ResumeButton.id = "ResumeButton"
ResumeButton.buttonDescription = Engine.Localize( "LUA_MENU_RESUME_GAME_DESC" ) ResumeButton.buttonDescription = Engine.Localize("LUA_MENU_RESUME_GAME_DESC")
ResumeButton.Text:setText( Engine.Localize( "MENU_RESUMEGAME_CAPS" ), 0 ) ResumeButton.Text:setText(Engine.Localize("MENU_RESUMEGAME_CAPS"), 0)
ResumeButton:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, 0, _1080p * 30 ) ResumeButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, 0, _1080p * 30)
self:addElement( ResumeButton ) self:addElement(ResumeButton)
self.ResumeButton = ResumeButton self.ResumeButton = ResumeButton
local NewButton = nil local NewButton = nil
NewButton = MenuBuilder.BuildRegisteredType( "MenuButton", { NewButton = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f12_local1 controllerIndex = f12_local1
} ) })
NewButton.id = "NewButton" NewButton.id = "NewButton"
NewButton.buttonDescription = Engine.Localize( "LUA_MENU_NEW_GAME_DESC" ) NewButton.buttonDescription = Engine.Localize("LUA_MENU_NEW_GAME_DESC")
NewButton.Text:setText( Engine.Localize( "MENU_NEWGAME_CAPS" ), 0 ) NewButton.Text:setText(Engine.Localize("MENU_NEWGAME_CAPS"), 0)
NewButton:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, _1080p * 40, _1080p * 70 ) NewButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 40, _1080p * 70)
self:addElement( NewButton ) self:addElement(NewButton)
self.NewButton = NewButton self.NewButton = NewButton
local f12_local5 = nil local f12_local5 = nil
if not CONDITIONS.IsTrialLicense( self ) then if not CONDITIONS.IsTrialLicense(self) then
f12_local5 = MenuBuilder.BuildRegisteredType( "MenuButton", { f12_local5 = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f12_local1 controllerIndex = f12_local1
} ) })
f12_local5.id = "MissionSelectButton" f12_local5.id = "MissionSelectButton"
if not CONDITIONS.IsTrialLicense( self ) then if not CONDITIONS.IsTrialLicense(self) then
else else
end end
if not CONDITIONS.IsTrialLicense( self ) then if not CONDITIONS.IsTrialLicense(self) then
f12_local5.buttonDescription = Engine.Localize( "LUA_MENU_MISSION_SELECT_DESC" ) f12_local5.buttonDescription = Engine.Localize("LUA_MENU_MISSION_SELECT_DESC")
end end
f12_local5.Text:setText( Engine.Localize( "MENU_MISSION_SELECT_CAPS" ), 0 ) f12_local5.Text:setText(Engine.Localize("MENU_MISSION_SELECT_CAPS"), 0)
f12_local5:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, _1080p * 80, _1080p * 110 ) f12_local5:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 80, _1080p * 110)
self:addElement( f12_local5 ) self:addElement(f12_local5)
self.MissionSelectButton = f12_local5 self.MissionSelectButton = f12_local5
end end
local CreditsButton = nil local CreditsButton = nil
CreditsButton = MenuBuilder.BuildRegisteredType( "MenuButton", { CreditsButton = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f12_local1 controllerIndex = f12_local1
} ) })
CreditsButton.id = "CreditsButton" CreditsButton.id = "CreditsButton"
CreditsButton.buttonDescription = Engine.Localize( "LUA_MENU_CREDITS_DESC" ) CreditsButton.buttonDescription = Engine.Localize("LUA_MENU_CREDITS_DESC")
CreditsButton.Text:setText( ToUpperCase( Engine.Localize( "MENU_SP_CREDITS_CAPS" ) ), 0 ) CreditsButton.Text:setText(ToUpperCase(Engine.Localize("MENU_SP_CREDITS_CAPS")), 0)
CreditsButton:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, _1080p * 120, _1080p * 150 ) CreditsButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 120, _1080p * 150)
self:addElement( CreditsButton ) self:addElement(CreditsButton)
self.CreditsButton = CreditsButton self.CreditsButton = CreditsButton
local ModsButton = nil local ModsButton = nil
ModsButton = MenuBuilder.BuildRegisteredType( "MenuButton", { ModsButton = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f12_local1 controllerIndex = f12_local1
} ) })
ModsButton.id = "ModsButton" ModsButton.id = "ModsButton"
ModsButton.buttonDescription = Engine.Localize( "LUA_MENU_MODS_DESC" ) ModsButton.buttonDescription = Engine.Localize("LUA_MENU_MODS_DESC")
ModsButton.Text:setText( ToUpperCase( Engine.Localize( "LUA_MENU_MODS_CAPS" ) ), 0 ) ModsButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_MODS_CAPS")), 0)
ModsButton:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, _1080p * 160, _1080p * 190 ) ModsButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 160, _1080p * 190)
self:addElement( ModsButton ) self:addElement(ModsButton)
self.ModsButton = ModsButton self.ModsButton = ModsButton
local ButtonDescription = nil local ButtonDescription = nil
ButtonDescription = MenuBuilder.BuildRegisteredType( "ButtonDescriptionText", { ButtonDescription = MenuBuilder.BuildRegisteredType("ButtonDescriptionText", {
controllerIndex = f12_local1 controllerIndex = f12_local1
} ) })
ButtonDescription.id = "ButtonDescription" ButtonDescription.id = "ButtonDescription"
ButtonDescription:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 504, _1080p * 200, _1080p * 300 ) ButtonDescription:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 504, _1080p * 200, _1080p * 300)
self:addElement( ButtonDescription ) self:addElement(ButtonDescription)
self.ButtonDescription = ButtonDescription self.ButtonDescription = ButtonDescription
f0_local4( self, f12_local1, controller ) f0_local4(self, f12_local1, controller)
return self return self
end end
MenuBuilder.m_types["CampaignMenuButtons"] = CampaignMenuButtons MenuBuilder.m_types["CampaignMenuButtons"] = CampaignMenuButtons

View File

@ -1,206 +1,208 @@
local buttonSpacing = 40 local buttonSpacing = 40
local f0_local1 = 10 local f0_local1 = 10
local f0_local2 = function ( f1_arg0, f1_arg1, f1_arg2 ) local f0_local2 = function(f1_arg0, f1_arg1, f1_arg2)
if 0 < f1_arg2 then if 0 < f1_arg2 then
local f1_local0, f1_local1, f1_local2, f1_local3 = f1_arg0:getLocalRect() local f1_local0, f1_local1, f1_local2, f1_local3 = f1_arg0:getLocalRect()
local f1_local4 = f1_local3 - f1_local1 local f1_local4 = f1_local3 - f1_local1
f1_arg0:SetTop( f1_local1 - (f1_local4 + f1_arg1) * f1_arg2 ) f1_arg0:SetTop(f1_local1 - (f1_local4 + f1_arg1) * f1_arg2)
f1_arg0:SetBottom( f1_local3 - (f1_local4 + f1_arg1) * f1_arg2 ) f1_arg0:SetBottom(f1_local3 - (f1_local4 + f1_arg1) * f1_arg2)
end end
end end
local f0_local3 = function ( f2_arg0, f2_arg1, f2_arg2 ) local f0_local3 = function(f2_arg0, f2_arg1, f2_arg2)
assert( f2_arg0.ConquestButton ) assert(f2_arg0.ConquestButton)
if CONDITIONS.IsStoreAllowed( f2_arg0 ) then if CONDITIONS.IsStoreAllowed(f2_arg0) then
assert( f2_arg0.StoreButton ) assert(f2_arg0.StoreButton)
end end
local f2_local0 = not CONDITIONS.IsTrialLicense( f2_arg0 ) local f2_local0 = not CONDITIONS.IsTrialLicense(f2_arg0)
if f2_local0 then if f2_local0 then
assert( f2_arg0.CustomGameButton ) assert(f2_arg0.CustomGameButton)
end end
f2_arg0.buttonSpacing = _1080p * buttonSpacing f2_arg0.buttonSpacing = _1080p * buttonSpacing
local f2_local1 = function () local f2_local1 = function()
return Lobby.IsInPrivateParty() and not Lobby.IsPrivatePartyHost() return Lobby.IsInPrivateParty() and not Lobby.IsPrivatePartyHost()
end end
local f2_local2 = function () local f2_local2 = function()
local f4_local0 = f2_local1() local f4_local0 = f2_local1()
f2_arg0.ConquestButton:SetButtonDisabled( f4_local0 ) f2_arg0.ConquestButton:SetButtonDisabled(f4_local0)
if f2_arg0.MLGGameBattlesButton ~= nil then if f2_arg0.MLGGameBattlesButton ~= nil then
f2_arg0.MLGGameBattlesButton:SetButtonDisabled( f4_local0 ) f2_arg0.MLGGameBattlesButton:SetButtonDisabled(f4_local0)
end end
if f2_local0 then if f2_local0 then
f2_arg0.CustomGameButton:SetButtonDisabled( f4_local0 ) f2_arg0.CustomGameButton:SetButtonDisabled(f4_local0)
end end
end end
local f2_local3 = LUI.DataSourceInGlobalModel.new( "frontEnd.lobby.areWeGameHost" ) local f2_local3 = LUI.DataSourceInGlobalModel.new("frontEnd.lobby.areWeGameHost")
local f2_local4 = DataSources.frontEnd.lobby.memberCount local f2_local4 = DataSources.frontEnd.lobby.memberCount
f2_arg0:SubscribeToModel( f2_local3:GetModel( f2_arg1 ), f2_local2 ) f2_arg0:SubscribeToModel(f2_local3:GetModel(f2_arg1), f2_local2)
f2_arg0:SubscribeToModel( f2_local4:GetModel( f2_arg1 ), f2_local2 ) f2_arg0:SubscribeToModel(f2_local4:GetModel(f2_arg1), f2_local2)
f2_arg0.ConquestButton:addEventHandler( "button_action", function ( f5_arg0, f5_arg1 ) f2_arg0.ConquestButton:addEventHandler("button_action", function(f5_arg0, f5_arg1)
Engine.SetDvarBool( "cg_mlg_gamebattles_match", false ) Engine.SetDvarBool("cg_mlg_gamebattles_match", false)
local f5_local0 = function () local f5_local0 = function()
LUI.FlowManager.RequestAddMenu( "Missions", false, f5_arg1.controller, false, {}, true ) LUI.FlowManager.RequestAddMenu("Missions", false, f5_arg1.controller, false, {}, true)
end end
if not Onboarding:BeginFlow( Onboarding.RigTutorial, f2_arg1 ) then if not Onboarding:BeginFlow(Onboarding.RigTutorial, f2_arg1) then
f5_local0() f5_local0()
else else
LUI.FlowManager.RequestPopupMenu( nil, "MPFullScreenVideoOverlay", true, f2_arg1, nil, { LUI.FlowManager.RequestPopupMenu(nil, "MPFullScreenVideoOverlay", true, f2_arg1, nil, {
videoRef = "mp_wolverines_mission_commander", videoRef = "mp_wolverines_mission_commander",
allowSkip = true, allowSkip = true,
doIntroFadeOut = false, doIntroFadeOut = false,
doIntroFadeIn = false, doIntroFadeIn = false,
doOutroFadeIn = true, doOutroFadeIn = true,
doOutroFadeOut = true, doOutroFadeOut = true,
fadeColor = COLORS.black fadeColor = COLORS.black
}, nil, true, true ) }, nil, true, true)
local f5_local1 = f2_arg0:Wait( 500 ) local f5_local1 = f2_arg0:Wait(500)
f5_local1.onComplete = f5_local0 f5_local1.onComplete = f5_local0
end end
end ) end)
if CONDITIONS.IsGameBattlesAllowed( f2_arg0 ) then if CONDITIONS.IsGameBattlesAllowed(f2_arg0) then
f2_arg0.MLGGameBattlesButton:addEventHandler( "button_action", function ( f7_arg0, f7_arg1 ) f2_arg0.MLGGameBattlesButton:addEventHandler("button_action", function(f7_arg0, f7_arg1)
if Engine.GetDvarBool( "splitscreen" ) then if Engine.GetDvarBool("splitscreen") then
LUI.FlowManager.RequestPopupMenu( f2_arg0, "MLGGamebattlesSplitscreenPopup", true, f7_arg1.controller, false, { LUI.FlowManager.RequestPopupMenu(f2_arg0, "MLGGamebattlesSplitscreenPopup", true, f7_arg1.controller,
controllerIndex = f2_arg1 false, {
} ) controllerIndex = f2_arg1
elseif Lobby.IsNotAloneInPrivateParty() then })
LUI.FlowManager.RequestPopupMenu( f2_arg0, "DisbandPartyEnterGameBattlesLobbyPopup", true, f7_arg1.controller, false, { elseif Lobby.IsNotAloneInPrivateParty() then
controllerIndex = f2_arg1 LUI.FlowManager.RequestPopupMenu(f2_arg0, "DisbandPartyEnterGameBattlesLobbyPopup", true,
} ) f7_arg1.controller, false, {
else controllerIndex = f2_arg1
OpenGameBattlesLobby( f7_arg1.controller ) })
end else
end ) OpenGameBattlesLobby(f7_arg1.controller)
end end
if f2_local0 then end)
f2_arg0.CustomGameButton:addEventHandler( "button_action", function ( f8_arg0, f8_arg1 ) end
OpenPrivateMatchLobby( f8_arg1 ) if f2_local0 then
end ) f2_arg0.CustomGameButton:addEventHandler("button_action", function(f8_arg0, f8_arg1)
end OpenPrivateMatchLobby(f8_arg1)
end)
end
f2_arg0.ModsButton:addEventHandler( "button_action", function ( arg0, arg1 ) f2_arg0.ModsButton:addEventHandler("button_action", function(arg0, arg1)
LUI.FlowManager.RequestAddMenu( "ModSelectMenu", true, arg1.controller, false ) LUI.FlowManager.RequestAddMenu("ModSelectMenu", true, arg1.controller, false)
end ) end)
if CONDITIONS.IsStoreAllowed( f2_arg0 ) then if CONDITIONS.IsStoreAllowed(f2_arg0) then
f2_arg0.StoreButton:addEventHandler( "button_action", function ( f9_arg0, f9_arg1 ) f2_arg0.StoreButton:addEventHandler("button_action", function(f9_arg0, f9_arg1)
local f9_local0 = STORE.GoToStore local f9_local0 = STORE.GoToStore
local f9_local1 = f9_arg1.controller local f9_local1 = f9_arg1.controller
local f9_local2 = f9_arg0:GetCurrentMenu() local f9_local2 = f9_arg0:GetCurrentMenu()
f9_local0( f9_local1, f9_local2.id, f9_arg0.id ) f9_local0(f9_local1, f9_local2.id, f9_arg0.id)
end ) end)
end end
local f2_local5 = _1080p * f0_local1 local f2_local5 = _1080p * f0_local1
local f2_local6 = 0 local f2_local6 = 0
if f2_arg0.MLGGameBattlesButton == nil then if f2_arg0.MLGGameBattlesButton == nil then
f2_local6 = 1 f2_local6 = 1
end end
if f2_arg0.CustomGameButton then if f2_arg0.CustomGameButton then
f0_local2( f2_arg0.CustomGameButton, f2_local5, f2_local6 ) f0_local2(f2_arg0.CustomGameButton, f2_local5, f2_local6)
else
f2_local6 = f2_local6 + 1
end
if f2_arg0.ModsButton then
f0_local2( f2_arg0.ModsButton, f2_local5, f2_local6 )
else else
f2_local6 = f2_local6 + 1 f2_local6 = f2_local6 + 1
end end
if CONDITIONS.IsStoreAllowed( f2_arg0 ) then if f2_arg0.ModsButton then
f0_local2( f2_arg0.StoreButton, f2_local5, f2_local6 ) f0_local2(f2_arg0.ModsButton, f2_local5, f2_local6)
else else
f2_local6 = f2_local6 + 1 f2_local6 = f2_local6 + 1
end end
if f2_arg0.StoreButton then if CONDITIONS.IsStoreAllowed(f2_arg0) then
f2_arg0.StoreButton:SetButtonDescription( STORE.GetStoreDescription() ) f0_local2(f2_arg0.StoreButton, f2_local5, f2_local6)
if CONDITIONS.IsTrialLicense() then else
f2_arg0.StoreButton.Text:setText( ToUpperCase( Engine.Localize( "LUA_MENU_BUY_NOW" ) ) ) f2_local6 = f2_local6 + 1
end end
end if f2_arg0.StoreButton then
f2_arg0.StoreButton:SetButtonDescription(STORE.GetStoreDescription())
if CONDITIONS.IsTrialLicense() then
f2_arg0.StoreButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_BUY_NOW")))
end
end
end end
function MPMainMenuButtons( menu, controller ) function MPMainMenuButtons(menu, controller)
local self = LUI.UIVerticalNavigator.new() local self = LUI.UIVerticalNavigator.new()
self:SetAnchorsAndPosition( 0, 1, 0, 1, 0, 500 * _1080p, 0, 190 * _1080p ) self:SetAnchorsAndPosition(0, 1, 0, 1, 0, 500 * _1080p, 0, 190 * _1080p)
self.id = "MPMainMenuButtons" self.id = "MPMainMenuButtons"
local f11_local1 = controller and controller.controllerIndex local f11_local1 = controller and controller.controllerIndex
if not f11_local1 and not Engine.InFrontend() then if not f11_local1 and not Engine.InFrontend() then
f11_local1 = self:getRootController() f11_local1 = self:getRootController()
end end
assert( f11_local1 ) assert(f11_local1)
local ConquestButton = nil local ConquestButton = nil
ConquestButton = MenuBuilder.BuildRegisteredType( "MenuButton", { ConquestButton = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f11_local1
} )
ConquestButton.id = "ConquestButton"
ConquestButton.buttonDescription = Engine.Localize( "LUA_MENU_PUBLIC_MATCH_DESC" )
ConquestButton.Text:setText( Engine.Localize( "LUA_MENU_PUBLIC_MATCH_CAPS" ), 0 )
ConquestButton:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, 0, _1080p * 30 )
self:addElement( ConquestButton )
self.ConquestButton = ConquestButton
local MLGGameBattlesButton = nil
if CONDITIONS.IsGameBattlesAllowed( self ) then
MLGGameBattlesButton = MenuBuilder.BuildRegisteredType( "MenuButton", {
controllerIndex = f11_local1
} )
MLGGameBattlesButton.id = "MLGGameBattlesButton"
if CONDITIONS.IsGameBattlesAllowed( self ) then
else
end
if CONDITIONS.IsGameBattlesAllowed( self ) then
MLGGameBattlesButton.buttonDescription = Engine.Localize( "LUA_MENU_MLG_GAMEBATTLES_DESC" )
end
MLGGameBattlesButton.Text:setText( Engine.Localize( "LUA_MENU_MLG_GAMEBATTLES_CAPS" ), 0 )
MLGGameBattlesButton:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, _1080p * 40, _1080p * 70 )
self:addElement( MLGGameBattlesButton )
self.MLGGameBattlesButton = MLGGameBattlesButton
end
local CustomGameButton = nil
CustomGameButton = MenuBuilder.BuildRegisteredType( "MenuButton", {
controllerIndex = f11_local1 controllerIndex = f11_local1
} ) })
ConquestButton.id = "ConquestButton"
ConquestButton.buttonDescription = Engine.Localize("LUA_MENU_PUBLIC_MATCH_DESC")
ConquestButton.Text:setText(Engine.Localize("LUA_MENU_PUBLIC_MATCH_CAPS"), 0)
ConquestButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, 0, _1080p * 30)
self:addElement(ConquestButton)
self.ConquestButton = ConquestButton
local MLGGameBattlesButton = nil
if CONDITIONS.IsGameBattlesAllowed(self) then
MLGGameBattlesButton = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f11_local1
})
MLGGameBattlesButton.id = "MLGGameBattlesButton"
if CONDITIONS.IsGameBattlesAllowed(self) then
else
end
if CONDITIONS.IsGameBattlesAllowed(self) then
MLGGameBattlesButton.buttonDescription = Engine.Localize("LUA_MENU_MLG_GAMEBATTLES_DESC")
end
MLGGameBattlesButton.Text:setText(Engine.Localize("LUA_MENU_MLG_GAMEBATTLES_CAPS"), 0)
MLGGameBattlesButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 40, _1080p * 70)
self:addElement(MLGGameBattlesButton)
self.MLGGameBattlesButton = MLGGameBattlesButton
end
local CustomGameButton = nil
CustomGameButton = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f11_local1
})
CustomGameButton.id = "CustomGameButton" CustomGameButton.id = "CustomGameButton"
CustomGameButton.buttonDescription = Engine.Localize( "LUA_MENU_CUSTOM_GAME_DESC" ) CustomGameButton.buttonDescription = Engine.Localize("LUA_MENU_CUSTOM_GAME_DESC")
CustomGameButton.Text:setText( Engine.Localize( "LUA_MENU_CUSTOM_GAME_CAPS" ), 0 ) CustomGameButton.Text:setText(Engine.Localize("LUA_MENU_CUSTOM_GAME_CAPS"), 0)
CustomGameButton:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, _1080p * 80, _1080p * 110 ) CustomGameButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 80, _1080p * 110)
self:addElement( CustomGameButton ) self:addElement(CustomGameButton)
self.CustomGameButton = CustomGameButton self.CustomGameButton = CustomGameButton
local ModsButton = nil local ModsButton = nil
ModsButton = MenuBuilder.BuildRegisteredType( "MenuButton", { ModsButton = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f11_local1 controllerIndex = f11_local1
} ) })
ModsButton.id = "ModsButton" ModsButton.id = "ModsButton"
ModsButton.buttonDescription = Engine.Localize( "LUA_MENU_MODS_DESC" ) ModsButton.buttonDescription = Engine.Localize("LUA_MENU_MODS_DESC")
ModsButton.Text:setText( ToUpperCase( Engine.Localize( "LUA_MENU_MODS_CAPS" ) ), 0 ) ModsButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_MODS_CAPS")), 0)
ModsButton:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, _1080p * 120, _1080p * 150 ) ModsButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 120, _1080p * 150)
self:addElement( ModsButton ) self:addElement(ModsButton)
self.ModsButton = ModsButton self.ModsButton = ModsButton
local f11_local6 = nil local f11_local6 = nil
if CONDITIONS.IsStoreAllowed( self ) then if CONDITIONS.IsStoreAllowed(self) then
f11_local6 = MenuBuilder.BuildRegisteredType( "MenuButton", { f11_local6 = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = f11_local1 controllerIndex = f11_local1
} ) })
f11_local6.id = "StoreButton" f11_local6.id = "StoreButton"
f11_local6.buttonDescription = Engine.Localize( "LUA_MENU_STORE_DESC" ) f11_local6.buttonDescription = Engine.Localize("LUA_MENU_STORE_DESC")
f11_local6.Text:setText( Engine.Localize( "LUA_MENU_STORE_CAPS" ), 0 ) f11_local6.Text:setText(Engine.Localize("LUA_MENU_STORE_CAPS"), 0)
f11_local6:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, _1080p * 160, _1080p * 190 ) f11_local6:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 160, _1080p * 190)
self:addElement( f11_local6 ) self:addElement(f11_local6)
self.StoreButton = f11_local6 self.StoreButton = f11_local6
end end
f0_local3( self, f11_local1, controller ) f0_local3(self, f11_local1, controller)
return self return self
end end
MenuBuilder.m_types["MPMainMenuButtons"] = MPMainMenuButtons MenuBuilder.m_types["MPMainMenuButtons"] = MPMainMenuButtons

View File

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

View File

@ -1,15 +1,15 @@
function ModDownloadCancel( arg0, arg1 ) function ModDownloadCancel(arg0, arg1)
download.abort() download.abort()
LUI.FlowManager.RequestLeaveMenu( arg0 ) LUI.FlowManager.RequestLeaveMenu(arg0)
end end
function ModDownloadPopup( arg0, arg1 ) function ModDownloadPopup(arg0, arg1)
local popup = MenuBuilder.BuildRegisteredType( "FenceDialogPopup", { local popup = MenuBuilder.BuildRegisteredType("FenceDialogPopup", {
message = "Downloading files...", message = "Downloading files...",
controllerIndex = arg1.controllerIndex, controllerIndex = arg1.controllerIndex,
onCancel = ModDownloadCancel onCancel = ModDownloadCancel
} ) })
popup.id = "ModDownloadPopup" popup.id = "ModDownloadPopup"
local file = "" local file = ""
@ -26,14 +26,14 @@ function ModDownloadPopup( arg0, arg1 )
LUI.FlowManager.RequestLeaveMenu(popup) LUI.FlowManager.RequestLeaveMenu(popup)
end) end)
return popup return popup
end end
MenuBuilder.registerType( "ModDownloadPopup", ModDownloadPopup ) MenuBuilder.registerType("ModDownloadPopup", ModDownloadPopup)
local function reg_func() local function reg_func()
Engine.GetLuiRoot():registerEventHandler("mod_download_start", function(element, event) Engine.GetLuiRoot():registerEventHandler("mod_download_start", function(element, event)
LUI.FlowManager.RequestPopupMenu( element, "ModDownloadPopup", true, event.controller, false ) LUI.FlowManager.RequestPopupMenu(element, "ModDownloadPopup", true, event.controller, false)
end) end)
end end

View File

@ -1,223 +1,193 @@
local function PostLoadFunc( f1_arg0, f1_arg1, f1_arg2 ) local function PostLoadFunc(buttonElement, controllerIndex, controller)
assert( f1_arg0.GenericButton ) assert(buttonElement.GenericButton)
f1_arg0.GenericButton:addEventHandler( "button_action", function ( f3_arg0, f3_arg1 ) buttonElement.GenericButton:addEventHandler("button_action", function(clickedElement, eventArgs)
local f3_local0 = f1_arg0:GetDataSource() local dataSource = buttonElement:GetDataSource()
f3_local0.buttonOnClickFunction( f3_arg0, f3_arg1 ) dataSource.buttonOnClickFunction(clickedElement, eventArgs)
end ) end)
f1_arg0.GenericButton:addEventHandler( "button_over", function ( f4_arg0, f4_arg1 )
local f4_local0 = f1_arg0:GetDataSource() buttonElement.GenericButton:addEventHandler("button_over", function(hoveredElement, eventArgs)
f4_local0.buttonOnHoverFunction( f4_arg0, f4_arg1 ) local dataSource = buttonElement:GetDataSource()
f4_local0 = f1_arg0:GetDataSource() dataSource.buttonOnHoverFunction(hoveredElement, eventArgs)
f4_local0 = f4_local0.levelName dataSource = buttonElement:GetDataSource()
end ) dataSource = dataSource.levelName
f1_arg0.GenericButton:addEventHandler( "button_up", function ( f5_arg0, f5_arg1 ) end)
local f5_local0 = f1_arg0:GetDataSource()
f5_local0.buttonOnHoverFunction( f5_arg0, f5_arg1 ) buttonElement.GenericButton:addEventHandler("button_up", function(unhoveredElement, eventArgs)
f5_local0 = f1_arg0:GetDataSource() local dataSource = buttonElement:GetDataSource()
f5_local0 = f5_local0.levelName dataSource.buttonOnHoverFunction(unhoveredElement, eventArgs)
end ) dataSource = buttonElement:GetDataSource()
f1_arg0:registerEventHandler( "grid_anim", function ( element, event ) dataSource = dataSource.levelName
element:SetAlpha( event.value ) end)
end )
assert( f1_arg0.MainMissionIcon ) buttonElement:registerEventHandler("grid_anim", function(element, event)
assert( f1_arg0.SAIcon ) element:SetAlpha(event.value)
assert( f1_arg0.JAIcon ) end)
f1_arg0:SubscribeToDataSourceThroughElement( f1_arg0, nil, function ()
local f7_local0 = f1_arg0:GetDataSource() buttonElement:SubscribeToDataSourceThroughElement(buttonElement, nil, function()
f7_local0 = f7_local0.levelName local dataSource = buttonElement:GetDataSource()
end ) dataSource = dataSource.levelName
end)
end end
function ModSelectButton( menu, controller ) function ModSelectButton(menu, controller)
local self = LUI.UIButton.new() local modSelectButton = LUI.UIButton.new()
self:SetAnchorsAndPosition( 0, 1, 0, 1, 0, 500 * _1080p, 0, 30 * _1080p ) modSelectButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, 500 * _1080p, 0, 30 * _1080p)
self.id = "ModSelectButton" modSelectButton.id = "ModSelectButton"
self._animationSets = {} modSelectButton._animationSets = {}
self._sequences = {} modSelectButton._sequences = {}
local f8_local1 = controller and controller.controllerIndex
if not f8_local1 and not Engine.InFrontend() then
f8_local1 = self:getRootController()
end
assert( f8_local1 )
local f8_local2 = self
local GenericButton = nil
GenericButton = MenuBuilder.BuildRegisteredType( "GenericButton", { local controllerIndex = controller and controller.controllerIndex
controllerIndex = f8_local1 if not controllerIndex and not Engine.InFrontend() then
} ) controllerIndex = modSelectButton:getRootController()
GenericButton.id = "GenericButton" end
GenericButton:SetAlpha( 0, 0 ) assert(controllerIndex)
GenericButton:SetAnchorsAndPosition( 0, 1, 0, 0, 0, _1080p * 500, 0, 0 )
GenericButton:SubscribeToModelThroughElement( self, "buttonLabel", function ()
local f9_local0 = self:GetDataSource()
f9_local0 = f9_local0.buttonLabel:GetValue( f8_local1 )
if f9_local0 ~= nil then
GenericButton.Text:setText( LocalizeString( ToUpperCase( f9_local0 ) ), 0 )
end
end )
self:addElement( GenericButton )
self.GenericButton = GenericButton
local GenericListButtonBackground = nil local buttonContainer = modSelectButton
local genericButton = nil
GenericListButtonBackground = MenuBuilder.BuildRegisteredType( "GenericListArrowButtonBackground", { genericButton = MenuBuilder.BuildRegisteredType("GenericButton", {
controllerIndex = f8_local1 controllerIndex = controllerIndex
} ) })
GenericListButtonBackground.id = "GenericListButtonBackground" genericButton.id = "GenericButton"
GenericListButtonBackground:SetAnchorsAndPosition( 0, 0, 0, 0, 0, 0, 0, 0 ) genericButton:SetAlpha(0, 0)
self:addElement( GenericListButtonBackground ) genericButton:SetAnchorsAndPosition(0, 1, 0, 0, 0, _1080p * 500, 0, 0)
self.GenericListButtonBackground = GenericListButtonBackground
local Text = nil genericButton:SubscribeToModelThroughElement(modSelectButton, "buttonLabel", function()
local dataSource = modSelectButton:GetDataSource()
local buttonLabel = dataSource.buttonLabel:GetValue(controllerIndex)
if buttonLabel ~= nil then
genericButton.Text:setText(LocalizeString(ToUpperCase(buttonLabel)), 0)
end
end)
Text = LUI.UIStyledText.new() modSelectButton:addElement(genericButton)
Text.id = "Text" modSelectButton.GenericButton = genericButton
Text:SetRGBFromInt( 14277081, 0 )
Text:SetFontSize( 22 * _1080p )
Text:SetFont( FONTS.GetFont( FONTS.MainMedium.File ) )
Text:SetAlignment( LUI.Alignment.Left )
Text:SetStartupDelay( 2000 )
Text:SetLineHoldTime( 400 )
Text:SetAnimMoveTime( 300 )
Text:SetEndDelay( 1500 )
Text:SetCrossfadeTime( 750 )
Text:SetAutoScrollStyle( LUI.UIStyledText.AutoScrollStyle.ScrollH )
Text:SetMaxVisibleLines( 1 )
Text:SetOutlineRGBFromInt( 0, 0 )
Text:SetAnchorsAndPosition( 0, 0, 0.5, 0.5, _1080p * 44, _1080p * -41, _1080p * -11, _1080p * 11 )
Text:SubscribeToModelThroughElement( self, "buttonLabel", function ()
local f10_local0 = self:GetDataSource()
f10_local0 = f10_local0.buttonLabel:GetValue( f8_local1 )
if f10_local0 ~= nil then
Text:setText( LocalizeString( ToUpperCase( f10_local0 ) ), 0 )
end
end )
self:addElement( Text )
self.Text = Text
local Lock = nil local listButtonBackground = nil
Lock = LUI.UIImage.new() listButtonBackground = MenuBuilder.BuildRegisteredType("GenericListArrowButtonBackground", {
Lock.id = "Lock" controllerIndex = controllerIndex
Lock:SetRGBFromTable( SWATCHES.genericButton.textDisabled, 0 ) })
Lock:SetAlpha( 0, 0 ) listButtonBackground.id = "GenericListButtonBackground"
Lock:setImage( RegisterMaterial( "icon_slot_locked" ), 0 ) listButtonBackground:SetAnchorsAndPosition(0, 0, 0, 0, 0, 0, 0, 0)
Lock:SetAnchorsAndPosition( 1, 0, 0.5, 0.5, _1080p * -32, _1080p * -6, _1080p * -12, _1080p * 14 )
self:addElement( Lock )
self.Lock = Lock
self._animationSets.DefaultAnimationSet = function () modSelectButton:addElement(listButtonBackground)
self._sequences.DefaultSequence = function () modSelectButton.GenericListButtonBackground = listButtonBackground
end local buttonText = nil
Text:RegisterAnimationSequence( "ButtonOver", { buttonText = LUI.UIStyledText.new()
{ buttonText.id = "Text"
function () buttonText:SetRGBFromInt(14277081, 0)
return self.Text:SetRGBFromInt( 0, 0 ) buttonText:SetFontSize(22 * _1080p)
end buttonText:SetFont(FONTS.GetFont(FONTS.MainMedium.File))
}, buttonText:SetAlignment(LUI.Alignment.Left)
{ buttonText:SetStartupDelay(2000)
function () buttonText:SetLineHoldTime(400)
return self.Text:SetAlpha( 1, 0 ) buttonText:SetAnimMoveTime(300)
end buttonText:SetEndDelay(1500)
} buttonText:SetCrossfadeTime(750)
} ) buttonText:SetAutoScrollStyle(LUI.UIStyledText.AutoScrollStyle.ScrollH)
Lock:RegisterAnimationSequence( "ButtonOver", { buttonText:SetMaxVisibleLines(1)
{ buttonText:SetOutlineRGBFromInt(0, 0)
function () buttonText:SetAnchorsAndPosition(0, 0, 0.5, 0.5, _1080p * 44, _1080p * -41, _1080p * -11, _1080p * 11)
return self.Lock:SetAlpha( 0, 0 )
end
},
{
function ()
return self.Lock:SetRGBFromTable( SWATCHES.genericButton.textDisabled, 0 )
end
}
} )
self._sequences.ButtonOver = function ()
Text:AnimateSequence( "ButtonOver" )
Lock:AnimateSequence( "ButtonOver" )
end
Text:RegisterAnimationSequence( "ButtonUp", { buttonText:SubscribeToModelThroughElement(modSelectButton, "buttonLabel", function()
{ local dataSource = modSelectButton:GetDataSource()
function () local buttonLabel = dataSource.buttonLabel:GetValue(controllerIndex)
return self.Text:SetRGBFromInt( 14277081, 0 ) if buttonLabel ~= nil then
end buttonText:setText(LocalizeString(ToUpperCase(buttonLabel)), 0)
} end
} ) end)
Lock:RegisterAnimationSequence( "ButtonUp", {
{
function ()
return self.Lock:SetAlpha( 0, 0 )
end
}
} )
self._sequences.ButtonUp = function ()
Text:AnimateSequence( "ButtonUp" )
Lock:AnimateSequence( "ButtonUp" )
end
Text:RegisterAnimationSequence( "ButtonOverDisabled", { modSelectButton:addElement(buttonText)
{ modSelectButton.Text = buttonText
function ()
return self.Text:SetRGBFromInt( 0, 0 )
end
},
{
function ()
return self.Text:SetAlpha( 1, 0 )
end
}
} )
Lock:RegisterAnimationSequence( "ButtonOverDisabled", {
{
function ()
return self.Lock:SetAlpha( 1, 0 )
end
},
{
function ()
return self.Lock:SetRGBFromInt( 0, 0 )
end
}
} )
self._sequences.ButtonOverDisabled = function ()
Text:AnimateSequence( "ButtonOverDisabled" )
Lock:AnimateSequence( "ButtonOverDisabled" )
end
Text:RegisterAnimationSequence( "ButtonUpDisabled", { local lockIcon = nil
{
function ()
return self.Text:SetRGBFromInt( 14277081, 0 )
end
}
} )
Lock:RegisterAnimationSequence( "ButtonUpDisabled", {
{
function ()
return self.Lock:SetAlpha( 1, 0 )
end
},
{
function ()
return self.Lock:SetRGBFromInt( 12566463, 0 )
end
}
} )
self._sequences.ButtonUpDisabled = function ()
Text:AnimateSequence( "ButtonUpDisabled" )
Lock:AnimateSequence( "ButtonUpDisabled" )
end
end lockIcon = LUI.UIImage.new()
lockIcon.id = "Lock"
lockIcon:SetRGBFromTable(SWATCHES.genericButton.textDisabled, 0)
lockIcon:SetAlpha(0, 0)
lockIcon:setImage(RegisterMaterial("icon_slot_locked"), 0)
lockIcon:SetAnchorsAndPosition(1, 0, 0.5, 0.5, _1080p * -32, _1080p * -6, _1080p * -12, _1080p * 14)
self._animationSets.DefaultAnimationSet() modSelectButton:addElement(lockIcon)
PostLoadFunc( self, f8_local1, controller ) modSelectButton.Lock = lockIcon
return self
modSelectButton._animationSets.DefaultAnimationSet = function()
modSelectButton._sequences.DefaultSequence = function()
end
buttonText:RegisterAnimationSequence("ButtonOver", {{function()
return modSelectButton.Text:SetRGBFromInt(0, 0)
end}, {function()
return modSelectButton.Text:SetAlpha(1, 0)
end}})
lockIcon:RegisterAnimationSequence("ButtonOver", {{function()
return modSelectButton.Lock:SetAlpha(0, 0)
end}, {function()
return modSelectButton.Lock:SetRGBFromTable(SWATCHES.genericButton.textDisabled, 0)
end}})
modSelectButton._sequences.ButtonOver = function()
buttonText:AnimateSequence("ButtonOver")
lockIcon:AnimateSequence("ButtonOver")
end
buttonText:RegisterAnimationSequence("ButtonUp", {{function()
return modSelectButton.Text:SetRGBFromInt(14277081, 0)
end}})
lockIcon:RegisterAnimationSequence("ButtonUp", {{function()
return modSelectButton.Lock:SetAlpha(0, 0)
end}})
modSelectButton._sequences.ButtonUp = function()
buttonText:AnimateSequence("ButtonUp")
lockIcon:AnimateSequence("ButtonUp")
end
buttonText:RegisterAnimationSequence("ButtonOverDisabled", {{function()
return modSelectButton.Text:SetRGBFromInt(0, 0)
end}, {function()
return modSelectButton.Text:SetAlpha(1, 0)
end}})
lockIcon:RegisterAnimationSequence("ButtonOverDisabled", {{function()
return modSelectButton.Lock:SetAlpha(1, 0)
end}, {function()
return modSelectButton.Lock:SetRGBFromInt(0, 0)
end}})
modSelectButton._sequences.ButtonOverDisabled = function()
buttonText:AnimateSequence("ButtonOverDisabled")
lockIcon:AnimateSequence("ButtonOverDisabled")
end
buttonText:RegisterAnimationSequence("ButtonUpDisabled", {{function()
return modSelectButton.Text:SetRGBFromInt(14277081, 0)
end}})
lockIcon:RegisterAnimationSequence("ButtonUpDisabled", {{function()
return modSelectButton.Lock:SetAlpha(1, 0)
end}, {function()
return modSelectButton.Lock:SetRGBFromInt(12566463, 0)
end}})
modSelectButton._sequences.ButtonUpDisabled = function()
buttonText:AnimateSequence("ButtonUpDisabled")
lockIcon:AnimateSequence("ButtonUpDisabled")
end
end
modSelectButton._animationSets.DefaultAnimationSet()
PostLoadFunc(modSelectButton, controllerIndex, controller)
return modSelectButton
end end
MenuBuilder.registerType( "ModSelectButton", ModSelectButton ) MenuBuilder.registerType("ModSelectButton", ModSelectButton)

View File

@ -1,317 +1,316 @@
local f0_local0 = "frontEnd.ModSelect" local modSelectPath = "frontEnd.ModSelect"
f0_local1 = function ()
WipeGlobalModelsAtPath( f0_local0 ) modSelectPathCleanup = function()
WipeGlobalModelsAtPath(modSelectPath)
end end
local function getmodname(path) local function getModName(path)
local name = path local modName = path
local desc = Engine.Localize("LUA_MENU_MOD_DESC_DEFAULT", name) local modDesc = Engine.Localize("LUA_MENU_MOD_DESC_DEFAULT", modName)
return name, desc return modName, modDesc
end end
local function set_mod( modname ) local function setMod(modName)
Engine.SetDvarString( "fs_game", modname ) Engine.SetDvarString("fs_game", modName)
Engine.Exec( "vid_restart" ) Engine.Exec("vid_restart")
end end
local unload_mod = function( arg0, arg1 ) local unloadMod = function(buttonElement, controllerIndex)
set_mod( "" ) setMod("")
end end
local f0_local4 = function ( f4_arg0, f4_arg1 ) local leaveMenu = function(menuElement, controllerIndex)
LUI.FlowManager.RequestLeaveMenu( f4_arg0 ) LUI.FlowManager.RequestLeaveMenu(menuElement)
end end
local f0_local8 = function ( f8_arg0, f8_arg1 ) local updateModInfo = function(menuElement, controllerIndex)
local f8_local0 = LUI.FlowManager.GetScopedData( f8_arg0 ) local scopedData = LUI.FlowManager.GetScopedData(menuElement)
if not f8_local0.currentLabel then if not scopedData.currentLabel then
f8_local0.currentLabel = "" scopedData.currentLabel = ""
end end
if not f8_local0.currentDesc then if not scopedData.currentDesc then
f8_local0.currentDesc = "" scopedData.currentDesc = ""
end end
f8_arg0:processEvent( { menuElement:processEvent({
name = "menu_refresh" name = "menu_refresh"
} ) })
local f8_local2 = f8_arg0:GetCurrentMenu() local currentMenu = menuElement:GetCurrentMenu()
assert( f8_local2.ModInfoTitle ) assert(currentMenu.ModInfoTitle)
f8_local2.ModInfoTitle:setText( f8_local0.currentLabel ) currentMenu.ModInfoTitle:setText(scopedData.currentLabel)
assert( f8_local2.ModInfoText ) assert(currentMenu.ModInfoText)
f8_local2.ModInfoText:setText( f8_local0.currentDesc ) currentMenu.ModInfoText:setText(scopedData.currentDesc)
end end
local f0_local9 = function ( f9_arg0, f9_arg1, f9_arg2 ) local applyMod = function(buttonElement, controllerIndex, modName)
set_mod( f9_arg2 ) setMod(modName)
end end
local f0_local10 = function ( f11_arg0, f11_arg1, f11_arg2 ) local updateModSelection = function(menuElement, controllerIndex, modData)
local f11_local0 = LUI.FlowManager.GetScopedData( f11_arg0 ) local scopedData = LUI.FlowManager.GetScopedData(menuElement)
f11_local0.currentLabel = f11_arg2.buttonLabel scopedData.currentLabel = modData.buttonLabel
f11_local0.currentName = f11_arg2.modName scopedData.currentName = modData.modName
f11_local0.currentDesc = f11_arg2.objectiveText scopedData.currentDesc = modData.objectiveText
f0_local8( f11_arg0, f11_arg1 ) updateModInfo(menuElement, controllerIndex)
Engine.PlaySound( CoD.SFX.SPMinimap ) Engine.PlaySound(CoD.SFX.SPMinimap)
end end
local f0_local12 = function ( f13_arg0, f13_arg1 ) local populateModList = function(menuElement, controllerIndex)
local f13_local0 = {} local modList = {}
local mods = io.listfiles("mods/") local mods = io.listfiles("mods/")
for i = 1, #mods do for i = 1, #mods do
local name, desc = getmodname(mods[i]) local name, desc = getModName(mods[i])
f13_local0[#f13_local0 + 1] = { modList[#modList + 1] = {
buttonLabel = ToUpperCase(name), buttonLabel = ToUpperCase(name),
modName = name, modName = name,
objectiveText = desc, objectiveText = desc
} }
end end
local f13_local1 = LUI.DataSourceFromList.new( #f13_local0 ) local dataSource = LUI.DataSourceFromList.new(#modList)
f13_local1.MakeDataSourceAtIndex = function ( f14_arg0, f14_arg1, f14_arg2 ) dataSource.MakeDataSourceAtIndex = function(dataSource, index, controllerIndex)
return { return {
buttonLabel = LUI.DataSourceInGlobalModel.new( f0_local0 .. ".mods." .. f14_arg1, f13_local0[f14_arg1 + 1].buttonLabel ), buttonLabel = LUI.DataSourceInGlobalModel.new(modSelectPath .. ".mods." .. index,
buttonOnClickFunction = function ( f15_arg0, f15_arg1 ) modList[index + 1].buttonLabel),
f0_local9( f15_arg0, f15_arg1, f13_local0[f14_arg1 + 1].modName ) buttonOnClickFunction = function(buttonElement, controllerIndex)
end applyMod(buttonElement, controllerIndex, modList[index + 1].modName)
, end,
buttonOnHoverFunction = function ( f16_arg0, f16_arg1 ) buttonOnHoverFunction = function(buttonElement, controllerIndex)
f0_local10( f16_arg0, f16_arg1, f13_local0[f14_arg1 + 1] ) updateModSelection(buttonElement, controllerIndex, modList[index + 1])
end end,
, modName = modList[index + 1].modName
modName = f13_local0[f14_arg1 + 1].modName }
} end
end
assert( f13_arg0.ModSelectionList ) assert(menuElement.ModSelectionList)
f13_arg0.ModSelectionList:SetGridDataSource( f13_local1, f13_arg1 ) menuElement.ModSelectionList:SetGridDataSource(dataSource, controllerIndex)
end end
local function PostLoadFunc( f17_arg0, f17_arg1, f17_arg2 ) local function postLoadFunction(menuElement, controllerIndex, controller)
assert( f17_arg0.bindButton ) assert(menuElement.bindButton)
f17_arg0.bindButton:addEventHandler( "button_secondary", f0_local4 ) menuElement.bindButton:addEventHandler("button_secondary", leaveMenu)
local fs_game = Engine.GetDvarString( "fs_game" ) local fsGame = Engine.GetDvarString("fs_game")
if fs_game ~= "" then if fsGame ~= "" then
f17_arg0.LoadedModName:setText( "^3Loaded mod^7: " .. fs_game ) menuElement.LoadedModName:setText("^3Loaded mod^7: " .. fsGame)
f17_arg0.bindButton:addEventHandler( "button_alt2", unload_mod ) menuElement.bindButton:addEventHandler("button_alt2", unloadMod)
else else
f17_arg0.LoadedModName:setText( "" ) menuElement.LoadedModName:setText("")
end end
--f17_arg0:addEventHandler( "menu_create", f0_local3 ) -- menuElement:addEventHandler("menu_create", f0_local3)
f0_local12( f17_arg0, f17_arg1 ) populateModList(menuElement, controllerIndex)
f17_arg0:addEventHandler( "gain_focus", function ( f18_arg0, f18_arg1 ) menuElement:addEventHandler("gain_focus", function(focusElement, controllerIndex)
local f18_local0 = f18_arg0.ModSelectionList local modSelectionList = focusElement.ModSelectionList
local f18_local1 = f18_local0:GetContentOffset( LUI.DIRECTION.vertical ) local contentOffset = modSelectionList:GetContentOffset(LUI.DIRECTION.vertical)
f18_local0:SetFocusedPosition( { modSelectionList:SetFocusedPosition({
x = 0, x = 0,
y = f18_local1 y = contentOffset
}, true ) }, true)
local f18_local2 = f18_local0:GetElementAtPosition( 0, f18_local1 ) local focusedElement = modSelectionList:GetElementAtPosition(0, contentOffset)
if f18_local2 then if focusedElement then
f18_local2:processEvent( { focusedElement:processEvent({
name = "gain_focus", name = "gain_focus",
controllerIndex = f17_arg1 controllerIndex = controllerIndex
} ) })
end end
end ) end)
end end
function ModSelectMenu( menu, controller ) function ModSelectMenu(menu, controller)
local self = LUI.UIElement.new() local menuElement = LUI.UIElement.new()
self.id = "ModSelectMenu" menuElement.id = "ModSelectMenu"
local f20_local1 = controller and controller.controllerIndex local controllerIndex = controller and controller.controllerIndex
if not f20_local1 and not Engine.InFrontend() then if not controllerIndex and not Engine.InFrontend() then
f20_local1 = self:getRootController() controllerIndex = menuElement:getRootController()
end end
assert( f20_local1 ) assert(controllerIndex)
self:playSound( "menu_open" ) menuElement:playSound("menu_open")
if Engine.IsSingleplayer() then if Engine.IsSingleplayer() then
local Background = nil local backgroundImage = nil
Background = LUI.UIImage.new() backgroundImage = LUI.UIImage.new()
Background.id = "Background" backgroundImage.id = "Background"
Background:setImage( RegisterMaterial( "sp_frontend_bink_background" ), 0 ) backgroundImage:setImage(RegisterMaterial("sp_frontend_bink_background"), 0)
self:addElement( Background ) menuElement:addElement(backgroundImage)
self.Background = Background menuElement.Background = backgroundImage
local Bink = nil local binkImage = nil
Bink = LUI.UIImage.new() binkImage = LUI.UIImage.new()
Bink.id = "Bink" binkImage.id = "Bink"
Bink:setImage( RegisterMaterial( "cinematic" ), 0 ) binkImage:setImage(RegisterMaterial("cinematic"), 0)
self:addElement( Bink ) menuElement:addElement(binkImage)
self.Bink = Bink menuElement.Bink = binkImage
end end
local ButtonHelperBar = nil local buttonHelperBar = nil
ButtonHelperBar = MenuBuilder.BuildRegisteredType( "ButtonHelperBar", { buttonHelperBar = MenuBuilder.BuildRegisteredType("ButtonHelperBar", {
controllerIndex = f61_local1 controllerIndex = controllerIndex
} ) })
ButtonHelperBar.id = "ButtonHelperBar" buttonHelperBar.id = "ButtonHelperBar"
ButtonHelperBar:SetAnchorsAndPosition( 0, 0, 1, 0, 0, 0, _1080p * -85, 0 ) buttonHelperBar:SetAnchorsAndPosition(0, 0, 1, 0, 0, 0, _1080p * -85, 0)
self:addElement( ButtonHelperBar ) menuElement:addElement(buttonHelperBar)
self.ButtonHelperBar = ButtonHelperBar menuElement.ButtonHelperBar = buttonHelperBar
MenuTitle = MenuBuilder.BuildRegisteredType( "MenuTitle", { local menuTitle = MenuBuilder.BuildRegisteredType("MenuTitle", {
controllerIndex = f61_local1 controllerIndex = controllerIndex
} ) })
MenuTitle.id = "MenuTitle" menuTitle.id = "MenuTitle"
MenuTitle.MenuTitle:setText( ToUpperCase( Engine.Localize( "LUA_MENU_MODS" ) ), 0 ) menuTitle.MenuTitle:setText(ToUpperCase(Engine.Localize("LUA_MENU_MODS")), 0)
--MenuTitle.MenuTitle:setText( ToUpperCase( "Mods" ), 0 ) menuTitle.MenuBreadcrumbs:setText(ToUpperCase(""), 0)
MenuTitle.MenuBreadcrumbs:setText( ToUpperCase( "" ), 0 ) menuTitle.Icon:SetTop(_1080p * -28.5, 0)
MenuTitle.Icon:SetTop( _1080p * -28.5, 0 ) menuTitle.Icon:SetBottom(_1080p * 61.5, 0)
MenuTitle.Icon:SetBottom( _1080p * 61.5, 0 ) menuTitle:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 96, _1080p * 1056, _1080p * 54, _1080p * 134)
MenuTitle:SetAnchorsAndPosition( 0, 1, 0, 1, _1080p * 96, _1080p * 1056, _1080p * 54, _1080p * 134 ) menuElement:addElement(menuTitle)
self:addElement( MenuTitle ) menuElement.MenuTitle = menuTitle
self.MenuTitle = MenuTitle
local ModInfoTitle = nil local modInfoTitle = nil
ModInfoTitle = LUI.UIStyledText.new() modInfoTitle = LUI.UIStyledText.new()
ModInfoTitle.id = "ModInfoTitle" modInfoTitle.id = "ModInfoTitle"
ModInfoTitle:setText( "", 0 ) modInfoTitle:setText("", 0)
ModInfoTitle:SetFontSize( 30 * _1080p ) modInfoTitle:SetFontSize(30 * _1080p)
ModInfoTitle:SetFont( FONTS.GetFont( FONTS.MainMedium.File ) ) modInfoTitle:SetFont(FONTS.GetFont(FONTS.MainMedium.File))
ModInfoTitle:SetAlignment( LUI.Alignment.Left ) modInfoTitle:SetAlignment(LUI.Alignment.Left)
ModInfoTitle:SetStartupDelay( 2000 ) modInfoTitle:SetStartupDelay(2000)
ModInfoTitle:SetLineHoldTime( 400 ) modInfoTitle:SetLineHoldTime(400)
ModInfoTitle:SetAnimMoveTime( 300 ) modInfoTitle:SetAnimMoveTime(300)
ModInfoTitle:SetEndDelay( 1500 ) modInfoTitle:SetEndDelay(1500)
ModInfoTitle:SetCrossfadeTime( 750 ) modInfoTitle:SetCrossfadeTime(750)
ModInfoTitle:SetAutoScrollStyle( LUI.UIStyledText.AutoScrollStyle.ScrollH ) modInfoTitle:SetAutoScrollStyle(LUI.UIStyledText.AutoScrollStyle.ScrollH)
ModInfoTitle:SetMaxVisibleLines( 1 ) modInfoTitle:SetMaxVisibleLines(1)
ModInfoTitle:SetDecodeLetterLength( 15 ) modInfoTitle:SetDecodeLetterLength(15)
ModInfoTitle:SetDecodeMaxRandChars( 6 ) modInfoTitle:SetDecodeMaxRandChars(6)
ModInfoTitle:SetDecodeUpdatesPerLetter( 4 ) modInfoTitle:SetDecodeUpdatesPerLetter(4)
ModInfoTitle:SetAnchorsAndPosition( 0, 1, 0, 1, _1080p * 1254, _1080p * 1824, _1080p * 216, _1080p * 246 ) modInfoTitle:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 1254, _1080p * 1824, _1080p * 216, _1080p * 246)
self:addElement( ModInfoTitle ) menuElement:addElement(modInfoTitle)
self.ModInfoTitle = ModInfoTitle menuElement.ModInfoTitle = modInfoTitle
local ModInfoText = nil local modInfoText = nil
ModInfoText = LUI.UIStyledText.new() modInfoText = LUI.UIStyledText.new()
ModInfoText.id = "ModInfoText" modInfoText.id = "ModInfoText"
ModInfoText:setText( "", 0 ) modInfoText:setText("", 0)
ModInfoText:SetFontSize( 20 * _1080p ) modInfoText:SetFontSize(20 * _1080p)
ModInfoText:SetFont( FONTS.GetFont( FONTS.MainCondensed.File ) ) modInfoText:SetFont(FONTS.GetFont(FONTS.MainCondensed.File))
ModInfoText:SetAlignment( LUI.Alignment.Left ) modInfoText:SetAlignment(LUI.Alignment.Left)
ModInfoText:SetAnchorsAndPosition( 0, 1, 0, 1, _1080p * 1254, _1080p * 1824, _1080p * 248, _1080p * 268 ) modInfoText:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 1254, _1080p * 1824, _1080p * 248, _1080p * 268)
self:addElement( ModInfoText ) menuElement:addElement(modInfoText)
self.ModInfoText = ModInfoText menuElement.ModInfoText = modInfoText
local ModSelectionList = nil local modSelectionList = nil
ModSelectionList = LUI.UIDataSourceGrid.new( nil, { modSelectionList = LUI.UIDataSourceGrid.new(nil, {
maxVisibleColumns = 1, maxVisibleColumns = 1,
maxVisibleRows = 17, maxVisibleRows = 17,
controllerIndex = f20_local1, controllerIndex = controllerIndex,
buildChild = function () buildChild = function()
return MenuBuilder.BuildRegisteredType( "ModSelectButton", { return MenuBuilder.BuildRegisteredType("ModSelectButton", {
controllerIndex = f20_local1 controllerIndex = controllerIndex
} ) })
end, end,
wrapX = true, wrapX = true,
wrapY = true, wrapY = true,
spacingX = _1080p * 10, spacingX = _1080p * 10,
spacingY = _1080p * 10, spacingY = _1080p * 10,
columnWidth = _1080p * 500, columnWidth = _1080p * 500,
rowHeight = _1080p * 30, rowHeight = _1080p * 30,
scrollingThresholdX = 1, scrollingThresholdX = 1,
scrollingThresholdY = 1, scrollingThresholdY = 1,
adjustSizeToContent = false, adjustSizeToContent = false,
horizontalAlignment = LUI.Alignment.Left, horizontalAlignment = LUI.Alignment.Left,
verticalAlignment = LUI.Alignment.Top, verticalAlignment = LUI.Alignment.Top,
springCoefficient = 600, springCoefficient = 600,
maxVelocity = 5000 maxVelocity = 5000
} ) })
ModSelectionList.id = "ModSelectionList" modSelectionList.id = "ModSelectionList"
ModSelectionList:setUseStencil( false ) modSelectionList:setUseStencil(false)
ModSelectionList:SetAnchorsAndPosition( 0, 1, 0, 1, _1080p * 130, _1080p * 630, _1080p * 216, _1080p * 886 ) modSelectionList:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 130, _1080p * 630, _1080p * 216, _1080p * 886)
self:addElement( ModSelectionList ) menuElement:addElement(modSelectionList)
self.ModSelectionList = ModSelectionList menuElement.ModSelectionList = modSelectionList
local ArrowUp = nil local arrowUp = nil
ArrowUp = MenuBuilder.BuildRegisteredType( "ArrowUp", { arrowUp = MenuBuilder.BuildRegisteredType("ArrowUp", {
controllerIndex = f20_local1 controllerIndex = controllerIndex
} ) })
ArrowUp.id = "ArrowUp" arrowUp.id = "ArrowUp"
ArrowUp:SetAnchorsAndPosition( 0, 1, 0, 1, _1080p * 452.5, _1080p * 472.5, _1080p * 887, _1080p * 927 ) arrowUp:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 452.5, _1080p * 472.5, _1080p * 887, _1080p * 927)
self:addElement( ArrowUp ) menuElement:addElement(arrowUp)
self.ArrowUp = ArrowUp menuElement.ArrowUp = arrowUp
local ArrowDown = nil local arrowDown = nil
ArrowDown = MenuBuilder.BuildRegisteredType( "ArrowDown", { arrowDown = MenuBuilder.BuildRegisteredType("ArrowDown", {
controllerIndex = f20_local1 controllerIndex = controllerIndex
} ) })
ArrowDown.id = "ArrowDown" arrowDown.id = "ArrowDown"
ArrowDown:SetAnchorsAndPosition( 0, 1, 0, 1, _1080p * 287.5, _1080p * 307.5, _1080p * 886, _1080p * 926 ) arrowDown:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 287.5, _1080p * 307.5, _1080p * 886, _1080p * 926)
self:addElement( ArrowDown ) menuElement:addElement(arrowDown)
self.ArrowDown = ArrowDown menuElement.ArrowDown = arrowDown
local ListCount = nil local listCount = nil
ListCount = LUI.UIText.new() listCount = LUI.UIText.new()
ListCount.id = "ListCount" listCount.id = "ListCount"
ListCount:setText( "1/15", 0 ) listCount:setText("1/15", 0)
ListCount:SetFontSize( 24 * _1080p ) listCount:SetFontSize(24 * _1080p)
ListCount:SetFont( FONTS.GetFont( FONTS.MainMedium.File ) ) listCount:SetFont(FONTS.GetFont(FONTS.MainMedium.File))
ListCount:SetAlignment( LUI.Alignment.Center ) listCount:SetAlignment(LUI.Alignment.Center)
ListCount:SetAnchorsAndPosition( 0, 1, 0, 1, _1080p * 307.5, _1080p * 452.5, _1080p * 894, _1080p * 918 ) listCount:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 307.5, _1080p * 452.5, _1080p * 894, _1080p * 918)
self:addElement( ListCount ) menuElement:addElement(listCount)
self.ListCount = ListCount menuElement.ListCount = listCount
local LoadedModName = nil local loadedModName = nil
LoadedModName = LUI.UIText.new() loadedModName = LUI.UIText.new()
LoadedModName.id = "LoadedModName" loadedModName.id = "LoadedModName"
LoadedModName:setText( "LOADED MOD NAME", 0 ) loadedModName:setText("LOADED MOD NAME", 0)
LoadedModName:SetFontSize( 20 * _1080p ) loadedModName:SetFontSize(20 * _1080p)
LoadedModName:SetFont( FONTS.GetFont( FONTS.MainBold.File ) ) loadedModName:SetFont(FONTS.GetFont(FONTS.MainBold.File))
LoadedModName:SetAlignment( LUI.Alignment.Left ) loadedModName:SetAlignment(LUI.Alignment.Left)
LoadedModName:SetAnchorsAndPosition( 0, 1, 0, 1, _1080p * 130, _1080p * 630, _1080p * 942, _1080p * 966 ) loadedModName:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 130, _1080p * 630, _1080p * 942, _1080p * 966)
self:addElement( LoadedModName ) menuElement:addElement(loadedModName)
self.LoadedModName = LoadedModName menuElement.LoadedModName = loadedModName
ModSelectionList:AddArrow( ArrowUp ) modSelectionList:AddArrow(arrowUp)
ModSelectionList:AddArrow( ArrowDown ) modSelectionList:AddArrow(arrowDown)
ModSelectionList:AddItemNumbers( ListCount ) modSelectionList:AddItemNumbers(listCount)
self.addButtonHelperFunction = function ( arg0, arg1 ) menuElement.addButtonHelperFunction = function(arg0, arg1)
arg0:AddButtonHelperText( { arg0:AddButtonHelperText({
helper_text = Engine.Localize( "MENU_BACK" ), helper_text = Engine.Localize("MENU_BACK"),
button_ref = "button_secondary", button_ref = "button_secondary",
side = "left", side = "left",
clickable = true clickable = true
} ) })
local fs_game = Engine.GetDvarString( "fs_game" ) local fsGame = Engine.GetDvarString("fs_game")
if fs_game ~= "" then if fsGame ~= "" then
arg0:AddButtonHelperText( { arg0:AddButtonHelperText({
helper_text = Engine.Localize( "LUA_MENU_UNLOAD" ), helper_text = Engine.Localize("LUA_MENU_UNLOAD"),
button_ref = "button_alt2", button_ref = "button_alt2",
side = "left", side = "left",
clickable = true clickable = true
} ) })
end end
end end
self:addEventHandler( "menu_create", self.addButtonHelperFunction ) menuElement:addEventHandler("menu_create", menuElement.addButtonHelperFunction)
local bindButton = LUI.UIBindButton.new() local bindButton = LUI.UIBindButton.new()
bindButton.id = "selfBindButton" bindButton.id = "selfBindButton"
self:addElement( bindButton ) menuElement:addElement(bindButton)
self.bindButton = bindButton menuElement.bindButton = bindButton
PostLoadFunc( self, f20_local1, controller ) postLoadFunction(menuElement, controllerIndex, controller)
return self return menuElement
end end
MenuBuilder.registerType( "ModSelectMenu", ModSelectMenu ) MenuBuilder.registerType("ModSelectMenu", ModSelectMenu)
LUI.FlowManager.RegisterStackPushBehaviour( "ModSelectMenu", PushFunc ) LUI.FlowManager.RegisterStackPushBehaviour("ModSelectMenu", PushFunc)
LUI.FlowManager.RegisterStackPopBehaviour( "ModSelectMenu", f0_local1 ) LUI.FlowManager.RegisterStackPopBehaviour("ModSelectMenu", modSelectPathCleanup)

View File

@ -1,5 +1,5 @@
require( "ModSelectButton" ) require("ModSelectButton")
require( "ModSelectMenu" ) require("ModSelectMenu")
if (Engine.InFrontend()) then if (Engine.InFrontend()) then
require("ModDownload") require("ModDownload")

View File

@ -1,70 +1,66 @@
function SystemLinkMenuButtons( menu, controller ) function SystemLinkMenuButtons(menu, controller)
local self = LUI.UIVerticalList.new() local SystemLinkMenuButtons = LUI.UIVerticalList.new()
self:SetAnchorsAndPosition( 0, 1, 0, 1, 0, 500 * _1080p, 0, 300 * _1080p ) SystemLinkMenuButtons:SetAnchorsAndPosition(0, 1, 0, 1, 0, 500 * _1080p, 0, 300 * _1080p)
self.id = "SystemLinkMenuButtons" SystemLinkMenuButtons.id = "SystemLinkMenuButtons"
local f1_local1 = controller and controller.controllerIndex
if not f1_local1 and not Engine.InFrontend() then
f1_local1 = self:getRootController()
end
assert( f1_local1 )
local f1_local2 = self
self:SetSpacing( 10 * _1080p )
local f1_local5 = nil local controllerIndex = controller and controller.controllerIndex
if CONDITIONS.IsCoreMultiplayer( self ) then if not controllerIndex and not Engine.InFrontend() then
f1_local5 = MenuBuilder.BuildRegisteredType( "MenuButton", { controllerIndex = SystemLinkMenuButtons:getRootController()
controllerIndex = f1_local1 end
} ) assert(controllerIndex)
f1_local5.id = "CASButton"
if CONDITIONS.IsCoreMultiplayer( self ) then
else SystemLinkMenuButtons:SetSpacing(10 * _1080p)
end local casButton = nil
if CONDITIONS.IsCoreMultiplayer( self ) then if CONDITIONS.IsCoreMultiplayer(SystemLinkMenuButtons) then
f1_local5.buttonDescription = Engine.Localize( "LUA_MENU_DESC_CREATE_A_CLASS" ) casButton = MenuBuilder.BuildRegisteredType("MenuButton", {
end controllerIndex = controllerIndex
f1_local5.Text:setText( ToUpperCase( Engine.Localize( "LUA_MENU_CREATE_A_CLASS" ) ), 0 ) })
f1_local5:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, _1080p * 80, _1080p * 110 ) casButton.id = "CASButton"
self:addElement( f1_local5 )
self.CASButton = f1_local5
end
local f1_local6 = nil
if CONDITIONS.IsThirdGameMode( self ) then
f1_local6 = MenuBuilder.BuildRegisteredType( "MenuButton", {
controllerIndex = f1_local1
} )
f1_local6.id = "LoadoutButton"
if CONDITIONS.IsThirdGameMode( self ) then
else if CONDITIONS.IsCoreMultiplayer(SystemLinkMenuButtons) then
casButton.buttonDescription = Engine.Localize("LUA_MENU_DESC_CREATE_A_CLASS")
end
end casButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_CREATE_A_CLASS")), 0)
if CONDITIONS.IsThirdGameMode( self ) then casButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 80, _1080p * 110)
f1_local6.buttonDescription = Engine.Localize( "LUA_MENU_ZM_LOADOUT_DESC" ) SystemLinkMenuButtons:addElement(casButton)
end SystemLinkMenuButtons.CASButton = casButton
f1_local6.Text:setText( ToUpperCase( Engine.Localize( "LUA_MENU_ZM_LOADOUT_CAPS" ) ), 0 ) end
f1_local6:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, _1080p * 120, _1080p * 150 )
self:addElement( f1_local6 )
self.LoadoutButton = f1_local6
end
local LoadoutButton = nil
if CONDITIONS.IsThirdGameMode(SystemLinkMenuButtons) then
LoadoutButton = MenuBuilder.BuildRegisteredType("MenuButton", {
controllerIndex = controllerIndex
})
LoadoutButton.id = "LoadoutButton"
if CONDITIONS.IsCoreMultiplayer( self ) then if CONDITIONS.IsThirdGameMode(SystemLinkMenuButtons) then
f1_local5:addEventHandler( "button_action", function ( f2_arg0, f2_arg1 ) LoadoutButton.buttonDescription = Engine.Localize("LUA_MENU_ZM_LOADOUT_DESC")
local f2_local0 = f2_arg1.controller or f1_local1 end
ClientWeapon.SetWeaponVisible( 0, true )
ClientCharacter.SetCharacterVisible( 0, true )
ACTIONS.OpenCreateAClass( self, f2_arg1 )
end )
end
if CONDITIONS.IsThirdGameMode( self ) then
f1_local6:addEventHandler( "button_action", function ( f3_arg0, f3_arg1 )
ACTIONS.OpenMenu( "CPLoadoutMenu", true, f3_arg1.controller or f1_local1 )
end )
end
return self LoadoutButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_ZM_LOADOUT_CAPS")), 0)
LoadoutButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 120, _1080p * 150)
SystemLinkMenuButtons:addElement(LoadoutButton)
SystemLinkMenuButtons.LoadoutButton = LoadoutButton
end
if CONDITIONS.IsCoreMultiplayer(SystemLinkMenuButtons) then
casButton:addEventHandler("button_action", function(button, event)
local currentControllerIndex = event.controller or controllerIndex
ClientWeapon.SetWeaponVisible(0, true)
ClientCharacter.SetCharacterVisible(0, true)
ACTIONS.OpenCreateAClass(SystemLinkMenuButtons, event)
end)
end
if CONDITIONS.IsThirdGameMode(SystemLinkMenuButtons) then
loadoutButton:addEventHandler("button_action", function(button, event)
ACTIONS.OpenMenu("CPLoadoutMenu", true, event.controller or controllerIndex)
end)
end
return SystemLinkMenuButtons
end end
MenuBuilder.m_types["SystemLinkMenuButtons"] = SystemLinkMenuButtons MenuBuilder.m_types["SystemLinkMenuButtons"] = SystemLinkMenuButtons

File diff suppressed because it is too large Load Diff