iw6-lui/lui/mp_menus/mplobbywidgets.dec.lua
2024-09-12 17:25:45 +02:00

1854 lines
43 KiB
Lua

local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function mpLobbyWidgets()
return {
type = "UIElement",
id = "mpLobbyWidgets",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "UIHorizontalList",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 100,
bottom = 132,
left = 100,
right = 568
}
},
children = {
{
type = "UIImage",
id = "left_cap",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
right = 32,
material = RegisterMaterial( "box_lobby_name_lt" ),
red = 1,
green = 1,
blue = 1,
alpha = 0.35
}
}
},
{
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
right = 468,
red = 1,
green = 1,
blue = 1,
alpha = 1
}
},
children = {
{
type = "UIImage",
id = "middle",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "box_lobby_name_mid" ),
red = 1,
green = 1,
blue = 1,
alpha = 0.35
}
}
},
{
type = "rank_icon_name"
}
}
},
{
type = "UIImage",
id = "right_cap",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
right = 4,
material = RegisterMaterial( "box_lobby_name_rt" ),
red = 1,
green = 1,
blue = 1,
alpha = 0.35
}
}
}
}
},
{
type = "UIImage",
id = "speaker_icon",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 42,
left = -21,
right = 21,
material = RegisterMaterial( "icon_online_chat" ),
red = 1,
green = 1,
blue = 1,
alpha = 1
}
}
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
},
{
type = "global_activity_map",
id = "global_activity_map_id"
},
{
type = "map_digital_anim",
id = "map_digital_anim_id"
}
}
}
end
function map_digital_anim()
return {
type = "UIElement",
id = "map_container",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "UIImage",
id = "left_side_meters",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = -48,
right = -16,
material = RegisterMaterial( "fluff_lobby_meters_lt" ),
red = 1,
green = 1,
blue = 1,
alpha = 0.2
}
}
},
{
type = "UIImage",
id = "rt_map_arrow",
states = {
default = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = -8,
bottom = 0,
left = 364,
right = 396,
material = RegisterMaterial( "fluff_arrow_tick" ),
red = 1,
green = 1,
blue = 1,
alpha = 0.15
},
moveup1 = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = -8,
bottom = 0,
left = 364,
right = 396,
red = 1,
green = 1,
blue = 1,
alpha = 0.2
},
moveup2 = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = -78,
bottom = -70,
left = 364,
right = 396,
red = 1,
green = 1,
blue = 1,
alpha = 0.3
},
moveup3 = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = -33,
bottom = -25,
left = 364,
right = 392,
red = 1,
green = 1,
blue = 1,
alpha = 0.15
},
moveup4 = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = -180,
bottom = -172,
left = 364,
right = 396,
red = 1,
green = 1,
blue = 1,
alpha = 0.3
},
moveup5 = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = -8,
bottom = 0,
left = 364,
right = 396,
red = 1,
green = 1,
blue = 1,
alpha = 0.2
}
},
handlers = {
menu_create = MBh.AnimateLoop( {
{
"moveup1",
0,
true,
true
},
{
"moveup2",
5000,
true,
true
},
{
"moveup3",
5000,
true,
true
},
{
"moveup4",
5000,
true,
true
},
{
"moveup5",
5000,
true,
true
}
} )
}
},
{
type = "UIImage",
id = "blinky",
states = {
default = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 16,
bottom = 32,
left = -32,
right = -16,
material = RegisterMaterial( "fluff_lobby_register_tick" ),
red = 1,
green = 1,
blue = 1,
alpha = 0.5
},
moveup1 = {
red = 1,
green = 1,
blue = 1,
alpha = 0.1,
zRot = 0
},
moveup2 = {
red = 1,
green = 1,
blue = 1,
alpha = 0.25,
zRot = 90
},
moveup3 = {
red = 1,
green = 1,
blue = 1,
alpha = 0.1,
zRot = 180
},
moveup4 = {
red = 1,
green = 1,
blue = 1,
alpha = 0.35,
zRot = 270
},
moveup5 = {
red = 1,
green = 1,
blue = 1,
alpha = 0.1,
zRot = 360
}
},
handlers = {
menu_create = MBh.AnimateLoop( {
{
"moveup1",
0
},
{
"moveup2",
500
},
{
"moveup3",
500
},
{
"moveup4",
500
},
{
"moveup5",
500
}
} )
}
}
}
}
end
function rank_icon_name()
return {
type = "UIHorizontalList",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 1,
spacing = 3
},
dim = {
alpha = 0.65
},
disabled = {
alpha = 0.2
}
},
handlers = {
button_over = MBh.AnimateLoop( {
{
"dim",
200
},
{
"default",
200
}
} ),
button_up = MBh.AnimateToState( "default" ),
button_disable = MBh.AnimateToState( "disabled", 0 )
},
children = {
{
type = "UIText",
id = "rank_text",
properties = {
text = "65"
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 3,
bottom = -3,
left = 0,
right = 32,
font = RegisterFont( "fonts/smallfont" )
}
}
},
{
type = "UIImage",
id = "rank_icon",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 5,
bottom = -5,
left = 0,
right = 21,
material = RegisterMaterial( "icon_mp_rank" ),
red = 1,
green = 1,
blue = 1,
alpha = 1
}
}
},
{
type = "UIText",
id = "clan_tag_text",
properties = {
text = "[WWWW]"
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 3,
bottom = -3,
left = 0,
right = 75,
red = 0.5,
green = 0.5,
blue = 0.5,
font = RegisterFont( "fonts/smallfont" )
}
}
},
{
type = "UIText",
id = "gamertag_text",
properties = {
text = "WWWWWWWWWWWWWWWW"
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 3,
bottom = -3,
left = 0,
right = -200,
font = RegisterFont( "fonts/smallfont" )
}
}
}
}
}
end
function updateGlobalActivityMap( f4_arg0, f4_arg1 )
local f4_local0 = 10
local f4_local1 = Playlist.GetTotalActivePlayersCount()
if f4_local1 == nil or not f4_local1 then
f4_local1 = ""
end
local f4_local2, f4_local3, f4_local4, f4_local5 = GetTextDimensions( Engine.Localize( "@LUA_MENU_PLAYERS_ONLINE" ), CoD.TextSettings.NormalFont.Font, 16 )
local f4_local6 = f4_local4 - f4_local2
f4_arg0:setText( tostring( f4_local1 ) )
f4_arg0:registerAnimationState( "updated", {
leftAnchor = true,
rightAnchor = false,
topAnchor = false,
bottomAnchor = true,
left = f4_local6 + f4_local0,
bottom = -34,
width = 200,
top = -50
} )
f4_arg0:animateToState( "updated", 0 )
end
function global_activity_map()
return {
type = "UIElement",
id = "map_container",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 415,
left = 100,
height = 200,
width = 345
}
},
handlers = {
update_map = MBh.EmitEvent( "update_map_activity" )
},
children = {
{
type = "UIImage",
id = "map_shadow",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = -31.5,
bottom = 0,
left = -37,
right = 34,
material = RegisterMaterial( "box_xbl_map_shadow" ),
red = 1,
green = 1,
blue = 1,
alpha = 0.95
}
}
},
{
type = "UIImage",
id = "map_graph",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 164,
bottom = 4,
left = -85,
right = 85,
material = RegisterMaterial( "img_lobby_map_graph_bg" ),
red = 1,
green = 1,
blue = 1,
alpha = 0.75
}
}
},
{
type = "UIPopulationMap",
id = "population_map",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
}
},
{
type = "UIText",
id = "players_online_label",
properties = {
text = Engine.Localize( "@LUA_MENU_PLAYERS_ONLINE" )
},
states = {
default = {
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.NormalFont.Font,
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
left = 6,
right = 0,
top = -50,
bottom = -34,
red = 0.39,
green = 0.39,
blue = 0.39,
alpha = 1
}
}
},
{
type = "UIText",
id = "players_online",
properties = {
text = "4,443,235,012"
},
states = {
default = {
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.NormalFont.Font,
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
left = 0,
right = 0,
top = -50,
bottom = -34,
red = 0.6,
green = 0.6,
blue = 0.6,
alpha = 1
}
},
handlers = {
menu_create = updateGlobalActivityMap,
update_map_activity = updateGlobalActivityMap
}
},
{
type = "UIImage",
id = "map_graph_line",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = -23,
bottom = 220,
left = -8,
right = 0,
material = RegisterMaterial( "img_lobby_map_graph_line" ),
red = 1,
green = 1,
blue = 1,
alpha = 0.5
},
move1 = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = -23,
bottom = 220,
left = -8,
right = 0
},
move2 = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = -23,
bottom = 220,
left = 340,
right = 348
}
},
handlers = {
menu_create = MBh.EmitEvent( "start_map_scan" ),
start_map_scan = MBh.AnimateLoop( {
{
"move1",
0
},
{
"move2",
10000
}
} )
}
},
{
type = "UIImage",
id = "map_graph_brackets",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 166,
bottom = 4,
left = -8,
right = 4,
material = RegisterMaterial( "img_lobby_map_graph_brackets" ),
red = 1,
green = 1,
blue = 1,
alpha = 1
},
move1 = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 166,
bottom = 4,
left = -8,
right = 4
},
move2 = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 166,
bottom = 4,
left = 340,
right = 352
}
},
handlers = {
menu_create = MBh.EmitEvent( "start_map_scan" ),
start_map_scan = MBh.AnimateLoop( {
{
"move1",
0
},
{
"move2",
10000
}
} )
}
},
{
type = "UITimer",
id = "map_scan_timer",
properties = {
event = "update_map",
interval = 1000
}
}
}
}
end
function theater_recording_widget()
return {
type = "UIImage",
id = "theater_recording_widget_id",
states = {
default = {
material = RegisterMaterial( "box_theater_bg" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 790,
right = 955,
top = 651,
bottom = 683
}
},
children = {
{
type = "UIText",
id = "theater_text_id",
properties = {
text = Engine.Localize( "@LUA_MENU_THEATER" )
},
states = {
default = {
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.NormalFont.Font,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 8,
right = 0,
top = 8,
bottom = 24,
red = 0.39,
green = 0.39,
blue = 0.39
}
}
},
{
type = "UIText",
id = "recording_text_id",
properties = {
text = Engine.Localize( "@LUA_MENU_RECORDING" )
},
states = {
default = {
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.NormalFont.Font,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 80,
right = 0,
top = 8,
bottom = 24,
red = Colors.cac_ability_text.r,
green = Colors.cac_ability_text.g,
blue = Colors.cac_ability_text.b
}
}
},
{
type = "UIText",
id = "onoff_text_id",
properties = {
text = Engine.Localize( "@MENU_ON" )
},
states = {
default = {
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.NormalFont.Font,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 137,
right = 0,
top = 8,
bottom = 24,
red = 0.39,
green = 0.39,
blue = 0.39
}
},
handlers = {
theater_widget_recording_on = function ( f7_arg0, f7_arg1 )
f7_arg0.setText( Engine.Localize( "@MENU_ON" ) )
end
,
theater_widget_recording_off = function ( f8_arg0, f8_arg1 )
f8_arg0.setText( Engine.Localize( "@MENU_OFF" ) )
end
}
},
{
type = "UIImage",
id = "recording_light_id",
states = {
default = {
material = RegisterMaterial( "fluff_circle" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 114,
right = 129,
top = 8,
bottom = -8,
red = 0.95,
green = 0.42,
blue = 0.31
}
}
}
}
}
end
function leaveprelobbywarning()
return {
type = "generic_yesno_popup",
properties = {
message_text = Engine.Localize( "@XBOXLIVE_LEAVEPARTYANDLOBBY" ),
popup_title = Engine.Localize( "@MENU_NOTICE" ),
yes_action = MBh.EmitEventToRoot( {
name = "exit_live_lobby",
immediate = true
} ),
default_focus_index = 2
}
}
end
function leaveLobbyWarningYesAction( f10_arg0, f10_arg1 )
if AreWePrivatePartyHost() then
Engine.Exec( "xstoplobbybackout leavelobbywarning", f10_arg1.controller )
else
Engine.Exec( "xstopparty leavelobbywarning", f10_arg1.controller )
end
Engine.Exec( "xblive_privatematch 0", f10_arg1.controller )
SetIsAliensSolo( false )
Engine.SetDvarBool( "squad_match", false )
if Lobby.GetBotsConnectType() > 0 then
Lobby.SetBotsConnectType( 0 )
end
if MLG.AreMLGRulesEnabled() then
MLG.Toggle( f10_arg0, f10_arg1 )
end
f10_arg0:dispatchEventToRoot( {
name = "private_match_dvar_updated",
controller = f10_arg1.controller
} )
end
function leavelobbywarning()
return {
type = "generic_yesno_popup",
properties = {
message_text = Engine.Localize( "@XBOXLIVE_LEAVELOBBY" ),
popup_title = Engine.Localize( "@MENU_NOTICE" ),
yes_action = MBh.DoMultiple( {
leaveLobbyWarningYesAction,
ExitLobby
} ),
default_focus_index = 2
}
}
end
function leavelobbybadsquad()
return {
type = "generic_confirmation_popup",
properties = {
message_text = Engine.Localize( "@LUA_MENU_BAD_SQUAD" ),
popup_title = Engine.Localize( "@MENU_NOTICE" ),
confirmation_action = MBh.DoMultiple( {
leaveLobbyWarningYesAction,
ExitLobby
} )
}
}
end
function leavelobbybadsquadmap()
return {
type = "generic_confirmation_popup",
properties = {
message_text = Engine.Localize( "@PLATFORM_MISSINGMAP" ),
popup_title = Engine.Localize( "@MENU_NOTICE" ),
confirmation_action = MBh.DoMultiple( {
leaveLobbyWarningYesAction,
ExitLobby
} ),
cancel_will_close = false
}
}
end
function leaveLobbyAndPartyYesAction( f14_arg0, f14_arg1 )
local f14_local0 = Engine.Exec
if f14_arg1.execNow then
f14_local0 = Engine.ExecNow
end
f14_local0( "xstopparty leavelobbyandpartywarning" )
f14_local0( "xstopprivateparty" )
f14_local0( "xstartprivateparty" )
f14_local0( "xblive_privatematch 0" )
SetIsAliensSolo( false )
Engine.SetDvarBool( "squad_match", false )
if Lobby.GetBotsConnectType() > 0 then
Lobby.SetBotsConnectType( 0 )
end
if MLG.AreMLGRulesEnabled() then
MLG.Toggle( f14_arg0, f14_arg1 )
end
end
function leaveLobbyAndPartyYesActionWithExitLobby( f15_arg0, f15_arg1 )
leaveLobbyAndPartyYesAction( f15_arg0, f15_arg1 )
ExitLobby( f15_arg0, f15_arg1 )
end
function leavelobbyandpartywarning()
return {
type = "generic_yesno_popup",
properties = {
message_text = Engine.Localize( "@XBOXLIVE_LEAVEPARTYANDLOBBY" ),
popup_title = Engine.Localize( "@MENU_NOTICE" ),
yes_action = MBh.DoMultiple( {
leaveLobbyAndPartyYesAction,
ExitLobby
} ),
default_focus_index = 2
}
}
end
function leaveLobbyBlockedPlayerWarningYesAction( f17_arg0, f17_arg1 )
if AreWePrivatePartyHost() then
Engine.Exec( "xstoplobbybackout leavelobbyblockedplayerwarning", f17_arg1.controller )
else
Engine.Exec( "xstopparty leavelobbyblockedplayerwarning", f17_arg1.controller )
end
Engine.Exec( "xblive_privatematch 0" )
SetIsAliensSolo( false )
if Lobby.GetBotsConnectType() > 0 then
Lobby.SetBotsConnectType( 0 )
end
if MLG.AreMLGRulesEnabled() then
MLG.Toggle( f17_arg0, f17_arg1 )
end
end
function leavelobbyblockedplayerwarning()
return {
type = "generic_yesno_popup",
properties = {
message_text = Engine.Localize( "@XBOXLIVE_LEAVELOBBYBLOCKEDPLAYER" ),
popup_title = Engine.Localize( "@MENU_NOTICE" ),
yes_action = MBh.DoMultiple( {
leaveLobbyBlockedPlayerWarningYesAction,
ExitLobby
} ),
default_focus_index = 2
}
}
end
function ShouldShowMapInfo( f19_arg0 )
if IsPublicMatch() then
if Lobby.HasVotePassed() or Engine.GetDvarBool( "squad_match" ) == true then
f19_arg0:animateToState( "default", 200 )
else
f19_arg0:animateToState( "hidden", 0 )
return
end
end
end
function MapInfoSetMapName( f20_arg0, f20_arg1 )
local f20_local0 = Lobby.GetMapName()
local f20_local1 = CoD.TextSettings.BoldFont
local f20_local2, f20_local3, f20_local4, f20_local5 = GetTextDimensions( f20_local0, f20_local1.Font, f20_local1.Height )
f20_arg0:registerAnimationState( "current", {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 20 + f20_local4 - f20_local2,
top = 0,
bottom = 0
} )
f20_arg0:setText( f20_local0 )
f20_arg0:animateToState( "current", 0 )
end
function MapInfoSetGameMode( f21_arg0, f21_arg1 )
if IsPublicMatch() then
if Lobby.HasVotePassed() or squad_mode == true then
f21_arg0:animateToState( "default", 0 )
else
f21_arg0:animateToState( "hidden", 0 )
return
end
end
local f21_local0 = LUI.mp_menus.Aliens.FixGameModeTextForChaos( Lobby.GameTypeNameAbbreviated() )
local f21_local1 = CoD.TextSettings.NormalFont
local f21_local2, f21_local3, f21_local4, f21_local5 = GetTextDimensions( f21_local0, f21_local1.Font, f21_local1.Height )
f21_arg0:registerAnimationState( "current", {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 20 + f21_local4 - f21_local2,
top = 0,
bottom = 0
} )
f21_arg0:setText( f21_local0 )
f21_arg0:animateToState( "current", 0 )
end
function MapInfoSetExtinctionDifficulty( f22_arg0, f22_arg1 )
if not LUI.mp_menus.Aliens.ExtinctionHasDifficultySelection() then
f22_arg0:animateToState( "hidden", 0 )
return
elseif not Engine.IsAliensMode() then
f22_arg0:animateToState( "hidden", 0 )
return
elseif LUI.mp_menus.Aliens.IsChaosEnabled() then
f22_arg0:animateToState( "hidden", 0 )
return
elseif IsPublicMatch() then
if Lobby.HasVotePassed() or squad_mode == true then
f22_arg0:animateToState( "default", 0 )
else
f22_arg0:animateToState( "hidden", 0 )
return
end
end
local f22_local0 = LUI.mp_menus.Aliens.ExtinctionDifficultyDisplayText( LUI.mp_menus.Aliens.ExtinctionDetermineDifficulty() )
local f22_local1 = CoD.TextSettings.NormalFont
local f22_local2, f22_local3, f22_local4, f22_local5 = GetTextDimensions( f22_local0, f22_local1.Font, f22_local1.Height )
f22_arg0:registerAnimationState( "current", {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 20 + f22_local4 - f22_local2,
top = 0,
bottom = 0,
alpha = 1
} )
f22_arg0:setText( f22_local0 )
f22_arg0:animateToState( "current", 0 )
end
function map_info_text()
local f23_local0, f23_local1, f23_local2, f23_local3 = GetTextDimensions( text, CoD.TextSettings.BoldFont.Font, CoD.TextSettings.BoldFont.Height )
local f23_local4, f23_local5, f23_local6, f23_local7 = GetTextDimensions( text, CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
local f23_local8 = 20 + f23_local2 - f23_local0
local f23_local9 = 20 + f23_local6 - f23_local4
return {
type = "UIElement",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 100,
right = 0,
top = 594,
bottom = 594 + CoD.TextSettings.NormalFont.Height,
alignment = LUI.Alignment.Left,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
update_info_text = ShouldShowMapInfo,
menu_create = ShouldShowMapInfo
},
children = {
{
type = "UIImage",
id = "bg_bot",
states = {
default = {
material = RegisterMaterial( "box_white_gradient_bot" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
left = -200,
right = 0,
top = -38,
bottom = 5,
red = 0,
green = 0,
blue = 0,
alpha = 0.5
}
}
},
{
type = "UIHorizontalList",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
children = {
{
type = "UIText",
id = "map_name_text",
properties = {
text = Lobby.GetMapName()
},
states = {
default = {
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.Center,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = f23_local8,
top = 0,
bottom = 0,
red = 1,
green = 1,
blue = 1,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
update_info_text = MapInfoSetMapName,
menu_create = MapInfoSetMapName
}
},
{
type = "UIText",
id = "game_mode_text",
properties = {
text = Lobby.GameTypeNameAbbreviated()
},
states = {
default = {
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = f23_local9,
top = 0,
bottom = 0,
red = 0.7,
green = 0.7,
blue = 0.7,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
update_info_text = MapInfoSetGameMode,
menu_create = MapInfoSetGameMode
}
},
{
type = "UIText",
id = "extinction_difficulty_text",
properties = {
text = ""
},
states = {
default = {
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = f23_local9,
top = 0,
bottom = 0,
red = 0.7,
green = 0.7,
blue = 0.7,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
update_info_text = MapInfoSetExtinctionDifficulty,
menu_create = MapInfoSetExtinctionDifficulty
}
}
}
},
{
type = "UITimer",
id = "map_info_text_timer_id",
properties = {
event = {
name = "update_info_text",
dispatchChildren = true
},
interval = 200,
disposable = false
}
}
}
}
end
function lobby_status( menu, controller )
local self = LUI.UIElement.new()
self.id = "lobby_status_widget_id"
self:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 655,
width = 525,
top = 43,
bottom = 0,
alpha = 1
} )
self:registerAnimationState( "hidden", {
alpha = 0
} )
self:animateToState( "default" )
local f24_local1 = LUI.UIText.new()
f24_local1.id = "status_text_line_one"
f24_local1:registerAnimationState( "default", CoD.ColorizeState( Colors.primary_text_color, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = -10,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Right,
alpha = 1
} ) )
f24_local1:registerAnimationState( "hidden", {
alpha = 0
} )
f24_local1:animateToState( "default" )
f24_local1:registerEventHandler( "lobby_page_enter", function ( element, event )
element:animateToState( "default", event.animTime or 0 )
end )
self:addElement( f24_local1 )
local f24_local2 = function ( f26_arg0, f26_arg1 )
f24_local1:setText( Lobby.GetPartyStatus() )
end
local f24_local3 = LUI.UITimer.new( 200, {
name = "refresh_lobby_status_text"
}, nil, false, self, false )
f24_local3.id = "lobby_status_refresh_timer_id"
self:addElement( f24_local3 )
self:registerEventHandler( "menu_create", f24_local2 )
self:registerEventHandler( "refresh_lobby_status_text", f24_local2 )
self:registerEventHandler( "lobby_page_leave", function ( element, event )
element:animateToState( "hidden", event.animTime or 0 )
end )
self:registerEventHandler( "lobby_page_enter", function ( element, event )
element:animateToState( "default", event.animTime or 0 )
end )
return self
end
function lobby_search_status( menu, controller )
local self = LUI.UIElement.new()
self.id = "lobby_search_status_widget_id"
self:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 655,
width = 525,
top = 43,
bottom = 0,
alpha = 1
} )
self:registerAnimationState( "hidden", {
alpha = 0
} )
if SvS.IsSvS() and SvS.GetCurrentSquadModeInfo() == SvS.SquadModes.SquadAssault then
self:animateToState( "hidden" )
else
self:animateToState( "default" )
end
local f29_local1 = LUI.UIText.new()
f29_local1.id = "search_status_text_line_two"
f29_local1:registerAnimationState( "default", CoD.ColorizeState( Colors.white, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 50,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
alpha = 1
} ) )
f29_local1:registerAnimationState( "hidden", {
alpha = 0
} )
f29_local1:animateToState( "default" )
self:addElement( f29_local1 )
local f29_local2 = function ( f30_arg0, f30_arg1 )
f29_local1:setText( Lobby.GetSearchStatus() )
end
local f29_local3 = LUI.UITimer.new( 200, {
name = "refresh_lobby_search_status_text"
}, nil, false, self, false )
f29_local3.id = "lobby_search_status_refresh_timer_id"
self:addElement( f29_local3 )
self:registerEventHandler( "menu_create", f29_local2 )
self:registerEventHandler( "refresh_lobby_search_status_text", f29_local2 )
self:registerEventHandler( "lobby_page_leave", function ( element, event )
element:animateToState( "hidden", event.animTime or 0 )
end )
self:registerEventHandler( "lobby_page_enter", function ( element, event )
element:animateToState( "default", event.animTime or 0 )
end )
return self
end
function lobby_loading_widget()
local f33_local0 = Engine.GetDvarBool( "wideScreen" )
if not Engine.IsAliensMode() then
local f33_local1 = {
type = "UIImage",
id = "empty_load_bar_id"
}
local f33_local2 = {}
local f33_local3 = {
leftAnchor = false,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true
}
local f33_local4
if f33_local0 then
f33_local4 = -208
if not f33_local4 then
else
f33_local3.left = f33_local4
if f33_local0 then
f33_local4 = -73
if not f33_local4 then
else
f33_local3.right = f33_local4
f33_local3.top = -228
f33_local3.bottom = -93
f33_local3.alpha = 0
f33_local3.material = RegisterMaterial( "img_load_diamond_000" )
f33_local2.default = f33_local3
f33_local3 = {
leftAnchor = false,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true
}
if f33_local0 then
f33_local4 = -208
if not f33_local4 then
else
f33_local3.left = f33_local4
if f33_local0 then
f33_local4 = -73
if not f33_local4 then
else
f33_local3.right = f33_local4
f33_local3.top = -228
f33_local3.bottom = -93
f33_local3.alpha = 1
f33_local2.visible = f33_local3
f33_local1.states = f33_local2
f33_local1.children = {
{
type = "UILoadingDots",
id = "loading_dots",
states = {
default = {
leftAnchor = false,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = -42,
right = 20,
top = 21,
bottom = 46,
alpha = 0.4,
font = CoD.TextSettings.ExtraBigFont.Font
}
}
}
}
f33_local1.handlers = {
lobby_transition_to_game = MBh.AnimateToState( "visible", 500 ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
}
return f33_local1
end
end
f33_local4 = -162
end
end
f33_local4 = -296
end
end
f33_local4 = -162
end
end
f33_local4 = -296
else
return {
type = "UIImage",
id = "empty_load_bar_id",
states = {
default = CoD.ColorizeState( Colors.white, {
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
left = 121,
right = -237,
top = -91,
bottom = -87,
alpha = 0,
material = RegisterMaterial( "white" )
} ),
visible = {
alpha = 0.25
}
},
handlers = {
lobby_transition_to_game = MBh.AnimateToState( "visible", 500, true ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
}
}
end
end
function lobby_game_type_title()
return {
type = "UIText",
id = "game_type_name_id",
properties = {
text = "",
textStyle = CoD.TextStyle.OutlinedMore
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 202,
right = 438,
top = 56,
bottom = 96,
alpha = 0,
font = CoD.TextSettings.ExtraBigFont.Font
},
visible = {
alpha = 1
}
},
handlers = {
lobby_transition_to_game = function ( f35_arg0, f35_arg1 )
if not Engine.IsAliensMode() then
if SvS.IsSvS() then
local f35_local0 = Engine.GetDvarBool( "squad_match" )
local f35_local1 = Squad.GetEnemyGameMode()
end
f35_arg0:setText( Engine.Localize( Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f35_local0 and f35_local1 or Engine.GetDvarString( "ui_gametype" ), GameTypesTable.Cols.Name ) ) )
else
f35_arg0:setText( Lobby.GameTypeNameAbbreviated() )
end
f35_arg0:animateToState( "visible", 500 )
end
,
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
}
}
end
function GetLobbyIconMaterial( f36_arg0 )
if f36_arg0 and Engine.GetDvarString( "playlist_image" ) then
return RegisterMaterial( Engine.GetDvarString( "playlist_image" ) )
else
return RegisterMaterial( GetGameTypeIcon( Engine.GetDvarString( "ui_gametype" ) ) )
end
end
function lobby_game_type_icon( menu, controller )
local self = LUI.UIImage.new()
self.id = "game_type_icon_id"
if not controller then
controller = {}
end
self:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 88,
right = 217,
top = 24,
bottom = 148,
alpha = 0,
material = GetLobbyIconMaterial( controller.online )
} )
self:animateToState( "default" )
self:registerEventHandler( "lobby_transition_to_game", function ( element, event )
element:registerAnimationState( "visible", {
alpha = 1,
material = GetLobbyIconMaterial( element.properties.online )
} )
element:animateToState( "visible", 500 )
end )
self:registerEventHandler( "lobby_rollback_transition_to_game", function ( element, event )
element:animateToState( "default", Lobby.TransitionTime )
end )
return self
end
function character_playing_as( menu, controller )
local self = LUI.UIElement.new()
self.id = "character_playing_as_widget_id"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 55,
right = -100,
height = CoD.TextSettings.NormalFont.Height,
width = 520,
alpha = 1
} )
self:registerAnimationState( "hidden", {
alpha = 0
} )
self:animateToState( "default" )
if not Engine.IsAliensMode() then
local f40_local1 = Engine.GetFirstActiveController()
local f40_local2 = Cac.GetActiveSquadMember( f40_local1 )
local f40_local3 = Cac.GetSquadMemberName( f40_local1, Cac.GetSquadLoc(), f40_local2 ) or ""
local f40_local4 = Engine.Localize( "@LUA_MENU_PLAYING_AS", Engine.MarkLocalized( f40_local3 ) )
local f40_local5 = LUI.UIMarqueeText.new()
f40_local5.id = "character_playing_as_text"
local f40_local6 = f40_local5
local f40_local7 = f40_local5.setText
if f40_local3 then
local f40_local8 = f40_local4
end
f40_local7( f40_local6, f40_local8 or "" )
f40_local5:registerAnimationState( "default", CoD.ColorizeState( Colors.white, {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Right
} ) )
f40_local5:animateToState( "default" )
f40_local5:registerEventHandler( "private_match_dvar_updated", function ( element, event )
local f41_local0 = Cac.GetSquadMemberName( f40_local1, Cac.GetSquadLoc(), f40_local2 ) or ""
local f41_local1 = Engine.Localize( "@LUA_MENU_PLAYING_AS", Engine.MarkLocalized( f41_local0 ) )
local f41_local2 = element
local f41_local3 = element.setText
if f41_local0 then
local f41_local4 = f41_local1
end
f41_local3( f41_local2, f41_local4 or "" )
end )
self:addElement( f40_local5 )
f40_local5:registerEventHandler( "online_data_finished", function ( element, event )
local f42_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
local f42_local1 = f42_local0.exclusiveController
if not f42_local1 then
f42_local1 = Engine.GetFirstActiveController()
end
local f42_local2 = Cac.GetSquadMemberName( f42_local1, Cac.GetSquadLoc(), Cac.GetActiveSquadMember( f42_local1 ) ) or ""
local f42_local3 = Engine.Localize( "@LUA_MENU_PLAYING_AS", Engine.MarkLocalized( f42_local2 ) )
local f42_local4 = element
local f42_local5 = element.setText
if f42_local2 then
local f42_local6 = f42_local3
end
f42_local5( f42_local4, f42_local6 or "" )
end )
f40_local5:registerEventHandler( "menu_create", function ( element, event )
local f43_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
local f43_local1 = f43_local0.exclusiveController
if not f43_local1 then
f43_local1 = Engine.GetFirstActiveController()
end
local f43_local2 = Cac.GetSquadMemberName( f43_local1, Cac.GetSquadLoc(), Cac.GetActiveSquadMember( f43_local1 ) ) or ""
local f43_local3 = Engine.Localize( "@LUA_MENU_PLAYING_AS", Engine.MarkLocalized( f43_local2 ) )
local f43_local4 = element
local f43_local5 = element.setText
if f43_local2 then
local f43_local6 = f43_local3
end
f43_local5( f43_local4, f43_local6 or "" )
end )
end
return self
end
function UpdateRestrictionsIcon( f44_arg0, f44_arg1 )
local f44_local0 = f44_arg1.controller
if not f44_arg1.controller then
f44_local0 = Engine.GetFirstActiveController()
end
local f44_local1 = "loadouts"
local f44_local2 = "privateMatchSquadMembers"
local f44_local3 = Cac.GetActiveSquadMember( f44_local0 )
local f44_local4 = true
if MatchRules.AllowCustomClasses( f44_local1 ) then
for f44_local5 = 0, Cac.Settings.DataLoc[f44_local2].maxClassSlots - 1, 1 do
if not MatchRules.CustomClassIsRestricted( f44_local0, CoD.GetStatsGroupForGameMode(), f44_local2, f44_local3, f44_local1, f44_local5 ) then
f44_local4 = false
break
end
end
if f44_local4 then
f44_arg0:animateToState( f44_arg1.inFocus and "expand" or "default" )
f44_arg0:animateToState( "visible" )
end
f44_arg0:animateToState( "default" )
end
end
function lobby_restriction_icon( f45_arg0, f45_arg1 )
return {
type = "UIImage",
id = "weapon_restriction_icon",
states = {
default = {
rightAnchor = true,
leftAnchor = false,
topAnchor = false,
bottomAnchor = true,
right = 32,
bottom = -7,
width = 32,
height = 32,
material = RegisterMaterial( "icon_new_3" ),
alpha = 0
},
expand = {
rightAnchor = true,
leftAnchor = false,
topAnchor = false,
bottomAnchor = true,
right = 71,
bottom = -7,
width = 32,
height = 32,
material = RegisterMaterial( "icon_new_3" ),
alpha = 0
},
visible = {
alpha = 1
}
},
handlers = {
update_restrictions_icon = UpdateRestrictionsIcon,
menu_create = UpdateRestrictionsIcon
}
}
end
LUI.MenuBuilder.registerType( "lobby_status", lobby_status )
LUI.MenuBuilder.registerType( "lobby_search_status", lobby_search_status )
LUI.MenuBuilder.registerDef( "theater_recording_widget", theater_recording_widget )
LUI.MenuBuilder.registerDef( "leaveprelobbywarning", leaveprelobbywarning )
LUI.MenuBuilder.registerDef( "leavelobbywarning", leavelobbywarning )
LUI.MenuBuilder.registerDef( "leavelobbyandpartywarning", leavelobbyandpartywarning )
LUI.MenuBuilder.registerDef( "global_activity_map", global_activity_map )
LUI.MenuBuilder.registerDef( "mpLobbyWidgets", mpLobbyWidgets )
LUI.MenuBuilder.registerDef( "rank_icon_name", rank_icon_name )
LUI.MenuBuilder.registerDef( "leavelobbyblockedplayerwarning", leavelobbyblockedplayerwarning )
LUI.MenuBuilder.registerDef( "map_info_text", map_info_text )
LUI.MenuBuilder.registerDef( "map_digital_anim", map_digital_anim )
LUI.MenuBuilder.registerDef( "leavelobbybadsquad", leavelobbybadsquad )
LUI.MenuBuilder.registerDef( "lobby_loading_widget", lobby_loading_widget )
LUI.MenuBuilder.registerDef( "lobby_game_type_title", lobby_game_type_title )
LUI.MenuBuilder.registerType( "lobby_game_type_icon", lobby_game_type_icon )
LUI.MenuBuilder.registerType( "character_playing_as", character_playing_as )
LUI.MenuBuilder.registerDef( "leavelobbybadsquadmap", leavelobbybadsquadmap )
LUI.MenuBuilder.registerDef( "lobby_restriction_icon", lobby_restriction_icon )
LockTable( _M )