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

1248 lines
32 KiB
Lua

local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = {
TeamWindow = {
Top = 90,
Bottom = -80,
Width = 400,
SideMargin = 175,
XPBannerHeight = 52,
FriendlyBGColor = Colors.cyan,
EnemyBGColor = Colors.orange,
InfoBar = {
Height = CoD.TextSettings.NormalFont.Height + 2,
BreakWidth = 220,
CapWidth = 32,
Alpha = 0.5,
TextMargin = 10,
TextTop = 1,
DarkColor = {
r = 0,
g = 0,
b = 0,
a = 0.15
},
LightColor = {
r = 1,
g = 1,
b = 1,
a = 0.05
}
},
MemberInfo = {
Height = 54,
EdgeMargin = 8,
TextMargin = 64,
BarHeight = 2,
LineOneTop = 4,
LineTwoTop = 7 + CoD.TextSettings.NormalFont.Height,
RankTextTop = 16,
RankIconTop = 12,
RankTextWidth = 24,
RankIconSize = 28,
WeaponIconTop = 17,
WeaponIconWidth = 76,
WeaponIconHeight = 38,
MVPOffset = 10,
MVPWidth = 64,
MVPHeight = 32
}
},
CompareStats = {
WinsTop = 228,
LossesTop = 256,
StreakTop = 284,
BGWidth = 65,
ArrowSize = 6,
BGColors = {
Better = {
r = 0,
g = 1,
b = 0
},
Worse = {
r = 1,
g = 0,
b = 0
},
Same = Colors.white
},
TextColors = {
Better = {
r = 0.04,
g = 0.94,
b = 0.04
},
Worse = {
r = 0.94,
g = 0.04,
b = 0.04
},
Same = Colors.white
}
}
}
function CreateDetailMenu( f1_arg0, f1_arg1 )
local f1_local0 = f1_arg0.properties.reportData
if not f1_local0 then
f1_local0 = {
enemyPlayercardProps = {}
}
end
f1_arg0:dispatchEventToRoot( LUI.ButtonHelperText.CommonEvents.addBackButton )
local f1_local1 = f1_arg0:getChildById( "squad_report_detail_local_player" )
local f1_local2 = f1_arg0:getChildById( "squad_report_detail_enemy_player" )
local f1_local3 = Cac.GetLocalRankedPlayercardInfo( f1_arg0.properties.controller )
f1_local3.name = "update_playercard"
f1_local3.patchEmblem = f1_local3.patch
f1_local1:processEvent( f1_local3 )
f1_local2:processEvent( {
name = "update_playercard",
gamertag = f1_local0.enemyPlayercardProps.gamertag,
clantag = f1_local0.enemyPlayercardProps.clanTag,
rank = f1_local0.enemyPlayercardProps.rank,
prestige = f1_local0.enemyPlayercardProps.prestige,
background = f1_local0.enemyPlayercardProps.background,
patchEmblem = f1_local0.enemyPlayercardProps.patchEmblem,
patchShape = f1_local0.enemyPlayercardProps.patchShape
} )
end
function OutcomeTextChildFeeder( f2_arg0 )
local f2_local0 = {}
local f2_local1 = f2_arg0.reportData
local f2_local2 = SvS.GetReportOutcomeLayoutInfo( f2_local1.matchOutcome )
f2_local0[#f2_local0 + 1] = {
type = "UIText",
id = "squad_report_detail_result_text",
states = {
default = CoD.ColorizeState( f2_local2.textColor, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 60,
bottom = 60 + CoD.TextSettings.BigFont.Height,
font = CoD.TextSettings.BigFont.Font,
alignment = textAlign
} )
},
properties = {
text = f2_local2.text
}
}
f2_local0[#f2_local0 + 1] = {
type = "UIText",
id = "squad_report_detail_clock_text",
states = {
default = CoD.ColorizeState( Colors.secondary_text_color, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 35,
bottom = 35 + CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = textAlign
} )
},
properties = {
text = f2_local1.timeString
}
}
return f2_local0
end
function CompareStatsFeeder( f3_arg0 )
local f3_local0 = {}
local f3_local1 = f3_arg0.reportData
if not f3_local1.isCompare then
return f3_local0
else
f3_local0[#f3_local0 + 1] = {
type = "squad_report_detail_stat_compare",
id = "squad_report_detail_stat_compare_wins",
states = {
default = CoD.ColorizeState( Colors.window_title_text_color, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = f0_local0.TeamWindow.SideMargin + f0_local0.TeamWindow.Width,
right = -f0_local0.TeamWindow.SideMargin - f0_local0.TeamWindow.Width,
top = f0_local0.CompareStats.WinsTop,
bottom = f0_local0.CompareStats.WinsTop + f0_local0.TeamWindow.InfoBar.Height
} )
},
properties = {
value = f3_local1.yourWins - f3_local1.enemyWins
}
}
f3_local0[#f3_local0 + 1] = {
type = "squad_report_detail_stat_compare",
id = "squad_report_detail_stat_compare_losses",
states = {
default = CoD.ColorizeState( Colors.window_title_text_color, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = f0_local0.TeamWindow.SideMargin + f0_local0.TeamWindow.Width,
right = -f0_local0.TeamWindow.SideMargin - f0_local0.TeamWindow.Width,
top = f0_local0.CompareStats.LossesTop,
bottom = f0_local0.CompareStats.LossesTop + f0_local0.TeamWindow.InfoBar.Height
} )
},
properties = {
value = f3_local1.enemyLosses - f3_local1.yourLosses
}
}
f3_local0[#f3_local0 + 1] = {
type = "squad_report_detail_stat_compare",
id = "squad_report_detail_stat_compare_streak",
states = {
default = CoD.ColorizeState( Colors.window_title_text_color, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = f0_local0.TeamWindow.SideMargin + f0_local0.TeamWindow.Width,
right = -f0_local0.TeamWindow.SideMargin - f0_local0.TeamWindow.Width,
top = f0_local0.CompareStats.StreakTop,
bottom = f0_local0.CompareStats.StreakTop + f0_local0.TeamWindow.InfoBar.Height
} )
},
properties = {
value = f3_local1.yourWinStreak - f3_local1.enemyWinStreak
}
}
return f3_local0
end
end
function squad_report_detail_menu()
return {
type = "UIElement",
id = "squad_report_detail_menu",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = CreateDetailMenu
},
children = {
{
type = "UIElement",
id = "squad_report_detail_title_info_container",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
}
},
{
type = "generic_menu_title",
id = "squad_report_detail_title_text_id",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_SQUAD_COMPARE_CAPS" )
}
},
{
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = false,
top = f0_local0.TeamWindow.Top,
bottom = f0_local0.TeamWindow.Bottom,
width = 200,
alpha = 0.5
}
},
children = {
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Colors.black, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = -200,
left = 0,
right = 0,
material = RegisterMaterial( "box_white_gradient_bot" )
} )
}
},
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Colors.black, {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = -200,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "white" )
} )
}
}
}
},
{
type = "squad_report_detail_team_window",
id = "squad_report_detail_local_player",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = f0_local0.TeamWindow.Top,
bottom = f0_local0.TeamWindow.Bottom,
left = f0_local0.TeamWindow.SideMargin,
right = f0_local0.TeamWindow.SideMargin + f0_local0.TeamWindow.Width
}
},
properties = {
isEnemy = false
}
},
{
type = "squad_report_detail_team_window",
id = "squad_report_detail_enemy_player",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = true,
top = f0_local0.TeamWindow.Top,
bottom = f0_local0.TeamWindow.Bottom,
left = -f0_local0.TeamWindow.SideMargin - f0_local0.TeamWindow.Width,
right = -f0_local0.TeamWindow.SideMargin
}
},
properties = {
isEnemy = true
}
},
{
type = "UIText",
id = "squad_report_detail_vs_text",
states = {
default = CoD.ColorizeState( Colors.window_title_text_color, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 160,
height = CoD.TextSettings.ExtraBigFont.Height,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = textAlign,
textStyle = CoD.TextStyle.ShadowedMore
} )
},
properties = {
text = Engine.Localize( "LUA_MENU_VERSUS" ),
textStyle = CoD.TextStyle.Shadowed
}
},
{
type = "UIElement",
id = "squad_report_detail_compare_stats_container",
states = {
default = CoD.ColorizeState( Colors.window_title_text_color, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
} )
},
childrenFeeder = CompareStatsFeeder
},
{
type = "button_helper_text_main",
id = "squad_report_detail_button_helper_text_id"
},
{
type = "online_friends_widget",
id = "squad_report_detail_friends_widget_id"
},
{
type = "generic_back_button"
}
}
}
end
function InfoBarChildFeeder( f5_arg0 )
local f5_local0 = {}
local f5_local1 = f5_arg0.isEnemy or false
local f5_local2 = f5_arg0.infoBar or 0
local f5_local3 = f0_local0.TeamWindow.InfoBar
local f5_local4 = 9
local f5_local5, f5_local6, f5_local7, f5_local8, f5_local9, f5_local10, f5_local11, f5_local12, f5_local13, f5_local14 = nil
if f5_local1 then
f5_local5 = f0_local0.TeamWindow.Width - f5_local3.BreakWidth
f5_local6 = 0
f5_local7 = 0
f5_local8 = f5_local3.Height
f5_local9 = -f5_local3.Height
f5_local10 = f5_local3.LightColor
f5_local11 = f5_local3.DarkColor
f5_local12 = LUI.Alignment.Right
f5_local13 = 0
f5_local14 = f5_local5
else
f5_local5 = f5_local3.BreakWidth - f5_local3.CapWidth
f5_local6 = f5_local3.Height
f5_local7 = -f5_local3.Height
f5_local8 = 0
f5_local9 = 0
f5_local10 = f5_local3.DarkColor
f5_local11 = f5_local3.LightColor
f5_local12 = LUI.Alignment.Left
f5_local13 = f5_local5 + f5_local3.CapWidth + f5_local4
f5_local14 = f5_local3.Width
end
local f5_local15 = f5_local5 + f5_local3.CapWidth
f5_local0[#f5_local0 + 1] = {
type = "UIImage",
id = "report_detail_infoBar_bg_left",
states = {
default = CoD.ColorizeState( f5_local10, {
material = RegisterMaterial( "white" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
right = f5_local5,
alpha = f5_local3.Alpha
} )
}
}
f5_local0[#f5_local0 + 1] = {
type = "UIImage",
id = "report_detail_infoBar_bg_left_cap",
states = {
default = CoD.ColorizeState( f5_local10, {
material = RegisterMaterial( "box_angle_rtcap" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = f5_local6,
bottom = f5_local7,
left = f5_local5,
right = f5_local15,
alpha = f5_local3.Alpha
} )
}
}
f5_local0[#f5_local0 + 1] = {
type = "UIImage",
id = "report_detail_infoBar_bg_right_cap",
states = {
default = CoD.ColorizeState( f5_local11, {
material = RegisterMaterial( "box_angle_ltcap" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = f5_local8,
bottom = f5_local9,
left = f5_local5 + f5_local4,
right = f5_local15 + f5_local4,
alpha = f5_local3.Alpha
} )
}
}
f5_local0[#f5_local0 + 1] = {
type = "UIImage",
id = "report_detail_infoBar_bg_right",
states = {
default = CoD.ColorizeState( f5_local11, {
material = RegisterMaterial( "white" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = f5_local15 + f5_local4,
right = 0,
alpha = f5_local3.Alpha
} )
}
}
f5_local0[#f5_local0 + 1] = {
type = "UIText",
id = "report_detail_infoBar_label_text",
states = {
default = CoD.ColorizeState( Colors.secondary_text_color, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = f5_local3.TextMargin,
right = -f5_local3.TextMargin,
top = f5_local3.TextTop,
bottom = f5_local3.TextTop + CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = f5_local12
} )
},
properties = {
text = MBh.Property( "labelText" )
}
}
f5_local0[#f5_local0 + 1] = {
type = "UIText",
id = "report_detail_infoBar_value_text",
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = f5_local13,
right = f5_local14,
top = f5_local3.TextTop,
bottom = f5_local3.TextTop + CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = f5_local12
} )
},
properties = {
text = MBh.Property( "valueText" )
}
}
return f5_local0
end
function MemberListFeeder( f6_arg0 )
local f6_local0 = {}
local f6_local1 = f6_arg0.isEnemy or false
local f6_local2 = f6_arg0.reportData or {}
local f6_local3 = f0_local0.TeamWindow.MemberInfo
local f6_local4, f6_local5, f6_local6, f6_local7, f6_local8, f6_local9, f6_local10, f6_local11, f6_local12, f6_local13, f6_local14 = nil
if f6_local1 then
f6_local4 = f6_local2.enemyTeam
f6_local6 = f0_local0.TeamWindow.Width - f6_local3.RankTextWidth + f6_local3.EdgeMargin * 2
f6_local7 = f0_local0.TeamWindow.Width - f6_local3.RankTextWidth + f6_local3.RankIconSize + f6_local3.EdgeMargin * 2
f6_local8 = f6_local3.WeaponIconWidth + f6_local3.EdgeMargin
f6_local9 = f0_local0.TeamWindow.Width - f6_local3.TextMargin + f6_local3.EdgeMargin
f6_local10 = LUI.Alignment.Right
f6_local11 = f6_local3.EdgeMargin
f6_local12 = f0_local0.TeamWindow.Width + f6_local3.MVPOffset
f6_local13 = f0_local0.TeamWindow.EnemyBGColor
f6_local14 = f0_local0.TeamWindow.EnemyBGColor
else
f6_local4 = f6_local2.yourTeam
f6_local6 = f6_local3.EdgeMargin
f6_local7 = f6_local3.EdgeMargin + f6_local3.RankTextWidth
f6_local8 = f6_local3.TextMargin
f6_local9 = f0_local0.TeamWindow.Width - f6_local3.WeaponIconWidth + f6_local3.EdgeMargin * 2
f6_local10 = LUI.Alignment.Left
f6_local11 = f0_local0.TeamWindow.Width - f6_local3.WeaponIconWidth + f6_local3.EdgeMargin * 2
f6_local12 = -1 * (f6_local3.MVPOffset + f6_local3.MVPWidth + f6_local3.EdgeMargin)
f6_local13 = f0_local0.TeamWindow.FriendlyBGColor
f6_local14 = f0_local0.TeamWindow.FriendlyBGColor
end
local f6_local15 = 0
local f6_local16 = 0
for f6_local17 = 1, SvS.MaxSquadSize, 1 do
local f6_local20 = f6_local4[f6_local17]
if f6_local16 < f6_local20.rank then
f6_local15 = f6_local17
f6_local16 = f6_local20.rank
end
end
for f6_local17 = 1, SvS.MaxSquadSize, 1 do
local f6_local20 = f6_local4[f6_local17]
local f6_local21 = Squad.GetWeaponNameFromIndex and Squad.GetWeaponNameFromIndex( f6_local20.weaponIndex ) or ""
local f6_local22 = Cac.GetWeaponName( f6_local21 ) or ""
local f6_local23 = Cac.GetWeaponProfileImage( f6_local21 ) or "white"
local f6_local24 = f6_local17 == f6_local15
local f6_local25 = {
[#f6_local25 + 1] = {
type = "UIImage",
id = "report_detail_member_bg",
states = {
default = CoD.ColorizeState( f6_local14, {
material = RegisterMaterial( "white" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.1
} )
}
}
}
local f6_local26 = #f6_local25 + 1
local f6_local27 = {
type = "UIMarqueeText",
id = "report_detail_member_name"
}
local f6_local28 = {}
local f6_local29 = CoD.ColorizeState
if f6_local24 then
local f6_local30 = f6_local13
end
f6_local28.default = f6_local29( f6_local30 or Colors.primary_text_color, {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = f6_local8,
right = f6_local9,
top = f6_local3.LineOneTop,
bottom = f6_local3.LineOneTop + CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = f6_local10
} )
f6_local27.states = f6_local28
f6_local27.properties = {
text = f6_local20.name
}
f6_local25[f6_local26] = f6_local27
f6_local25[#f6_local25 + 1] = {
type = "UIText",
id = "report_detail_member_rank_text",
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = f6_local6,
right = f6_local6 + f6_local3.RankTextWidth,
top = f6_local3.RankTextTop,
bottom = f6_local3.RankTextTop + CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = f6_local10
} )
},
properties = {
text = Rank.GetRankDisplay( f6_local20.rank, CoD.PlayMode.SquadVsSquad )
}
}
f6_local26 = #f6_local25 + 1
f6_local27 = {
type = "UIImage",
id = "report_detail_member_rank_icon"
}
f6_local28 = {}
f6_local29 = CoD.ColorizeState
local f6_local31 = Colors.primary_text_color
local f6_local32 = {}
local f6_local33 = RegisterMaterial
local f6_local34 = Rank.GetRankIcon( f6_local20.rank, f6_local20.prestige, CoD.PlayMode.SquadVsSquad )
if not f6_local34 then
f6_local34 = "white"
end
f6_local32.material = f6_local33( f6_local34 )
f6_local32.leftAnchor = true
f6_local32.rightAnchor = false
f6_local32.topAnchor = true
f6_local32.bottomAnchor = false
f6_local32.left = f6_local7
f6_local32.right = f6_local7 + f6_local3.RankIconSize
f6_local32.top = f6_local3.RankIconTop
f6_local32.bottom = f6_local3.RankIconTop + f6_local3.RankIconSize
f6_local28.default = f6_local29( f6_local31, f6_local32 )
f6_local27.states = f6_local28
f6_local25[f6_local26] = f6_local27
f6_local25[#f6_local25 + 1] = {
type = "UIMarqueeText",
id = "report_detail_member_weapon_name",
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = f6_local8,
right = f6_local9,
top = f6_local3.LineTwoTop,
bottom = f6_local3.LineTwoTop + CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = f6_local10
} )
},
properties = {
text = f6_local22
}
}
f6_local25[#f6_local25 + 1] = {
type = "UIImage",
id = "report_detail_member_weapon_icon",
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
material = RegisterMaterial( f6_local23 ),
leftAnchor = true,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = f6_local11,
right = f6_local11 + f6_local3.WeaponIconWidth,
height = f6_local3.WeaponIconHeight
} )
}
}
f6_local25[#f6_local25 + 1] = {
type = "UIImage",
id = "report_detail_member_bar",
states = {
default = CoD.ColorizeState( Colors.grey_4, {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = f6_local3.Height - f6_local3.BarHeight,
bottom = 0,
alpha = 0.5
} )
}
}
if f6_local24 then
f6_local25[#f6_local25 + 1] = {
type = "UIImage",
id = "report_detail_member_mvp_bg",
states = {
default = CoD.ColorizeState( f6_local13, {
material = RegisterMaterial( "box_squad_mvp" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = f6_local12,
right = f6_local12 + f6_local3.MVPWidth,
height = f6_local3.MVPHeight
} )
},
children = {
{
type = "UIMarqueeText",
id = "report_detail_mvp_text",
properties = {
text = Engine.Localize( "LUA_MENU_MVP_SHORT" )
},
states = {
default = CoD.ColorizeState( Colors.black, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 4,
height = CoD.TextSettings.BoldFont.Height,
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.Center
} )
}
}
}
}
end
f6_local0[#f6_local0 + 1] = {
type = "UIElement",
id = "report_detail_member_" .. f6_local17,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = f6_local3.Height
}
},
children = f6_local25
}
end
return f6_local0
end
function TeamWindowContentFeeder( f7_arg0 )
if not f7_arg0 then
f7_arg0 = {}
end
local f7_local0 = f7_arg0.reportData or {}
local f7_local1 = f7_arg0.isEnemy or false
local f7_local2 = f7_arg0.controller
local f7_local3 = f7_local0.isCompare
assert( f7_local2 )
if not f7_local2 then
f7_local2 = Engine.GetFirstActiveController()
DebugPrint( "[WARNING] Squad Report Detail: using controller index 0, this is only ok if you are editing a menu" )
end
local f7_local4, f7_local5 = nil
if f7_local1 then
f7_local4 = f7_local0.enemyScore
f7_local5 = f7_local0.enemyXPEarned
else
f7_local4 = f7_local0.yourScore
f7_local5 = f7_local0.yourXPEarned
end
local f7_local6 = {
[#f7_local6 + 1] = {
type = "UIElement",
id = "playercard_container",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
left = -35,
height = 100,
width = 100
}
},
children = {
{
type = "playercard",
id = "report_detail_playercard",
states = {
default = {
scale = -0.18
}
}
}
}
}
}
if f7_local3 then
local f7_local7 = #f7_local6 + 1
local f7_local8 = {
type = "UIElement",
id = "report_detail_wins_container",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = f0_local0.TeamWindow.InfoBar.Height,
left = 0,
right = 0
}
}
}
local f7_local9 = {
isEnemy = f7_local1
}
local f7_local10
if f7_local1 then
f7_local10 = f7_local0.enemyInfoBar
if not f7_local10 then
else
f7_local9.infoBar = f7_local10
f7_local9.labelText = Engine.Localize( "LUA_MENU_WINS" )
f7_local10 = tostring
local f7_local11
if f7_local1 then
f7_local11 = f7_local0.enemyWins
if not f7_local11 then
else
f7_local9.valueText = f7_local10( f7_local11 )
f7_local8.properties = f7_local9
f7_local8.childrenFeeder = InfoBarChildFeeder
f7_local6[f7_local7] = f7_local8
f7_local7 = #f7_local6 + 1
f7_local8 = {
type = "UIElement",
id = "report_detail_losses_container",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = f0_local0.TeamWindow.InfoBar.Height,
left = 0,
right = 0
}
}
}
f7_local9 = {
isEnemy = f7_local1
}
if f7_local1 then
f7_local10 = f7_local0.enemyInfoBar
if not f7_local10 then
else
f7_local9.infoBar = f7_local10
f7_local9.labelText = Engine.Localize( "MENU_LOSSES" )
f7_local10 = tostring
if f7_local1 then
f7_local11 = f7_local0.enemyLosses
if not f7_local11 then
else
f7_local9.valueText = f7_local10( f7_local11 )
f7_local8.properties = f7_local9
f7_local8.childrenFeeder = InfoBarChildFeeder
f7_local6[f7_local7] = f7_local8
f7_local7 = #f7_local6 + 1
f7_local8 = {
type = "UIElement",
id = "report_detail_streak_container",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = f0_local0.TeamWindow.InfoBar.Height,
left = 0,
right = 0
}
}
}
f7_local9 = {
isEnemy = f7_local1
}
if f7_local1 then
f7_local10 = f7_local0.enemyInfoBar
if not f7_local10 then
else
f7_local9.infoBar = f7_local10
f7_local9.labelText = Engine.Localize( "LUA_MENU_CURRENT_STREAK" )
f7_local10 = tostring
if f7_local1 then
f7_local11 = f7_local0.enemyWinStreak
if not f7_local11 then
else
f7_local9.valueText = f7_local10( f7_local11 )
f7_local8.properties = f7_local9
f7_local8.childrenFeeder = InfoBarChildFeeder
f7_local6[f7_local7] = f7_local8
end
end
f7_local11 = f7_local0.yourWinStreak or 0
end
end
f7_local10 = f7_local0.yourInfoBar
end
end
f7_local11 = f7_local0.yourLosses or 0
end
end
f7_local10 = f7_local0.yourInfoBar
end
end
f7_local11 = f7_local0.yourWins or 0
end
end
f7_local10 = f7_local0.yourInfoBar
end
f7_local6[#f7_local6 + 1] = {
type = "UIVerticalList",
id = "report_detail_member_list",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
properties = {
isEnemy = f7_local1,
reportData = f7_local0
},
childrenFeeder = MemberListFeeder
}
return f7_local6
end
function TeamWindowChildFeeder( f8_arg0 )
local f8_local0 = {}
local f8_local1 = f8_arg0.isEnemy or false
local f8_local2 = nil
if f8_local1 then
f8_local2 = f8_arg0.reportData.enemySquadName
else
f8_local2 = Squad.GetPlayerSquadName( f8_arg0.controller )
end
f8_local0[#f8_local0 + 1] = {
type = "generic_drop_shadow",
id = "report_detail_main_dropshadow",
properties = {
offset_shadow = -5
}
}
f8_local0[#f8_local0 + 1] = {
type = "generic_menu_background",
id = "report_detail_main_titlebar",
properties = {
hide_bottom = true,
fill_alpha = 1
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
right = 0,
height = GenericTitleBarDims.TitleBarHeight
}
},
children = {
{
type = "UIText",
id = "report_detail_title_text",
states = {
default = CoD.ColorizeState( Colors.window_title_text_color, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
height = CoD.TextSettings.ExtraBigFont.Height,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Center
} )
},
properties = {
text = Engine.Localize( "LUA_MENU_SQUAD_LABEL", Engine.MarkLocalized( f8_local2 ) )
}
}
}
}
f8_local0[#f8_local0 + 1] = {
type = "generic_menu_background",
id = "report_detail_main_background",
properties = {
fill_alpha = 1,
top_offset = Cac.Layout.InfoPane.header_height - 1
}
}
f8_local0[#f8_local0 + 1] = {
type = "UIVerticalList",
id = "report_detail_main_vlist",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = GenericTitleBarDims.TitleBarHeight,
bottom = 0,
left = 5,
right = -5,
spacing = 5
}
},
childrenFeeder = TeamWindowContentFeeder,
properties = {
reportData = f8_arg0.reportData,
controller = f8_arg0.controller,
isEnemy = f8_local1
}
}
return f8_local0
end
function squad_report_detail_team_window()
return {
type = "UIElement",
id = "squad_report_detail_team_window",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
properties = {
reportData = MBh.Property( "reportData" ),
controller = MBh.Property( "controller" )
},
handlers = {},
childrenFeeder = TeamWindowChildFeeder
}
end
function squad_report_detail_stat_compare( f10_arg0, f10_arg1 )
if not f10_arg1 then
f10_arg1 = {}
end
local f10_local0 = f10_arg1.value or 0
local f10_local1 = tostring( f10_local0 )
local f10_local2 = f0_local0.CompareStats.BGColors.Same
local f10_local3 = f0_local0.CompareStats.TextColors.Same
local f10_local4 = nil
if f10_local0 > 0 then
f10_local2 = f0_local0.CompareStats.BGColors.Better
f10_local3 = f0_local0.CompareStats.TextColors.Better
f10_local4 = RegisterMaterial( "widg_arrow_up" )
f10_local1 = string.format( "%+d", f10_local0 )
elseif f10_local0 < 0 then
f10_local2 = f0_local0.CompareStats.BGColors.Worse
f10_local3 = f0_local0.CompareStats.TextColors.Worse
f10_local4 = RegisterMaterial( "widg_arrow_dn" )
f10_local1 = string.format( "%+d", f10_local0 )
end
local self = LUI.UIElement.new()
self.id = "squad_report_detail_stat_compare_container"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
} )
self:animateToState( "default", 0 )
local f10_local6 = LUI.UIImage.new()
f10_local6.id = "stat_compare_bg_left"
f10_local6:registerAnimationState( "default", CoD.ColorizeState( f10_local2, {
material = RegisterMaterial( "box_white_gradient_fade_rt" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = f0_local0.CompareStats.BGWidth,
top = 0,
bottom = 0,
alpha = 0.12
} ) )
f10_local6:animateToState( "default", 0 )
self:addElement( f10_local6 )
local f10_local7 = LUI.UIImage.new()
f10_local7.id = "stat_compare_bg_right"
f10_local7:registerAnimationState( "default", CoD.ColorizeState( f10_local2, {
material = RegisterMaterial( "box_white_gradient_fade" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = f0_local0.CompareStats.BGWidth,
right = 0,
top = 0,
bottom = 0,
alpha = 0.12
} ) )
f10_local7:animateToState( "default", 0 )
self:addElement( f10_local7 )
local f10_local8 = LUI.UIText.new()
f10_local8.id = "stat_compare_value_text"
f10_local8:registerAnimationState( "default", CoD.ColorizeState( f10_local3, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 5,
bottom = CoD.TextSettings.SmallFont.Height + 5,
font = CoD.TextSettings.SmallFont.Font,
alignment = LUI.Alignment.Center
} ) )
f10_local8:animateToState( "default", 0 )
f10_local8:setText( f10_local1 )
self:addElement( f10_local8 )
if f10_local4 then
local f10_local9 = LUI.UIImage.new()
f10_local9.id = "stat_compare_arrow"
f10_local9:registerAnimationState( "default", CoD.ColorizeState( f10_local2, {
material = f10_local4,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = f0_local0.CompareStats.BGWidth - f0_local0.CompareStats.ArrowSize * 0.5,
right = f0_local0.CompareStats.BGWidth + f0_local0.CompareStats.ArrowSize,
top = 1,
bottom = 1 + f0_local0.CompareStats.ArrowSize,
alpha = 1
} ) )
f10_local9:animateToState( "default", 0 )
self:addElement( f10_local9 )
end
return self
end
LUI.MenuBuilder.registerDef( "squad_report_detail_menu", squad_report_detail_menu )
LUI.MenuBuilder.registerDef( "squad_report_detail_team_window", squad_report_detail_team_window )
LUI.MenuBuilder.registerType( "squad_report_detail_stat_compare", squad_report_detail_stat_compare )
LockTable( _M )