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

1338 lines
46 KiB
Lua

local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( "Registering " .. _NAME )
SOCIAL_TOP_PADDING = 20
ArticleLayout = {
Default = 0,
List = 1,
SocialCompare = 2,
SquadReport = 3
}
function GetLayoutType( f1_arg0, f1_arg1, f1_arg2 )
local f1_local0 = ArticleLayout.Default
if f1_arg0 == FeedCategory.Clans and f1_arg1 == 0 then
f1_local0 = ArticleLayout.List
end
if f1_arg0 == FeedCategory.Social and not f1_arg2 then
f1_local0 = ArticleLayout.SocialCompare
end
if f1_arg0 == FeedCategory.Squads and not f1_arg2 then
f1_local0 = ArticleLayout.SquadReport
end
return f1_local0
end
function GetDefaultArticleInfo( f2_arg0 )
local f2_local0 = {}
if f2_arg0 == FeedCategory.News then
f2_local0.header = Engine.Localize( "@SOCIALFEED_DEFAULT_NEWS_HEADER" )
f2_local0.body = Engine.Localize( "@SOCIALFEED_DEFAULT_NEWS_BODY" )
elseif f2_arg0 == FeedCategory.Clans then
f2_local0.header = Engine.Localize( "@SOCIALFEED_DEFAULT_CLAN_HEADER" )
f2_local0.listHeader = Engine.Localize( "@SOCIALFEED_DEFAULT_CLAN_BODY" )
f2_local0.listFeeder = ClanBenefitsFeeder
elseif f2_arg0 == FeedCategory.Squads then
f2_local0.header = Engine.Localize( "@LUA_MENU_NO_REPORTS_TITLE" )
f2_local0.body = Engine.Localize( "@LUA_MENU_NO_REPORTS_DESC" )
elseif f2_arg0 == FeedCategory.Social then
f2_local0.header = Engine.Localize( "@SOCIALFEED_DEFAULT_SOCIAL_HEADER" )
f2_local0.body = Engine.Localize( "@SOCIALFEED_DEFAULT_SOCIAL_BODY" )
end
f2_local0.image = GetDefaultArticleImage( f2_arg0 )
return f2_local0
end
function GetDefaultArticleImage( f3_arg0 )
local f3_local0 = ""
if f3_arg0 == FeedCategory.News then
f3_local0 = "img_sf_generic_news1"
elseif f3_arg0 == FeedCategory.Squads then
f3_local0 = "img_sf_generic_news4"
end
return f3_local0
end
function GetActionTextForType( f4_arg0, f4_arg1 )
local f4_local0 = ""
if f4_arg0 == FeedCategory.News then
if f4_arg1 == NewsType.Item then
f4_local0 = Engine.Localize( "@LUA_MENU_STORE_CAPS" )
end
elseif f4_arg0 == FeedCategory.MOTD and Engine.GetDvarInt( "motd_store_link" ) == 1 then
f4_local0 = Engine.Localize( "@LUA_MENU_STORE_CAPS" )
end
return f4_local0
end
function GetArticleInfo( f5_arg0, f5_arg1, f5_arg2 )
local f5_local0 = nil
if SocialFeed.GetArticleCount( f5_arg0, f5_arg1 ) < 1 then
f5_local0 = GetDefaultArticleInfo( f5_arg1 )
else
f5_local0 = SocialFeed.GetArticleInfo( f5_arg0, f5_arg1, f5_arg2 )
end
f5_local0.index = f5_arg2
f5_local0.category = f5_arg1
return f5_local0
end
function OnCreate( f6_arg0, f6_arg1 )
local f6_local0 = f6_arg1.controller
f6_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
local f6_local1 = LUI.FlowManager.GetMenuScopedDataFromElement( f6_arg0 )
f6_arg0:processEvent( {
name = "update_header_text",
string = Engine.Localize( "@SOCIALFEED_TITLE_CAPS", Engine.MarkLocalized( Engine.GetUsernameByController( f6_local0 ) ) ),
dispatchChildren = true
} )
f6_local1.forcedArticleIndex = Sns.TickerIndex
end
function OnStoreButtonPressed( f7_arg0, f7_arg1, f7_arg2 )
if f7_arg1 then
LUI.FlowManager.RequestPopupMenu( self, "popup_social_to_store_lobby_confirm", true, f7_arg0, false, {
callback_params = {
itemID = f7_arg2
}
} )
else
Sns.OpenStoreMenu( f7_arg0, "social_feed", true, f7_arg2 )
end
end
function OnActionPressed( f8_arg0, f8_arg1 )
local f8_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f8_arg0 )
if f8_local0.category == FeedCategory.News then
if SocialFeed.GetNewsType( f8_local0.articleIndex ) == NewsType.Item then
OnStoreButtonPressed( f8_arg1.controller, f8_local0.fromLobby, SocialFeed.GetNewsItemID( f8_local0.articleIndex ) )
end
elseif f8_local0.category == FeedCategory.MOTD and Engine.GetDvarInt( "motd_store_link" ) == 1 then
OnStoreButtonPressed( f8_arg1.controller, f8_local0.fromLobby )
end
end
function ChangeCategory( f9_arg0, f9_arg1 )
local f9_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f9_arg0 )
f9_local0.category = f9_arg0.properties.article_category
f9_local0.articleIndex = 0
if f9_local0.forcedArticleIndex then
f9_local0.articleIndex = f9_local0.forcedArticleIndex
f9_local0.forcedArticleIndex = nil
end
f9_arg0:dispatchEventToRoot( {
name = "refresh_thumbnails",
immediate = true
} )
f9_arg0:dispatchEventToRoot( {
name = "change_article",
immediate = true
} )
end
function ChangeArticle( f10_arg0, f10_arg1 )
local f10_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f10_arg0 )
if f10_arg1 and f10_arg1.delta then
f10_local0.articleIndex = f10_local0.articleIndex + f10_arg1.delta
end
local f10_local1 = SocialFeed.GetArticleCount( f10_local0.exclusiveControllerIndex, f10_local0.category )
f10_local0.articleIndex = math.min( f10_local1 - 1, f10_local0.articleIndex )
f10_local0.articleIndex = math.max( 0, f10_local0.articleIndex )
f10_arg0:processEvent( {
name = "refresh_article",
layoutType = GetLayoutType( f10_local0.category, f10_local0.articleIndex, f10_local1 < 1 )
} )
f10_arg0:processEvent( {
name = "update_thumbnail_arrows",
left_visible = f10_local0.articleIndex > 0,
right_visible = f10_local0.articleIndex < f10_local1 - 1
} )
SocialFeed.SetArticleRead( f10_local0.exclusiveControllerIndex, f10_local0.category, f10_local0.articleIndex )
f10_arg0:processEvent( {
name = "update_unread_count",
category = f10_local0.category,
dispatchChildren = true
} )
f10_arg0:processEvent( {
name = "update_thumbnail_states"
} )
end
function RefreshArticle( f11_arg0, f11_arg1 )
if f11_arg1.layoutType ~= f11_arg0.layoutType then
f11_arg0:animateToState( "hidden", 0 )
return
end
f11_arg0:animateToState( "default", 0 )
local f11_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f11_arg0 )
local f11_local1 = f11_local0.category
local f11_local2 = f11_local0.articleIndex
local f11_local3 = SocialFeed.GetArticleCount( f11_local0.exclusiveControllerIndex, f11_local1 ) < 1
local f11_local4 = GetArticleInfo( f11_local0.exclusiveControllerIndex, f11_local1, f11_local2 )
if f11_local1 == FeedCategory.Social and not f11_local3 then
f11_local4.header = Engine.Localize( SocialArticleStrings.Header[f11_local4.subCategory + 1] )
f11_local4.summary = Sns.GetSocialArticleBodyString( f11_local4 )
end
if f11_local1 == FeedCategory.Squads and not f11_local3 then
f11_local4.reportData = SvS.GetSquadReportData( f11_local0.exclusiveControllerIndex, f11_local2 )
f11_local4.header = Engine.Localize( "SOCIALFEED_SQUAD_HEADER", Engine.MarkLocalized( f11_local4.reportData.enemyName ) )
f11_local4.image = SvS.GetBasePreviewImageLarge( f11_local4.reportData.mapName )
end
if not f11_local3 then
f11_local4.actionText = GetActionTextForType( f11_local1, f11_local4.subCategory )
end
f11_arg0:dispatchEventToMenuRoot( {
name = "update_title",
title_text = f11_local4.header
} )
f11_arg0:dispatchEventToChildren( {
name = "update_article_details",
articleInfo = f11_local4,
immediate = true,
dispatchChildren = true
} )
end
function RefreshThumbnails( f12_arg0, f12_arg1 )
f12_arg0:closeChildren()
f12_arg0:clearSavedState()
f12_arg0:processEvent( {
name = "menu_refresh"
} )
f12_arg0:processEvent( {
name = "gain_focus"
} )
end
function UpdateActionButton( f13_arg0, f13_arg1 )
local f13_local0 = f13_arg1.articleInfo.actionText
local f13_local1 = 32
local f13_local2 = 20
local f13_local3 = 160
local f13_local4 = 40
if not f13_local0 or f13_local0 == "" then
f13_arg0:animateToState( "hidden", 0 )
return
end
local f13_local5, f13_local6 = Sns.GetArticleImageDims( f13_arg1.articleInfo.imageWidth, f13_arg1.articleInfo.imageHeight )
local f13_local7 = f13_local6 + SOCIAL_TOP_PADDING + 30
local f13_local8 = CoD.CreateState( 0, f13_local7, 0, f13_local7 + CoD.TextSettings.BoldFont.Height + f13_local2, CoD.AnchorTypes.TopLeft )
f13_local8.alpha = 1
local f13_local9, f13_local10, f13_local11, f13_local12 = GetTextDimensions( f13_arg1.articleInfo.actionText, CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
local f13_local13 = f13_local11 - f13_local9 + f13_local1 + f13_local2
local f13_local14 = f13_local13 / 2
f13_local8.left = f13_local4 + (f13_local3 - f13_local13) / 2
f13_local8.right = f13_local8.left + f13_local13
f13_arg0:registerAnimationState( "default", f13_local8 )
f13_arg0:animateToState( "default", 0 )
f13_arg0.hList:closeChildren()
local f13_local15 = {}
if 1 == Engine.IsGamepadEnabled() then
local f13_local16 = CoD.CreateState( 0, -f13_local1 / 2, f13_local1, f13_local1 / 2, CoD.AnchorTypes.Left )
f13_local16.font = CoD.TextSettings.NormalFont.Font
f13_local16.alignment = LUI.Alignment.Left
local self = LUI.UIText.new( f13_local16 )
self:setText( Engine.Localize( ButtonMap.button_action.string ) )
f13_arg0.hList:addElement( self )
end
f13_local15 = CoD.CreateState( 0, -CoD.TextSettings.NormalFont.Height / 2, f13_local11, CoD.TextSettings.NormalFont.Height / 2, CoD.AnchorTypes.Left )
CoD.ColorizeState( Colors.white, f13_local15 )
f13_local15.font = CoD.TextSettings.NormalFont.Font
f13_local15.alignment = LUI.Alignment.Left
local f13_local16 = LUI.UIText.new( f13_local15 )
CoD.ColorizeState( Colors.generic_button_text_focus_color, f13_local15 )
f13_local16:registerAnimationState( "focus", f13_local15 )
f13_local16:setText( f13_arg1.articleInfo.actionText )
f13_arg0.hList:addElement( f13_local16 )
f13_local16:registerEventHandler( "button_over", function ( element, event )
local f14_local0 = element:getParent()
if f14_local0:isInFocus() then
element:animateToState( "focus", 0 )
end
end )
f13_local16:registerEventHandler( "button_up", function ( element, event )
element:animateToState( "default", 0 )
end )
end
function SocialCategoryFeeder( f16_arg0 )
local f16_local0 = f16_arg0.exclusiveController
local f16_local1 = {}
if not SocialFeed.HasIOTD() then
SocialFeed.DownloadIOTD()
end
if Engine.GetDvarInt( "social_feed_motd_active" ) == 1 then
f16_local1[#f16_local1 + 1] = {
type = "socialfeed_category_button",
id = "category_motd_id",
listDefaultFocus = Sns.TickerCategory == FeedCategory.MOTD,
properties = {
button_text = Engine.Localize( "@SOCIALFEED_CATEGORY_MOTD" ),
button_over_func = ChangeCategory,
button_action_func = OnActionPressed,
article_category = FeedCategory.MOTD,
category_icon = RegisterMaterial( "icon_social_feed_motd" )
}
}
end
if Engine.GetDvarInt( "social_feed_news_active" ) == 1 then
f16_local1[#f16_local1 + 1] = {
type = "socialfeed_category_button",
id = "category_news_id",
listDefaultFocus = Sns.TickerCategory == FeedCategory.News,
properties = {
button_text = Engine.Localize( "@SOCIALFEED_CATEGORY_NEWS" ),
button_over_func = ChangeCategory,
button_action_func = OnActionPressed,
article_category = FeedCategory.News,
info_text = SocialFeed.GetUnreadArticleCount( f16_local0, FeedCategory.News ),
category_icon = RegisterMaterial( "icon_social_feed_news" )
}
}
end
if Engine.GetDvarInt( "social_feed_clans_active" ) == 1 and not Engine.IsAliensMode() then
f16_local1[#f16_local1 + 1] = {
type = "socialfeed_category_button",
id = "category_clans_id",
listDefaultFocus = Sns.TickerCategory == FeedCategory.Clans,
properties = {
button_text = Engine.Localize( "@SOCIALFEED_CATEGORY_CLANS" ),
button_over_func = ChangeCategory,
button_action_func = OnActionPressed,
article_category = FeedCategory.Clans,
info_text = SocialFeed.GetUnreadArticleCount( f16_local0, FeedCategory.Clans ),
category_icon = RegisterMaterial( "icon_social_feed_clans" )
}
}
end
if Engine.GetDvarInt( "social_feed_squads_active" ) == 1 and not Engine.IsAliensMode() then
f16_local1[#f16_local1 + 1] = {
type = "socialfeed_category_button",
id = "category_squad_id",
listDefaultFocus = Sns.TickerCategory == FeedCategory.Squads,
properties = {
button_text = Engine.Localize( "@SOCIALFEED_CATEGORY_SQUADS" ),
button_over_func = ChangeCategory,
button_action_func = OnActionPressed,
article_category = FeedCategory.Squads,
info_text = SocialFeed.GetUnreadArticleCount( f16_local0, FeedCategory.Squads ),
category_icon = RegisterMaterial( "icon_social_feed_squads" )
}
}
end
if Engine.GetDvarInt( "social_feed_social_active" ) == 1 then
f16_local1[#f16_local1 + 1] = {
type = "socialfeed_category_button",
id = "category_social_id",
listDefaultFocus = Sns.TickerCategory == FeedCategory.Social,
properties = {
button_text = Engine.Localize( "@SOCIALFEED_CATEGORY_SOCIAL" ),
button_over_func = ChangeCategory,
button_action_func = OnActionPressed,
article_category = FeedCategory.Social,
info_text = SocialFeed.GetUnreadArticleCount( f16_local0, FeedCategory.Social ),
category_icon = RegisterMaterial( "icon_social_feed_social" )
}
}
end
return f16_local1
end
function ThumbnailFeeder( f17_arg0 )
local f17_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "social_feed_main" )
local f17_local1 = f17_local0.category
if not f17_local1 then
f17_local1 = FeedCategory.News
end
local f17_local2 = f17_local0.articleIndex or 0
local f17_local3 = f17_arg0.exclusiveController
local f17_local4 = {}
local f17_local5 = 12
local f17_local6 = SocialFeed.GetArticleCount( f17_local3, f17_local1 )
if f17_local6 < 1 then
f17_local6 = 1
end
for f17_local7 = 0, f17_local6 - 1, 1 do
local f17_local10 = f17_local7
f17_local4[#f17_local4 + 1] = {
type = "UIImage",
id = "thumbnail_" .. f17_local10,
listDefaultFocus = f17_local2 == f17_local10,
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = f17_local5,
top = 0,
bottom = f17_local5,
material = RegisterMaterial( "widg_circle_empty" )
},
focused = {
material = RegisterMaterial( "widg_circle_fill" )
}
},
handlers = {
update_thumbnail_states = function ( f18_arg0, f18_arg1 )
if f17_local0.articleIndex == f17_local10 then
f18_arg0:animateToState( "focused", 0 )
else
f18_arg0:animateToState( "default", 0 )
end
end
}
}
end
return f17_local4
end
function ClanBenefitsFeeder( f19_arg0 )
local f19_local0 = {}
local f19_local1 = {
"-Member count is still 100",
"-25 Clan levels",
"-Gain Clan XP(CXP) while playing with a clan mate in multiplayer",
"-Earn CXP while playing in the clan v clan playlist",
"-Each clan levels gets your clan cool entitlements. Camos, backgrounds, patches and much more",
"-Earn CXP for winning a clan war",
"-View your clans progress in your Clan Profile",
"-Download the mobile app for more advanced options"
}
for f19_local2 = 1, #f19_local1, 1 do
local f19_local5 = nil
f19_local0[#f19_local0 + 1] = {
type = "UIText",
id = "clan_benefit_" .. f19_local2,
properties = {
text = f19_local1[f19_local2]
},
states = {
default = {
leftAnchor = true,
topAnchor = true,
bottomAnchor = false,
rightAnchor = true,
left = 0,
top = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left
}
}
}
end
return f19_local0
end
function socialfeed_category_button()
return {
type = "UIGenericButton",
id = "socialfeed_category_button_id",
properties = {
style = GenericButtonSettings.Styles.FlatButton,
substyle = GenericButtonSettings.Styles.FlatButton.SubStyles.SubMenu,
use_locking = false,
info_text = "",
article_category = FeedCategory.News,
category_icon = RegisterMaterial( "white" ),
text_padding_without_content = 45
},
children = {
{
type = "UIImage",
id = "socialfeed_category_button_category_image_id",
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
left = 4,
right = 36,
top = -16,
bottom = 16,
material = MBh.Property( "category_icon" ),
red = 1,
green = 1,
blue = 1
},
focus = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
left = 4,
right = 36,
top = -16,
bottom = 16,
material = MBh.Property( "category_icon" ),
red = 0,
green = 0,
blue = 0
}
},
handlers = {
button_over = MBh.AnimateToState( "focus" ),
button_up = MBh.AnimateToState( "default" )
}
},
{
type = "UIElement",
id = "socialfeed_category_button_info_vis_control_id",
properties = {
info_text = MBh.Property( "info_text" ),
article_category = MBh.Property( "article_category" )
},
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
left = -30,
right = -2,
top = -16,
bottom = 16,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
update_unread_count = function ( f21_arg0, f21_arg1 )
local f21_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f21_arg0 )
local f21_local1 = SocialFeed.GetUnreadArticleCount( f21_local0.exclusiveControllerIndex, f21_arg0.properties.article_category )
local f21_local2 = f21_arg0
local f21_local3 = f21_arg0.animateToState
local f21_local4
if f21_local1 > 0 then
f21_local4 = "default"
if not f21_local4 then
else
f21_local3( f21_local2, f21_local4, 0 )
end
end
f21_local4 = "hidden"
end
},
children = {
{
type = "UIImage",
id = "socialfeed_category_button_info_image_id",
properties = {
info_text = MBh.Property( "info_text" ),
article_category = MBh.Property( "article_category" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = 1,
green = 1,
blue = 1,
material = RegisterMaterial( "icon_social_feed_notification" )
},
focus = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = 0,
green = 0,
blue = 0,
material = RegisterMaterial( "icon_social_feed_notification" )
}
},
handlers = {
button_over = MBh.AnimateToState( "focus" ),
button_up = MBh.AnimateToState( "default" )
}
},
{
type = "UIText",
id = "socialfeed_category_button_info_text_id",
properties = {
text = MBh.Property( "info_text" ),
article_category = MBh.Property( "article_category" )
},
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = -CoD.TextSettings.NormalFont.Height * 0.5,
bottom = CoD.TextSettings.NormalFont.Height * 0.5,
red = 0,
green = 0,
blue = 0,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center
},
focus = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = -CoD.TextSettings.NormalFont.Height * 0.5,
bottom = CoD.TextSettings.NormalFont.Height * 0.5,
red = 1,
green = 1,
blue = 1,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center
}
},
handlers = {
update_unread_count = function ( f22_arg0, f22_arg1 )
local f22_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f22_arg0 )
f22_arg0:setText( SocialFeed.GetUnreadArticleCount( f22_local0.exclusiveControllerIndex, f22_arg0.properties.article_category ) )
end
,
button_over = MBh.AnimateToState( "focus" ),
button_up = MBh.AnimateToState( "default" )
}
}
}
}
}
}
end
function social_feed_header_window()
return {
type = "UIElement",
id = "social_feed_header_window_id",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 100,
bottom = 140,
left = 400,
right = 1200
}
},
children = {
{
type = "UIStencil",
id = "header_window_stencil_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "UIHorizontalList",
id = "header_list_id",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 10,
right = -10,
top = 10,
bottom = -10,
spacing = 25,
alignment = LUI.Alignment.Center
}
},
childrenFeeder = ThumbnailFeeder,
handlers = {
refresh_thumbnails = RefreshThumbnails
}
}
}
}
}
}
end
function social_article_base()
return {
type = "UIElement",
id = "social_feed_article_container_id",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 140,
bottom = 600,
left = 400,
right = 1200
}
},
children = {
{
type = "generic_menu_titlebar",
id = "article_details_window_title_id",
properties = {
font = CoD.TextSettings.BoldFont,
title_bar_text = "",
title_bar_text_indent = 4,
title_bar_alignment = LUI.Alignment.Center
}
},
{
type = "UIButton",
id = "header_list_left_arrow_id",
requireFocusType = FocusType.MouseOver,
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 5,
bottom = 30,
left = 20,
right = 45
}
},
handlers = {
button_action = MBh.EmitEventToRoot( {
name = "change_article",
delta = -1,
immediate = true
} ),
update_thumbnail_arrows = function ( f25_arg0, f25_arg1 )
f25_arg0:processEvent( {
name = f25_arg1.left_visible and "enable" or "disable"
} )
end
},
children = {
{
type = "UIImage",
id = "member_select_left_arrow_image_id",
states = {
default = {
material = RegisterMaterial( "widg_margin_arrow_lt" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.5
},
over = {
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
button_over = MBh.AnimateToState( "over" ),
button_up = MBh.AnimateToState( "default" ),
button_disable = MBh.AnimateToState( "hidden" ),
button_over_disable = MBh.AnimateToState( "hidden" )
}
}
}
},
{
type = "UIButton",
id = "header_list_right_arrow_id",
requireFocusType = FocusType.MouseOver,
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
top = 5,
bottom = 30,
left = -35,
right = -10
}
},
handlers = {
button_action = MBh.EmitEventToRoot( {
name = "change_article",
delta = 1,
immediate = true
} ),
update_thumbnail_arrows = function ( f26_arg0, f26_arg1 )
f26_arg0:processEvent( {
name = f26_arg1.right_visible and "enable" or "disable"
} )
end
},
children = {
{
type = "UIImage",
id = "member_select_right_arrow_image_id",
states = {
default = {
material = RegisterMaterial( "widg_margin_arrow_rt" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.5
},
over = {
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
button_over = MBh.AnimateToState( "over" ),
button_up = MBh.AnimateToState( "default" ),
button_disable = MBh.AnimateToState( "hidden" ),
button_over_disable = MBh.AnimateToState( "hidden" )
}
}
}
},
{
type = "generic_menu_background_withfade",
id = "article_details_window_bg_id"
},
{
type = "SnSDefaultArticle",
id = "sns_default_article_id"
},
{
type = "SnSListArticle",
id = "sns_list_article_id"
},
{
type = "SnSSquadArticle",
id = "sns_squad_article_id"
}
}
}
end
function social_feed_main()
return {
type = "UIElement",
id = "social_feed_root",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = OnCreate,
change_article = ChangeArticle
},
children = {
{
type = "UIImage",
id = "social_feed_background_id",
states = {
default = {
material = RegisterMaterial( "bkgd_cas" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
}
},
{
type = "generic_menu_title",
properties = {
menu_title = ""
}
},
{
type = "sns_category_window",
id = "social_feed_category_window_id",
properties = {
feeder = SocialCategoryFeeder
}
},
{
type = "social_feed_header_window",
id = "social_feed_header_window_id"
},
{
type = "social_article_base",
id = "social_article_base_id"
},
{
type = "button_helper_text_main",
id = "social_feed_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
},
{
type = "UIBindButton",
id = "back_button",
handlers = {
button_secondary = MBh.LeaveMenu(),
button_left = MBh.EmitEventToRoot( {
name = "change_article",
delta = -1,
immediate = true
} ),
button_right = MBh.EmitEventToRoot( {
name = "change_article",
delta = 1,
immediate = true
} )
}
}
}
}
end
function AddDefaultLeftPane( f28_arg0 )
local f28_local0 = 30
local self = LUI.UIElement.new( CoD.CreateState( 1, GenericTitleBarDims.TitleBarHeight + 1, 400, 0, CoD.AnchorTypes.TopBottomLeft ) )
self.id = "article_left_pane_id"
f28_arg0:addElement( self )
local f28_local2 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
f28_local2.material = RegisterMaterial( "gradient_top" )
f28_local2.alpha = 0.4
self:addElement( LUI.UIImage.new( f28_local2 ) )
local f28_local3 = LUI.UIElement.new( CoD.CreateState( 40, 20, -40, 340, CoD.AnchorTypes.TopLeftRight ) )
f28_local3.id = "article_image_container_id"
self:addElement( f28_local3 )
f28_local3:registerEventHandler( "update_article_details", function ( element, event )
local f29_local0, f29_local1 = Sns.GetArticleImageDims( event.articleInfo.imageWidth, event.articleInfo.imageHeight )
element:registerAnimationState( "default", CoD.CreateState( -f29_local0 / 2, SOCIAL_TOP_PADDING, f29_local0 / 2, SOCIAL_TOP_PADDING + f29_local1, CoD.AnchorTypes.Top ) )
element:animateToState( "default", 0 )
end )
local f28_local4 = LUI.MenuGenerics.generic_drop_shadow( nil, {
offset_shadow = 0
} )
f28_local4.id = "article_image_shadow_id"
f28_local3:addElement( f28_local4 )
f28_local2 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
CoD.ColorizeState( Swatches.GenericMenu.Border, f28_local2 )
local f28_local5 = LUI.UIImage.new( f28_local2 )
f28_local5.id = "article_image_border_id"
f28_local3:addElement( f28_local5 )
local f28_local6 = LUI.UIImage.new( CoD.CreateState( 1, 1, -1, -1, CoD.AnchorTypes.All ) )
f28_local6:registerEventHandler( "update_article_details", function ( element, event )
if event.articleInfo.localJPEGImage then
SocialFeed.SetNewsArticleImageJPEG( event.articleInfo.index )
element:setImage( RegisterMaterial( "news_jpeg_image" ) )
else
element:setImage( RegisterMaterial( event.articleInfo.image ) )
end
end )
f28_local3:addElement( f28_local6 )
local f28_local7 = LUI.UIText.new( CoD.CreateState( -180, 360, -40, 360 + CoD.TextSettings.BoldFont.Height, CoD.AnchorTypes.TopRight ) )
f28_local7.id = "article_timer_header_id"
f28_local7:registerAnimationState( "hidden", {
alpha = 0
} )
f28_local7:registerEventHandler( "update_article_details", function ( element, event )
if event.articleInfo.endTime and event.articleInfo.endTime > 0 then
local f31_local0, f31_local1 = Sns.GetArticleImageDims( event.articleInfo.imageWidth, event.articleInfo.imageHeight )
local f31_local2 = f31_local1 + SOCIAL_TOP_PADDING + f28_local0
local f31_local3 = CoD.CreateState( -180, f31_local2, -40, f31_local2 + CoD.TextSettings.NormalFont.Height, CoD.AnchorTypes.TopRight )
f31_local3.font = CoD.TextSettings.NormalFont.Font
f31_local3.alignment = LUI.Alignment.Center
f31_local3.alpha = 1
element:registerAnimationState( "default", f31_local3 )
local f31_local4 = element
local f31_local5 = element.setText
local f31_local6 = event.articleInfo.timerHeader
if not f31_local6 then
f31_local6 = Engine.Localize( "@SOCIALFEED_TIME_LEFT" )
end
f31_local5( f31_local4, f31_local6 )
element:animateToState( "default", 0 )
else
element:animateToState( "hidden", 0 )
end
end )
self:addElement( f28_local7 )
local f28_local8 = LUI.UILongCountdown.new( 0 )
f28_local8:animateToState( "default" )
f28_local8:registerAnimationState( "hidden", {
alpha = 0
} )
f28_local8:registerEventHandler( "update_article_details", function ( element, event )
if event.articleInfo.endTime and event.articleInfo.endTime > 0 then
local f32_local0, f32_local1 = Sns.GetArticleImageDims( event.articleInfo.imageWidth, event.articleInfo.imageHeight )
local f32_local2 = f32_local1 + SOCIAL_TOP_PADDING + f28_local0 + 20
local f32_local3 = CoD.CreateState( -180, f32_local2, -40, f32_local2 + CoD.TextSettings.NormalFont.Height, CoD.AnchorTypes.TopRight )
CoD.ColorizeState( Colors.primary_text_color, f32_local3 )
f32_local3.font = CoD.TextSettings.NormalFont.Font
f32_local3.alignment = LUI.Alignment.Center
f32_local3.alpha = 1
element:registerAnimationState( "default", f32_local3 )
element:setEndTime( event.articleInfo.endTime )
element:animateToState( "default", 0 )
else
element:animateToState( "hidden", 0 )
end
end )
self:addElement( f28_local8 )
local f28_local9 = LUI.UIButton.new( CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.TopLeft ) )
f28_local9.id = "article_action_button_id"
f28_local9:registerAnimationState( "hidden", {
alpha = 0
} )
f28_local9.m_requireFocusType = FocusType.MouseOver
self:addElement( f28_local9 )
f28_local9:registerEventHandler( "update_article_details", UpdateActionButton )
f28_local9:registerEventHandler( "button_action", OnActionPressed )
f28_local2 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
CoD.ColorizeState( Colors.grey_2, f28_local2 )
f28_local2.material = RegisterMaterial( "white" )
f28_local2.alpha = 0
local f28_local10 = LUI.UIImage.new( f28_local2 )
CoD.ColorizeState( Colors.generic_button_content_focus_color, f28_local2 )
f28_local2.alpha = 0.2
f28_local10:registerAnimationState( "focus", f28_local2 )
f28_local9:addElement( f28_local10 )
f28_local10:registerEventHandler( "button_over", function ( element, event )
local f33_local0 = element:getParent()
if f33_local0:isInFocus() then
element:animateToState( "focus", 0 )
end
end )
f28_local10:registerEventHandler( "button_up", function ( element, event )
element:animateToState( "default", 0 )
end )
f28_local2 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
f28_local2.alignment = LUI.Alignment.Center
f28_local9.hList = LUI.UIHorizontalList.new( f28_local2 )
f28_local9:addElement( f28_local9.hList )
end
function SquadReportScoreBar( f35_arg0, f35_arg1, f35_arg2, f35_arg3 )
local f35_local0 = 10
local f35_local1 = 320
local f35_local2 = 100
local self = LUI.UIElement.new( CoD.CreateState( f35_local0, f35_arg3, -f35_local0, f35_arg3 + 26, CoD.AnchorTypes.TopLeftRight ) )
self.id = f35_arg1
local f35_local4 = CoD.CreateState( 0, 0, -(f35_local2 + 26), 0, CoD.AnchorTypes.All )
f35_local4.material = RegisterMaterial( "white" )
f35_local4.alpha = 0.15
CoD.ColorizeState( Colors.black, f35_local4 )
local f35_local5 = LUI.UIImage.new( f35_local4 )
f35_local5.id = "squad_report_score_base_left_bg_id"
self:addElement( f35_local5 )
f35_local4 = CoD.CreateState( -f35_local2, 0, 0, 0, CoD.AnchorTypes.TopBottomRight )
f35_local4.material = RegisterMaterial( "white" )
f35_local4.alpha = 0.05
CoD.ColorizeState( Colors.white, f35_local4 )
local f35_local6 = LUI.UIImage.new( f35_local4 )
f35_local6.id = "squad_report_score_base_right_bg_id"
self:addElement( f35_local6 )
f35_local4 = CoD.CreateState( -(f35_local2 + 26), 0, -f35_local2, 0, CoD.AnchorTypes.TopBottomRight )
f35_local4.material = RegisterMaterial( "box_stat_cap" )
f35_local4.alpha = 0.15
f35_local4.zRot = 180
CoD.ColorizeState( Colors.black, f35_local4 )
local f35_local7 = LUI.UIImage.new( f35_local4 )
f35_local7.id = "squad_report_score_base_left_cap_id"
self:addElement( f35_local7 )
f35_local4 = CoD.CreateState( -(f35_local2 + 26), 0, -f35_local2, 0, CoD.AnchorTypes.TopBottomRight )
f35_local4.material = RegisterMaterial( "box_stat_cap" )
f35_local4.alpha = 0.05
CoD.ColorizeState( Colors.white, f35_local4 )
local f35_local8 = LUI.UIImage.new( f35_local4 )
f35_local8.id = "squad_report_score_base_right_cap_id"
self:addElement( f35_local8 )
f35_local4 = CoD.CreateState( 5, -CoD.TextSettings.NormalFont.Height * 0.5, f35_local1, CoD.TextSettings.NormalFont.Height * 0.5, CoD.AnchorTypes.Left )
f35_local4.font = CoD.TextSettings.NormalFont.Font
f35_local4.alignment = LUI.Alignment.Left
CoD.ColorizeState( Colors.primary_text_color, f35_local4 )
local f35_local9 = LUI.UIText.new( f35_local4 )
f35_local9.id = "squad_report_score_label_id"
f35_local9:setText( f35_arg2 )
self:addElement( f35_local9 )
f35_local4 = CoD.CreateState( -f35_local2, -CoD.TextSettings.NormalFont.Height * 0.5, -5, CoD.TextSettings.NormalFont.Height * 0.5, CoD.AnchorTypes.Right )
f35_local4.font = CoD.TextSettings.NormalFont.Font
f35_local4.alignment = LUI.Alignment.Right
CoD.ColorizeState( Colors.white, f35_local4 )
self.statValue = LUI.UIText.new( f35_local4 )
self.statValue.id = "squad_report_score_value_id"
self:addElement( self.statValue )
return self
end
LUI.SnSDefaultArticle = {}
LUI.SnSDefaultArticle.new = function ( f36_arg0, f36_arg1, f36_arg2 )
local f36_local0 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
f36_local0.alpha = 1
local self = LUI.UIElement.new( f36_local0 )
self:registerAnimationState( "hidden", {
alpha = 0
} )
self:registerEventHandler( "refresh_article", RefreshArticle )
AddDefaultLeftPane( self )
local f36_local2 = LUI.UIElement.new( CoD.CreateState( -400, GenericTitleBarDims.TitleBarHeight, 0, 0, CoD.AnchorTypes.TopBottomRight ) )
f36_local2.id = "article_right_pane_id"
self:addElement( f36_local2 )
f36_local0 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
f36_local0.material = RegisterMaterial( "gradient_top" )
f36_local0.alpha = 0.1
f36_local2:addElement( LUI.UIImage.new( f36_local0 ) )
f36_local0 = CoD.CreateState( 10, 20, -10, -10, CoD.AnchorTypes.All )
CoD.ColorizeState( Colors.primary_text_color, f36_local0 )
f36_local0.font = CoD.TextSettings.NormalFont.Font
f36_local0.alignment = LUI.Alignment.Left
f36_local0.alpha = 1
local f36_local3 = LUI.UIMarqueeText.new( f36_local0 )
f36_local3:SetUseTextWrapping( true )
f36_local3:SetTextHeight( CoD.TextSettings.SmallFont.Height )
f36_local3:registerAnimationState( "hidden", {
alpha = 0
} )
f36_local3.id = "article_body_id"
f36_local3:registerEventHandler( "update_article_details", function ( element, event )
element:setText( event.articleInfo.body )
end )
f36_local2:addElement( f36_local3 )
self.layoutType = ArticleLayout.Default
return self
end
LUI.SnSListArticle = {}
LUI.SnSListArticle.new = function ( f38_arg0, f38_arg1, f38_arg2 )
local f38_local0 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
f38_local0.alpha = 1
local self = LUI.UIElement.new( f38_local0 )
self:registerAnimationState( "hidden", {
alpha = 0
} )
self:registerEventHandler( "refresh_article", RefreshArticle )
AddDefaultLeftPane( self )
local f38_local2 = LUI.UIElement.new( CoD.CreateState( -400, GenericTitleBarDims.TitleBarHeight, 0, 0, CoD.AnchorTypes.TopBottomRight ) )
f38_local2.id = "article_right_pane_id"
self:addElement( f38_local2 )
f38_local0 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
f38_local0.material = RegisterMaterial( "gradient_top" )
f38_local0.alpha = 0.1
f38_local2:addElement( LUI.UIImage.new( f38_local0 ) )
f38_local0 = CoD.CreateState( 10, 10, -10, 10 + CoD.TextSettings.NormalFont.Height, CoD.AnchorTypes.TopLeftRight )
f38_local0.font = CoD.TextSettings.NormalFont.Font
f38_local0.alignment = LUI.Alignment.Left
local f38_local3 = LUI.UIText.new( f38_local0 )
f38_local3.id = "article_list_header_id"
f38_local3:registerEventHandler( "update_article_details", function ( element, event )
element:setText( event.articleInfo.listHeader )
end )
f38_local2:addElement( f38_local3 )
local f38_local4 = LUI.UIVerticalList.new( CoD.CreateState( 10, 20 + CoD.TextSettings.NormalFont.Height, -10, 0, CoD.AnchorTypes.All ), false, false, false )
f38_local4:registerEventHandler( "update_article_details", function ( element, event )
element:closeChildren()
element:clearSavedState()
LUI.MenuBuilder.buildChildren( element, element.properties, event.articleInfo.listFeeder and event.articleInfo.listFeeder( element.properties ) or {} )
end )
f38_local2:addElement( f38_local4 )
self.layoutType = ArticleLayout.List
return self
end
LUI.SnSSquadArticle = {}
LUI.SnSSquadArticle.new = function ( f41_arg0, f41_arg1, f41_arg2 )
local f41_local0 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
f41_local0.alpha = 1
local self = LUI.UIElement.new( f41_local0 )
self:registerAnimationState( "hidden", {
alpha = 0
} )
self:registerEventHandler( "refresh_article", RefreshArticle )
local f41_local2 = LUI.UIElement.new( CoD.CreateState( 1, GenericTitleBarDims.TitleBarHeight + 1, 440, 0, CoD.AnchorTypes.TopBottomLeft ) )
f41_local2.id = "article_left_pane_id"
self:addElement( f41_local2 )
local f41_local3 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
f41_local3.material = RegisterMaterial( "gradient_top" )
f41_local3.alpha = 0.4
f41_local2:addElement( LUI.UIImage.new( f41_local3 ) )
local f41_local4 = LUI.UIElement.new( CoD.CreateState( 30, 20, 400, 260, CoD.AnchorTypes.TopLeft ) )
f41_local4.id = "article_image_container_id"
f41_local2:addElement( f41_local4 )
local f41_local5 = LUI.MenuGenerics.generic_drop_shadow( nil, {
offset_shadow = 0
} )
f41_local5.id = "article_image_shadow_id"
f41_local4:addElement( f41_local5 )
f41_local3 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
CoD.ColorizeState( Swatches.GenericMenu.Border, f41_local3 )
local f41_local6 = LUI.UIImage.new( f41_local3 )
f41_local6.id = "article_image_border_id"
f41_local4:addElement( f41_local6 )
local f41_local7 = LUI.UIImage.new( CoD.CreateState( 1, 1, -1, -1, CoD.AnchorTypes.All ) )
f41_local7:registerEventHandler( "update_article_details", function ( element, event )
element:setImage( RegisterMaterial( event.articleInfo.image ) )
end )
f41_local4:addElement( f41_local7 )
local f41_local8 = LUI.Playercard.new( nil, {}, f41_arg2 )
f41_local8:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 300,
bottom = 420,
left = 5,
right = 325,
scale = -0.15
} )
f41_local8:animateToState( "default" )
f41_local8.id = "article_squad_playercard_id"
f41_local8:registerEventHandler( "update_article_details", function ( element, event )
local f43_local0 = event.articleInfo.reportData.enemyPlayercardProps
f43_local0.name = "update_playercard"
element:processEvent( f43_local0 )
end )
f41_local2:addElement( f41_local8 )
local f41_local9 = LUI.UIElement.new( CoD.CreateState( -360, GenericTitleBarDims.TitleBarHeight, 0, 0, CoD.AnchorTypes.TopBottomRight ) )
f41_local9.id = "article_right_pane_id"
self:addElement( f41_local9 )
f41_local3 = CoD.CreateState( 10, 15, -10, 15 + CoD.TextSettings.ExtraBigFont.Height, CoD.AnchorTypes.TopLeftRight )
f41_local3.font = CoD.TextSettings.ExtraBigFont.Font
f41_local3.alignment = LUI.Alignment.Center
local f41_local10 = LUI.UIText.new( f41_local3 )
for f41_local14, f41_local15 in ipairs( SvS.Reports.MatchOutcomeArray ) do
f41_local10:registerAnimationState( f41_local15, CoD.ColorizeState( SvS.Reports.MatchOutcomeColors[f41_local15].textColor, {} ) )
end
f41_local10.id = "article_squad_outcome_id"
f41_local10:registerEventHandler( "update_article_details", function ( element, event )
element:setText( SvS.GetReportOutcomeText( event.articleInfo.reportData.matchOutcome ) )
element:animateToState( event.articleInfo.reportData.matchOutcome )
end )
f41_local9:addElement( f41_local10 )
f41_local3 = CoD.CreateState( 15, 45, -15, 46, CoD.AnchorTypes.TopLeftRight )
CoD.ColorizeState( Swatches.GenericMenu.Border, f41_local3 )
f41_local3.alpha = 0.5
f41_local11 = LUI.UIImage.new( f41_local3 )
f41_local11.id = "article_hbreak_id"
f41_local9:addElement( f41_local11 )
f41_local3 = CoD.CreateState( 10, 65, -10, 65 + CoD.TextSettings.NormalFont.Height, CoD.AnchorTypes.TopLeftRight )
f41_local3.font = CoD.TextSettings.NormalFont.Font
f41_local3.alignment = LUI.Alignment.Center
f41_local12 = LUI.UIText.new( f41_local3 )
f41_local12.id = "article_squad_name_id"
f41_local12:registerEventHandler( "update_article_details", function ( element, event )
element:setText( Engine.Localize( "LUA_MENU_SQUAD_LABEL", Engine.MarkLocalized( event.articleInfo.reportData.enemySquadName ) ) )
end )
f41_local9:addElement( f41_local12 )
f41_local3 = CoD.CreateState( 10, 90, -10, 90 + CoD.TextSettings.NormalFont.Height, CoD.AnchorTypes.TopLeftRight )
CoD.ColorizeState( Colors.primary_text_color, f41_local3 )
f41_local3.font = CoD.TextSettings.NormalFont.Font
f41_local3.alignment = LUI.Alignment.Center
f41_local13 = LUI.UIText.new( f41_local3 )
f41_local13:registerAnimationState( "highlight", CoD.ColorizeState( Colors.frontend_hilite, {} ) )
f41_local13.id = "article_squad_xp_earned_id"
f41_local13:registerEventHandler( "update_article_details", function ( element, event )
element:animateToState( event.articleInfo.reportData.didEarnXP and "highlight" or "default" )
element:setText( event.articleInfo.reportData.xpString )
end )
f41_local9:addElement( f41_local13 )
f41_local3 = CoD.CreateState( 10, 140, -10, 140 + CoD.TextSettings.NormalFont.Height, CoD.AnchorTypes.TopLeftRight )
CoD.ColorizeState( Colors.primary_text_color, f41_local3 )
f41_local3.font = CoD.TextSettings.NormalFont.Font
f41_local3.alignment = LUI.Alignment.Center
f41_local14 = LUI.UIText.new( f41_local3 )
f41_local14.id = "article_game_type_id"
f41_local14:registerEventHandler( "update_article_details", function ( element, event )
element:setText( Engine.Localize( Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, event.articleInfo.reportData.gametype, GameTypesTable.Cols.Name ) ) )
end )
f41_local9:addElement( f41_local14 )
f41_local3 = CoD.CreateState( 10, 165, -10, 165 + CoD.TextSettings.NormalFont.Height, CoD.AnchorTypes.TopLeftRight )
CoD.ColorizeState( Colors.primary_text_color, f41_local3 )
f41_local3.font = CoD.TextSettings.NormalFont.Font
f41_local3.alignment = LUI.Alignment.Center
f41_local15 = LUI.UIText.new( f41_local3 )
f41_local15.id = "article_squad_base_text_id"
f41_local15:registerEventHandler( "update_article_details", function ( element, event )
element:setText( Squad.GetRealBaseNameFromLoadName( event.articleInfo.reportData.mapName ) )
end )
f41_local9:addElement( f41_local15 )
f41_local3 = CoD.CreateState( 10, 190, -10, 190 + CoD.TextSettings.NormalFont.Height, CoD.AnchorTypes.TopLeftRight )
CoD.ColorizeState( Colors.secondary_text_color, f41_local3 )
f41_local3.font = CoD.TextSettings.NormalFont.Font
f41_local3.alignment = LUI.Alignment.Center
local f41_local16 = LUI.UIText.new( f41_local3 )
f41_local16.id = "article_squad_time_text_id"
f41_local16:registerEventHandler( "update_article_details", function ( element, event )
element:setText( event.articleInfo.reportData.timeString )
end )
f41_local9:addElement( f41_local16 )
local f41_local17 = SquadReportScoreBar( self, "article_squad_your_score_id", Engine.Localize( "LUA_MENU_YOUR_SQUAD_SCORE" ), 240 )
f41_local17.id = "article_squad_your_score_id"
f41_local17.statValue:registerEventHandler( "update_article_details", function ( element, event )
element:setText( event.articleInfo.reportData.yourScore )
end )
f41_local9:addElement( f41_local17 )
local f41_local18 = SquadReportScoreBar( self, "article_squad_their_score_id", Engine.Localize( "LUA_MENU_ENEMY_SQUAD_SCORE" ), 265 )
f41_local18.id = "article_squad_their_score_id"
f41_local18.statValue:registerEventHandler( "update_article_details", function ( element, event )
element:setText( event.articleInfo.reportData.enemyScore )
end )
f41_local9:addElement( f41_local18 )
self.layoutType = ArticleLayout.SquadReport
return self
end
LUI.MenuBuilder.registerDef( "social_feed_main", social_feed_main )
LUI.MenuBuilder.registerDef( "social_feed_header_window", social_feed_header_window )
LUI.MenuBuilder.registerDef( "socialfeed_category_button", socialfeed_category_button )
LUI.MenuBuilder.registerDef( "social_article_base", social_article_base )
LUI.MenuBuilder.registerType( "SnSDefaultArticle", LUI.SnSDefaultArticle.new )
LUI.MenuBuilder.registerType( "SnSListArticle", LUI.SnSListArticle.new )
LUI.MenuBuilder.registerType( "SnSSquadArticle", LUI.SnSSquadArticle.new )
LockTable( _M )