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

1048 lines
31 KiB
Lua

local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 64
f0_local1 = 410
f0_local2 = 25
local f0_local3 = 250
local f0_local4 = Engine.Localize( "@LUA_MENU_MAX" )
local f0_local5 = Engine.Localize( "@LUA_MENU_SCORE" )
local f0_local6 = Engine.Localize( "@LUA_MENU_K_FOR_KILLS_CAPS" )
local f0_local7 = Engine.Localize( "@LUA_MENU_D_FOR_DEATHS_CAPS" )
local f0_local8 = Engine.Localize( "@LUA_MENU_A_FOR_ASSISTS_CAPS" )
local f0_local9 = Engine.Localize( "@LUA_MENU_C_FOR_CAPTURES_CAPS" )
local f0_local10 = Engine.Localize( "@LUA_MENU_P_FOR_PLANTS_CAPS" )
local f0_local11 = Engine.Localize( "@LUA_MENU_T_FOR_TAGS_CAPS" )
local f0_local12 = Engine.Localize( "@LUA_MENU_R_FOR_RESCUES_CAPS" )
local f0_local13 = Engine.Localize( "@LUA_MENU_T_FOR_TIME_CAPS" )
local f0_local14 = Engine.Localize( "@LUA_MENU_S_FOR_SECONDS" )
local f0_local15 = Engine.Localize( "@LUA_MENU_M_FOR_MINUTES" )
local f0_local16 = Engine.Localize( "@LUA_MENU_S_FOR_SCORES_CAPS" )
local f0_local17 = Engine.Localize( "@LUA_MENU_C_FOR_CRATES_CAPS" )
local f0_local18 = Engine.Localize( "@LUA_MENU_R_FOR_REVIVES_CAPS" )
local f0_local19 = Engine.Localize( "@PATCH_MENU_S_FOR_STREAK_CAPS" )
local f0_local20 = Engine.Localize( "@PATCH_MENU_S_FOR_STABS_CAPS" )
local f0_local21 = {}
local f0_local22 = Engine.Localize( "@LUA_MENU_1ST" )
local f0_local23 = Engine.Localize( "@LUA_MENU_2ND" )
local f0_local24 = Engine.Localize( "@LUA_MENU_3RD" )
local f0_local25 = Engine.Localize( "@LUA_MENU_4TH" )
local f0_local26 = Engine.Localize( "@LUA_MENU_5TH" )
local f0_local27 = Engine.Localize( "@LUA_MENU_6TH" )
local f0_local28 = Engine.Localize( "@LUA_MENU_7TH" )
local f0_local29 = Engine.Localize( "@LUA_MENU_8TH" )
local f0_local30 = Engine.Localize( "@LUA_MENU_9TH" )
local f0_local31 = Engine.Localize( "@LUA_MENU_10TH" )
local f0_local32 = Engine.Localize( "@LUA_MENU_11TH" )
local f0_local33 = Engine.Localize( "@LUA_MENU_12TH" )
local f0_local34 = Engine.Localize( "@LUA_MENU_13TH" )
local f0_local35 = Engine.Localize( "@LUA_MENU_14TH" )
local f0_local36 = Engine.Localize( "@LUA_MENU_15TH" )
local f0_local37 = Engine.Localize( "@LUA_MENU_16TH" )
local f0_local38 = Engine.Localize( "@LUA_MENU_17TH" )
local f0_local39 = Engine.Localize( "@LUA_MENU_18TH" )
f0_local21 = f0_local22
f0_local22 = function ( f1_arg0, f1_arg1 )
if f1_arg0.current_state ~= "inactive" then
f1_arg0:animateToState( "inactive", 0 )
f1_arg0.current_state = "inactive"
elseif f1_arg0.current_state ~= "default" then
f1_arg0:animateToState( "default", 0 )
f1_arg0.current_state = "default"
f1_arg0:processEvent( {
name = "hud_on"
} )
end
end
f0_local23 = function ( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg0.score
if f2_local0 >= 10000 then
f2_local0 = 9999
end
local f2_local1 = f2_arg0.kills
if f2_arg1 ~= "horde" then
if f2_local1 >= 100 then
f2_local1 = 99
end
elseif f2_local1 >= 1000 then
f2_local1 = 999
end
local f2_local2 = f2_arg0.deaths
if f2_local2 >= 100 then
f2_local2 = 99
end
local f2_local3 = f2_arg0.assists
if f2_arg1 ~= "horde" then
if f2_local3 >= 100 then
f2_local3 = 99
end
elseif f2_local3 >= 1000 then
f2_local3 = 999
end
local f2_local4 = f2_arg0.extrascore0
if f2_arg1 ~= "infect" then
if not (f2_arg1 ~= "dm" and (f2_arg1 ~= "cranked" or not GameX.gameModeIsFFA())) or f2_arg1 == "sotf_ffa" then
f2_local4 = Game.GetOmnvar( "ui_game_type_kill_value" )
if not f2_local4 then
f2_local4 = 0
end
f2_local4 = f2_local4 * f2_local0
if f2_local4 >= 10000 then
f2_local4 = 9999
end
elseif f2_local4 >= 100 then
f2_local4 = 99
end
end
return f2_local0, f2_local1, f2_local2, f2_local3, f2_local4
end
f0_local24 = function ( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg0:getParent()
if f3_local0.current_state == "inactive" then
return
end
local f3_local1 = Engine.GetDvarString( "ui_gametype" )
local f3_local2 = Game.GetPlayerScoreRanking() or 1
local f3_local3 = Game.GetPlayerScoreInfoAtRank( Game.GetPlayerTeam(), f3_local2 )
if f3_local3 ~= nil then
local f3_local4 = f3_arg0:getChildById( "playerInfoPlaceTextId" )
f3_local4:setText( f3_local2 )
local f3_local5 = f3_arg0:getChildById( "playerInfoHeaderRowId" )
local f3_local6 = f3_local5:getChildById( "playerInfoDeathsTextId" )
local f3_local7 = f3_local5:getChildById( "playerInfoAssistsTextId" )
local f3_local8 = f3_arg0:getChildById( "playerInfoRowId" )
local f3_local9 = f3_local8:getChildById( "playerInfoScoreValueId" )
local f3_local10 = f3_local8:getChildById( "playerInfoKillsValueId" )
local f3_local11 = f3_local8:getChildById( "playerInfoDeathsValueId" )
local f3_local12 = f3_local8:getChildById( "playerInfoAssistsValueId" )
local f3_local13, f3_local14, f3_local15, f3_local16, f3_local17 = f0_local23( f3_local3, f3_local1 )
if f3_local1 == "war" then
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local16 )
f3_local7:setText( f0_local8 )
elseif f3_local1 == "dom" then
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local17 )
f3_local7:setText( f0_local9 )
elseif f3_local1 == "sd" then
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local17 )
f3_local7:setText( f0_local10 )
elseif f3_local1 == "conf" then
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local17 )
f3_local7:setText( f0_local11 )
elseif f3_local1 == "dm" then
f3_local9:setText( f3_local17 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local16 )
f3_local7:setText( f0_local19 )
elseif f3_local1 == "mugger" then
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local16 )
f3_local7:setText( f0_local11 )
elseif f3_local1 == "sr" then
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local17 )
f3_local7:setText( f0_local12 )
elseif f3_local1 == "blitz" then
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local17 )
f3_local7:setText( f0_local9 )
elseif f3_local1 == "cranked" then
if GameX.gameModeIsFFA() then
f3_local9:setText( f3_local17 )
else
f3_local9:setText( f3_local13 )
end
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local16 )
f3_local7:setText( f0_local8 )
elseif f3_local1 == "sotf" then
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local16 )
f3_local7:setText( f0_local8 )
elseif f3_local1 == "sotf_ffa" then
f3_local9:setText( f3_local17 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local16 )
f3_local7:setText( f0_local19 )
elseif f3_local1 == "gun" then
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local7:setText( f0_local20 )
f3_local12:setText( f3_local16 )
elseif f3_local1 == "infect" then
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( CoD.FormatInfectedTime( f3_local17 ) )
f3_local7:setText( f0_local13 )
elseif f3_local1 == "grind" then
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local17 )
f3_local7:setText( f0_local16 )
elseif f3_local1 == "horde" then
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local16 )
f3_local6:setText( f0_local18 )
f3_local12:setText( f3_local17 )
f3_local7:setText( f0_local17 )
elseif f3_local1 == "siege" then
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local17 )
f3_local7:setText( f0_local9 )
else
f3_local9:setText( f3_local13 )
f3_local10:setText( f3_local14 )
f3_local11:setText( f3_local15 )
f3_local12:setText( f3_local16 )
f3_local7:setText( f0_local8 )
end
end
end
f0_local25 = function ( f4_arg0, f4_arg1 )
local f4_local0 = Game.GetPlayerScoreRanking()
if not f4_local0 then
return
end
local f4_local1 = f4_arg0.last_rank ~= 1
local f4_local2 = f4_local0 ~= 1
if f4_local1 ~= f4_local2 then
if f4_local2 then
f4_arg0:dispatchEventToRoot( {
name = "open_rival_info",
immediate = true
} )
else
f4_arg0:dispatchEventToRoot( {
name = "close_rival_info",
immediate = true
} )
end
end
f4_arg0.last_rank = f4_local0
if f4_local0 > 1 then
local f4_local3 = Game.GetPlayerScoreInfoAtRank( Game.GetPlayerTeam(), f4_local0 - 1 )
if not f4_local3 then
return
end
local f4_local4 = f4_arg0:getChildById( "rivalInfoRowId" )
if f4_local3 ~= nil then
local f4_local5 = f4_arg0:getChildById( "rivalInfoPlaceTextId" )
f4_local5:setText( f0_local21[f4_local0 - 1] )
f4_local5 = f4_local4:getChildById( "rivalInfoScoreValueId" )
local f4_local6 = f4_local4:getChildById( "rivalInfoKillsValueId" )
local f4_local7 = f4_local4:getChildById( "rivalInfoDeathsValueId" )
local f4_local8 = f4_local4:getChildById( "rivalInfoAssistsValueId" )
local f4_local9 = Engine.GetDvarString( "ui_gametype" )
local f4_local10, f4_local11, f4_local12, f4_local13, f4_local14 = f0_local23( f4_local3, f4_local9 )
if f4_local9 == "war" then
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local13 )
elseif f4_local9 == "dom" then
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local14 )
elseif f4_local9 == "sd" then
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local14 )
elseif f4_local9 == "conf" then
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local14 )
elseif f4_local9 == "dm" then
f4_local5:setText( f4_local14 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local13 )
elseif f4_local9 == "mugger" then
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local13 )
elseif f4_local9 == "sr" then
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local14 )
elseif f4_local9 == "blitz" then
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local14 )
elseif f4_local9 == "cranked" then
if GameX.gameModeIsFFA() then
f4_local5:setText( f4_local14 )
else
f4_local5:setText( f4_local10 )
end
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local13 )
elseif f4_local9 == "sotf" then
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local13 )
elseif f4_local9 == "sotf_ffa" then
f4_local5:setText( f4_local14 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local13 )
elseif f4_local9 == "gun" then
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local13 )
elseif f4_local9 == "infect" then
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( CoD.FormatInfectedTime( f4_local14 ) )
elseif f4_local9 == "grind" then
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local14 )
elseif f4_local9 == "siege" then
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local14 )
else
f4_local5:setText( f4_local10 )
f4_local6:setText( f4_local11 )
f4_local7:setText( f4_local12 )
f4_local8:setText( f4_local13 )
end
local f4_local15 = f4_local3.name
local f4_local16 = f4_arg0:getChildById( "rivalInfoNameId" )
f4_local16:setText( f4_local15 )
if f4_arg1.name == "hud_on" then
f4_arg0:dispatchEventToRoot( {
name = "open_rival_info",
immediate = true
} )
end
end
end
end
f0_local26 = function ()
local f5_local0 = Engine.GetDvarString( "ui_gametype" ) == "horde"
local f5_local1 = RegisterMaterial( "hud_player_info_bg" )
local f5_local2 = 50
local f5_local3
if f5_local0 then
f5_local3 = 42
if not f5_local3 then
else
local f5_local4
if f5_local0 then
f5_local4 = 42
if not f5_local4 then
else
local f5_local5
if f5_local0 then
f5_local5 = 42
if not f5_local5 then
else
local f5_local6 = 11
local f5_local7 = 250
local self = LUI.UIElement.new( {
topAnchor = true,
rightAnchor = true,
top = 0,
right = 0,
height = 64,
width = 256,
alpha = 1
} )
self.id = "playerInfoId"
self:registerAnimationState( "showrival", {
topAnchor = true,
rightAnchor = true,
top = 15
} )
self:registerEventHandler( "player_info_refresh", f0_local24 )
self:registerEventHandler( "open_rival_info", MBh.AnimateSequence( {
{
"default",
0
},
{
"showrival",
f0_local3 / 4
}
} ) )
self:registerEventHandler( "close_rival_info", MBh.AnimateSequence( {
{
"showrival",
0
},
{
"showrival",
f0_local3 * 3 / 4
},
{
"default",
f0_local3 / 4
}
} ) )
local f5_local9 = LUI.UIImage.new()
f5_local9.id = "playerInfoBgId"
f5_local9:registerAnimationState( "default", {
topAnchor = true,
rightAnchor = true,
top = 0,
right = 0,
height = 64,
width = 0,
material = f5_local1,
alpha = 0
} )
f5_local9:animateToState( "default", 0 )
f5_local9:registerAnimationState( "active", {
topAnchor = true,
rightAnchor = true,
top = 0,
right = 0,
height = 64,
width = 256,
material = f5_local1,
alpha = 1
} )
f5_local9:registerAnimationState( "opening", {
topAnchor = true,
rightAnchor = true,
top = 0,
right = 0,
height = 64,
width = 296,
material = f5_local1,
alpha = 1
} )
f5_local9:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"opening",
f5_local7 / 2
},
{
"active",
f5_local7 / 2
}
} ) )
local f5_local10 = LUI.UIText.new()
f5_local10.id = "player_info_place_text_bg"
f5_local10:setText( "8" )
f5_local10:registerAnimationState( "default", {
topAnchor = true,
rightAnchor = true,
top = 15,
right = -186,
height = CoD.TextSettings.HudDigitalExtraBigFont.Height,
width = 40,
font = CoD.TextSettings.HudDigitalExtraBigFont.Font,
alignment = LUI.Alignment.Right,
red = 0,
blue = 0,
green = 0,
alpha = 0.25
} )
f5_local10:animateToState( "default", 0 )
local f5_local11 = LUI.UIText.new()
f5_local11.id = "playerInfoPlaceTextId"
f5_local11:setText( "" )
f5_local11:registerAnimationState( "default", {
topAnchor = true,
rightAnchor = true,
top = 15,
right = -186,
height = CoD.TextSettings.HudDigitalExtraBigFont.Height,
width = 40,
font = CoD.TextSettings.HudDigitalExtraBigFont.Font,
alignment = LUI.Alignment.Right,
alpha = 0
} )
f5_local11:animateToState( "default", 0 )
f5_local11:registerAnimationState( "active", {
alpha = 1
} )
f5_local11:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
500
}
} ) )
local f5_local12 = LUI.UIHorizontalList.new()
f5_local12.id = "playerInfoHeaderRowId"
f5_local12:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 15,
right = 0,
height = CoD.TextSettings.HudEuroConRegSmallFont.Height,
spacing = f5_local6,
alignment = LUI.Alignment.Right,
alpha = 0
} )
f5_local12:animateToState( "default", 0 )
f5_local12:registerAnimationState( "active", {
alpha = 1
} )
f5_local12:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
500
}
} ) )
local f5_local13 = LUI.UIElement.new()
f5_local13.id = "player_header_hl_spacer1"
f5_local13:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = 7
} )
f5_local13:animateToState( "default", 0 )
local f5_local14 = LUI.UIText.new()
f5_local14.id = "playerInfoAssistsTextId"
f5_local14:setText( f0_local8 )
f5_local14:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = f5_local5,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right
} )
f5_local14:animateToState( "default", 0 )
local f5_local15 = LUI.UIText.new()
f5_local15.id = "playerInfoDeathsTextId"
f5_local15:setText( f0_local7 )
f5_local15:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = f5_local4,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right
} )
f5_local15:animateToState( "default", 0 )
local f5_local16 = LUI.UIText.new()
f5_local16.id = "playerInfoKillsTextId"
f5_local16:setText( f0_local6 )
f5_local16:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = f5_local3,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right
} )
f5_local16:animateToState( "default", 0 )
local f5_local17 = LUI.UIText.new()
f5_local17.id = "playerInfoScoreTextId"
f5_local17:setText( f0_local5 )
f5_local17:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = f5_local2,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right
} )
f5_local17:animateToState( "default", 0 )
f5_local12:addElement( f5_local13 )
f5_local12:addElement( f5_local14 )
f5_local12:addElement( f5_local15 )
f5_local12:addElement( f5_local16 )
if not f5_local0 then
f5_local12:addElement( f5_local17 )
end
local f5_local18 = LUI.UIHorizontalList.new()
f5_local18.id = "playerInfoRowId"
f5_local18:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 32,
left = 0,
bottom = 25 + CoD.TextSettings.HudEuroConRegSmallFont.Height,
right = 0,
spacing = f5_local6,
alignment = LUI.Alignment.Right,
alpha = 0
} )
f5_local18:animateToState( "default", 0 )
f5_local18:registerAnimationState( "active", {
alpha = 1
} )
f5_local18:registerEventHandler( "hud_on", MBh.AnimateSequence( {
{
"default",
0
},
{
"active",
750
}
} ) )
local f5_local19 = LUI.UIElement.new()
f5_local19.id = "player_info_hl_spacer1"
f5_local19:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = 7
} )
f5_local19:animateToState( "default", 0 )
local f5_local20 = LUI.UIText.new()
f5_local20.id = "playerInfoAssistsValueId"
f5_local20:setText( "" )
f5_local20:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
bottom = CoD.TextSettings.HudEuroConRegSmallFont.Height,
right = f5_local5,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 0,
blue = 0,
alpha = 1
} )
f5_local20:animateToState( "default", 0 )
local f5_local21 = LUI.UIText.new()
f5_local21.id = "playerInfoDeathsValueId"
f5_local21:setText( "" )
f5_local21:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
bottom = CoD.TextSettings.HudEuroConRegSmallFont.Height,
right = f5_local4,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 0,
blue = 0,
alpha = 1
} )
f5_local21:animateToState( "default", 0 )
local f5_local22 = LUI.UIText.new()
f5_local22.id = "playerInfoKillsValueId"
f5_local22:setText( "" )
f5_local22:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
bottom = CoD.TextSettings.HudEuroConRegSmallFont.Height,
right = f5_local3,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 0,
blue = 0,
alpha = 1
} )
f5_local22:animateToState( "default", 0 )
local f5_local23 = LUI.UIText.new()
f5_local23.id = "playerInfoScoreValueId"
f5_local23:setText( "" )
f5_local23:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
bottom = CoD.TextSettings.HudEuroConRegSmallFont.Height,
right = f5_local2,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 0,
blue = 0,
alpha = 1
} )
f5_local23:animateToState( "default", 0 )
f5_local18:addElement( f5_local19 )
f5_local18:addElement( f5_local20 )
f5_local18:addElement( f5_local21 )
f5_local18:addElement( f5_local22 )
if not f5_local0 then
f5_local18:addElement( f5_local23 )
end
self:addElement( f5_local9 )
self:addElement( f5_local10 )
self:addElement( f5_local11 )
self:addElement( f5_local12 )
self:addElement( f5_local18 )
return self
end
end
f5_local5 = 25
end
end
f5_local4 = 25
end
end
f5_local3 = 25
end
f0_local27 = function ()
local f6_local0 = RegisterMaterial( "hud_rival_info_bg" )
local f6_local1 = 50
local f6_local2 = 25
local f6_local3 = 25
local f6_local4 = 25
local f6_local5 = 13
local self = LUI.UIElement.new()
self.id = "rivalInfoId"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 10,
height = f0_local2,
right = 0,
width = 0,
alpha = 0
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "active", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 10,
height = f0_local2,
right = 0,
width = 410,
alpha = 1
} )
self:registerAnimationState( "opening", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 10,
height = f0_local2,
right = 0,
width = 450,
alpha = 1
} )
self:registerEventHandler( "menu_create", f0_local25 )
self:registerEventHandler( "player_info_refresh", f0_local25 )
self:registerEventHandler( "hud_on", f0_local25 )
self:registerEventHandler( "hud_off", MBh.AnimateToState( "default", 0 ) )
self:registerEventHandler( "open_rival_info", MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
f0_local3 / 4
},
{
"opening",
f0_local3 / 2
},
{
"active",
f0_local3 / 4
}
} ) )
self:registerEventHandler( "close_rival_info", MBh.AnimateSequence( {
{
"active",
0
},
{
"default",
f0_local3 * 3 / 4
}
} ) )
local f6_local7 = LUI.UIImage.new()
f6_local7.id = "rivalInfoBgId"
f6_local7:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
material = f6_local0
} )
f6_local7:animateToState( "default", 0 )
local f6_local8 = LUI.UIText.new()
f6_local8.id = "rivalInfoPlaceTextId"
f6_local8:setText( "" )
f6_local8:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 3,
right = -379,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
width = 40,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Right,
red = 0,
green = 0,
blue = 0
} )
f6_local8:animateToState( "default", 0 )
local f6_local9 = LUI.UIMarqueeText.new()
f6_local9.id = "rivalInfoNameId"
f6_local9:setText( "" )
f6_local9:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 3,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
right = -215,
width = 150,
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
alignment = LUI.Alignment.Left
} )
f6_local9:animateToState( "default", 0 )
local f6_local10 = LUI.UIHorizontalList.new()
f6_local10.id = "rivalInfoRowId"
f6_local10:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 3,
left = 0,
right = 0,
height = CoD.TextSettings.HudEuroConRegSmallFont.Height,
spacing = f6_local5,
alignment = LUI.Alignment.Right
} )
f6_local10:animateToState( "default", 0 )
local f6_local11 = LUI.UIElement.new()
f6_local11.id = "rival_info_hl_spacer1"
f6_local11:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
bottom = 0,
right = 15
} )
f6_local11:animateToState( "default", 0 )
local f6_local12 = LUI.UIText.new()
f6_local12.id = "rivalInfoAssistsValueId"
f6_local12:setText( "" )
f6_local12:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
bottom = CoD.TextSettings.HudEuroConRegSmallFont.Height,
right = f6_local4,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Right
} )
f6_local12:animateToState( "default", 0 )
local f6_local13 = LUI.UIText.new()
f6_local13.id = "rivalInfoDeathsValueId"
f6_local13:setText( "" )
f6_local13:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
bottom = CoD.TextSettings.HudEuroConRegSmallFont.Height,
right = f6_local3,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Right
} )
f6_local13:animateToState( "default", 0 )
local f6_local14 = LUI.UIText.new()
f6_local14.id = "rivalInfoKillsValueId"
f6_local14:setText( "" )
f6_local14:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
bottom = CoD.TextSettings.HudEuroConRegSmallFont.Height,
right = f6_local2,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Right
} )
f6_local14:animateToState( "default", 0 )
local f6_local15 = LUI.UIText.new()
f6_local15.id = "rivalInfoScoreValueId"
f6_local15:setText( "" )
f6_local15:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 0,
left = 0,
bottom = CoD.TextSettings.HudEuroConRegSmallFont.Height,
right = f6_local1,
font = CoD.TextSettings.HudEuroConRegSmallFont.Font,
alignment = LUI.Alignment.Right
} )
f6_local15:animateToState( "default", 0 )
f6_local10:addElement( f6_local11 )
f6_local10:addElement( f6_local12 )
f6_local10:addElement( f6_local13 )
f6_local10:addElement( f6_local14 )
f6_local10:addElement( f6_local15 )
self:addElement( f6_local7 )
self:addElement( f6_local8 )
self:addElement( f6_local9 )
self:addElement( f6_local10 )
return self
end
LUI.MenuBuilder.registerType( "playerInfoHudDef", function ()
local self = LUI.UIElement.new()
self.id = "playerInfoHud"
self:registerAnimationState( "default", {
topAnchor = true,
rightAnchor = true,
top = 0,
right = 0,
height = f0_local0,
width = f0_local1,
alpha = 1
} )
self:animateToState( "default", 0 )
self:registerAnimationState( "inactive", {
alpha = 0
} )
self:registerEventHandler( "toggle_scoreboard", f0_local22 )
self:registerEventHandler( "keybind", function ( element, event )
if event.command == "togglescores" or event.command == "+scores" then
f0_local22( element, event )
end
end )
if not GameX.IsHardcoreMode() then
local f7_local1 = LUI.UITimer.new( 200, "player_info_refresh", "hud" )
f7_local1.id = "playerInfoRefreshTimer"
local f7_local2 = Engine.GetDvarString( "ui_gametype" )
self:addElement( f7_local1 )
self:addElement( f0_local26() )
if f7_local2 ~= "horde" then
self:addElement( f0_local27() )
end
end
if not MLG.IsMLGSpectator() then
self:addElement( LUI.MenuBuilder.buildItems( {
type = "obituaryHudDef"
}, self.properties, self ) )
end
return self
end )
LockTable( _M )