format ui scripts
This commit is contained in:
@ -1,70 +1,66 @@
|
||||
function SystemLinkMenuButtons( menu, controller )
|
||||
local self = LUI.UIVerticalList.new()
|
||||
self:SetAnchorsAndPosition( 0, 1, 0, 1, 0, 500 * _1080p, 0, 300 * _1080p )
|
||||
self.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 )
|
||||
function SystemLinkMenuButtons(menu, controller)
|
||||
local SystemLinkMenuButtons = LUI.UIVerticalList.new()
|
||||
SystemLinkMenuButtons:SetAnchorsAndPosition(0, 1, 0, 1, 0, 500 * _1080p, 0, 300 * _1080p)
|
||||
SystemLinkMenuButtons.id = "SystemLinkMenuButtons"
|
||||
|
||||
local controllerIndex = controller and controller.controllerIndex
|
||||
if not controllerIndex and not Engine.InFrontend() then
|
||||
controllerIndex = SystemLinkMenuButtons:getRootController()
|
||||
end
|
||||
assert(controllerIndex)
|
||||
|
||||
SystemLinkMenuButtons:SetSpacing(10 * _1080p)
|
||||
|
||||
local f1_local5 = nil
|
||||
if CONDITIONS.IsCoreMultiplayer( self ) then
|
||||
f1_local5 = MenuBuilder.BuildRegisteredType( "MenuButton", {
|
||||
controllerIndex = f1_local1
|
||||
} )
|
||||
f1_local5.id = "CASButton"
|
||||
if CONDITIONS.IsCoreMultiplayer( self ) then
|
||||
|
||||
else
|
||||
|
||||
end
|
||||
if CONDITIONS.IsCoreMultiplayer( self ) then
|
||||
f1_local5.buttonDescription = Engine.Localize( "LUA_MENU_DESC_CREATE_A_CLASS" )
|
||||
end
|
||||
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 )
|
||||
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
|
||||
|
||||
end
|
||||
if CONDITIONS.IsThirdGameMode( self ) then
|
||||
f1_local6.buttonDescription = Engine.Localize( "LUA_MENU_ZM_LOADOUT_DESC" )
|
||||
end
|
||||
f1_local6.Text:setText( ToUpperCase( Engine.Localize( "LUA_MENU_ZM_LOADOUT_CAPS" ) ), 0 )
|
||||
f1_local6:SetAnchorsAndPosition( 0, 1, 0, 1, 0, _1080p * 500, _1080p * 120, _1080p * 150 )
|
||||
self:addElement( f1_local6 )
|
||||
self.LoadoutButton = f1_local6
|
||||
end
|
||||
local casButton = nil
|
||||
if CONDITIONS.IsCoreMultiplayer(SystemLinkMenuButtons) then
|
||||
casButton = MenuBuilder.BuildRegisteredType("MenuButton", {
|
||||
controllerIndex = controllerIndex
|
||||
})
|
||||
casButton.id = "CASButton"
|
||||
|
||||
if CONDITIONS.IsCoreMultiplayer(SystemLinkMenuButtons) then
|
||||
casButton.buttonDescription = Engine.Localize("LUA_MENU_DESC_CREATE_A_CLASS")
|
||||
end
|
||||
|
||||
casButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_CREATE_A_CLASS")), 0)
|
||||
casButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 80, _1080p * 110)
|
||||
SystemLinkMenuButtons:addElement(casButton)
|
||||
SystemLinkMenuButtons.CASButton = casButton
|
||||
end
|
||||
|
||||
local LoadoutButton = nil
|
||||
if CONDITIONS.IsThirdGameMode(SystemLinkMenuButtons) then
|
||||
LoadoutButton = MenuBuilder.BuildRegisteredType("MenuButton", {
|
||||
controllerIndex = controllerIndex
|
||||
})
|
||||
LoadoutButton.id = "LoadoutButton"
|
||||
|
||||
if CONDITIONS.IsThirdGameMode(SystemLinkMenuButtons) then
|
||||
LoadoutButton.buttonDescription = Engine.Localize("LUA_MENU_ZM_LOADOUT_DESC")
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
if CONDITIONS.IsCoreMultiplayer( self ) then
|
||||
f1_local5:addEventHandler( "button_action", function ( f2_arg0, f2_arg1 )
|
||||
local f2_local0 = f2_arg1.controller or f1_local1
|
||||
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
|
||||
return SystemLinkMenuButtons
|
||||
end
|
||||
|
||||
MenuBuilder.m_types["SystemLinkMenuButtons"] = SystemLinkMenuButtons
|
File diff suppressed because it is too large
Load Diff
@ -1,2 +1,2 @@
|
||||
require("ServerButtons")
|
||||
require("SysLinkBrowser")
|
||||
require("SysLinkBrowser")
|
||||
|
Reference in New Issue
Block a user