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

1406 lines
36 KiB
Lua

local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
ScoreboardLUT = {
File = "mp/alien/scoreboard_string_lookup.csv",
Cols = {
Ref = 0,
String = 1
}
}
bgPalette = {
Dark = {
EvenRow = {
EvenCol = {
r = 0.2,
g = 0.2,
b = 0.2,
a = 0.8
},
OddCol = {
r = 0.1,
g = 0.1,
b = 0.1,
a = 0.8
}
},
OddRow = {
EvenCol = {
r = 0.14,
g = 0.14,
b = 0.14,
a = 0.8
},
OddCol = {
r = 0.07,
g = 0.07,
b = 0.07,
a = 0.8
}
}
},
DarkUniform = {
EvenRow = {
EvenCol = {
r = 0.14,
g = 0.14,
b = 0.14,
a = 0.8
},
OddCol = {
r = 0.14,
g = 0.14,
b = 0.14,
a = 0.8
}
},
OddRow = {
EvenCol = {
r = 0.14,
g = 0.14,
b = 0.14,
a = 0.8
},
OddCol = {
r = 0.14,
g = 0.14,
b = 0.14,
a = 0.8
}
}
},
Bright = {
EvenRow = {
EvenCol = {
r = 1,
g = 1,
b = 1,
a = 0.5
},
OddCol = {
r = 0.75,
g = 0.75,
b = 0.75,
a = 0.5
}
},
OddRow = {
EvenCol = {
r = 1,
g = 1,
b = 1,
a = 0.5
},
OddCol = {
r = 0.75,
g = 0.75,
b = 0.75,
a = 0.5
}
}
},
BrightUniform = {
EvenRow = {
EvenCol = {
r = 1,
g = 1,
b = 1,
a = 0.5
},
OddCol = {
r = 1,
g = 1,
b = 1,
a = 0.5
}
},
OddRow = {
EvenCol = {
r = 1,
g = 1,
b = 1,
a = 0.5
},
OddCol = {
r = 1,
g = 1,
b = 1,
a = 0.5
}
}
}
}
function table_row_factory( f1_arg0 )
local self = LUI.UIHorizontalList.new()
self.id = "row"
local f1_local1 = {}
for f1_local16, f1_local17 in ipairs( f1_arg0 ) do
if f1_local16 == 1 then
local f1_local5 = LUI.UIElement.new()
f1_local5.id = "cap"
f1_local5:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
right = 20
} )
f1_local5:animateToState( "default" )
local f1_local6 = LUI.UIImage.new()
f1_local6.id = "cap_img"
f1_local6:registerAnimationState( "default", CoD.ColorizeState( f1_local17.bgColor, {
material = RegisterMaterial( "box_scoreboard_ltcap" ),
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = -2,
left = -4,
width = 24,
height = 24
} ) )
f1_local6:animateToState( "default" )
f1_local5:addElement( f1_local6 )
local f1_local7 = LUI.UIImage.new()
f1_local7.id = "cap_fill"
f1_local7:registerAnimationState( "default", CoD.ColorizeState( f1_local17.bgColor, {
material = RegisterMaterial( "white" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 19,
left = 0,
right = 0,
bottom = 0
} ) )
f1_local7:animateToState( "default" )
f1_local5:addElement( f1_local7 )
self:addElement( f1_local5 )
f1_local17.width = f1_local17.width - 20
end
local f1_local5 = LUI.UIElement.new()
f1_local5.id = "col_" .. f1_local16
f1_local5:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
right = f1_local17.width
} )
f1_local5:animateToState( "default" )
self:addElement( f1_local5 )
local f1_local6 = LUI.UIImage.new()
f1_local6.id = "bg"
f1_local6:registerAnimationState( "default", CoD.ColorizeState( f1_local17.bgColor, {
material = RegisterMaterial( "white" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
} ) )
f1_local6:animateToState( "default" )
f1_local5:addElement( f1_local6 )
if f1_local17.text then
local f1_local7 = CoD.TextSettings.SmallFont
if f1_local17.pretty then
f1_local5.text = LUI.UIPrettyNumber.new( nil, f1_local17.pretty )
f1_local5.text:setValue( f1_local17.text )
else
if f1_local17.marquee then
f1_local5.text = LUI.UIMarqueeText.new()
else
f1_local5.text = LUI.UIText.new()
end
f1_local5.text:setText( f1_local17.text )
end
f1_local5.text.id = "text"
local f1_local8 = f1_local5.text
local f1_local9 = f1_local8
f1_local8 = f1_local8.registerAnimationState
local f1_local10 = "default"
local f1_local11 = CoD.ColorizeState
local f1_local12 = f1_local17.fgColor
local f1_local13 = {
font = f1_local7.Font,
alignment = f1_local17.align,
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true
}
local f1_local14 = f1_local17.textOffset or 0
local f1_local15
if f1_local16 == 1 then
f1_local15 = -10
if not f1_local15 then
else
f1_local13.left = f1_local14 + f1_local15
f1_local13.top = -f1_local7.Height / 2
f1_local13.right = -10
f1_local13.height = f1_local7.Height
f1_local8( f1_local9, f1_local10, f1_local11( f1_local12, f1_local13 ) )
f1_local5.text:animateToState( "default" )
f1_local5:addElement( f1_local5.text )
end
end
f1_local15 = 10
end
table.insert( f1_local1, f1_local5 )
end
self.getColumn = function ( f2_arg0 )
return f1_local1[f2_arg0]
end
return self
end
function table_factory( f3_arg0, f3_arg1, f3_arg2, f3_arg3 )
local f3_local0 = 0
for f3_local4, f3_local5 in ipairs( f3_arg1 ) do
f3_local0 = f3_local0 + f3_local5
end
assert( 0 < f3_local0, "Invalid table width" )
assert( 0 < f3_arg0, "Invalid table row height" )
self = LUI.UIElement.new()
self.id = "table_widget"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
} )
self:animateToState( "default" )
f3_local2 = LUI.UIVerticalList.new()
f3_local2.headers = 0
f3_local2.rows = 0
f3_local2:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
width = f3_local0,
spacing = f3_arg2 or 6,
alignment = f3_arg3
} )
f3_local2:animateToState( "default" )
self:addElement( f3_local2 )
self.addHeader = function ( f4_arg0, f4_arg1 )
f3_local2.headers = f3_local2.headers + 1
local f4_local0 = table_row_factory( {
{
width = f3_local0,
text = f4_arg0,
align = f4_arg1 or LUI.Alignment.Center,
bgColor = bgPalette.Bright.EvenRow.EvenCol,
fgColor = {
r = 0,
g = 0,
b = 0,
a = 1
},
marquee = false
}
} )
f4_local0.id = "header_" .. f3_local2.headers
f4_local0:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
right = 0,
height = f3_arg0
} )
f4_local0:animateToState( "default" )
f3_local2:addElement( f4_local0 )
return f4_local0
end
self.addRow = function ( f5_arg0, f5_arg1, f5_arg2 )
f3_local2.rows = f3_local2.rows + 1
local f5_local0 = {}
assert( #f5_arg1 == #f3_arg1, "Wrong number of columns in dataset" )
for f5_local6, f5_local7 in ipairs( f5_arg1 ) do
local f5_local8 = table.insert
local f5_local9 = f5_local0
local f5_local10 = {
text = f5_local7.text,
textOffset = f5_local7.textOffset or 0,
width = f3_arg1[f5_local6]
}
local f5_local4 = f5_local7.color
if not f5_local4 then
f5_local4 = {
r = 0,
g = 0,
b = 0,
a = 1
}
end
f5_local10.fgColor = f5_local4
f5_local4 = f3_local2.rows % 2 and "EvenRow" or "OddRow"
local f5_local5 = f5_arg0[f5_local4]
f5_local10.bgColor = f5_local4[f5_local6 % 2 and "EvenCol" or "OddCol"]
f5_local4 = f5_local7.align
if not f5_local4 then
if f5_local6 == 1 then
f5_local4 = LUI.Alignment.Left
if not f5_local4 then
else
f5_local10.align = f5_local4
f5_local10.marquee = f5_local7.marquee or false
f5_local10.pretty = f5_local7.pretty or nil
f5_local8( f5_local9, f5_local10 )
end
end
f5_local4 = LUI.Alignment.Right
end
f5_local10.align = f5_local4
f5_local10.marquee = f5_local7.marquee or false
f5_local10.pretty = f5_local7.pretty or nil
f5_local8( f5_local9, f5_local10 )
end
f5_local1 = table_row_factory( f5_local0 )
f5_local1.id = "row_" .. f3_local2.rows
f3_local2:addElement( f5_local1 )
f5_local1:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
right = 0,
height = f3_arg0,
alpha = 1
} )
f5_local1:animateToState( "default" )
if f5_arg2 then
if type( f5_arg2 ) == "number" then
local f5_local11 = f5_arg2
end
f5_local2 = f5_local11 or 300
f5_local1:registerAnimationState( "intro", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
right = 0,
height = f3_arg0,
alpha = 0
} )
f5_local1:animateToState( "intro" )
f5_local3 = MBh.AnimateSequence( {
{
"intro",
f5_local2 * f3_local2:getNumChildren(),
false,
false
},
{
"default",
200,
true,
true
}
} )
f5_local3( f5_local1, {} )
end
return f5_local1
end
self.popRow = function ()
local f6_local0 = f3_local2:getLastChild()
f6_local0:close()
f3_local2.rows = f3_local2.rows - 1
end
return self
end
function pause_menu_scoreboard()
local f7_local0 = {
name = 1,
loadout = 2,
cash = 3,
score = 4
}
local f7_local1 = LUI.mp_menus.Aliens.IsChaosMode()
local f7_local2 = nil
if f7_local1 then
f7_local2 = table_factory( 28, {
330,
150,
68
} )
else
f7_local2 = table_factory( 28, {
330,
150,
68,
102
} )
end
f7_local2:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = GenericMenuDims.menu_top,
left = 540,
width = 0,
height = 0
} )
f7_local2:animateToState( "default" )
f7_local2.player_rows = 0
local self = LUI.UITimer.new( 250, {
name = "refresh_scoreboard",
dispatchChildren = true
}, nil, false, f7_local2, false )
self.id = "refreshTimer"
f7_local2:addElement( self )
local f7_local4 = {
{
text = Engine.Localize( "@ALIENS_PLAYER_CAPS" ),
align = LUI.Alignment.Center,
color = {
r = 0,
g = 0,
b = 0,
a = 1
}
},
{
text = Engine.Localize( "@ALIENS_ABILITIES_CAPS" ),
align = LUI.Alignment.Center,
color = {
r = 0,
g = 0,
b = 0,
a = 1
}
},
{
text = Engine.Localize( "@ALIENS_CASH_CAPS" ),
align = LUI.Alignment.Center,
color = {
r = 0,
g = 0,
b = 0,
a = 1
}
}
}
if not f7_local1 then
table.insert( f7_local4, {
text = Engine.Localize( "@ALIENS_SCORE_CAPS" ),
align = LUI.Alignment.Center,
color = {
r = 0,
g = 0,
b = 0,
a = 1
}
} )
end
f7_local2.addRow( bgPalette.Bright, f7_local4 )
local f7_local5 = function ( f8_arg0, f8_arg1 )
assert( f8_arg1.data, "Missing scoreboard data" )
local f8_local0 = LUI.mp_menus.Aliens
local f8_local1 = Game.GetPlayerScoreRanking()
local f8_local2 = f8_arg1.data.ranks[f8_arg0.rank]
local f8_local3 = f8_arg0.getColumn( f7_local0.name )
f8_local3.text:setText( f8_local2.name )
if f8_local2.client then
f8_local3 = f8_local0.GetPlayerCash( f8_local2.client )
local f8_local4 = f8_local0.GetScoreFromClient( f8_local2.client )
local f8_local5 = f8_arg0.getColumn( f7_local0.cash )
f8_local5.text:setText( f8_local3 )
if not f7_local1 then
f8_local5 = f8_arg0.getColumn( f7_local0.score )
f8_local5.text:setText( f8_local4 )
end
end
if f8_arg0.rank == f8_local1 then
f8_local3 = f8_arg0.getColumn( f7_local0.name )
f8_local3.text:registerAnimationState( "current", CoD.ColorizeState( Colors.alien_frontend_hilite, {} ) )
f8_local3 = f8_arg0.getColumn( f7_local0.name )
f8_local3.text:animateToState( "current" )
f8_local3 = f8_arg0.getColumn( f7_local0.cash )
f8_local3.text:registerAnimationState( "current", CoD.ColorizeState( Colors.alien_frontend_hilite, {} ) )
f8_local3 = f8_arg0.getColumn( f7_local0.cash )
f8_local3.text:animateToState( "current" )
if not f7_local1 then
f8_local3 = f8_arg0.getColumn( f7_local0.score )
f8_local3.text:registerAnimationState( "current", CoD.ColorizeState( Colors.alien_frontend_hilite, {} ) )
f8_local3 = f8_arg0.getColumn( f7_local0.score )
f8_local3.text:animateToState( "current" )
end
else
f8_local3 = f8_arg0.getColumn( f7_local0.name )
f8_local3.text:registerAnimationState( "current", CoD.ColorizeState( Colors.alien_scoreboard_bright_grey, {} ) )
f8_local3 = f8_arg0.getColumn( f7_local0.name )
f8_local3.text:animateToState( "current" )
f8_local3 = f8_arg0.getColumn( f7_local0.cash )
f8_local3.text:registerAnimationState( "current", CoD.ColorizeState( Colors.alien_scoreboard_dull_grey, {} ) )
f8_local3 = f8_arg0.getColumn( f7_local0.cash )
f8_local3.text:animateToState( "current" )
if not f7_local1 then
f8_local3 = f8_arg0.getColumn( f7_local0.score )
f8_local3.text:registerAnimationState( "current", CoD.ColorizeState( Colors.alien_scoreboard_bright_grey, {} ) )
f8_local3 = f8_arg0.getColumn( f7_local0.score )
f8_local3.text:animateToState( "current" )
end
end
if f8_local2.rankIcon and f8_local2.rank then
f8_local3 = f8_arg0.getColumn( f7_local0.name )
assert( f8_local3.rankIcon )
f8_local3.rankIcon:setImage( f8_local2.rankIcon )
assert( f8_local3.rankText )
f8_local3.rankText:setText( Rank.GetRankDisplay( f8_local2.rank, CoD.PlayMode.Aliens ) )
end
if f8_local2.client then
f8_local3 = f8_arg0.getColumn( f7_local0.loadout )
for f8_local4 = 1, 2, 1 do
f8_local3.children[f8_local4]:setImage( RegisterMaterial( f8_local0.GetFieldForPerk( f8_local0.GetPerkFromClient( f8_local2.client, f8_local4 - 1 ), f8_local0.AlienPerks.Cols.Icon ) ) )
end
for f8_local4 = 3, 6, 1 do
f8_local3.children[f8_local4]:setImage( RegisterMaterial( f8_local0.GetFieldForAbility( f8_local0.GetAbilityFromClient( f8_local2.client, f8_local0.AlienAbilities.Types[f8_local4 - 2] ), f8_local0.AlienAbilities.Cols.Icon ) ) )
end
end
end
f7_local2:registerEventHandler( "refresh_scoreboard", function ( element, event )
local f9_local0 = Game.GetPlayerTeam()
if GameX.IsSpectatingNotOnTeam() then
f9_local0 = spectatorFakeTeam
end
local f9_local1 = Game.GetNumPlayersOnTeam( f9_local0 )
for f9_local2 = f9_local1 + 1, f7_local2.player_rows, 1 do
local f9_local5 = f9_local2
f7_local2.popRow()
f7_local2.player_rows = f7_local2.player_rows - 1
end
for f9_local2 = f7_local2.player_rows + 1, f9_local1, 1 do
f7_local2.player_rows = f7_local2.player_rows + 1
local f9_local6 = {
{
text = "",
textOffset = 55,
align = LUI.Alignment.Left,
marquee = true
},
{},
{
text = ""
}
}
if not f7_local1 then
table.insert( f9_local6, {
text = ""
} )
end
local f9_local7 = f7_local2.addRow( bgPalette.Dark, f9_local6 )
f9_local7.rank = f9_local2
f9_local7:registerEventHandler( "refresh_scoreboard_row", f7_local5 )
local f9_local8 = f9_local7.getColumn( f7_local0.name )
local rankText = LUI.UIText.new()
rankText.id = "rankText"
rankText:registerAnimationState( "default", {
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 4,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
left = 0,
width = 20
} )
rankText:animateToState( "default" )
f9_local8:addElement( rankText )
f9_local8.rankText = rankText
local f9_local10 = 23
local rankIcon = LUI.UIImage.new()
rankIcon.id = "rankIcon"
rankIcon:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 2,
height = f9_local10,
left = 20,
width = f9_local10
} )
rankIcon:animateToState( "default" )
f9_local8:addElement( rankIcon )
f9_local8.rankIcon = rankIcon
local f9_local12 = f9_local7.getColumn( f7_local0.loadout )
local f9_local13 = 23
f9_local12.children = {}
for f9_local14 = 1, 6, 1 do
local f9_local17 = LUI.UIImage.new( {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 2,
height = f9_local13,
left = 4 + (f9_local13 + 1) * (f9_local14 - 1),
width = f9_local13
} )
f9_local17.id = "icon_" .. f9_local14
f9_local17:registerAnimationState( "hidden", {
alpha = 0
} )
if f7_local1 and f9_local14 < 5 then
f9_local17:animateToState( "hidden" )
end
f9_local12:addElement( f9_local17 )
table.insert( f9_local12.children, f9_local17 )
end
end
local f9_local2 = {
ranks = {}
}
for f9_local3 = 1, f7_local2.player_rows, 1 do
f9_local2.ranks[f9_local3] = Game.GetPlayerScoreInfoAtRank( f9_local0, f9_local3 )
end
element:processEvent( {
name = "refresh_scoreboard_row",
data = f9_local2
} )
end )
f7_local2:processEvent( {
name = "refresh_scoreboard"
} )
return f7_local2
end
function hive_bonus_scoreboard_internal()
local f10_local0 = table_factory( 21, {
240,
110
}, 4 )
f10_local0.id = "hive_bonus_scoreboard_internal"
f10_local0:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
width = 350,
height = 0,
alpha = 0
} )
f10_local0:registerAnimationState( "animating", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
top = 0,
right = -20,
width = 350,
height = 0,
alpha = 1
} )
f10_local0:registerAnimationState( "open", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
top = 0,
right = 0,
width = 350,
height = 0
} )
f10_local0:animateToState( "open" )
if not Engine.UsingSplitscreenUpscaling() then
f10_local0.addHeader( Engine.Localize( "@ALIENS_ROUND_SCORE_CAPS" ) )
end
local f10_local1 = 8
local f10_local2, f10_local3 = nil
for f10_local4 = 1, f10_local1, 1 do
local f10_local7 = Game.GetOmnvar( "ui_alien_encounter_title_row_" .. f10_local4 )
local f10_local8 = Game.GetOmnvar( "ui_alien_encounter_score_row_" .. f10_local4 )
if f10_local7 then
if f10_local7 <= 0 then
break
end
f10_local7 = Engine.TableLookup( ScoreboardLUT.File, ScoreboardLUT.Cols.Ref, f10_local7, ScoreboardLUT.Cols.String )
local f10_local9 = bgPalette.Dark
local f10_local10 = Colors.alien_scoreboard_dull_grey
local f10_local11 = Colors.alien_scoreboard_dull_grey
if f10_local4 == f10_local1 or Game.GetOmnvar( "ui_alien_encounter_title_row_" .. f10_local4 + 1 ) <= 0 then
f10_local9 = bgPalette.DarkUniform
f10_local10 = Colors.white
f10_local11 = Colors.frontend_hilite
elseif f10_local4 == f10_local1 - 1 or Game.GetOmnvar( "ui_alien_encounter_title_row_" .. f10_local4 + 2 ) <= 0 then
f10_local9 = bgPalette.BrightUniform
f10_local10 = Colors.black
f10_local11 = Colors.black
end
local f10_local12 = f10_local0.addRow( f10_local9, {
{
text = Engine.Localize( f10_local7 ),
color = f10_local10
},
{
text = f10_local8,
color = f10_local11
}
}, true )
if f10_local7 == "ALIEN_COLLECTIBLES_BONUS_MONEY_EARNED" then
f10_local2 = f10_local12
f10_local3 = f10_local8
end
end
end
if f10_local2 and f10_local3 then
local f10_local4 = f10_local2.getColumn( 2 )
local self = LUI.UIText.new()
self.id = "animatedMoney"
self:setText( f10_local3 )
self:registerAnimationState( "default", CoD.ColorizeState( Colors.frontend_hilite, {
font = CoD.TextSettings.SmallFont.Font,
alignment = LUI.Alignment.Right,
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 10,
top = 0,
right = -10,
height = CoD.TextSettings.SmallFont.Height
} ) )
self:animateToState( "default" )
self:registerAnimationState( "moved", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = -90,
top = 300,
right = -110,
height = 0
} )
f10_local4:addElement( self )
local f10_local6 = MBh.AnimateSequence( {
{
"default",
4000
},
{
"moved",
1200,
true,
true
}
} )
f10_local6( self, {} )
end
f10_local4 = LUI.UITimer.new( 11000, {
name = "kill_hive_scoreboard",
dispatchChildren = true
}, nil, true, f10_local0, false )
f10_local0:addElement( f10_local4 )
f10_local4.id = "exitTimer"
f10_local0:registerEventHandler( "kill_hive_scoreboard", function ( element, event )
local f11_local0 = MBh.AnimateSequence( {
{
"animating",
200,
true,
true
},
{
"default",
200,
true,
false
}
} )
f11_local0( element, {} )
element:addEventHandler( LUI.FormatAnimStateFinishEvent( "default" ), function ( f12_arg0, f12_arg1 )
f12_arg0:close()
end )
end )
return f10_local0
end
function hive_bonus_scoreboard()
local self = LUI.UIElement.new()
self.id = "hive_bonus_scoreboard"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
left = 0,
top = 0,
right = 0,
bottom = 0
} )
self:animateToState( "default" )
self:registerOmnvarHandler( "ui_alien_show_encounter_score", function ( f14_arg0, f14_arg1 )
if f14_arg1.value then
f14_arg0:closeChildren()
f14_arg0.board = hive_bonus_scoreboard_internal()
f14_arg0:addElement( f14_arg0.board )
end
end )
return self
end
function end_game_tally()
if LUI.mp_menus.Aliens.IsChaosMode() then
return LUI.MenuBuilder.BuildRegisteredType( "chaos_event_recap" )
end
local f15_local0 = {
"ALIEN_COLLECTIBLES_MISSION_WIN",
"ALIEN_COLLECTIBLES_MISSION_FAIL"
}
local f15_local1 = {
"ALIEN_COLLECTIBLES_MISSION_WIN_ALL_ESCAPE",
"ALIEN_COLLECTIBLES_MISSION_WIN_CASUALTY",
"ALIEN_COLLECTIBLES_MISSION_FAIL_ESCAPE",
"ALIEN_COLLECTIBLES_MISSION_FAIL_DRILL_DESTROYED",
"ALIEN_COLLECTIBLES_MISSION_FAIL_KILLED_IN_ACTION",
"ALIEN_COLLECTIBLES_MISSION_FAIL_HOST_END",
"ALIEN_PICKUPS_BEACON_GAS_FAIL",
"MP_ALIEN_LAST_GENERATOR_DESTROYED"
}
local self = LUI.UIElement.new()
self.id = "end_game_tally"
self:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
left = -200,
top = -140,
width = 400,
height = 0
} )
self:registerAnimationState( "hidden", {
alpha = 0
} )
self:animateToState( "default" )
local f15_local3 = f15_local0[Game.GetOmnvar( "ui_round_end_title" )]
local f15_local4 = LUI.UIText.new()
f15_local4.id = "game_outcome"
f15_local4:setTextStyle( CoD.TextStyle.OutlinedMore )
f15_local4:registerAnimationState( "default", {
font = CoD.TextSettings.HudIW6ExtraBigFont.Font,
alignment = LUI.Alignment.Center,
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = -200,
top = 0,
right = 0,
height = CoD.TextSettings.HudIW6ExtraBigFont.Height,
alpha = 0
} )
f15_local4:registerAnimationState( "open", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 0,
top = 0,
right = 0,
height = CoD.TextSettings.HudIW6ExtraBigFont.Height,
alpha = 1
} )
f15_local4:animateToState( "default" )
f15_local4:animateToState( "open", 200, false, true )
if f15_local3 then
f15_local4:setText( Engine.Localize( f15_local3 ) )
end
self:addElement( f15_local4 )
local f15_local5 = f15_local1[Game.GetOmnvar( "ui_round_end_reason" )]
local f15_local6 = LUI.UIText.new()
f15_local6.id = "reason"
f15_local6:setTextStyle( CoD.TextStyle.Outlined )
f15_local6:registerAnimationState( "default", CoD.ColorizeState( Colors.frontend_hilite, {
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.Center,
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 0,
top = 40,
right = 200,
height = CoD.TextSettings.BoldFont.Height,
alpha = 0
} ) )
f15_local6:registerAnimationState( "open", CoD.ColorizeState( Colors.frontend_hilite, {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 0,
top = 40,
right = 0,
height = CoD.TextSettings.BoldFont.Height,
alpha = 1
} ) )
f15_local6:animateToState( "default" )
f15_local6:animateToState( "open", 200, false, true )
if f15_local5 then
f15_local6:setText( Engine.Localize( f15_local5 ) )
end
self:addElement( f15_local6 )
local f15_local7 = table_factory( 21, {
300,
100
}, 4 )
f15_local7.id = "stats"
f15_local7:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 100,
left = 0,
right = 0,
height = 0
} )
f15_local7:animateToState( "default" )
self:addElement( f15_local7 )
local f15_local8 = 7
for f15_local9 = 1, f15_local8, 1 do
local f15_local12 = Game.GetOmnvar( "ui_alien_eog_title_row_" .. f15_local9 )
local f15_local13 = Game.GetOmnvar( "ui_alien_eog_score_row_" .. f15_local9 )
if f15_local12 then
if f15_local12 <= 0 then
break
end
f15_local12 = Engine.TableLookup( ScoreboardLUT.File, ScoreboardLUT.Cols.Ref, f15_local12, ScoreboardLUT.Cols.String )
local f15_local14 = bgPalette.Dark
local f15_local15 = Colors.alien_scoreboard_dull_grey
local f15_local16 = Colors.alien_scoreboard_dull_grey
if f15_local9 == f15_local8 or Game.GetOmnvar( "ui_alien_eog_title_row_" .. f15_local9 + 1 ) <= 0 then
f15_local14 = bgPalette.BrightUniform
f15_local15 = Colors.black
f15_local16 = Colors.black
end
else
self:registerDvarHandler( "ui_game_state", function ( f16_arg0, f16_arg1 )
if f16_arg1.value ~= "postgame" then
f16_arg0:animateToState( "hidden", 400 )
end
end )
return self
end
f15_local7.addRow( f15_local14, {
{
text = Engine.Localize( f15_local12 ),
color = f15_local15
},
{
text = f15_local13,
color = f15_local16
}
}, true )
end
self:registerDvarHandler( "ui_game_state", function ( f16_arg0, f16_arg1 )
if f16_arg1.value ~= "postgame" then
f16_arg0:animateToState( "hidden", 400 )
end
end )
return self
end
function end_game_scoreboard()
local f17_local0 = Engine.GetDvarString( "ui_mapname" )
local f17_local1 = Game.GetOmnvar( "ui_alien_is_solo" )
local f17_local2 = LUI.mp_menus.Aliens.IsChaosMode()
local f17_local3 = f17_local1 and f17_local2
local self = LUI.UIElement.new()
self.id = "end_game_scoreboard"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
} )
self:animateToState( "default" )
local f17_local5 = LUI.UIImage.new()
f17_local5.id = "bg_image_tint_id"
f17_local5:registerAnimationState( "default", CoD.ColorizeState( Colors.alien_frontend_hilite, {
material = RegisterMaterial( "box_alien_color_tint" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = -200,
bottom = 200,
left = 0,
right = 0,
alpha = 0.2
} ) )
f17_local5:animateToState( "default" )
self:addElement( f17_local5 )
local f17_local6 = LUI.UIElement.new()
f17_local6.id = "letterbox"
f17_local6:setupLetterboxElement()
f17_local6:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
} )
f17_local6:animateToState( "default" )
self:addElement( f17_local6 )
local f17_local7 = Engine.UsingSplitscreenUpscaling() and 50 or 0
local f17_local8 = LUI.UIElement.new()
f17_local8.id = "end_game_scoreboard"
f17_local8:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
left = -512,
top = -160 + f17_local7,
width = 1024,
height = 256
} )
f17_local8:animateToState( "default" )
f17_local6:addElement( f17_local8 )
local f17_local9 = LUI.UIImage.new()
f17_local9.id = "background"
f17_local9:registerAnimationState( "default", {
material = RegisterMaterial( "box_white_gradient_bot" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 256,
bottom = -256,
left = 0,
right = 0,
red = 0,
green = 0,
blue = 0,
alpha = 0.5
} )
f17_local9:animateToState( "default" )
f17_local8:addElement( f17_local9 )
local f17_local10 = table_row_factory( {
{
width = 1024,
text = Engine.Localize( "ALIENS_SCOREBOARD" ),
align = LUI.Alignment.Center,
fgColor = {
b = 0,
g = 0,
r = 0
},
bgColor = bgPalette.Bright.EvenRow.EvenCol
}
} )
f17_local10:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
bottom = 0,
height = 24,
left = -512,
width = 1024
} )
f17_local10:animateToState( "default" )
f17_local8:addElement( f17_local10 )
local f17_local11 = "@ALIENS_END_GAME_A"
if f17_local2 then
f17_local11 = "@ALIENS_END_GAME_CHAOS"
elseif f17_local0 == "mp_alien_dlc3" then
f17_local11 = "@LUA_MENU_MP_END_GAME_DESCENT_A"
elseif f17_local0 == "mp_alien_last" then
f17_local11 = "@LUA_MENU_MP_END_GAME_EXODUS_A"
end
local f17_local12
if f17_local2 then
f17_local12 = "hits"
if not f17_local12 then
else
local f17_local13 = Engine.GetPlayerDataEx( -1, CoD.StatsGroup.Coop, "alienSession", f17_local12 )
local f17_local14 = LUI.UIText.new()
f17_local14.id = "titleMessage"
f17_local14:setText( Engine.Localize( f17_local11, f17_local13 ) )
f17_local14:registerAnimationState( "default", CoD.ColorizeState( Colors.white, {
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Center,
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 0,
top = 10,
right = 0,
height = CoD.TextSettings.ExtraBigFont.Height
} ) )
f17_local14:animateToState( "default" )
f17_local8:addElement( f17_local14 )
local f17_local15 = LUI.UIText.new()
f17_local15.id = "statsMessage"
f17_local15:setText( Engine.Localize( "@ALIENS_END_GAME_B", Engine.GetPlayerDataEx( -1, CoD.StatsGroup.Coop, "alienSession", "team_kills" ), Engine.GetPlayerDataEx( -1, CoD.StatsGroup.Coop, "alienSession", "team_shots" ) ) )
f17_local15:registerAnimationState( "default", CoD.ColorizeState( Colors.alien_frontend_hilite, {
font = CoD.TextSettings.SmallFont.Font,
alignment = LUI.Alignment.Center,
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 0,
top = 40,
right = 0,
height = CoD.TextSettings.SmallFont.Height
} ) )
f17_local15:animateToState( "default" )
f17_local8:addElement( f17_local15 )
local f17_local16 = nil
if f17_local3 then
f17_local16 = table_factory( 28, {
541,
150,
111,
111,
111
} )
elseif f17_local2 then
f17_local16 = table_factory( 28, {
430,
150,
111,
111,
111,
111
} )
elseif f17_local1 then
f17_local16 = table_factory( 28, {
430,
120,
99,
110,
165,
100
} )
else
f17_local16 = table_factory( 28, {
430,
100,
79,
90,
90,
145,
90
} )
end
f17_local16:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 80,
left = 0,
right = 0,
height = 0
} )
f17_local16:animateToState( "default" )
f17_local8:addElement( f17_local16 )
local f17_local17 = {
r = Colors.alien_tech_tree_bright_grey.r,
g = Colors.alien_tech_tree_bright_grey.g,
b = Colors.alien_tech_tree_bright_grey.b,
a = 0.5
}
local f17_local18 = {
{
text = Engine.Localize( "@ALIENS_PLAYER_CAPS" ),
color = f17_local17
},
{
text = Engine.Localize( "@ALIENS_SCORE_CAPS" ),
color = f17_local17
},
{
text = Engine.Localize( "@ALIENS_KILLS_CAPS" ),
color = f17_local17
}
}
if not f17_local1 then
table.insert( f17_local18, {
text = Engine.Localize( "@ALIENS_ASSISTS_CAPS" ),
color = f17_local17
} )
end
table.insert( f17_local18, {
text = Engine.Localize( "@ALIENS_REVIVES_CAPS" ),
color = f17_local17
} )
if not f17_local2 then
table.insert( f17_local18, {
text = Engine.Localize( "@ALIENS_DRILL_REPAIRS_CAPS" ),
color = f17_local17
} )
end
table.insert( f17_local18, {
text = Engine.Localize( "@ALIENS_DOWNS_CAPS" ),
color = f17_local17
} )
f17_local16.addRow( bgPalette.Dark, f17_local18 )
local f17_local19 = Game.GetPlayerTeam()
if GameX.IsSpectatingNotOnTeam() then
f17_local19 = spectatorFakeTeam
end
local f17_local20 = Game.GetNumPlayersOnTeam( f17_local19 )
local f17_local21 = Game.GetPlayerScoreRanking()
local f17_local22 = LUI.mp_menus.Aliens
for f17_local23 = 1, f17_local20, 1 do
local f17_local26 = Game.GetPlayerScoreInfoAtRank( f17_local19, f17_local23 )
local f17_local27
if f17_local23 == f17_local21 then
f17_local27 = Colors.white
if not f17_local27 then
else
local f17_local28 = {}
local f17_local29 = {
text = f17_local26.name,
textOffset = 50
}
local f17_local30
if f17_local23 == f17_local21 then
f17_local30 = Colors.alien_frontend_hilite
if not f17_local30 then
else
f17_local29.color = f17_local30
f17_local30 = {
text = f17_local22.GetScoreFromClient( f17_local26.client ),
color = f17_local27
}
local f17_local31 = {
text = f17_local22.GetKillsFromClient( f17_local26.client ),
color = f17_local27
}
f17_local28[1] = f17_local29
f17_local28[2] = f17_local30
f17_local28[3] = f17_local31
if not f17_local1 then
table.insert( f17_local28, {
text = f17_local22.GetAssistsFromClient( f17_local26.client ),
color = f17_local27
} )
end
table.insert( f17_local28, {
text = f17_local22.GetRevivesFromClient( f17_local26.client ),
color = f17_local27
} )
if not f17_local2 then
table.insert( f17_local28, {
text = f17_local22.GetDrillRestartsFromClient( f17_local26.client ),
color = f17_local27
} )
end
table.insert( f17_local28, {
text = f17_local22.GetDownsFromClient( f17_local26.client ),
color = f17_local27
} )
f17_local29 = f17_local16.addRow( bgPalette.Dark, f17_local28 )
if f17_local26.rankIcon and f17_local26.rank then
f17_local30 = f17_local29.getColumn( 1 )
f17_local31 = LUI.UIText.new()
f17_local31.id = "rankText"
f17_local31:registerAnimationState( "default", {
font = CoD.TextSettings.HudEuroMedSmallFont.Font,
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 4,
height = CoD.TextSettings.HudEuroMedSmallFont.Height,
left = -5,
width = 20
} )
f17_local31:animateToState( "default" )
f17_local30:addElement( f17_local31 )
local f17_local32 = 23
local f17_local33 = LUI.UIImage.new()
f17_local33.id = "rankIcon"
f17_local33:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 2,
height = f17_local32,
left = 15,
width = f17_local32
} )
f17_local33:animateToState( "default" )
f17_local30:addElement( f17_local33 )
f17_local33:setImage( f17_local26.rankIcon )
f17_local31:setText( Rank.GetRankDisplay( f17_local26.rank, CoD.PlayMode.Aliens ) )
end
end
end
f17_local30 = Colors.alien_scoreboard_bright_grey
end
end
f17_local27 = Colors.alien_scoreboard_dull_grey
end
return self
end
end
f17_local12 = "team_hives"
end
LUI.MenuBuilder.registerType( "roundEndHudDef", end_game_tally )
LUI.MenuBuilder.registerType( "scoreboard", end_game_scoreboard )
LockTable( _M )