This commit is contained in:
2024-09-12 17:25:45 +02:00
commit b4b2350b88
224 changed files with 172565 additions and 0 deletions

View File

@@ -0,0 +1,449 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function aar_title_bar()
return {
type = "UIElement",
id = "aar_title_bar_id",
properties = {
title_text = Engine.Localize( "@LUA_MENU_GAME_SUMMARY_CAPS" ),
subtitle_text = "GAMETYPE - Map Name",
subtitle_banner_width = AAR.Layout.SubTitleBannerWidth,
fill_alpha = 1,
border_alpha = Swatches.GenericMenu.BorderAlpha
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = AAR.Layout.TitleBarHeight + AAR.Layout.SubTitleBarHeight,
left = 0,
right = 0
}
},
children = {
{
type = "UIVerticalList",
id = "title_vert_list",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "generic_menu_titlebar",
id = "top_title_bar_id",
properties = {
title_bar_text = MBh.Property( "title_text" ),
fill_alpha = MBh.Property( "fill_alpha" ),
border_alpha = MBh.Property( "border_alpha" )
}
},
{
type = "aar_subtitle_bar",
id = "bottom_title_bar_id",
properties = {
subtitle_text = MBh.Property( "subtitle_text" ),
banner_width = MBh.Property( "subtitle_banner_width" )
}
}
}
}
}
}
end
function aar_title_bar_top()
return {
type = "UIElement",
properties = {
title_text = "TITLE TEXT"
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = AAR.Layout.TitleBarHeight,
left = 0,
right = 0
}
},
children = {
{
type = "UIImage",
id = "bar_background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 33,
right = -5,
material = RegisterMaterial( "box_popup_titlebar_mid" )
}
}
},
{
type = "UIImage",
id = "bar_corner_left",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
right = 33,
material = RegisterMaterial( "box_popup_titlebar_lt" )
}
}
},
{
type = "UIImage",
id = "bar_corner_right",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = true,
top = 0,
bottom = 0,
left = -5,
right = 0,
material = RegisterMaterial( "box_popup_titlebar_rt" )
}
}
},
{
type = "UIText",
id = "bar_title",
properties = {
text = MBh.Property( "title_text" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 2,
bottom = 2 + CoD.TextSettings.ExtraBigFont.Height,
left = 0,
right = 0,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Center,
red = 1,
green = 1,
blue = 1,
alpha = 1
}
},
handlers = {
aar_set_title_text = function ( f3_arg0, f3_arg1 )
assert( f3_arg1.new_text )
f3_arg0:setText( f3_arg1.new_text )
end
}
}
}
}
end
function aar_subtitle_bar()
return {
type = "UIElement",
properties = {
subtitle_text = "GAMETYPE - Map Name",
banner_width = AAR.Layout.SubTitleBannerWidth
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = AAR.Layout.SubTitleBarHeight,
left = 0,
right = 0
}
},
children = {
{
type = "UIImage",
id = "text_bkg_center",
states = {
default = CoD.ColorizeState( Swatches.GenericMenu.Border, {
material = RegisterMaterial( "white" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = false,
top = 1,
bottom = -6,
left = MBh.HalfOppositeProperty( "banner_width" ),
right = MBh.HalfProperty( "banner_width" ),
alpha = Swatches.GenericMenu.BorderAlpha
} )
},
children = {
{
type = "UIImage",
id = "text_bkg_left",
states = {
default = CoD.ColorizeState( Swatches.GenericMenu.Border, {
material = RegisterMaterial( "box_angle_ltcap" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = -1 * AAR.Layout.SubTitleCapWidth,
right = 0
} )
}
},
{
type = "UIImage",
id = "text_bkg_right",
states = {
default = CoD.ColorizeState( Swatches.GenericMenu.Border, {
material = RegisterMaterial( "box_angle_rtcap" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = AAR.Layout.SubTitleCapWidth
} )
}
}
}
},
{
type = "UIText",
id = "bar_title",
properties = {
text = MBh.Property( "subtitle_text" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 2,
left = 0,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center,
red = 0,
green = 0,
blue = 0,
alpha = 1
}
},
handlers = {
aar_set_subtitle_text = function ( f5_arg0, f5_arg1 )
assert( f5_arg1.new_text )
f5_arg0:setText( f5_arg1.new_text )
end
}
}
}
}
end
function ExitAAR( f6_arg0, f6_arg1 )
f6_arg0:dispatchEventToRoot( {
name = "lobby_slide_enable",
dispatchChildren = true
} )
LUI.FlowManager.RequestLeaveMenu( f6_arg0 )
end
function aar_footer_bar()
local self = nil
if Engine.IsConsoleGame() then
self = LUI.UIButton.new()
self:registerEventHandler( "button_action", ExitAAR )
else
self = LUI.UIElement.new()
end
self.id = "aar_footer_bar_id"
self:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = -AAR.Layout.FooterHeight,
bottom = 0,
left = 0,
right = 0,
red = 0,
green = 0,
blue = 0
} )
self:animateToState( "default" )
local f7_local1 = LUI.UIImage.new()
f7_local1.id = "aar_footer_bkg"
f7_local1:registerAnimationState( "default", CoD.ColorizeState( Swatches.GenericMenu.Border, {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 1,
right = -1,
top = 0,
bottom = 1,
alpha = Swatches.GenericMenu.BorderAlpha
} ) )
f7_local1:animateToState( "default" )
self:addElement( f7_local1 )
local f7_local2 = LUI.UIBindButton.new()
f7_local2.id = "aar_buttons_handler_id"
f7_local2:registerEventHandler( "button_secondary", ExitAAR )
f7_local2:registerEventHandler( "button_select", ExitAAR )
self:addElement( f7_local2 )
if Engine.IsConsoleGame() then
local f7_local3 = LUI.UIText.new()
f7_local3.id = "aar_footer_text"
f7_local3:setText( Engine.Localize( "@LUA_MENU_AAR_FOOTER_TEXT" ) )
local f7_local4 = CoD.TextSettings.BoldFont.Height + 5
f7_local3:registerAnimationState( "default", CoD.ColorizeState( Colors.cac_label_text, {
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.Left,
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = false,
top = -f7_local4 / 2,
bottom = f7_local4 / 2,
left = 10,
right = 0
} ) )
f7_local3:animateToState( "default" )
self:addElement( f7_local3 )
else
local f7_local3 = LUI.ButtonHelperText.helper_text_item( ButtonMap.button_secondary, Engine.Localize( "@LUA_MENU_CLOSE" ), nil, nil, nil )
f7_local3.triggers_event = "button_secondary"
f7_local3.id = "aar_helper_text_id"
local f7_local4 = LUI.UIHorizontalList.new()
f7_local4.id = "aar_footer_hlist"
f7_local4:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 10,
right = 0,
top = 0,
bottom = 0,
alignment = LUI.Alignment.Left
} )
f7_local4:animateToState( "default" )
f7_local4:addElement( f7_local3 )
self:addElement( f7_local4 )
end
return self
end
function aar_dots()
return {
type = "UIHorizontalList",
id = "page_dots",
focusable = false,
properties = {
num_dots = 3,
curr_dot = 1
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 67,
bottom = 79,
left = -100,
right = 100,
alignment = LUI.Alignment.Center,
alpha = 1,
spacing = 4
}
},
childrenFeeder = function ( f9_arg0 )
local f9_local0 = f9_arg0.num_dots
local f9_local1 = f9_arg0.curr_dot
local f9_local2 = {}
for f9_local3 = 1, f9_local0, 1 do
local f9_local6 = #f9_local2 + 1
local f9_local7 = {
type = "UIImage",
id = "nav_dot_" .. f9_local3
}
local f9_local8 = {}
local f9_local9 = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 12,
top = 0,
bottom = 12
}
local f9_local10
if f9_local3 == f9_local1 then
f9_local10 = RegisterMaterial( "widg_circle_fill" )
if not f9_local10 then
else
f9_local9.material = f9_local10
f9_local8.default = f9_local9
f9_local7.states = f9_local8
f9_local2[f9_local6] = f9_local7
end
end
f9_local10 = RegisterMaterial( "widg_circle_empty" )
end
return f9_local2
end
}
end
LUI.MenuBuilder.registerDef( "aar_title_bar", aar_title_bar )
LUI.MenuBuilder.registerDef( "aar_title_bar_top", aar_title_bar_top )
LUI.MenuBuilder.registerDef( "aar_subtitle_bar", aar_subtitle_bar )
LUI.MenuBuilder.registerType( "aar_footer_bar", aar_footer_bar )
LUI.MenuBuilder.registerDef( "aar_dots", aar_dots )
LockTable( _M )

View File

@@ -0,0 +1,314 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function AARSummaryMainCreate( f1_arg0, f1_arg1 )
local f1_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f1_arg0 )
local f1_local1 = f1_local0.controller
if IsPublicMatch() or Engine.IsAliensMode() then
TryForceOpenUnlocksScreens( f1_arg0, f1_arg1, f1_local1 )
end
f1_arg0:dispatchEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true
} )
end
function toggleScreen( f2_arg0, f2_arg1, f2_arg2 )
if #f2_arg0.properties.screens > 1 then
if f2_arg2 == "right" then
if f2_arg0.properties.screen_idx < #f2_arg0.properties.screens then
f2_arg0.properties.screen_idx = f2_arg0.properties.screen_idx + 1
f2_arg0:dispatchEventToRoot( {
name = "toggle_next_aar_screen"
} )
end
elseif f2_arg2 == "left" and f2_arg0.properties.screen_idx > 1 then
f2_arg0.properties.screen_idx = f2_arg0.properties.screen_idx - 1
f2_arg0:dispatchEventToRoot( {
name = "toggle_next_aar_screen"
} )
end
if #f2_arg0.properties.screens <= f2_arg0.properties.screen_idx then
f2_arg0:dispatchEventToRoot( {
name = "disable_right_arrow"
} )
else
f2_arg0:dispatchEventToRoot( {
name = "enable_right_arrow"
} )
end
if f2_arg0.properties.screen_idx <= 1 then
f2_arg0:dispatchEventToRoot( {
name = "disable_left_arrow"
} )
else
f2_arg0:dispatchEventToRoot( {
name = "enable_left_arrow"
} )
end
end
end
function aarMainChildFeeder( f3_arg0 )
local f3_local0 = {
"mp_scoreboard_main"
}
local f3_local1 = 0
if IsPublicMatch() then
local f3_local2 = Engine.GetPlayerDataEx
local f3_local3 = f3_arg0.exclusiveController
if not f3_local3 then
f3_local3 = Engine.GetFirstActiveController()
end
f3_local1 = f3_local2( f3_local3, CoD.StatsGroup.Common, "round", "squadMode" )
if f3_local1 == 0 then
f3_local0 = {
"aar_match_summary_main",
"mp_opprogress_main",
"mp_scoreboard_main"
}
else
f3_local0 = {
"aar_match_summary_main",
"mp_scoreboard_main"
}
end
end
if Engine.IsAliensMode() then
f3_local0 = {
"aar_match_summary_main",
"mp_scoreboard_main"
}
end
f3_arg0.screens = f3_local0
local f3_local2 = {
{
type = "UIImage",
id = "darken_behind_popup_id",
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = 0.1,
green = 0.14,
blue = 0.16,
alpha = 0.85
}
}
}
}
local f3_local3 = f3_arg0.screen_idx
local f3_local4 = f3_arg0.screens
if f3_local3 > 0 then
assert( f3_local4[f3_local3] )
f3_local2[#f3_local2 + 1] = {
type = f3_local4[f3_local3],
id = "aar_screen_" .. f3_local4[f3_local3] .. "_id",
properties = {
page_idx = f3_local3,
num_pages = #f3_local4,
controller = f3_arg0.exclusiveController,
squadMode = f3_local1
}
}
end
if #f3_local4 > 1 then
f3_local2[#f3_local2 + 1] = {
type = "aar_nav_arrows",
id = "aar_nav_arrows_id"
}
f3_local2[#f3_local2 + 1] = {
type = "UIBindButton",
id = "aar_summary_main_bind_btn_id",
handlers = {
button_right = function ( f4_arg0, f4_arg1 )
toggleScreen( f4_arg0, f4_arg1, "right" )
end,
button_left = function ( f5_arg0, f5_arg1 )
toggleScreen( f5_arg0, f5_arg1, "left" )
end,
toggle_aar_right = function ( f6_arg0, f6_arg1 )
toggleScreen( f6_arg0, f6_arg1, "right" )
end,
toggle_aar_left = function ( f7_arg0, f7_arg1 )
toggleScreen( f7_arg0, f7_arg1, "left" )
end
}
}
end
return f3_local2
end
function aar_summary_main()
return {
type = "UIElement",
id = "aar_main_container_id",
properties = {
screen_idx = 1
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
childrenFeeder = aarMainChildFeeder,
handlers = {
toggle_next_aar_screen = MBh.EmitEvent( "menu_refresh" ),
menu_create = AARSummaryMainCreate,
open_after_action_report_unlocks = OpenUnlockScreens
}
}
end
function aar_nav_arrows()
return {
type = "UIElement",
focusable = true,
requireFocusType = FocusType.MouseOver,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = false,
left = 0,
right = 0,
top = -30,
bottom = 30,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
popup_active = MBh.AnimateToState( "hidden" ),
popup_inactive = MBh.AnimateToState( "default" )
},
children = {
{
type = "UIButton",
id = "left_nav_arrow_button_id",
requireFocusType = FocusType.MouseOver,
states = {
default = {
leftAnchor = false,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = AAR.Layout.Width / -2 - 10 - 30,
right = AAR.Layout.Width / -2 - 10,
top = 0,
bottom = 0
}
},
handlers = {
button_action = MBh.EmitEventToRoot( {
name = "toggle_aar_left"
} )
},
children = {
{
type = "UIImage",
id = "left_nav_arrow_image_id",
states = {
default = {
material = RegisterMaterial( "widg_margin_arrow_lt" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = Engine.IsAliensMode() and Colors.alien_frontend_hilite.r or Colors.frontend_hilite.r,
green = Engine.IsAliensMode() and Colors.alien_frontend_hilite.g or Colors.frontend_hilite.g,
blue = Engine.IsAliensMode() and Colors.alien_frontend_hilite.b or Colors.frontend_hilite.b,
alpha = 0
},
bright = {
alpha = 1
}
},
handlers = {
disable_left_arrow = MBh.AnimateToState( "default", 0 ),
enable_left_arrow = MBh.AnimateToState( "bright", 0 )
}
}
}
},
{
type = "UIButton",
id = "right_nav_arrow_button_id",
requireFocusType = FocusType.MouseOver,
states = {
default = {
leftAnchor = false,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = AAR.Layout.Width / 2 + 10,
right = AAR.Layout.Width / 2 + 10 + 30,
top = 0,
bottom = 0
}
},
handlers = {
button_action = MBh.EmitEventToRoot( {
name = "toggle_aar_right"
} )
},
children = {
{
type = "UIImage",
id = "right_nav_arrow_image_id",
states = {
default = {
material = RegisterMaterial( "widg_margin_arrow_rt" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = Engine.IsAliensMode() and Colors.alien_frontend_hilite.r or Colors.frontend_hilite.r,
green = Engine.IsAliensMode() and Colors.alien_frontend_hilite.g or Colors.frontend_hilite.g,
blue = Engine.IsAliensMode() and Colors.alien_frontend_hilite.b or Colors.frontend_hilite.b,
alpha = 1
},
dim = {
alpha = 0
}
},
handlers = {
disable_right_arrow = MBh.AnimateToState( "dim", 0 ),
enable_right_arrow = MBh.AnimateToState( "default", 0 )
}
}
}
}
}
}
end
LUI.MenuBuilder.registerDef( "aar_nav_arrows", aar_nav_arrows )
LUI.MenuBuilder.registerDef( "aar_summary_main", aar_summary_main )
LockTable( _M )

View File

@@ -0,0 +1,607 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0, f1_arg1 )
end
f0_local1 = function ( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg1.controller
local f2_local1 = nil
local f2_local2 = -1
local f2_local3, f2_local4 = nil
for f2_local5 = 1, MaxTrackedOperations, 1 do
local f2_local8 = GetTrackedOp( f2_local0, f2_local5 - 1 )
if f2_local8 ~= "" then
local f2_local9 = GetOperationData( f2_local0, f2_local8 )
local f2_local10 = f2_local9.PercentProgress
local f2_local11 = f2_local10 >= 1
local f2_local12 = f2_local10 <= 0
if not f2_local11 and not f2_local12 and f2_local2 < f2_local10 then
f2_local1 = f2_local9
if f2_local11 then
local f2_local13 = 0
end
f2_local2 = f2_local13 or f2_local10
end
if f2_local11 and not f2_local3 then
f2_local3 = f2_local9
end
if f2_local12 and not f2_local4 then
f2_local4 = f2_local9
end
end
DebugPrint( "Cannot Access Current Active Op" )
end
local f2_local5 = nil
if f2_local1 then
f2_local5 = f2_local1
elseif f2_local3 then
f2_local5 = f2_local3
else
f2_local5 = f2_local4
end
local f2_local6 = nil
if f2_local5 then
f2_local6 = getGroupRefForOperation( f2_local5.Ref )
end
if not f2_local6 or not f2_local5 then
DebugPrint( "Error getting most-progressed operation." )
f2_arg0:processEvent( {
name = "hide_mini_aar_op_progress"
} )
return
end
local f2_local7 = Engine.Localize( GetFieldForOperationsGroup( f2_local6, OperationGroups.Cols.Name ) )
local f2_local14 = f2_local5.Name
local f2_local8 = f2_local5.ProgressText
local f2_local9 = 0
local f2_local10 = f2_local5.MaxProgress
local f2_local11 = 0
local f2_local12 = f2_local5.Progress
local f2_local15 = 0
local f2_local16 = 0
if f2_local10 - f2_local9 > 0 then
f2_local15 = (f2_local11 - f2_local9) / (f2_local10 - f2_local9)
f2_local16 = (f2_local12 - f2_local9) / (f2_local10 - f2_local9)
end
f2_arg0:processEvent( {
name = "update_operation_progress",
title_text = f2_local7,
desc_text = f2_local14,
progress_text = f2_local8,
prevPercent = math.min( f2_local15, 1 ),
currPercent = math.min( f2_local16, 1 )
} )
end
f0_local2 = function ()
local f3_local0 = 244
local f3_local1 = 7
local f3_local2 = {
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 55,
left = 0,
right = 0,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
expand_mini_aar = f0_local1,
hide_mini_aar_op_progress = MBh.AnimateToState( "hidden" )
}
}
local f3_local3 = {}
local f3_local4 = {
type = "UIText",
id = "progress_item_title_id",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 5,
bottom = CoD.TextSettings.NormalFont.Height + 5,
left = 6,
right = 400,
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.NormalFont.Font,
red = AAR.Swatch.subtext.r,
green = AAR.Swatch.subtext.g,
blue = AAR.Swatch.subtext.b
}
},
handlers = {
update_operation_progress = function ( f4_arg0, f4_arg1 )
f4_arg0:setText( f4_arg1.title_text )
end
}
}
local f3_local5 = {
type = "UIMarqueeText",
id = "progress_item_desc_id",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 28,
bottom = CoD.TextSettings.NormalFont.Height + 28,
left = 6,
right = 275,
font = CoD.TextSettings.NormalFont.Font,
red = AAR.Swatch.title.r,
green = AAR.Swatch.title.g,
blue = AAR.Swatch.title.b,
alignment = LUI.Alignment.Left
}
},
handlers = {
update_operation_progress = function ( f5_arg0, f5_arg1 )
f5_arg0:setText( f5_arg1.desc_text )
end
}
}
local f3_local6 = {
type = "UIText",
id = "progress_item_max_val_id",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 5,
bottom = CoD.TextSettings.NormalFont.Height + 5,
left = 400,
right = 544,
alignment = LUI.Alignment.Right,
font = CoD.TextSettings.NormalFont.Font,
red = AAR.Swatch.subtext.r,
green = AAR.Swatch.subtext.g,
blue = AAR.Swatch.subtext.b
}
},
handlers = {
update_operation_progress = function ( f6_arg0, f6_arg1 )
f6_arg0:setText( f6_arg1.progress_text )
end
}
}
local f3_local7 = {
type = "UIImage",
id = "progress_fill_meter_id",
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 300,
right = 300 + f3_local0,
top = 34,
bottom = 34 + f3_local1,
red = 0,
green = 0,
blue = 0
}
}
}
local f3_local8 = {}
local f3_local9 = {
type = "UIImage",
id = "progress_meter_curr_fill",
states = {
default = {
material = RegisterMaterial( "btn_cas_fill_f" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = AAR.Swatch.colorpop.r + 0.1,
green = AAR.Swatch.colorpop.g + 0.1,
blue = AAR.Swatch.colorpop.b + 0.1
}
},
handlers = {
update_operation_progress = function ( f7_arg0, f7_arg1 )
f7_arg0:registerAnimationState( "fill", {
material = RegisterMaterial( "btn_cas_fill_f" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = f7_arg1.currPercent * f3_local0,
top = 0,
bottom = 0,
red = AAR.Swatch.colorpop.r + 0.1,
green = AAR.Swatch.colorpop.g + 0.1,
blue = AAR.Swatch.colorpop.b + 0.1
} )
local f7_local0 = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
250
},
{
"fill",
250
}
} )
f7_local0( f7_arg0 )
end
}
}
local f3_local10 = {
type = "UIImage",
id = "progress_meter_prev_fill",
states = {
default = {
material = RegisterMaterial( "btn_cas_fill_f" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = AAR.Swatch.progressborder.r,
green = AAR.Swatch.progressborder.g,
blue = AAR.Swatch.progressborder.b
}
},
handlers = {
update_operation_progress = function ( f8_arg0, f8_arg1 )
f8_arg0:registerAnimationState( "fill", {
material = RegisterMaterial( "btn_cas_fill_f" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = f8_arg1.prevPercent * f3_local0,
top = 0,
bottom = 0,
red = AAR.Swatch.progressborder.r,
green = AAR.Swatch.progressborder.g,
blue = AAR.Swatch.progressborder.b
} )
f8_arg0:animateToState( "fill", 0 )
end
}
}
local f3_local11 = LUI.mp_menus.Operations.HairlineBorder( "top", AAR.Swatch.progressborder.r, AAR.Swatch.progressborder.g, AAR.Swatch.progressborder.b, 0.6 )
local f3_local12 = LUI.mp_menus.Operations.HairlineBorder( "bottom", AAR.Swatch.progressborder.r, AAR.Swatch.progressborder.g, AAR.Swatch.progressborder.b, 0.6 )
local f3_local13 = LUI.mp_menus.Operations.HairlineBorder( "left", AAR.Swatch.progressborder.r, AAR.Swatch.progressborder.g, AAR.Swatch.progressborder.b, 0.6 )
local f3_local14 = LUI.mp_menus.Operations.HairlineBorder( "right", AAR.Swatch.progressborder.r, AAR.Swatch.progressborder.g, AAR.Swatch.progressborder.b, 0.6 )
f3_local7.children = f3_local9
f3_local8 = LUI.mp_menus.Operations.HairlineBorder( "top", AAR.Swatch.trim.r, AAR.Swatch.trim.g, AAR.Swatch.trim.b, 0.6 )
f3_local9 = LUI.mp_menus.Operations.HairlineBorder( "bottom", AAR.Swatch.trim.r, AAR.Swatch.trim.g, AAR.Swatch.trim.b, 0.6 )
f3_local2.children = f3_local4
return f3_local2
end
local f0_local3 = function ( f9_arg0 )
assert( f9_arg0 )
local f9_local0 = ""
local f9_local1 = Engine.Localize( "@LUA_MENU_AAR_NEW_UNLOCKS" )
if f9_arg0 and f9_arg0 > 0 then
f9_local0 = f9_local1 .. " " .. f9_arg0
end
return f9_local0
end
function aar_mini_background()
return {
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Swatches.GenericMenu.Background, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = false,
top = 0,
bottom = 0,
width = 200,
material = RegisterMaterial( "white" )
} )
}
},
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Swatches.GenericMenu.Background, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = false,
top = 0,
bottom = 0,
right = -100,
width = 500,
material = RegisterMaterial( "box_white_gradient_fade_rt" )
} )
}
},
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Swatches.GenericMenu.Background, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = false,
top = 0,
bottom = 0,
left = 100,
right = 500,
material = RegisterMaterial( "box_white_gradient_fade" )
} )
}
},
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Swatches.GenericMenu.Border, {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 0,
bottom = 1,
right = 0,
width = 500,
material = RegisterMaterial( "box_white_gradient_fade_rt" )
} )
}
},
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Swatches.GenericMenu.Border, {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 0,
bottom = 1,
left = 0,
width = 500,
material = RegisterMaterial( "box_white_gradient_fade" )
} )
}
}
}
}
end
function AARMiniChildrenFeeder( f11_arg0 )
local f11_local0 = {
[#f11_local0 + 1] = {
type = "aar_mini_background",
id = "aar_mini_background_id"
},
[#f11_local0 + 1] = {
type = "UIText",
id = "aar_mini_title_id",
properties = {
text = MBh.Property( "title_text" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 10,
bottom = 10 + CoD.TextSettings.ExtraBigFont.Height,
left = 0,
right = 0,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Center
}
}
}
}
local f11_local1 = #f11_local0 + 1
local f11_local2 = {
type = "aar_xp_info_widget",
id = "aar_mini_xp_info_widget_id"
}
local f11_local3 = {}
local f11_local4
if Engine.GetDvarBool( "ui_opensummary" ) then
f11_local4 = true
else
f11_local4 = false
end
f11_local3.animate_progress = f11_local4
f11_local2.properties = f11_local3
f11_local2.states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 42,
left = -213,
right = 213,
height = 67,
material = RegisterMaterial( "white" ),
red = AAR.Swatch.background_2.r,
green = AAR.Swatch.background_2.g,
blue = AAR.Swatch.background_2.b
}
}
f11_local0[f11_local1] = f11_local2
f11_local0[#f11_local0 + 1] = {
type = "UIText",
id = "aar_mini_unlocks_message_id",
states = {
default = CoD.ColorizeState( Colors.frontend_hilite, {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 112,
left = -213,
right = 213,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left
} )
},
handlers = {
expand_mini_aar = function ( f12_arg0, f12_arg1 )
if f12_arg1.num_unlocks and f12_arg1.num_unlocks > 0 then
f12_arg0:setText( f0_local3( f12_arg1.num_unlocks ) )
else
f12_arg0:setText( "" )
end
end
}
}
if not SvS.IsSvS() then
f11_local1 = #f11_local0 + 1
f11_local2 = {
type = "UIElement",
id = "aar_mini_operation_progress_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = false,
top = 112 + CoD.TextSettings.NormalFont.Height,
bottom = 0,
left = -275,
right = 275
}
}
}
f11_local3 = {}
f11_local2.children = f0_local2()
f11_local0[f11_local1] = f11_local2
end
return f11_local0
end
function aar_mini()
return {
type = "UIElement",
id = "aar_mini_main",
properties = {
title_text = Engine.Localize( "@MENU_GAME_SUMMARY_CAPS" )
},
states = {
default = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 220,
left = 0,
right = 0
},
anim_in = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = SvS.IsSvS() and -240 or -310,
bottom = 0,
left = 0,
right = 0
},
anim_in_hold = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = SvS.IsSvS() and -240 or -290,
bottom = 0,
left = 0,
right = 0
},
anim_out = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 220,
left = 0,
right = 0
}
},
handlers = {
expand_mini_aar = MBh.AnimateSequence( {
{
"default",
500
},
{
"anim_in",
175
},
{
"anim_in_hold",
75
},
{
"anim_in_hold",
5000
},
{
"anim_out",
175
}
} )
},
childrenFeeder = AARMiniChildrenFeeder
}
end
LUI.MenuBuilder.registerDef( "aar_mini", aar_mini )
LUI.MenuBuilder.registerDef( "aar_mini_background", aar_mini_background )
LockTable( _M )

View File

@@ -0,0 +1,396 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function OperationProgressListRowFeeder( f1_arg0 )
local f1_local0 = {}
local f1_local1 = LUI.FlowManager.GetMenuScopedDataByMenuName( "aar_summary_main" )
local f1_local2 = f1_local1.controller
local f1_local3 = GetAllOpGroupRefs()
local f1_local4 = 250
local f1_local5 = 7
local f1_local6 = 30
for f1_local7 = 1, MaxTrackedOperations, 1 do
local f1_local10 = GetTrackedOp( f1_local2, f1_local7 - 1 )
if f1_local10 == "" then
DebugPrint( "Cannot Access Current Tracked Op" )
return {}
end
local f1_local11 = GetOperationData( f1_local2, f1_local10 )
local f1_local12 = f1_local11.Name
local f1_local13 = f1_local11.ProgressText
local f1_local14 = 0
local f1_local15 = f1_local11.MaxProgress
local f1_local16 = 0
local f1_local17 = f1_local11.Progress
local f1_local18 = 0
local f1_local19 = 0
if f1_local15 - f1_local14 > 0 then
f1_local18 = (f1_local16 - f1_local14) / (f1_local15 - f1_local14)
f1_local19 = (f1_local17 - f1_local14) / (f1_local15 - f1_local14)
end
f1_local19 = math.min( f1_local19, 1 )
f1_local18 = math.min( f1_local18, 1 )
local f1_local20 = {
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = f1_local6,
left = 0,
right = 0
}
}
}
local f1_local21 = {}
local f1_local22 = {
type = "UIMarqueeText",
id = "progress_item_desc_id",
properties = {
text = f1_local12
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 5,
bottom = CoD.TextSettings.NormalFont.Height + 5,
left = 6,
right = 275,
font = CoD.TextSettings.NormalFont.Font,
red = AAR.Swatch.title.r,
green = AAR.Swatch.title.g,
blue = AAR.Swatch.title.b,
alignment = LUI.Alignment.Left
}
}
}
local f1_local23 = {
type = "UIText",
id = "progress_item_max_val_id",
properties = {
text = f1_local13
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 5,
bottom = CoD.TextSettings.NormalFont.Height + 5,
left = 500,
right = 656,
alignment = LUI.Alignment.Right,
font = CoD.TextSettings.NormalFont.Font,
red = AAR.Swatch.subtext.r,
green = AAR.Swatch.subtext.g,
blue = AAR.Swatch.subtext.b
}
}
}
local f1_local24 = {
type = "UIImage",
id = "progress_fill_meter_id",
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 300,
right = 300 + f1_local4,
top = 11,
bottom = 11 + f1_local5,
red = 0,
green = 0,
blue = 0
}
}
}
local f1_local25 = {}
local f1_local26 = {
type = "UIImage",
id = "progress_meter_curr_fill",
states = {
default = {
material = RegisterMaterial( "btn_cas_fill_f" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = AAR.Swatch.colorpop.r + 0.1,
green = AAR.Swatch.colorpop.g + 0.1,
blue = AAR.Swatch.colorpop.b + 0.1
},
fill = {
material = RegisterMaterial( "btn_cas_fill_f" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = f1_local19 * f1_local4,
top = 0,
bottom = 0,
red = AAR.Swatch.colorpop.r + 0.1,
green = AAR.Swatch.colorpop.g + 0.1,
blue = AAR.Swatch.colorpop.b + 0.1
}
},
handlers = {
element_refresh = function ( f2_arg0, f2_arg1 )
local f2_local0 = MBh.AnimateSequence( {
{
"default",
0
},
{
"default",
250
},
{
"fill",
250
}
} )
f2_local0( f2_arg0 )
end
}
}
local f1_local27 = {
type = "UIImage",
id = "progress_meter_prev_fill",
states = {
default = {
material = RegisterMaterial( "btn_cas_fill_f" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = f1_local18 * f1_local4,
top = 0,
bottom = 0,
red = AAR.Swatch.progressborder.r,
green = AAR.Swatch.progressborder.g,
blue = AAR.Swatch.progressborder.b
}
}
}
local f1_local28 = LUI.mp_menus.Operations.HairlineBorder( "top", AAR.Swatch.progressborder.r, AAR.Swatch.progressborder.g, AAR.Swatch.progressborder.b, 0.6 )
local f1_local29 = LUI.mp_menus.Operations.HairlineBorder( "bottom", AAR.Swatch.progressborder.r, AAR.Swatch.progressborder.g, AAR.Swatch.progressborder.b, 0.6 )
local f1_local30 = LUI.mp_menus.Operations.HairlineBorder( "left", AAR.Swatch.progressborder.r, AAR.Swatch.progressborder.g, AAR.Swatch.progressborder.b, 0.6 )
local f1_local31 = LUI.mp_menus.Operations.HairlineBorder( "right", AAR.Swatch.progressborder.r, AAR.Swatch.progressborder.g, AAR.Swatch.progressborder.b, 0.6 )
f1_local24.children = f1_local26
f1_local25 = LUI.mp_menus.Operations.HairlineBorder( "top", AAR.Swatch.trim.r, AAR.Swatch.trim.g, AAR.Swatch.trim.b, 0.6 )
if f1_local7 == MaxTrackedOperations then
f1_local26 = LUI.mp_menus.Operations.HairlineBorder( "bottom", AAR.Swatch.trim.r, AAR.Swatch.trim.g, AAR.Swatch.trim.b, 0.6 )
if not f1_local26 then
else
f1_local21[1] = f1_local22
f1_local21[2] = f1_local23
f1_local21[3] = f1_local24
f1_local21[4] = f1_local25
f1_local21[5] = f1_local26
f1_local20.children = f1_local21
f1_local20.id = "progress_item_" .. f1_local7
f1_local0[#f1_local0 + 1] = f1_local20
end
end
f1_local26 = nil
end
return f1_local0
end
function mp_opprogress_vlist()
return {
type = "UIVerticalList",
id = "mp_opprogress_vlist_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = false,
top = CoD.TextSettings.ExtraBigFont.Height + 40,
bottom = 0,
left = -331,
right = 331
}
},
childrenFeeder = OperationProgressListRowFeeder
}
end
function mp_opprogress_page()
return {
type = "UIElement",
id = "mp_opprogress_page_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "UIText",
id = "mp_opprogress_title",
properties = {
text = Engine.Localize( "@LUA_MENU_OPERATION_PROGRESS_CAPS" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 30,
bottom = CoD.TextSettings.ExtraBigFont.Height + 30,
left = -200,
right = 200,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.ExtraBigFont.Font,
red = AAR.Swatch.title.r,
green = AAR.Swatch.title.g,
blue = AAR.Swatch.title.b
}
}
},
{
type = "mp_opprogress_vlist"
}
}
}
end
function mp_opprogress_main()
return {
type = "UIElement",
id = "mp_opprogress_main_id",
properties = {
page_idx = 1,
num_pages = 3
},
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
width = AAR.Layout.Width,
height = AAR.Layout.Height
}
},
handlers = {
element_refresh = function ( f6_arg0, f6_arg1 )
local f6_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "aar_summary_main" )
local f6_local1 = f6_local0.controller
local f6_local2 = Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, Engine.GetPlayerDataEx( f6_local1, CoD.StatsGroup.Common, "round", "gameMode" ), GameTypesTable.Cols.Name )
local f6_local3 = Engine.GetPlayerDataEx( f6_local1, CoD.StatsGroup.Common, "round", "map" )
local f6_local4 = Squad.GetRealBaseNameFromLoadName( f6_local3 )
if f6_local3 ~= "" then
f6_arg0:processEvent( {
name = "aar_set_subtitle_text",
new_text = Engine.Localize( "LUA_MENU_MODE_AND_MAP_FORMAT", f6_local2, Engine.MarkLocalized( f6_local4 ) ),
dispatchChildren = true
} )
end
end
},
children = {
{
type = "generic_drop_shadow",
id = "description_drop_shadow1",
properties = {
offset_shadow = 0
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alpha = 0.35
}
}
},
{
type = "generic_menu_background",
id = "aar_match_summary_main_bkg",
properties = {
fill_alpha = 1
}
},
{
type = "aar_title_bar",
properties = {
title_text = Engine.Localize( "@LUA_MENU_GAME_SUMMARY" ),
subtitle_text = Engine.Localize( "@LUA_MENU_OPERATIONS_TITLE" ),
subtitle_banner_width = 300
}
},
{
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = AAR.Layout.TitleBarHeight + AAR.Layout.SubTitleBarHeight,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "mp_opprogress_page"
},
{
type = "aar_footer_bar",
id = "oink_1"
}
}
},
{
type = "aar_dots",
id = "AARSummaryDotsID",
properties = {
num_dots = MBh.Property( "num_pages" ),
curr_dot = MBh.Property( "page_idx" )
}
}
}
}
end
LUI.MenuBuilder.registerDef( "mp_opprogress_main", mp_opprogress_main )
LUI.MenuBuilder.registerDef( "mp_opprogress_page", mp_opprogress_page )
LUI.MenuBuilder.registerDef( "mp_opprogress_vlist", mp_opprogress_vlist )
LockTable( _M )

View File

@@ -0,0 +1,800 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0 )
local f1_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "aar_summary_main" )
local f1_local1 = Engine.GetPlayerDataEx( f1_local0.controller, CoD.StatsGroup.Common, "round", "scoreboardType" )
local f1_local2
if f1_local1 == "allies" or f1_local1 == "axis" then
f1_local2 = false
else
f1_local2 = true
end
local f1_local3 = {
default = {
"score",
"kills",
"deaths",
"assists"
},
war = {
"score",
"kills",
"deaths",
"assists"
},
dom = {
"score",
"kills",
"deaths",
"captures"
},
sd = {
"score",
"kills",
"deaths",
"plants"
},
conf = {
"score",
"kills",
"deaths",
"tags"
},
dm = {
"dm_score",
"kills",
"deaths",
"dm_streak"
},
sr = {
"score",
"kills",
"deaths",
"rescues"
},
blitz = {
"score",
"kills",
"deaths",
"captures"
},
cranked = {
"score",
"kills",
"deaths",
"assists"
},
cranked_ffa = {
"cranked_ffa_score",
"kills",
"deaths",
"assists"
},
sotf = {
"score",
"kills",
"deaths",
"assists"
},
sotf_ffa = {
"sotf_ffa_score",
"kills",
"deaths",
"dm_streak"
},
infect = {
"score",
"kills",
"deaths",
"time"
},
grind = {
"score",
"kills",
"deaths",
"scores"
},
horde = {
"kills",
"revives",
"crates"
},
gun = {
"score",
"kills",
"deaths",
"gun_knives"
},
siege = {
"score",
"kills",
"deaths",
"captures"
}
}
local f1_local4 = {
score = {
"LUA_MENU_SCORE",
"score"
},
kills = {
"LUA_MENU_KILLS",
"kills"
},
deaths = {
"LUA_MENU_DEATHS",
"deaths"
},
assists = {
"LUA_MENU_ASSISTS",
"assists"
},
cranked_ffa_score = {
"LUA_MENU_SCORE",
"extrascore0"
},
sotf_ffa_score = {
"LUA_MENU_SCORE",
"extrascore0"
},
dm_score = {
"LUA_MENU_SCORE",
"extrascore0"
},
rescues = {
"LUA_MENU_RESCUES",
"extrascore0"
},
captures = {
"LUA_MENU_CAPTURES",
"extrascore0"
},
tags = {
"LUA_MENU_TAGS",
"extrascore0"
},
time = {
"LUA_MENU_TIME",
"extrascore0"
},
scores = {
"LUA_MENU_SCORES",
"extrascore0"
},
plants = {
"LUA_MENU_PLANTS",
"extrascore0"
},
revives = {
"LUA_MENU_REVIVES",
"assists"
},
crates = {
"LUA_MENU_CRATES",
"extrascore0"
},
dm_streak = {
"MENU_STREAK",
"assists"
},
gun_knives = {
"PATCH_MENU_STABS",
"assists"
}
}
local f1_local5
if f1_local2 then
f1_local5 = f1_local3[f1_arg0 .. "_ffa"]
if not f1_local5 then
else
local f1_local6 = {}
for f1_local10, f1_local11 in ipairs( f1_local5 ) do
f1_local6[f1_local10] = {
Engine.Localize( f1_local4[f1_local11][1] ),
f1_local4[f1_local11][2]
}
end
return f1_local6
end
end
f1_local5 = f1_local3[f1_arg0] or f1_local3.default
end
function ScoreboardListRowFeeder( f2_arg0 )
local f2_local0 = {}
local f2_local1 = LUI.FlowManager.GetMenuScopedDataByMenuName( "aar_summary_main" )
local f2_local2 = f2_local1.controller
local f2_local3 = Engine.GetPlayerDataEx( f2_local2, CoD.StatsGroup.Common, "round", "gameMode" )
local f2_local4 = f0_local0( f2_local3 )
f2_local0[#f2_local0 + 1] = {
type = "UIImage",
id = "small_spacer_id",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 20,
left = 0,
right = 0,
material = RegisterMaterial( "white" ),
red = 1,
green = 1,
blue = 1,
alpha = 0
}
}
}
local f2_local5 = {}
if Engine.IsAliensMode() then
table.insert( f2_local5, Engine.Localize( "@LUA_MENU_PLAYER_NAME_CAPS" ) )
table.insert( f2_local5, Engine.Localize( "@MPUI_SCORE" ) )
table.insert( f2_local5, Engine.Localize( "@MPUI_KILLS" ) )
if not isAliensSolo() then
table.insert( f2_local5, Engine.Localize( "@MPUI_ASSISTS" ) )
end
table.insert( f2_local5, Engine.Localize( "@ALIENS_REVIVES" ) )
if not AAR.AreChaosStats( f2_local3 ) then
table.insert( f2_local5, Engine.Localize( "@ALIENS_DRILL_RESTARTS" ) )
end
table.insert( f2_local5, Engine.Localize( "@MENU_DOWNS" ) )
else
local f2_local6 = {}
f2_local5 = Engine.Localize( "@LUA_MENU_PLAYER_NAME_CAPS" )
for f2_local9, f2_local10 in pairs( f2_local4 ) do
f2_local5[#f2_local5 + 1] = f2_local10[1]
end
end
local f2_local6 = {}
local f2_local7 = 788
local f2_local8 = 0
for f2_local9 = #f2_local5, 1, -1 do
if f2_local9 == 1 then
f2_local6[f2_local9] = f2_local7 - f2_local8
else
local f2_local12, f2_local13, f2_local14, f2_local15 = GetTextDimensions( f2_local5[f2_local9], CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
f2_local6[f2_local9] = f2_local14 - f2_local12 + 20
f2_local8 = f2_local8 + f2_local6[f2_local9]
end
end
local f2_local9 = {}
for f2_local10 = 1, #f2_local5, 1 do
f2_local9[#f2_local9 + 1] = CreateScoreBoardHeaderCell( "scoreboard_header_" .. f2_local10, f2_local5[f2_local10], f2_local6[f2_local10], f2_local10 % 2 == 1 )
end
f2_local0[#f2_local0 + 1] = {
type = "UIHorizontalList",
properties = {},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 25,
left = 0,
right = 0
}
},
children = f2_local9
}
local f2_local11 = Engine.GetClientMatchData( "scoreboardPlayerCount" )
local f2_local16 = ""
if Engine.GetUsernameByController then
f2_local16 = Engine.GetUsernameByController( f2_local2 )
end
local f2_local12 = "none"
if f2_local11 ~= nil and f2_local11 > 0 then
for f2_local13 = 1, f2_local11, 1 do
local f2_local17 = Engine.GetClientMatchData( "scoreboards", Engine.GetPlayerDataEx( f2_local2, CoD.StatsGroup.Common, "round", "scoreboardType" ), f2_local13 - 1 )
if f2_local17 >= 0 and Engine.GetClientMatchData( "players", f2_local17, "xuid" ) == f2_local16 then
f2_local12 = Engine.GetClientMatchData( "players", f2_local17, "team" )
break
end
end
end
local f2_local13 = LUI.mp_menus.Aliens
local f2_local14 = {}
if Engine.IsAliensMode() then
for f2_local15 = 0, 3, 1 do
if f2_local13.GetGamerTagFromClient( f2_local15 ) ~= "" then
table.insert( f2_local14, f2_local15 )
end
end
end
for f2_local15 = 1, AAR.Scoreboard.NumRows, 1 do
local f2_local17 = f2_local15
local f2_local20 = 0
if f2_local17 % 2 == 1 then
f2_local20 = 0.25
end
local f2_local21 = -1
local f2_local22 = ""
local f2_local23 = "none"
local f2_local24 = 0
local f2_local25 = 0
local f2_local26 = 0
local f2_local27 = 0
local f2_local28 = ""
local f2_local29 = ""
local f2_local30 = ""
local f2_local31 = ""
local f2_local32 = ""
local f2_local33 = ""
if Engine.IsAliensMode() then
if f2_local14[f2_local17] then
local f2_local34 = f2_local14[f2_local17]
f2_local22 = f2_local13.GetGamerTagFromClient( f2_local34 )
f2_local28 = f2_local13.GetScoreFromClient( f2_local34 )
f2_local29 = f2_local13.GetKillsFromClient( f2_local34 )
f2_local30 = f2_local13.GetAssistsFromClient( f2_local34 )
f2_local32 = f2_local13.GetRevivesFromClient( f2_local34 )
f2_local33 = f2_local13.GetDrillRestartsFromClient( f2_local34 )
f2_local31 = f2_local13.GetDownsFromClient( f2_local34 )
end
else
local f2_local34 = Engine.GetPlayerDataEx( f2_local2, CoD.StatsGroup.Common, "round", "scoreboardType" )
if f2_local34 ~= "none" and f2_local11 ~= nil and f2_local17 - 1 < f2_local11 then
f2_local21 = Engine.GetClientMatchData( "scoreboards", f2_local34, f2_local17 - 1 )
end
if f2_local21 >= 0 and (f2_local34 == "allies" or f2_local34 == "axis") then
f2_local23 = Engine.GetClientMatchData( "players", f2_local21, "team" )
if f2_local23 == "axis" or f2_local23 == "allies" then
if f2_local12 == "none" then
if f2_local23 == "axis" then
f2_local24 = AAR.Swatch.enemy.r
f2_local25 = AAR.Swatch.enemy.g
f2_local26 = AAR.Swatch.enemy.b
else
f2_local24 = AAR.Swatch.friendly.r
f2_local25 = AAR.Swatch.friendly.g
f2_local26 = AAR.Swatch.friendly.b
end
elseif f2_local23 == f2_local12 then
f2_local24 = AAR.Swatch.friendly.r
f2_local25 = AAR.Swatch.friendly.g
f2_local26 = AAR.Swatch.friendly.b
else
f2_local24 = AAR.Swatch.enemy.r
f2_local25 = AAR.Swatch.enemy.g
f2_local26 = AAR.Swatch.enemy.b
end
f2_local27 = 0.65
end
end
end
f2_local0[#f2_local0 + 1] = {
type = "UIElement",
properties = {},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 26,
left = 0,
right = 0
}
},
children = {
{
type = "UIImage",
properties = {},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "white" ),
red = 0,
green = 0,
blue = 0,
alpha = f2_local20
}
}
},
{
type = "UIImage",
properties = {},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 1,
bottom = -1,
left = -3,
right = 0,
material = RegisterMaterial( "scoreboard_team_player" ),
red = f2_local24,
green = f2_local25,
blue = f2_local26,
alpha = f2_local27
}
}
},
{
type = "UIHorizontalList",
properties = {},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 3,
right = 0
}
},
childrenFeeder = function ( f3_arg0 )
local f3_local0 = {}
local f3_local1 = LUI.FlowManager.GetMenuScopedDataByMenuName( "aar_summary_main" )
local f3_local2 = f3_local1.controller
local f3_local3 = Engine.GetPlayerDataEx( f3_local2, CoD.StatsGroup.Common, "round", "gameMode" )
if Engine.IsAliensMode() then
f3_local0[#f3_local0 + 1] = CreateScoreBoardEntryCell( "player_name_" .. f2_local17, f2_local22, f2_local6[1], true, LUI.Alignment.Left, true )
f3_local0[#f3_local0 + 1] = CreateScoreBoardEntryCell( "score_" .. f2_local17, f2_local28, f2_local6[2], false )
f3_local0[#f3_local0 + 1] = CreateScoreBoardEntryCell( "kills_" .. f2_local17, f2_local29, f2_local6[3], true )
local f3_local4 = 4
if not isAliensSolo() then
f3_local0[#f3_local0 + 1] = CreateScoreBoardEntryCell( "assists_" .. f2_local17, f2_local30, f2_local6[f3_local4], false )
f3_local4 = f3_local4 + 1
end
f3_local0[#f3_local0 + 1] = CreateScoreBoardEntryCell( "revives_" .. f2_local17, f2_local32, f2_local6[f3_local4], true )
f3_local4 = f3_local4 + 1
if not AAR.AreChaosStats( f3_local3 ) then
f3_local0[#f3_local0 + 1] = CreateScoreBoardEntryCell( "drills_" .. f2_local17, f2_local33, f2_local6[f3_local4], false )
f3_local4 = f3_local4 + 1
end
f3_local0[#f3_local0 + 1] = CreateScoreBoardEntryCell( "deaths_" .. f2_local17, f2_local31, f2_local6[f3_local4], true )
else
local f3_local4 = -1
local f3_local5 = ""
local f3_local6 = Engine.GetPlayerDataEx( f3_local2, CoD.StatsGroup.Common, "round", "scoreboardType" )
if f3_local6 ~= "none" and f2_local11 ~= nil and f2_local17 - 1 < f2_local11 then
f3_local4 = Engine.GetClientMatchData( "scoreboards", f3_local6, f2_local17 - 1 )
end
if f3_local4 >= 0 then
f3_local5 = Engine.GetClientMatchData( "players", f3_local4, "xuid" )
end
f3_local0[#f3_local0 + 1] = CreateScoreBoardEntryCell( "player_name_" .. f2_local17, f3_local5, f2_local6[1], true, LUI.Alignment.Left )
for f3_local11, f3_local12 in pairs( f0_local0( f3_local3 ) ) do
local f3_local10 = ""
if f3_local4 >= 0 then
f3_local10 = Engine.GetClientMatchData( "players", f3_local4, f3_local12[2] )
if f3_local3 == "infect" and f3_local12[2] == "extrascore0" then
f3_local10 = CoD.FormatInfectedTime( f3_local10, true )
elseif (f3_local3 == "dm" or f3_local3 == "sotf_ffa") and f3_local12[2] == "extrascore0" then
f3_local10 = f3_local10 * Engine.GetClientMatchData( "players", f3_local4, "score" )
end
end
f3_local0[#f3_local0 + 1] = CreateScoreBoardEntryCell( f3_local12[2] .. "_" .. f2_local17, f3_local10, f2_local6[f3_local11 + 1], false )
end
end
return f3_local0
end
}
},
id = "scoreboard_line_" .. f2_local17
}
end
return f2_local0
end
function CreateScoreBoardHeaderCell( f4_arg0, f4_arg1, f4_arg2, f4_arg3 )
local f4_local0 = {
type = "UIElement",
id = f4_arg0,
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
right = f4_arg2
}
}
}
local f4_local1 = {}
local f4_local2 = {
type = "UIImage",
id = "bkg_1",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = -1,
left = 0,
right = 0,
material = RegisterMaterial( "white" ),
red = 1,
green = 1,
blue = 1,
alpha = 0.15
}
}
}
local f4_local3 = {
type = "UIImage",
id = "bkg_2",
states = {
default = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = -1,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "white" ),
red = 0,
green = 0,
blue = 0
}
}
}
local f4_local4 = {
type = "UIImage",
id = "bkg_3"
}
local f4_local5 = {}
local f4_local6 = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "white" ),
red = 0,
green = 0,
blue = 0
}
local f4_local7
if f4_arg3 then
f4_local7 = 0.1
if not f4_local7 then
else
f4_local6.alpha = f4_local7
f4_local5.default = f4_local6
f4_local4.states = f4_local5
f4_local5 = {
type = "UIText",
id = "label_text_id",
properties = {
text = f4_arg1
},
states = {
default = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = -CoD.TextSettings.NormalFont.Height,
bottom = 0,
left = 10,
right = 0,
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.NormalFont.Font,
red = AAR.Swatch.header_text.r,
green = AAR.Swatch.header_text.g,
blue = AAR.Swatch.header_text.b
}
}
}
f4_local1[1] = f4_local2
f4_local1[2] = f4_local3
f4_local1[3] = f4_local4
f4_local1[4] = f4_local5
f4_local0.children = f4_local1
return f4_local0
end
end
f4_local7 = 0
end
function CreateScoreBoardEntryCell( f5_arg0, f5_arg1, f5_arg2, f5_arg3, f5_arg4, f5_arg5 )
local f5_local0 = {
type = "UIElement",
id = f5_arg0,
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
right = f5_arg2
}
}
}
local f5_local1 = {}
local f5_local2 = {}
local f5_local3
if f5_arg5 then
f5_local3 = "UIMarqueeText"
if not f5_local3 then
else
f5_local2.type = f5_local3
f5_local2.properties = {
text = f5_arg1,
textStyle = CoD.TextStyle.Shadowed
}
f5_local3 = {}
local f5_local4 = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
height = CoD.TextSettings.NormalFont.Height
}
local f5_local5
if f5_arg4 == LUI.Alignment.Left then
f5_local5 = 5
if not f5_local5 then
else
f5_local4.left = f5_local5
f5_local4.right = -10
f5_local4.alignment = f5_arg4 or LUI.Alignment.Right
f5_local4.font = CoD.TextSettings.NormalFont.Font
f5_local4.red = Colors.white.r
f5_local4.green = Colors.white.g
f5_local4.blue = Colors.white.b
f5_local3.default = f5_local4
f5_local2.states = f5_local3
f5_local1[1] = f5_local2
f5_local0.children = f5_local1
return f5_local0
end
end
f5_local5 = 0
end
end
f5_local3 = "UIText"
end
function mp_scoreboard_page()
return {
type = "UIVerticalList",
id = "mp_scoreboard_page_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 1,
right = -1
}
},
childrenFeeder = ScoreboardListRowFeeder
}
end
function mp_scoreboard_main()
return {
type = "UIElement",
id = "mp_scoreboard_main_id",
properties = {
page_idx = 1,
num_pages = 3
},
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -AAR.Scoreboard.Layout.Height * 0.5,
bottom = AAR.Scoreboard.Layout.Height * 0.5,
left = -AAR.Layout.Width / 2,
right = AAR.Layout.Width / 2
}
},
children = {
{
type = "generic_drop_shadow",
id = "description_drop_shadow1",
properties = {
offset_shadow = 0
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alpha = 0.35
}
}
},
{
type = "generic_menu_background",
id = "aar_match_summary_main_bkg",
properties = {
fill_alpha = 1
}
},
{
type = "aar_title_bar",
id = "aar_scoreboard_title_bar_id",
properties = {
title_text = Engine.Localize( "@LUA_MENU_GAME_SUMMARY_CAPS" ),
subtitle_text = Engine.Localize( "@LUA_MENU_SCOREBOARD_CAPS" )
}
},
{
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = AAR.Layout.TitleBarHeight + AAR.Layout.SubTitleBarHeight,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "mp_scoreboard_page",
id = "scoreboard_id"
},
{
type = "aar_footer_bar",
id = "oink_2"
}
}
},
{
type = "aar_dots",
id = "AARSummaryDotsID",
properties = {
num_dots = MBh.Property( "num_pages" ),
curr_dot = MBh.Property( "page_idx" )
}
}
}
}
end
LUI.MenuBuilder.registerDef( "mp_scoreboard_main", mp_scoreboard_main )
LUI.MenuBuilder.registerDef( "mp_scoreboard_page", mp_scoreboard_page )
LockTable( _M )

View File

@@ -0,0 +1,495 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = {
OutcomeTextTop = 90,
TeamInfoMargin = 5,
SeparatorTop = 280,
SeparatorHeight = 1,
SeparatorAlpha = 0.15,
VersusTextTop = 126
}
f0_local1 = {
Top = 125,
Height = 164,
Width = 360,
Spacing = 10,
TitleBGColor = {
r = 0.1,
g = 0.1,
b = 0.1
},
TitleBGHeight = 25,
TitleBGTextMargin = 2
}
f0_local2 = {
Height = 25,
HorizontalTextMargin = 15,
VerticalTextMargin = 2,
ValueAreaWidth = 125,
SplitImageWidth = 32,
ValueAreaBorder = 2,
PrimaryColor = {
r = 0.1,
g = 0.1,
b = 0.1
},
ValueAreaColor = {
r = 0.4,
g = 0.4,
b = 0.4
}
}
function MatchSummaryCreate( f1_arg0, f1_arg1 )
local f1_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f1_arg0 )
local f1_local1 = f1_arg1.controller or f1_local0.exclusiveController
local f1_local2 = SvS.GetCachedPostMatchData()
f1_arg0:processEvent( {
name = "aar_set_subtitle_text",
new_text = Engine.Localize( "LUA_MENU_MODE_AND_MAP_FORMAT", Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, Engine.GetPlayerDataEx( f1_local1, CoD.StatsGroup.Common, "round", "gameMode" ), GameTypesTable.Cols.Name ), Engine.MarkLocalized( Squad.GetRealBaseNameFromLoadName( Engine.GetPlayerDataEx( f1_local1, CoD.StatsGroup.Common, "round", "map" ) ) ) )
} )
local f1_local3 = SvS.GetReportOutcomeKeyFromWinLoss( Engine.GetPlayerDataEx( f1_local1, CoD.StatsGroup.Common, "round", "win" ), Engine.GetPlayerDataEx( f1_local1, CoD.StatsGroup.Common, "round", "loss" ) )
f1_arg0:processEvent( {
name = "set_outcome_text",
text = SvS.GetReportOutcomeText( f1_local3, Engine.GetPlayerDataEx( f1_local1, CoD.StatsGroup.Common, "round", "endReasonTextIndex" ) ),
outcomeKey = f1_local3
} )
local f1_local4 = Engine.GetClientMatchData( "alliesScore" ) or 0
local f1_local5 = Engine.GetClientMatchData( "axisScore" ) or 0
local f1_local6 = Engine.GetPlayerDataEx( f1_local1, CoD.StatsGroup.Common, "round", "clientMatchIndex" ) or -1
local f1_local7, f1_local8 = nil
if f1_local6 ~= -1 then
if (Engine.GetClientMatchData( "players", f1_local6, "team" ) or "allies") == "allies" then
f1_local7 = f1_local4
f1_local8 = f1_local5
else
f1_local7 = f1_local5
f1_local8 = f1_local4
end
else
f1_local7 = 0
f1_local8 = 0
DebugPrint( "[WARNING] AARSquadSummary: Attempting to view scoreboard, but clientMatchIndex value is invalid" )
end
local f1_local9 = f1_arg0:getFirstDescendentById( "aar_squad_summary_your_team_info" )
local f1_local10 = f1_arg0:getFirstDescendentById( "aar_squad_summary_enemy_team_info" )
f1_local9:processEvent( {
name = "set_team_score_text",
text = f1_local7
} )
f1_local10:processEvent( {
name = "set_team_score_text",
text = f1_local8
} )
f1_local10:processEvent( {
name = "update_playercard",
gamertag = f1_local2.enemyName,
clantag = f1_local2.enemyPlayercard.clantag,
rank = f1_local2.enemyPlayercard.rank,
prestige = f1_local2.enemyPlayercard.prestige,
background = f1_local2.enemyPlayercard.background,
patchEmblem = f1_local2.enemyPlayercard.patch
} )
local f1_local11 = Cac.GetLocalRankedPlayercardInfo( f1_local1 )
f1_local11.name = "update_playercard"
f1_local11.patchEmblem = f1_local11.patch
f1_local9:processEvent( f1_local11 )
end
function CreateScoreBar( f2_arg0 )
local f2_local0, f2_local1, f2_local2, f2_local3, f2_local4, f2_local5 = nil
if not f2_arg0 then
f2_local0 = LUI.Alignment.Left
f2_local1 = LUI.Alignment.Right
f2_local2 = f0_local1.Width - f0_local2.ValueAreaWidth - f0_local2.SplitImageWidth
f2_local3 = f0_local1.Width - f0_local2.ValueAreaWidth
f2_local4 = f2_local3
f2_local5 = f2_local4 + f0_local2.ValueAreaWidth - f0_local2.ValueAreaBorder
else
f2_local0 = LUI.Alignment.Right
f2_local1 = LUI.Alignment.Left
f2_local2 = f0_local2.ValueAreaWidth + f0_local2.SplitImageWidth
f2_local3 = f0_local2.ValueAreaWidth
f2_local4 = f0_local2.ValueAreaBorder
f2_local5 = f2_local4 + f0_local2.ValueAreaWidth + f0_local2.ValueAreaBorder
end
return {
type = "UIImage",
id = "team_info_score_bar_bg",
states = {
default = CoD.ColorizeState( f0_local2.PrimaryColor, {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = f0_local2.Height
} )
},
children = {
{
type = "UIImage",
id = "team_info_score_bar_value_bg",
states = {
default = CoD.ColorizeState( f0_local2.ValueAreaColor, {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = f2_local4,
right = f2_local4 + f0_local2.ValueAreaWidth,
top = f0_local2.ValueAreaBorder,
bottom = f0_local2.Height - f0_local2.ValueAreaBorder
} )
}
},
{
type = "UIImage",
id = "team_info_score_bar_split_image",
states = {
default = CoD.ColorizeState( f0_local2.ValueAreaColor, {
material = RegisterMaterial( "box_stat_cap" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = f2_local2,
right = f2_local3,
top = f0_local2.ValueAreaBorder,
bottom = f0_local2.Height - f0_local2.ValueAreaBorder
} )
}
},
{
type = "UIText",
id = "team_info_score_bar_label_text",
properties = {
text = Engine.Localize( "LUA_MENU_SCORE_CAPS" )
},
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = f0_local2.HorizontalTextMargin,
right = -f0_local2.HorizontalTextMargin,
top = f0_local2.VerticalTextMargin,
bottom = f0_local2.VerticalTextMargin + CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = f2_local0
} )
}
},
{
type = "UIText",
id = "team_info_score_bar_value_text",
handlers = {
set_team_score_text = function ( f3_arg0, f3_arg1 )
f3_arg0:setText( f3_arg1.text )
end
},
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = f0_local2.HorizontalTextMargin,
right = -f0_local2.HorizontalTextMargin,
top = f0_local2.VerticalTextMargin,
bottom = f0_local2.VerticalTextMargin + CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = f2_local1
} )
}
}
}
}
end
function aar_squad_summary_main()
return {
type = "UIElement",
id = "aar_squad_summary_main_container",
states = {
default = {
leftAnchor = false,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = -395,
right = 395,
top = -170,
bottom = 170
}
},
properties = {
page_idx = 1,
num_pages = 3
},
handlers = {
menu_create = MatchSummaryCreate,
element_refresh = MatchSummaryCreate
},
children = {
{
type = "generic_drop_shadow",
id = "description_drop_shadow1",
properties = {
offset_shadow = 0
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alpha = 0.35
}
}
},
{
type = "generic_menu_background",
id = "aar_match_summary_main_bkg",
properties = {
fill_alpha = 1
}
},
{
type = "aar_title_bar",
id = "aar_title_bar_id",
properties = {
title_bar_text = Engine.Localize( "@LUA_MENU_GAME_SUMMARY" ),
subtitle_text = "",
subtitle_banner_width = 300
}
},
{
type = "aar_dots",
id = "AARSummaryDotsID",
properties = {
num_dots = MBh.Property( "num_pages" ),
curr_dot = MBh.Property( "page_idx" )
}
},
{
type = "UIText",
id = "aar_squad_summary_outcome_text",
properties = {
textStyle = CoD.TextStyle.Outlined
},
handlers = {
set_outcome_text = function ( f5_arg0, f5_arg1 )
f5_arg0:setText( f5_arg1.text )
f5_arg0:animateToState( f5_arg1.outcomeKey )
end
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = f0_local0.OutcomeTextTop,
bottom = f0_local0.OutcomeTextTop + CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Center
},
Victory = CoD.ColorizeState( SvS.Reports.MatchOutcomeColors.Victory.textColor, {} ),
Defeat = CoD.ColorizeState( SvS.Reports.MatchOutcomeColors.Defeat.textColor, {} ),
Draw = CoD.ColorizeState( SvS.Reports.MatchOutcomeColors.Draw.textColor, {} )
}
},
{
type = "aar_squad_summary_team_info",
id = "aar_squad_summary_your_team_info",
handlers = {
set_your_team_info = function ( f6_arg0, f6_arg1 )
end
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = f0_local0.TeamInfoMargin,
right = f0_local0.TeamInfoMargin + f0_local1.Width,
top = f0_local1.Top,
bottom = f0_local1.Top + f0_local1.Height,
spacing = f0_local1.Spacing
}
}
},
{
type = "aar_squad_summary_team_info",
id = "aar_squad_summary_enemy_team_info",
properties = {
isEnemy = true
},
handlers = {
set_your_team_info = function ( f7_arg0, f7_arg1 )
end
},
states = {
default = {
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = -f0_local0.TeamInfoMargin - f0_local1.Width,
right = -f0_local0.TeamInfoMargin,
top = f0_local1.Top,
bottom = f0_local1.Top + f0_local1.Height,
spacing = f0_local1.Spacing
}
}
},
{
type = "UIText",
id = "aar_squad_summary_vs_text",
properties = {
text = Engine.Localize( "LUA_MENU_VERSUS" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = f0_local0.VersusTextTop,
bottom = f0_local0.VersusTextTop + CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Center
}
}
},
{
type = "aar_footer_bar",
id = "oink_3"
}
}
}
end
function TeamInfoChildrenFeeder( f8_arg0 )
local f8_local0 = f8_arg0.exclusiveController
local f8_local1 = SvS.GetCachedPostMatchData()
local f8_local2 = f8_arg0.isEnemy
if not f8_local0 then
f8_local0 = Engine.GetFirstActiveController()
DebugPrint( "[WARNING] AARSquadSummary: using controller index 0, this is only ok if you are editing a menu" )
end
local f8_local3, f8_local4 = nil
if f8_local2 then
f8_local3 = f8_local1.enemySquadName or ""
else
f8_local3 = Squad.GetPlayerSquadName( f8_local0 ) or ""
end
local f8_local5 = {
[#f8_local5 + 1] = {
type = "UIImage",
id = "team_info_title_bg",
states = {
default = CoD.ColorizeState( f0_local1.TitleBGColor, {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = f0_local1.TitleBGHeight
} )
},
children = {
{
type = "UIText",
id = "team_info_title_text",
properties = {
text = Engine.Localize( "LUA_MENU_SQUAD_LABEL", Engine.MarkLocalized( f8_local3 ) )
},
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = f0_local1.TitleBGTextMargin,
bottom = f0_local1.TitleBGTextMargin + CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Center
} )
}
}
}
},
[#f8_local5 + 1] = {
type = "playercard",
id = "team_info_playercard",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = -13,
left = -13,
height = 90,
width = 100,
scale = -0.17
}
}
},
[#f8_local5 + 1] = CreateScoreBar( f8_arg0.isEnemy )
}
return f8_local5
end
function aar_squad_summary_team_info()
return {
type = "UIVerticalList",
id = "team_info_list",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
spacing = 10
}
},
childrenFeeder = TeamInfoChildrenFeeder
}
end
LUI.MenuBuilder.registerDef( "aar_squad_summary_main", aar_squad_summary_main )
LUI.MenuBuilder.registerDef( "aar_squad_summary_team_info", aar_squad_summary_team_info )
LockTable( _M )

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,860 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
UnlockIconSizesByType = {
Patch = {
height = 128,
width = 128
},
Patchbacking = {
height = 128,
width = 128
},
Background = {
height = 35,
width = 220
},
Head = {
height = 128,
width = 128
},
Helmet = {
height = 128,
width = 128
},
Body = {
height = 128,
width = 128
},
AlienPerk = {
height = 64,
width = 64
},
AlienAbility = {
height = 64,
width = 64
},
AlienPrestige = {
height = 128,
width = 128
},
Prestige = {
height = 128,
width = 128
},
perk = {
height = 64,
width = 64
},
camo = {
height = 128,
width = 128
},
reticle = {
height = 128,
width = 128
}
}
function UnlockedItemsFeeder( f1_arg0 )
local f1_local0 = f1_arg0.unlockData
local f1_local1 = f1_arg0.curr_page
local f1_local2 = AAR.NumUnlocksPerPage
local f1_local3 = 1 + (f1_local1 - 1) * f1_local2
local f1_local4 = f1_local3 + f1_local2 - 1
local f1_local5 = {}
for f1_local6 = f1_local3, f1_local4, 1 do
if f1_local0[f1_local6] and UnlockIconSizesByType[f1_local0[f1_local6].type] then
local f1_local9 = nil
local f1_local10 = ""
local f1_local11 = ""
local f1_local12 = 0
local f1_local13 = ""
local f1_local14 = ""
local f1_local15, f1_local16, f1_local17 = nil
local f1_local18 = false
if isUnlockItem( f1_local0[f1_local6].type ) then
if f1_local0[f1_local6].type == "Patch" then
f1_local10 = Cac.Customization.Fields[Cac.Customization.FieldIndexes.Patch].GetQuip( f1_local0[f1_local6].item )
else
f1_local10 = getNameForUnlockItem( f1_local0[f1_local6].type, f1_local0[f1_local6].item )
end
f1_local9 = getMaterialForUnlockItem( f1_local0[f1_local6].type, f1_local0[f1_local6].item )
f1_local11 = f1_local0[f1_local6].ch_desc
elseif f1_local0[f1_local6].type == "AlienPerk" then
local f1_local19 = LUI.mp_menus.Aliens.GetFieldForPerk( f1_local0[f1_local6].item, LUI.mp_menus.Aliens.AlienPerks.Cols.Category )
f1_local15 = Colors.alien_frontend_hilite.r
f1_local16 = Colors.alien_frontend_hilite.g
f1_local17 = Colors.alien_frontend_hilite.b
f1_local10 = LUI.mp_menus.Aliens.GetFieldForPerk( f1_local0[f1_local6].item, LUI.mp_menus.Aliens.AlienPerks.Cols.Name )
f1_local9 = LUI.mp_menus.Aliens.GetFieldForPerk( f1_local0[f1_local6].item, LUI.mp_menus.Aliens.AlienPerks.Cols.Icon )
f1_local11 = Engine.Localize( LUI.mp_menus.Aliens.GetFieldForPerk( f1_local0[f1_local6].item, LUI.mp_menus.Aliens.AlienPerks.Cols.Desc ) )
f1_local13 = Engine.Localize( "@" .. tostring( f1_local19 ) )
f1_local12 = 1
elseif f1_local0[f1_local6].type == "AlienAbility" then
local f1_local19 = LUI.mp_menus.Aliens.GetFieldForAbility( f1_local0[f1_local6].item, LUI.mp_menus.Aliens.AlienAbilities.Cols.Category )
f1_local15 = Colors.alien_frontend_hilite.r
f1_local16 = Colors.alien_frontend_hilite.g
f1_local17 = Colors.alien_frontend_hilite.b
f1_local10 = LUI.mp_menus.Aliens.GetFieldForAbility( f1_local0[f1_local6].item, LUI.mp_menus.Aliens.AlienAbilities.Cols.Name )
f1_local9 = LUI.mp_menus.Aliens.GetFieldForAbility( f1_local0[f1_local6].item, LUI.mp_menus.Aliens.AlienAbilities.Cols.Icon )
f1_local11 = Engine.Localize( LUI.mp_menus.Aliens.GetFieldForAbility( f1_local0[f1_local6].item, LUI.mp_menus.Aliens.AlienAbilities.Cols.Desc ) )
f1_local13 = Engine.Localize( "@" .. tostring( f1_local19 ) )
f1_local12 = 1
elseif f1_local0[f1_local6].type == "perk" then
local f1_local19 = Cac.GetPerkGroup( f1_local0[f1_local6].item )
local f1_local20 = tonumber( Engine.TableLookup( "mp/squadUnlockTable.csv", 0, f1_local0[f1_local6].item, 2 ) )
f1_local14 = tostring( Engine.TableLookup( PerkTable.File, PerkTable.Cols.Ref, f1_local0[f1_local6].item, PerkTable.Cols.Cost ) )
f1_local15 = Colors.cac_ability[f1_local19].r
f1_local16 = Colors.cac_ability[f1_local19].g
f1_local17 = Colors.cac_ability[f1_local19].b
f1_local10 = Engine.TableLookup( PerkTable.File, PerkTable.Cols.Ref, f1_local0[f1_local6].item, PerkTable.Cols.Name )
f1_local9 = Cac.GetPerkImage( f1_local0[f1_local6].item )
f1_local11 = Engine.Localize( "@LUA_MENU_AAR_NEW_PERK_UNLOCKS", f1_local20 )
f1_local13 = Cac.GetAbilityName( f1_local19 )
f1_local12 = 1
elseif f1_local0[f1_local6].type == "AlienPrestige" then
f1_local10 = Engine.Localize( "@ALIENS_RELIC_SLOT" )
f1_local18 = true
f1_local9 = "alien_icon_nerf_1"
f1_local11 = Engine.Localize( "@ALIENS_NEW_RELIC_SLOT_DESC" )
elseif f1_local0[f1_local6].type == "Prestige" then
f1_local10 = Engine.Localize( "@LUA_MENU_PRESTIGE_ICON" )
f1_local18 = true
f1_local9 = Rank.GetRankIcon( Rank.GetMaxRank(), f1_local0[f1_local6].item )
elseif f1_local0[f1_local6].type == "camo" then
f1_local10 = Cac.GetWeaponName( f1_local0[f1_local6].weapon )
f1_local18 = true
f1_local11 = f1_local0[f1_local6].ch_desc
f1_local9 = Cac.GetCamoImage( f1_local0[f1_local6].item )
elseif f1_local0[f1_local6].type == "reticle" then
f1_local10 = Cac.GetAttachmentName( f1_local0[f1_local6].sight )
f1_local18 = true
f1_local11 = f1_local0[f1_local6].ch_desc
f1_local9 = Cac.GetReticleImage( f1_local0[f1_local6].item )
end
local f1_local19 = #f1_local5 + 1
local f1_local20 = {
type = "aar_unlocked_item"
}
local f1_local21 = {}
if f1_local18 then
local f1_local22 = f1_local10
end
f1_local21.item_name = f1_local22 or Engine.Localize( f1_local10 )
f1_local21.item_icon = RegisterMaterial( f1_local9 )
f1_local21.icon_width = UnlockIconSizesByType[f1_local0[f1_local6].type].width
f1_local21.icon_height = UnlockIconSizesByType[f1_local0[f1_local6].type].height
f1_local21.item_detail_1 = f1_local11
f1_local21.perk_container_alpha = f1_local12
f1_local21.perk_category = f1_local13
f1_local21.perk_cost = f1_local14
f1_local21.perk_tint_r = f1_local15
f1_local21.perk_tint_g = f1_local16
f1_local21.perk_tint_b = f1_local17
f1_local20.properties = f1_local21
f1_local5[f1_local19] = f1_local20
end
end
return f1_local5
end
f0_local0 = function ( f2_arg0 )
local f2_local0 = 0
if f2_arg0.detail_text ~= "" then
f2_local0 = 1
end
return f2_local0
end
function aar_unlocked_item()
return {
type = "UIElement",
properties = {
item_name = "",
item_icon = RegisterMaterial( "white" ),
item_detail_1 = "",
icon_width = 256,
icon_height = 128,
perk_container_alpha = 0,
perk_category = "",
perk_cost = "",
perk_tint_r = Colors.white.r,
perk_tint_g = Colors.white.g,
perk_tint_b = Colors.white.b
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 226,
left = 0,
right = 226
}
},
children = {
{
type = "generic_drop_shadow",
properties = {
offset_shadow = -5
}
},
{
type = "cac_edit_choose_image_button_background",
properties = {
red = AAR.Swatch.background_5.r,
green = AAR.Swatch.background_5.g,
blue = AAR.Swatch.background_5.b,
alpha = 1
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
}
},
{
type = "cac_edit_choose_image_button_background_outline",
properties = {
red = AAR.Swatch.border.r,
green = AAR.Swatch.border.g,
blue = AAR.Swatch.border.b,
alpha = 0.4
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
}
},
{
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = -32,
left = 0,
right = 0
}
},
children = {
{
type = "UIElement",
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
width = 150,
height = 130,
alpha = MBh.Property( "perk_container_alpha" )
}
},
children = {
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "box_white_gradient_top" ),
red = MBh.Property( "perk_tint_r" ),
green = MBh.Property( "perk_tint_g" ),
blue = MBh.Property( "perk_tint_b" ),
alpha = 0.15
}
}
},
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
width = 16,
height = 16,
material = RegisterMaterial( "widg_triangle" ),
red = MBh.Property( "perk_tint_r" ),
green = MBh.Property( "perk_tint_g" ),
blue = MBh.Property( "perk_tint_b" ),
alpha = 0.5
}
}
},
{
type = "UIMarqueeText",
properties = {
text = MBh.Property( "perk_category" )
},
states = {
default = CoD.ColorizeState( AAR.Swatch.title, {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 10,
right = -10,
top = 5,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center
} )
}
},
{
type = "UIText",
properties = {
text = MBh.Property( "perk_cost" ),
textStyle = CoD.TextSettings.Shadowed
},
states = {
default = CoD.ColorizeState( AAR.Swatch.title_2, {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
left = 5,
right = 0,
bottom = 0,
height = CoD.TextSettings.ExtraBigFont.Height,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Left
} )
}
}
}
},
{
type = "UIImage",
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
left = MBh.HalfOppositeProperty( "icon_width" ),
right = MBh.HalfProperty( "icon_width" ),
top = MBh.HalfOppositeProperty( "icon_height" ),
bottom = MBh.HalfProperty( "icon_height" ),
material = MBh.Property( "item_icon" )
}
}
}
}
},
{
type = "UIElement",
id = "HeaderBarId",
states = {
default = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
bottom = 0,
left = 0,
right = 0,
height = 32
}
},
children = {
{
type = "UIImage",
states = {
default = CoD.ColorizeState( AAR.Swatch.border, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = -2,
left = 2,
right = -2,
alpha = 0.4
} )
}
},
{
type = "UIMarqueeText",
properties = {
text = MBh.Property( "item_name" )
},
states = {
default = CoD.ColorizeState( AAR.Swatch.header_text, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 5,
right = -5,
height = CoD.TextSettings.BoldFont.Height,
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.Center
} )
}
}
}
},
{
type = "UIMarqueeText",
id = "desc_text_id",
properties = {
text = MBh.Property( "item_detail_1" ),
useTextWrapping = true,
textHeight = CoD.TextSettings.NormalFont.Height
},
states = {
default = CoD.ColorizeState( AAR.Swatch.trim, {
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
left = 5,
right = -5,
top = 5,
height = 3 * CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center
} )
}
}
}
}
end
function changeUnlocksScreen( f4_arg0, f4_arg1, f4_arg2 )
local f4_local0 = f4_arg0.properties.curr_page
local f4_local1 = f4_arg0.properties.num_pages
local f4_local2 = f4_local0
if f4_local0 > 1 and f4_arg2 == "left" then
f4_local2 = f4_local0 - 1
elseif f4_local0 < f4_local1 and f4_arg2 == "right" then
f4_local2 = f4_local0 + 1
end
if f4_local2 ~= f4_local0 then
f4_arg0.properties.curr_page = f4_local2
local f4_local3 = f4_arg0:getParent()
f4_local3:processEvent( {
name = "refresh_unlocks_page"
} )
end
if f4_local1 <= f4_local2 then
f4_arg0:dispatchEventToRoot( {
name = "disable_unlock_right_arrow"
} )
else
f4_arg0:dispatchEventToRoot( {
name = "enable_unlock_right_arrow"
} )
end
if f4_local2 <= 1 then
f4_arg0:dispatchEventToRoot( {
name = "disable_unlock_left_arrow"
} )
else
f4_arg0:dispatchEventToRoot( {
name = "enable_unlock_left_arrow"
} )
end
end
function dotsFeeder( f5_arg0 )
local f5_local0 = f5_arg0.curr_page
local f5_local1 = f5_arg0.num_pages
if f5_local1 <= 1 then
return {}
end
local f5_local2 = {}
for f5_local3 = 1, f5_local1, 1 do
local f5_local6 = #f5_local2 + 1
local f5_local7 = {
type = "UIImage",
id = "nav_dot_" .. f5_local3
}
local f5_local8 = {}
local f5_local9 = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 12,
top = 0,
bottom = 12
}
local f5_local10
if f5_local3 == f5_local0 then
f5_local10 = RegisterMaterial( "widg_circle_fill" )
if not f5_local10 then
else
f5_local9.material = f5_local10
f5_local8.default = f5_local9
f5_local7.states = f5_local8
f5_local2[f5_local6] = f5_local7
end
end
f5_local10 = RegisterMaterial( "widg_circle_empty" )
end
return f5_local2
end
function UnlockMainHandleCreate( f6_arg0, f6_arg1 )
assert( f6_arg0.properties.unlockData )
local f6_local0 = f6_arg0.properties.unlockData
local f6_local1 = f6_arg0:getChildById( "num_items_unlocked" )
if f6_local1 then
if #f6_local0 > 1 then
f6_local1:setText( Engine.Localize( "@LUA_MENU_NUM_ITEMS_UNLOCKED", #f6_local0 ) )
else
f6_local1:setText( Engine.Localize( "@LUA_MENU_NUM_ITEM_UNLOCKED", #f6_local0 ) )
end
end
changeUnlocksScreen( f6_arg0, f6_arg1, "left" )
local f6_local2 = LUI.FlowManager.GetMenuScopedDataByMenuName( "aar_summary_main" )
local f6_local3 = f6_local2.controller
local f6_local4 = Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, Engine.GetPlayerDataEx( f6_local3, CoD.StatsGroup.Common, "round", "gameMode" ), GameTypesTable.Cols.Name )
local f6_local5 = Engine.GetPlayerDataEx( f6_local3, CoD.StatsGroup.Common, "round", "map" )
local f6_local6 = Squad.GetRealBaseNameFromLoadName( f6_local5 )
if Engine.IsAliensMode() then
f6_arg0:processEvent( {
name = "aar_set_subtitle_text",
new_text = Engine.Localize( "LUA_MENU_ALIENS" )
} )
elseif f6_local5 ~= "" then
f6_arg0:processEvent( {
name = "aar_set_subtitle_text",
new_text = Engine.Localize( "LUA_MENU_MODE_AND_MAP_FORMAT", f6_local4, Engine.MarkLocalized( f6_local6 ) ),
dispatchChildren = true
} )
end
end
function aar_unlock_main()
return {
type = "UIElement",
id = "main_container",
properties = {
curr_page = 1,
num_pages = 1
},
handlers = {
menu_create = UnlockMainHandleCreate,
nav_right = function ( f8_arg0, f8_arg1 )
changeUnlocksScreen( f8_arg0, f8_arg1, "right" )
end
,
nav_left = function ( f9_arg0, f9_arg1 )
changeUnlocksScreen( f9_arg0, f9_arg1, "left" )
end
},
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
width = AAR.Layout.Width,
height = AAR.Layout.Height
}
},
children = {
{
type = "generic_menu_background",
id = "kinect_background_id",
properties = {
fill_alpha = 1,
border_alpha = 0
}
},
{
type = "aar_title_bar",
properties = {
title_text = Engine.Localize( "@LUA_MENU_UNLOCKS_CAPS" ),
subtitle_text = "",
subtitle_banner_width = 300,
border_alpha = 0
}
},
{
type = "UIText",
id = "num_items_unlocked",
properties = {
text = Engine.Localize( "@LUA_MENU_NEW_ITEMS" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 95,
left = 0,
right = 0,
height = CoD.TextSettings.ExtraBigFont.Height,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Center,
red = Engine.IsAliensMode() and Colors.alien_frontend_hilite.r or AAR.Swatch.colorpop.r,
green = Engine.IsAliensMode() and Colors.alien_frontend_hilite.g or AAR.Swatch.colorpop.g,
blue = Engine.IsAliensMode() and Colors.alien_frontend_hilite.b or AAR.Swatch.colorpop.b
}
}
},
{
type = "UIHorizontalList",
id = "unlock_items_row",
focusable = false,
childrenFeeder = UnlockedItemsFeeder,
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = -100,
left = 0,
right = 0,
height = 260,
alignment = LUI.Alignment.Center,
spacing = 30
}
},
handlers = {
refresh_unlocks_page = function ( f10_arg0, f10_arg1 )
f10_arg0:closeChildren()
f10_arg0:processEvent( {
name = "menu_refresh"
} )
end
}
},
{
type = "UIHorizontalList",
id = "page_dots",
focusable = false,
childrenFeeder = dotsFeeder,
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 67,
left = -100,
right = 100,
height = 12,
alignment = LUI.Alignment.Center,
alpha = 1,
spacing = 4
},
hidden = {
alpha = 0
}
},
handlers = {
refresh_unlocks_page = function ( f11_arg0, f11_arg1 )
f11_arg0:closeChildren()
f11_arg0:processEvent( {
name = "menu_refresh"
} )
end
}
},
{
type = "aar_footer_bar",
id = "oink_5"
},
{
type = "UIBindButton",
id = "aar_summary_main_bind_btn_id",
handlers = {
button_right = aar_unlock_right,
button_left = aar_unlock_left
}
},
{
type = "aar_unlock_nav_arrows",
id = "aar_unlock_nav_arrows_id"
}
}
}
end
function aar_unlock_left( f12_arg0, f12_arg1 )
f12_arg0:dispatchEventToRoot( {
name = "nav_left"
} )
end
function aar_unlock_right( f13_arg0, f13_arg1 )
f13_arg0:dispatchEventToRoot( {
name = "nav_right"
} )
end
function aar_unlock_nav_arrows()
return {
type = "UIElement",
focusable = true,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = false,
left = 0,
right = 0,
top = -30,
bottom = 30,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
popup_active = MBh.AnimateToState( "hidden" ),
popup_inactive = MBh.AnimateToState( "default" )
},
children = {
{
type = "UIButton",
id = "left_nav_arrow_button_id",
states = {
default = {
leftAnchor = false,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = AAR.Layout.Width / -2 - 10 - 30,
right = AAR.Layout.Width / -2 - 10,
top = 0,
bottom = 0
}
},
handlers = {
button_action = aar_unlock_left
},
children = {
{
type = "UIImage",
id = "left_nav_arrow_image_id",
states = {
default = {
material = RegisterMaterial( "widg_margin_arrow_lt" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = Engine.IsAliensMode() and Colors.alien_frontend_hilite.r or Colors.frontend_hilite.r,
green = Engine.IsAliensMode() and Colors.alien_frontend_hilite.g or Colors.frontend_hilite.g,
blue = Engine.IsAliensMode() and Colors.alien_frontend_hilite.b or Colors.frontend_hilite.b,
alpha = 0
},
bright = {
alpha = 1
}
},
handlers = {
disable_unlock_left_arrow = MBh.AnimateToState( "default", 0 ),
enable_unlock_left_arrow = MBh.AnimateToState( "bright", 0 )
}
}
}
},
{
type = "UIButton",
id = "right_nav_arrow_button_id",
states = {
default = {
leftAnchor = false,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = AAR.Layout.Width / 2 + 10,
right = AAR.Layout.Width / 2 + 10 + 30,
top = 0,
bottom = 0
}
},
handlers = {
button_action = aar_unlock_right
},
children = {
{
type = "UIImage",
id = "right_nav_arrow_image_id",
states = {
default = {
material = RegisterMaterial( "widg_margin_arrow_rt" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = Engine.IsAliensMode() and Colors.alien_frontend_hilite.r or Colors.frontend_hilite.r,
green = Engine.IsAliensMode() and Colors.alien_frontend_hilite.g or Colors.frontend_hilite.g,
blue = Engine.IsAliensMode() and Colors.alien_frontend_hilite.b or Colors.frontend_hilite.b,
alpha = 0
},
bright = {
alpha = 1
}
},
handlers = {
disable_unlock_right_arrow = MBh.AnimateToState( "default", 0 ),
enable_unlock_right_arrow = MBh.AnimateToState( "bright", 0 )
}
}
}
}
}
}
end
LUI.MenuBuilder.registerDef( "aar_unlock_nav_arrows", aar_unlock_nav_arrows )
LUI.MenuBuilder.registerDef( "aar_unlock_main", aar_unlock_main )
LUI.MenuBuilder.registerDef( "aar_unlocked_item", aar_unlocked_item )
LockTable( _M )

View File

@@ -0,0 +1,153 @@
AAR = {
Layout = {
TitleBarHeight = 33,
SubTitleBarHeight = 31,
SubTitleBannerWidth = 180,
SubTitleCapWidth = 20,
FooterHeight = 38,
Width = 800,
Height = 490
},
Scoreboard = {
Layout = {
Height = 614
},
NumRows = 18
},
Arrow = {
Width = 32,
Height = 64
},
Progress = {
Layout = {
Height = 453
}
},
NumUnlocksPerPage = 3,
Swatch = {
title = Colors.primary_text_color,
title_2 = Colors.secondary_text_color,
background = Colors.grey_14,
background_2 = Colors.grey_22,
background_3 = Colors.grey_4,
background_4 = {
r = 0.12,
g = 0.12,
b = 0.12
},
background_5 = Colors.very_dark_cyan,
trim = Colors.grey_4,
subtext = Colors.grey_4,
colorpop = Colors.frontend_hilite,
progressborder = Colors.white,
header_text = Colors.white,
spacer_1 = Colors.grey_2,
friendly = Colors.cyan,
enemy = Colors.orange,
border = Colors.window_border_color
}
}
AwardsTable = {
File = "mp/awardTable.csv",
Cols = {
Ref = 1,
Icon = 2,
Name = 3,
Desc = 4
}
}
FactionTable = {
File = "mp/factionTable.csv",
Cols = {
Ref = 0,
ColorRed = 14,
ColorGreen = 15,
ColorBlue = 16
}
}
AAR.GetFactionColorRed = function ( f1_arg0 )
return Engine.TableLookup( FactionTable.File, FactionTable.Cols.Ref, f1_arg0, FactionTable.Cols.ColorRed )
end
AAR.GetFactionColorGreen = function ( f2_arg0 )
return Engine.TableLookup( FactionTable.File, FactionTable.Cols.Ref, f2_arg0, FactionTable.Cols.ColorGreen )
end
AAR.GetFactionColorBlue = function ( f3_arg0 )
return Engine.TableLookup( FactionTable.File, FactionTable.Cols.Ref, f3_arg0, FactionTable.Cols.ColorBlue )
end
AAR.GetRoundSquadMember = function ( f4_arg0 )
return Engine.GetPlayerDataEx( f4_arg0, CoD.StatsGroup.Common, "round", "squadMemberIndex" )
end
AAR.GetRoundOperationsXP = function ( f5_arg0 )
return Engine.GetPlayerDataEx( f5_arg0, CoD.StatsGroup.Common, "round", "operationXp" ) or 0
end
AAR.GetRoundMatchXP = function ( f6_arg0 )
return Engine.GetPlayerDataEx( f6_arg0, CoD.StatsGroup.Common, "round", "matchXp" ) or 0
end
AAR.GetRoundMiscXP = function ( f7_arg0 )
return Engine.GetPlayerDataEx( f7_arg0, CoD.StatsGroup.Common, "round", "miscXp" ) or 0
end
AAR.GetRoundScoreXP = function ( f8_arg0 )
return Engine.GetPlayerDataEx( f8_arg0, CoD.StatsGroup.Common, "round", "scoreXp" ) or 0
end
AAR.GetRoundChallengeXP = function ( f9_arg0 )
return Engine.GetPlayerDataEx( f9_arg0, CoD.StatsGroup.Common, "round", "challengeXp" ) or 0
end
AAR.GetRoundDoubleXP = function ( f10_arg0 )
return Engine.GetPlayerDataReservedInt( f10_arg0, CoD.StatsGroup.Common, "common_entitlement_xp" ) or 0
end
AAR.GetRoundClanXP = function ( f11_arg0 )
return Engine.GetPlayerDataReservedInt( f11_arg0, CoD.StatsGroup.Common, "common_clan_wars_xp" ) or 0
end
AAR.GetTotalUnlockPoints = function ( f12_arg0 )
return Engine.GetPlayerDataEx( f12_arg0, CoD.StatsGroup.Ranked, "unlockPoints" ) or 0
end
AAR.GetRoundTotalXP = function ( f13_arg0 )
return Engine.GetPlayerDataEx( f13_arg0, CoD.StatsGroup.Common, "round", "totalXp" ) or 0
end
AAR.GetCareerExperienceForSquadMember = function ( f14_arg0, f14_arg1 )
return Engine.GetPlayerDataEx( f14_arg0, CoD.StatsGroup.Ranked, "squadMembers", f14_arg1, "squadMemXP" ) or 0
end
AAR.GetNumAwards = function ( f15_arg0 )
return Engine.GetPlayerDataEx( f15_arg0, CoD.StatsGroup.Common, "round", "awardCount" )
end
AAR.GetAccolade = function ( f16_arg0, f16_arg1 )
return Engine.GetPlayerDataEx( f16_arg0, CoD.StatsGroup.Common, "round", "awards", f16_arg1, "award" )
end
AAR.GetAwardIcon = function ( f17_arg0 )
return Engine.TableLookup( AwardsTable.File, AwardsTable.Cols.Ref, f17_arg0, AwardsTable.Cols.Icon )
end
AAR.GetAwardName = function ( f18_arg0 )
return Engine.TableLookup( AwardsTable.File, AwardsTable.Cols.Ref, f18_arg0, AwardsTable.Cols.Name )
end
AAR.GetAwardDesc = function ( f19_arg0 )
return Engine.TableLookup( AwardsTable.File, AwardsTable.Cols.Ref, f19_arg0, AwardsTable.Cols.Desc )
end
AAR.AreChaosStats = function ( f20_arg0 )
if not Engine.IsAliensMode() then
return false
elseif f20_arg0 == "mugger" then
return true
else
return false
end
end

1237
lui/mp_menus/aliens.dec.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,990 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
IntelTable = {
File = "mp/alien/alien_armory_intel.csv",
Size = 13,
Cols = {
index = 0,
menu_order = 1,
type = 2,
audio_caption = 3,
map_name = 4,
locked_text = 5,
intel_name = 6,
audio = 7,
img2 = 8,
bink3 = 9,
subject = 10,
file_num = 11,
red_text1 = 12,
red_text2 = 13,
red_text3 = 14,
audio_snip = 15,
ingame_splash_title = 16,
custom_audio_track = 17
},
Unlocked = {}
}
g_available_episodes = {}
g_episode_array_index = 1
g_episode = 1
g_map = "mp_alien_armory"
function aliens_intel_update_episode( f1_arg0 )
g_episode_array_index = g_episode_array_index + f1_arg0
if g_episode_array_index < 1 then
g_episode_array_index = #g_available_episodes
elseif g_episode_array_index > #g_available_episodes then
g_episode_array_index = 1
end
aliens_intel_update_globals( g_available_episodes[g_episode_array_index] )
IntelTable.Unlocked = {}
set_unlocked_table()
end
function aliens_intel_generate_available_episodes()
if Engine.IsXbox360() and Engine.IsXenonDevTitle() then
g_available_episodes[#g_available_episodes + 1] = 1
g_available_episodes[#g_available_episodes + 1] = 2
g_available_episodes[#g_available_episodes + 1] = 3
g_available_episodes[#g_available_episodes + 1] = 4
else
if Engine.AnyoneHasAliensDLC1() then
g_available_episodes[#g_available_episodes + 1] = 1
end
if Engine.AnyoneHasAliensDLC2() then
g_available_episodes[#g_available_episodes + 1] = 2
end
if Engine.AnyoneHasAliensDLC3() then
g_available_episodes[#g_available_episodes + 1] = 3
end
if Engine.AnyoneHasAliensDLC4() then
g_available_episodes[#g_available_episodes + 1] = 4
end
end
end
function aliens_intel_menu_initialize()
IntelTable.Unlocked = {}
g_available_episodes = {}
g_episode_array_index = 1
aliens_intel_generate_available_episodes()
local f3_local0 = Engine.GetDvarString( "ui_mapname" )
local f3_local1 = 0
if f3_local0 == "mp_alien_town" then
f3_local1 = g_available_episodes[1]
elseif f3_local0 == "mp_alien_armory" then
if Engine.AnyoneHasAliensDLC1() then
f3_local1 = 1
else
f3_local1 = g_available_episodes[1]
end
elseif f3_local0 == "mp_alien_beacon" then
if Engine.AnyoneHasAliensDLC2() then
f3_local1 = 2
else
f3_local1 = g_available_episodes[1]
end
elseif f3_local0 == "mp_alien_dlc3" then
if Engine.AnyoneHasAliensDLC3() then
f3_local1 = 3
else
f3_local1 = g_available_episodes[1]
end
elseif f3_local0 == "mp_alien_last" then
if Engine.AnyoneHasAliensDLC4() then
f3_local1 = 4
else
f3_local1 = g_available_episodes[1]
end
end
if f3_local1 == 0 then
f3_local1 = 1
end
aliens_intel_update_globals( f3_local1 )
for f3_local5, f3_local6 in ipairs( g_available_episodes ) do
if f3_local6 == f3_local1 then
g_episode_array_index = f3_local5
end
end
set_unlocked_table()
end
function aliens_intel_update_globals( f4_arg0 )
if f4_arg0 == 1 then
g_episode = 1
g_map = "mp_alien_armory"
IntelTable.File = "mp/alien/alien_armory_intel.csv"
IntelTable.Size = 13
elseif f4_arg0 == 2 then
g_episode = 2
g_map = "mp_alien_beacon"
IntelTable.File = "mp/alien/alien_beacon_intel.csv"
IntelTable.Size = 9
elseif f4_arg0 == 3 then
g_episode = 3
g_map = "mp_alien_dlc3"
IntelTable.File = "mp/alien/alien_dlc3_intel.csv"
IntelTable.Size = 6
elseif f4_arg0 == 4 then
g_episode = 4
g_map = "mp_alien_last"
IntelTable.File = "mp/alien/alien_last_intel.csv"
IntelTable.Size = 8
end
end
function set_unlocked_table()
local f5_local0 = 1
local f5_local1 = 0
local f5_local2 = LUI.FlowManager.GetMenuScopedDataByMenuName( "aliens_intel_main" )
local f5_local3 = f5_local2.exclusiveController
local f5_local4 = Engine.GetPlayerDataReservedInt( f5_local3, CoD.StatsGroup.Coop, "intel_episode_" .. g_episode .. "_sequenced_count" )
for f5_local5 = 1, IntelTable.Size, 1 do
local f5_local8 = Engine.TableLookup( IntelTable.File, IntelTable.Cols.menu_order, f5_local5, IntelTable.Cols.type )
if f5_local8 == "dossier" then
IntelTable.Unlocked[f5_local5] = 1
end
if f5_local8 == "intercept" then
if Engine.GetPlayerDataReservedInt( f5_local3, CoD.StatsGroup.Coop, "intel_episode_" .. g_episode .. "_location_" .. f5_local0 ) == 1 then
IntelTable.Unlocked[f5_local5] = 1
else
IntelTable.Unlocked[f5_local5] = 0
end
f5_local0 = f5_local0 + 1
end
if f5_local8 == "nightfall" then
if f5_local1 < f5_local4 then
IntelTable.Unlocked[f5_local5] = 1
f5_local1 = f5_local1 + 1
else
IntelTable.Unlocked[f5_local5] = 0
end
end
end
end
function aliens_calculate_intel_num_collected( f6_arg0, f6_arg1 )
local f6_local0 = 0
if f6_arg0 then
f6_local0 = 1
end
for f6_local4, f6_local5 in ipairs( IntelTable.Unlocked ) do
if f6_local5 == 1 then
f6_local0 = f6_local0 + 1
end
end
if f6_arg0 and LUI.mp_menus.Aliens.OutroVideoUnlocked( f6_arg1, g_episode ) then
f6_local0 = f6_local0 + 1
end
return f6_local0
end
function HandleAliensIntel( f7_arg0, f7_arg1 )
LUI.FlowManager.RequestAddMenu( f7_arg0, "aliens_intel_main", true, f7_arg1.controller, false )
end
function GetAliensIntelButton()
return {
type = "UIGenericButton",
id = "aliens_intel_main_btn_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_INTEL_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_CLASSIFIED_DESC" ),
button_action_func = HandleAliensIntel
}
}
end
function exit_aliens_intel_main( f9_arg0 )
Engine.StopMenuVideo()
PersistentBackground.Show()
LUI.mp_menus.Aliens.SwapExtinctionMapMusic( LUI.mp_menus.Aliens.GetExtinctionMapMusic() )
end
function AliensIntelSwapBink( f10_arg0, f10_arg1, f10_arg2 )
if f10_arg1 then
local f10_local0 = 1
if Engine.IsPS3() then
f10_local0 = 0
end
if f10_arg0 == 0 then
Engine.PlayMenuVideo( g_map .. "_" .. f10_arg2, f10_local0 )
Engine.StopMusic( 200 )
else
Engine.PlayMenuVideo( Engine.TableLookup( IntelTable.File, IntelTable.Cols.menu_order, f10_arg0, IntelTable.Cols.bink3 ), f10_local0 )
if tonumber( Engine.TableLookup( IntelTable.File, IntelTable.Cols.menu_order, f10_arg0, IntelTable.Cols.custom_audio_track ) ) == 1 then
Engine.StopMusic( 200 )
else
Engine.PlayMusic( CoD.Music.MainExtinctIntelMusic )
end
end
end
end
function aliens_intel_menu_button( f11_arg0, f11_arg1 )
local f11_local0 = 42
local f11_local1 = (f11_local0 - f11_arg1.intel_icon_dims) * 0.5
local self = LUI.UIButton.new()
self.id = "aliens_intel_button_id"
self.properties = {}
self:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = f11_local0
} )
self:animateToState( "default" )
local f11_local3 = LUI.UIImage.new()
f11_local3.id = "btn_divider_id"
f11_local3:registerAnimationState( "default", {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 1,
red = 1,
green = 1,
blue = 1,
alpha = 0.1
} )
f11_local3:animateToState( "default" )
self:addElement( f11_local3 )
local f11_local4 = LUI.UIImage.new()
f11_local4.id = "btn_bkg_id"
f11_local4:registerAnimationState( "default", {
material = RegisterMaterial( "btn_alien_loadout_rtcap_f" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 16,
red = 1,
green = 1,
blue = 1,
alpha = 0
} )
f11_local4:registerAnimationState( "dimmed", {
red = 1,
green = 1,
blue = 1,
alpha = 0.5
} )
f11_local4:registerAnimationState( "focus", {
red = 1,
green = 1,
blue = 1,
alpha = 0.8
} )
f11_local4:registerEventHandler( "button_over", MBh.AnimateLoop( {
{
"focus",
0
},
{
"dimmed",
750
},
{
"focus",
750
}
} ) )
f11_local4:registerEventHandler( "button_up", MBh.AnimateToState( "default", 0 ) )
f11_local4:registerEventHandler( "button_locked", MBh.AnimateToState( "focus", 0 ) )
f11_local4:animateToState( "default" )
self:addElement( f11_local4 )
local f11_local5 = LUI.UIImage.new()
f11_local5.id = "now_playing_id"
f11_local5:registerAnimationState( "default", {
material = RegisterMaterial( "alien_icon_intel_now_playing" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = 5,
width = 32,
height = 32,
alpha = f11_arg1.intel_now_playing
} )
f11_local5:registerAnimationState( "visible", {
alpha = 1
} )
f11_local5:registerAnimationState( "invisible", {
alpha = 0
} )
f11_local5:registerEventHandler( "now_playing", MBh.AnimateToState( "visible", 0 ) )
f11_local5:registerEventHandler( "not_playing", MBh.AnimateToState( "invisible", 0 ) )
f11_local5:animateToState( "default" )
self:addElement( f11_local5 )
if f11_arg1.intel_icon_dims > 0 then
local f11_local6 = LUI.UIImage.new()
f11_local6.id = "btn_img_id"
f11_local6:registerAnimationState( "default", {
material = RegisterMaterial( f11_arg1.intel_icon ),
leftAnchor = true,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = f11_local1,
width = f11_arg1.intel_icon_dims,
height = f11_arg1.intel_icon_dims,
alpha = f11_arg1.intel_alpha
} )
f11_local6:registerAnimationState( "visible", {
alpha = f11_arg1.intel_alpha
} )
f11_local6:registerAnimationState( "invisible", {
alpha = 0
} )
f11_local6:registerEventHandler( "now_playing", MBh.AnimateToState( "invisible", 0 ) )
f11_local6:registerEventHandler( "not_playing", MBh.AnimateToState( "visible", 0 ) )
f11_local6:animateToState( "default" )
self:addElement( f11_local6 )
end
local f11_local6 = LUI.UIText.new()
f11_local6.id = "btn_name_text_id"
f11_local6:registerAnimationState( "default", {
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = false,
left = f11_arg1.intel_icon_dims + f11_local1 * 2,
right = 0,
top = -CoD.TextSettings.NormalFont.Height * 0.5,
bottom = CoD.TextSettings.NormalFont.Height * 0.5,
red = 0.7,
green = 0.7,
blue = 0.7,
alpha = f11_arg1.intel_alpha
} )
f11_local6:registerAnimationState( "focus", {
red = 0,
green = 0,
blue = 0
} )
f11_local6:registerEventHandler( "button_over", MBh.AnimateToState( "focus", 0 ) )
f11_local6:registerEventHandler( "button_up", MBh.AnimateToState( "default", 0 ) )
f11_local6:registerEventHandler( "button_locked", MBh.AnimateToState( "focus", 0 ) )
f11_local6:setText( f11_arg1.intel_name )
f11_local6:animateToState( "default" )
self:addElement( f11_local6 )
return self
end
function AliensIntelListFeeder( f12_arg0 )
assert( f12_arg0.exclusiveController, "No Exclusive controller found when opening Extinction Intel Menu." )
local f12_local0 = {}
local f12_local1 = "vf_lock"
local f12_local2 = 48
local f12_local3 = "Locked"
local f12_local4 = 1
f12_local0[1] = {
type = "aliens_intel_menu_button",
id = "aliens_intel_btn_id_" .. g_episode .. "_intro",
properties = {
intel_name = Engine.Localize( "@ALIEN_INTEL_FRONTEND_EXTINCTION_INTEL_INTRO" ),
intel_icon_dims = 0,
intel_now_playing = 1
},
handlers = {
button_action = function ( f13_arg0, f13_arg1 )
AliensIntelSwapBink( 0, true, "intro" )
f13_arg0:dispatchEventToRoot( {
name = "turn_off_now_playing",
immediate = true
} )
f13_arg0:dispatchEventToRoot( {
name = "invis_text",
immediate = true
} )
f13_arg0:dispatchEventToChildren( {
name = "now_playing",
immediate = true
} )
end
}
}
for f12_local9, f12_local10 in ipairs( IntelTable.Unlocked ) do
if g_map == "mp_alien_last" and f12_local9 == 8 then
break
elseif f12_local10 == 1 then
f12_local1 = "alien_icon_intel_" .. Engine.TableLookup( IntelTable.File, IntelTable.Cols.menu_order, f12_local9, IntelTable.Cols.type )
f12_local3 = Engine.Localize( "@ALIEN_INTEL_FRONTEND_" .. Engine.TableLookup( IntelTable.File, IntelTable.Cols.menu_order, f12_local9, IntelTable.Cols.intel_name ) )
f12_local2 = 32
f12_local4 = 1
else
f12_local1 = "vf_lock"
local f12_local8 = Engine.TableLookup( IntelTable.File, IntelTable.Cols.menu_order, f12_local9, IntelTable.Cols.type )
if f12_local8 == "nightfall" then
f12_local3 = Engine.Localize( "@ALIEN_INTEL_FRONTEND_EXTINCTION_CLASSIFIED_INTEL" )
elseif f12_local8 == "intercept" then
f12_local3 = Engine.Localize( "@ALIEN_INTEL_FRONTEND_EXTINCTION_ENCRYPTED" )
end
f12_local2 = 48
f12_local4 = 0.5
end
f12_local0[#f12_local0 + 1] = {
type = "aliens_intel_menu_button",
id = "aliens_intel_btn_id_" .. g_episode .. "_" .. f12_local9,
properties = {
intel_icon = f12_local1,
intel_name = f12_local3,
intel_icon_dims = f12_local2,
intel_alpha = f12_local4,
intel_now_playing = 0
},
handlers = {
button_action = function ( f14_arg0, f14_arg1 )
if f12_local10 == 1 then
AliensIntelSwapBink( f12_local9, f12_local10 )
f14_arg0:dispatchEventToRoot( {
name = "turn_off_now_playing",
immediate = true
} )
f14_arg0:dispatchEventToRoot( {
name = "update_intel",
immediate = true,
new_index = f12_local9
} )
f14_arg0:dispatchEventToChildren( {
name = "now_playing",
immediate = true
} )
end
end
}
}
end
f12_local5 = LUI.mp_menus.Aliens.OutroVideoUnlocked( f12_arg0.exclusiveController, g_episode )
if f12_local5 then
f12_local1 = "none"
f12_local3 = Engine.Localize( "@ALIEN_INTEL_FRONTEND_EXTINCTION_INTEL_OUTRO" )
f12_local2 = 0
f12_local4 = 1
else
f12_local1 = "vf_lock"
f12_local3 = Engine.Localize( "@ALIEN_INTEL_FRONTEND_EF_OUTRO_LOCKED" )
f12_local2 = 48
f12_local4 = 0.5
end
f12_local0[#f12_local0 + 1] = {
type = "aliens_intel_menu_button",
id = "aliens_intel_btn_id_" .. g_episode .. "_outro",
properties = {
intel_icon = f12_local1,
intel_name = f12_local3,
intel_icon_dims = f12_local2,
intel_alpha = f12_local4,
intel_now_playing = 0
},
handlers = {
button_action = function ( f15_arg0, f15_arg1 )
if f12_local5 then
AliensIntelSwapBink( 0, true, "outro" )
f15_arg0:dispatchEventToRoot( {
name = "turn_off_now_playing",
immediate = true
} )
f15_arg0:dispatchEventToRoot( {
name = "invis_text",
immediate = true
} )
f15_arg0:dispatchEventToChildren( {
name = "now_playing",
immediate = true
} )
end
end
}
}
if g_map == "mp_alien_last" then
if 1 == IntelTable.Unlocked[8] then
f12_local1 = "alien_icon_intel_" .. Engine.TableLookup( IntelTable.File, IntelTable.Cols.menu_order, 8, IntelTable.Cols.type )
f12_local3 = Engine.Localize( "@ALIEN_INTEL_FRONTEND_" .. Engine.TableLookup( IntelTable.File, IntelTable.Cols.menu_order, 8, IntelTable.Cols.intel_name ) )
f12_local2 = 32
f12_local4 = 1
else
f12_local1 = "vf_lock"
f12_local3 = Engine.Localize( "@ALIEN_INTEL_FRONTEND_EXTINCTION_TOP_SECRET" )
f12_local2 = 48
f12_local4 = 0.5
end
f12_local0[#f12_local0 + 1] = {
type = "aliens_intel_menu_button",
id = "aliens_intel_btn_id_" .. g_episode .. "_" .. 8,
properties = {
intel_icon = f12_local1,
intel_name = f12_local3,
intel_icon_dims = f12_local2,
intel_alpha = f12_local4,
intel_now_playing = 0
},
handlers = {
button_action = function ( f16_arg0, f16_arg1 )
if IntelTable.Unlocked[8] == 1 then
AliensIntelSwapBink( 8, 1 )
f16_arg0:dispatchEventToRoot( {
name = "turn_off_now_playing",
immediate = true
} )
f16_arg0:dispatchEventToRoot( {
name = "update_intel",
immediate = true,
new_index = 8
} )
f16_arg0:dispatchEventToChildren( {
name = "now_playing",
immediate = true
} )
end
end
}
}
end
return f12_local0
end
function aliens_intel_main()
local f17_local0 = Engine.Localize( ButtonMap.button_shoulderr.string )
local f17_local1 = Engine.Localize( ButtonMap.button_shoulderl.string )
local f17_local2 = 1
if 1 == #g_available_episodes then
f17_local2 = 0
end
local f17_local3 = Engine.IsConsoleGame()
if not f17_local3 then
f17_local3 = Engine.IsGamepadEnabled() == 1
end
if not f17_local3 then
f17_local0 = Engine.Localize( ButtonMap.button_shoulderr.keyboard_string )
f17_local1 = Engine.Localize( ButtonMap.button_shoulderl.keyboard_string )
end
local f17_local4 = {
type = "UIElement",
id = "aliens_intel_id",
properties = {},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = function ( f18_arg0, f18_arg1 )
PersistentBackground.Hide()
Engine.Exec( "uploadstats", f18_arg0.properties.exclusiveController )
Engine.StopMusic( 200 )
if Engine.IsConsoleGame() or Engine.IsGamepadEnabled() == 1 then
f18_arg0:dispatchEventToRoot( {
name = "add_button_helper_text",
button_ref = "button_action",
helper_text = Engine.Localize( "@ALIENS_SELECT" ),
side = "left",
clickable = false
} )
end
end
},
children = {
{
type = "generic_menu_title",
id = "aliens_intel_main_title_text_id",
properties = {
menu_title = Engine.Localize( "@ALIEN_INTEL_FRONTEND_EXTINCTION_INTEL_CAPS" )
}
},
{
type = "UIText",
id = "aliens_intel_main_bumper_l_id",
properties = {
text = f17_local1
},
states = {
default = {
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Center,
leftAnchor = true,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
top = -CoD.TextSettings.ExtraBigFont.Height / 2 - 246,
bottom = CoD.TextSettings.ExtraBigFont.Height / 2 - 246,
left = 106,
right = 0,
alpha = f17_local2
}
}
},
{
type = "UIText",
id = "aliens_intel_main_bumper_r_id",
properties = {
text = f17_local0
},
states = {
default = {
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Center,
leftAnchor = true,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
top = -CoD.TextSettings.ExtraBigFont.Height / 2 - 246,
bottom = CoD.TextSettings.ExtraBigFont.Height / 2 - 246,
left = 282,
right = 0,
alpha = f17_local2
}
}
},
{
type = "UIText",
id = "aliens_intel_main_episode_text_id",
properties = {
text = Engine.Localize( "@ALIEN_INTEL_FRONTEND_EXTINCTION_INTEL_EPISODE_CAPS", g_episode )
},
states = {
default = {
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 134,
right = -998,
top = 102,
bottom = 102 + CoD.TextSettings.NormalFont.Height,
red = 1,
green = 1,
blue = 1,
alpha = 1
}
},
handlers = {
change_episode = function ( f19_arg0, f19_arg1 )
f19_arg0:setText( Engine.Localize( "@ALIEN_INTEL_FRONTEND_EXTINCTION_INTEL_EPISODE_CAPS", g_episode ) )
end
}
},
{
type = "UIText",
id = "aliens_intel_collected_text_id",
properties = {
text = Engine.Localize( "@ALIEN_INTEL_FRONTEND_EXTINCTION_INTEL_COLLECTED", 0, 0 )
},
states = {
default = {
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Right,
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = -120,
top = 60,
bottom = 60 + CoD.TextSettings.NormalFont.Height,
red = Colors.grey_4.r,
green = Colors.grey_4.g,
blue = Colors.grey_4.b,
alpha = 1
}
},
handlers = {
menu_create = function ( f20_arg0, f20_arg1 )
f20_arg0:setText( Engine.Localize( "@ALIEN_INTEL_FRONTEND_EXTINCTION_INTEL_COLLECTED", aliens_calculate_intel_num_collected( true, f20_arg1.controller ), IntelTable.Size + 2 ) )
end,
change_episode = function ( f21_arg0, f21_arg1 )
f21_arg0:processEvent( {
name = "menu_create",
immediate = true,
controller = f21_arg1.controller
} )
end
}
},
{
type = "generic_menu_background_withfade",
id = "aliens_intel_menu_fade_id",
properties = {
fill_alpha = 0,
top_offset = 0
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 96,
right = 322,
top = 100,
bottom = GenericMenuDims.menu_bottom
}
}
},
{
type = "generic_menu_background",
id = " aliens_intel_menu_title_bar",
properties = {
hide_bottom = true
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 96,
right = 322,
top = 104 + CoD.TextSettings.NormalFont.Height
}
}
},
{
type = "UIScrollingVerticalList",
id = "aliens_intel_list_id",
properties = {
use_scrollbar = true,
bar_width = 8,
exclusiveController = MBh.Property( "exclusiveController" )
},
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 100,
right = 310,
top = 136,
bottom = GenericMenuDims.menu_bottom,
spacing = 1,
alpha = 1
}
},
handlers = {
turn_off_now_playing = function ( f22_arg0, f22_arg1 )
local f22_local0 = f22_arg0:getFirstChild()
while f22_local0 do
f22_local0:dispatchEventToChildren( {
name = "not_playing",
immediate = true
} )
f22_local0 = f22_local0:getNextSibling()
end
end,
change_episode = function ( f23_arg0, f23_arg1 )
f23_arg0:processEvent( {
name = "menu_refresh",
immediate = true
} )
f23_arg0:dispatchEventToRoot( {
name = "invis_text",
immediate = true
} )
AliensIntelSwapBink( 0, true, "intro" )
end
},
childrenFeeder = AliensIntelListFeeder
},
{
type = "UIImage",
id = "cinematic_image_id",
states = {
default = {
material = RegisterMaterial( "cinematic" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 324,
right = 1190,
top = 100,
bottom = 630
}
}
},
{
type = "UIText",
id = "subject_name_id",
properties = {
text = Engine.Localize( "@ALIEN_INTEL_FRONTEND_" .. Engine.TableLookup( IntelTable.File, IntelTable.Cols.menu_order, 1, IntelTable.Cols.subject ) )
},
states = {
default = {
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Left,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 522,
right = 0,
top = 112,
bottom = 112 + CoD.TextSettings.ExtraBigFont.Height,
red = 0,
green = 0,
blue = 0,
alpha = 0
},
visible = {
alpha = 1
}
},
handlers = {
invis_text = function ( f24_arg0, f24_arg1 )
f24_arg0:animateToState( "default" )
end,
update_intel = function ( f25_arg0, f25_arg1 )
if g_episode == 1 then
f25_arg0:animateToState( "visible" )
f25_arg0:setText( Engine.Localize( "@ALIEN_INTEL_FRONTEND_" .. Engine.TableLookup( IntelTable.File, IntelTable.Cols.menu_order, f25_arg1.new_index, IntelTable.Cols.subject ) ) )
end
end
}
},
{
type = "UIText",
id = "file_num_text_id",
properties = {
text = Engine.Localize( "@ALIEN_INTEL_FRONTEND_" .. Engine.TableLookup( IntelTable.File, IntelTable.Cols.menu_order, 1, IntelTable.Cols.file_num ) )
},
states = {
default = {
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 482,
right = 0,
top = 473,
bottom = 473 + CoD.TextSettings.NormalFont.Height,
red = Colors.grey_4.r,
green = Colors.grey_4.g,
blue = Colors.grey_4.b,
alpha = 0
},
visible = {
alpha = 1
},
invisible = {
alpha = 0
}
},
handlers = {
invis_text = function ( f26_arg0, f26_arg1 )
f26_arg0:animateToState( "default" )
end,
update_intel = function ( f27_arg0, f27_arg1 )
if g_episode == 1 then
f27_arg0:setText( Engine.Localize( "@ALIEN_INTEL_FRONTEND_" .. Engine.TableLookup( IntelTable.File, IntelTable.Cols.menu_order, f27_arg1.new_index, IntelTable.Cols.file_num ) ) )
local f27_local0 = MBh.AnimateSequence( {
{
"invisible",
0
},
{
"invisible",
100
},
{
"visible",
1000
}
} )
f27_local0( f27_arg0, {} )
end
end
}
},
{
type = "generic_back_button",
id = "aliens_intel_main_back_id"
},
{
type = "UIBindButton",
id = "aliens_intel_main_back_id",
handlers = {
button_shoulderr = function ( f28_arg0, f28_arg1 )
if #g_available_episodes > 1 then
aliens_intel_update_episode( 1 )
f28_arg0:dispatchEventToRoot( {
name = "change_episode",
immediate = true,
controller = f28_arg1.controller
} )
end
end,
button_shoulderl = function ( f29_arg0, f29_arg1 )
if #g_available_episodes > 1 then
aliens_intel_update_episode( -1 )
f29_arg0:dispatchEventToRoot( {
name = "change_episode",
immediate = true,
controller = f29_arg1.controller
} )
end
end
}
},
{
type = "button_helper_text_main",
id = "aliens_intel_helper_text_id",
handlers = {
menu_create = function ( f30_arg0, f30_arg1 )
f30_arg0:dispatchEventToRoot( LUI.ButtonHelperText.CommonEvents.addBackButton )
if #g_available_episodes > 1 then
f30_arg0:processEvent( {
name = "add_button_helper_text",
priority = 1,
button_ref = "button_shoulderl",
button_ref2 = "button_shoulderr",
helper_text = Engine.Localize( "ALIEN_INTEL_FRONTEND_EXTINCTION_INTEL_TOGGLE_EPISODE" ),
side = "left",
clickable = true,
immediate = true
} )
end
end
}
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
}
}
}
return AliensIntelSwapBink( 0, true, "intro" )
end
LUI.FlowManager.RegisterStackPushBehaviour( "aliens_intel_main", aliens_intel_menu_initialize )
LUI.MenuBuilder.registerDef( "aliens_intel_main", aliens_intel_main )
LUI.MenuBuilder.registerType( "aliens_intel_menu_button", aliens_intel_menu_button )
LUI.FlowManager.RegisterStackPopBehaviour( "aliens_intel_main", exit_aliens_intel_main )
LockTable( _M )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,954 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ( f1_arg0, f1_arg1, f1_arg2, f1_arg3, f1_arg4 )
if f1_arg4 == nil or f1_arg4 == "" then
return
else
Engine.SetPlayerDataEx( f1_arg0, f1_arg1, f1_arg2, f1_arg3, "challengeState", "ch_" .. string.sub( f1_arg4, 5 ) .. "_purchase", 2 )
end
end
f0_local1 = function ( f2_arg0, f2_arg1, f2_arg2, f2_arg3, f2_arg4 )
if f2_arg4 == nil or f2_arg4 == "" then
return
else
Engine.SetPlayerDataEx( f2_arg0, f2_arg1, f2_arg2, f2_arg3, "challengeState", "ch_" .. f2_arg4 .. "_purchase", 2 )
end
end
f0_local2 = function ( f3_arg0, f3_arg1, f3_arg2, f3_arg3, f3_arg4, f3_arg5 )
if f3_arg4 == nil or f3_arg4 == "" or f3_arg4 == "none" or f3_arg5 == nil or f3_arg5 == "" or f3_arg5 == "none" then
return
else
Engine.SetPlayerDataEx( f3_arg0, f3_arg1, f3_arg2, f3_arg3, "challengeState", "ch_" .. string.sub( f3_arg4, 5 ) .. "_" .. f3_arg5 .. "_purchase", 2 )
end
end
local f0_local3 = function ( f4_arg0, f4_arg1, f4_arg2, f4_arg3, f4_arg4 )
if f4_arg4 == nil or f4_arg4 == "" or f4_arg4 == "specialty_null" then
return
else
Engine.SetPlayerDataEx( f4_arg0, f4_arg1, f4_arg2, f4_arg3, "challengeState", "ch_" .. f4_arg4 .. "_purchase", 2 )
end
end
local f0_local4 = function ( f5_arg0, f5_arg1, f5_arg2 )
return Engine.TableLookup( f5_arg0, 0, f5_arg2, f5_arg1 % 10 + 1 )
end
local f0_local5 = function ( f6_arg0, f6_arg1, f6_arg2, f6_arg3, f6_arg4, f6_arg5 )
local f6_local0 = f0_local4( f6_arg5, f6_arg4, "loadoutEquipment" )
Cac.SetCacConfig( f6_arg0, f6_arg2, f6_arg3, "loadouts", f6_arg4, "perks", Cac.Indices.Grenade.Primary, f6_local0 )
f0_local3( f6_arg0, f6_arg1, f6_arg2, f6_arg3, f6_local0 )
f6_local0 = f0_local4( f6_arg5, f6_arg4, "loadoutOffhand" )
Cac.SetCacConfig( f6_arg0, f6_arg2, f6_arg3, "loadouts", f6_arg4, "perks", Cac.Indices.Grenade.Secondary, f6_local0 )
f0_local3( f6_arg0, f6_arg1, f6_arg2, f6_arg3, f6_local0 )
end
local f0_local6 = function ( f7_arg0, f7_arg1, f7_arg2, f7_arg3, f7_arg4, f7_arg5, f7_arg6, f7_arg7 )
local f7_local0 = f0_local4( f7_arg7, f7_arg4, "loadout" .. f7_arg6 )
local f7_local1 = f0_local4( f7_arg7, f7_arg4, "loadout" .. f7_arg6 .. "Attachment" )
local f7_local2 = f0_local4( f7_arg7, f7_arg4, "loadout" .. f7_arg6 .. "Attachment2" )
local f7_local3 = f0_local4( f7_arg7, f7_arg4, "loadout" .. f7_arg6 .. "Attachment3" )
local f7_local4 = f0_local4( f7_arg7, f7_arg4, "loadout" .. f7_arg6 .. "Camo" )
Cac.SetCacConfig( f7_arg0, f7_arg2, f7_arg3, "loadouts", f7_arg4, "weaponSetups", f7_arg5, "weapon", f7_local0 )
Cac.SetCacConfig( f7_arg0, f7_arg2, f7_arg3, "loadouts", f7_arg4, "weaponSetups", f7_arg5, "attachment", 0, f7_local1 )
Cac.SetCacConfig( f7_arg0, f7_arg2, f7_arg3, "loadouts", f7_arg4, "weaponSetups", f7_arg5, "attachment", 1, f7_local2 )
Cac.SetCacConfig( f7_arg0, f7_arg2, f7_arg3, "loadouts", f7_arg4, "weaponSetups", f7_arg5, "attachment", 2, f7_local3 )
f0_local0( f7_arg0, f7_arg1, f7_arg2, f7_arg3, f7_local0 )
f0_local2( f7_arg0, f7_arg1, f7_arg2, f7_arg3, f7_local0, f7_local1 )
f0_local2( f7_arg0, f7_arg1, f7_arg2, f7_arg3, f7_local0, f7_local2 )
f0_local2( f7_arg0, f7_arg1, f7_arg2, f7_arg3, f7_local0, f7_local3 )
local f7_local5 = {
f7_local1,
f7_local2,
f7_local3
}
local f7_local6 = "none"
for f7_local10, f7_local11 in ipairs( f7_local5 ) do
if f7_local11 and f7_local11 ~= "" and Cac.AttachmentHasReticles( f7_local11 ) then
f7_local6 = Cac.GetReticleDefault( f7_local11 )
break
end
end
Cac.SetCacConfig( f7_arg0, f7_arg2, f7_arg3, "loadouts", f7_arg4, "weaponSetups", f7_arg5, "reticle", f7_local6 )
end
local f0_local7 = function ( f8_arg0, f8_arg1, f8_arg2, f8_arg3, f8_arg4, f8_arg5 )
for f8_local0 = 1, 7, 1 do
for f8_local3 = 1, 5, 1 do
Cac.SetCacConfig( f8_arg0, f8_arg2, f8_arg3, "loadouts", f8_arg4, "abilitiesPicked", f8_local0 - 1, f8_local3 - 1, false )
end
end
for f8_local0 = 1, 8, 1 do
local f8_local3 = f0_local4( f8_arg5, f8_arg4, "loadoutPerk" .. f8_local0 )
if f8_local3 == "" then
break
end
local f8_local4 = string.sub( f8_local3, 1, 1 )
local f8_local5 = string.sub( f8_local3, 2, 2 )
f8_local4 = f8_local4 + 0
f8_local5 = f8_local5 + 0
Cac.SetCacConfig( f8_arg0, f8_arg2, f8_arg3, "loadouts", f8_arg4, "abilitiesPicked", f8_local4 - 1, f8_local5 - 1, true )
f0_local1( f8_arg0, f8_arg1, f8_arg2, f8_arg3, Engine.TableLookupByRow( "mp/cacAbilityTable.csv", f8_local4 + 1, f8_local5 + 3 ) )
end
end
local f0_local8 = function ( f9_arg0, f9_arg1, f9_arg2, f9_arg3, f9_arg4, f9_arg5 )
for f9_local0 = 0, 5, 1 do
local f9_local3 = f0_local4( f9_arg5, f9_arg4, "loadoutStreak" .. f9_local0 )
local f9_local4 = "assaultStreaks"
local f9_local5 = f9_local0
if f9_local0 > 2 then
f9_local4 = "supportStreaks"
f9_local5 = f9_local0 - 3
end
Cac.SetCacConfig( f9_arg0, f9_arg2, f9_arg3, "loadouts", f9_arg4, f9_local4, f9_local5, f9_local3 )
end
end
local f0_local9 = function ( f10_arg0 )
local f10_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "menu_archetype_select" )
local f10_local1 = f10_local0.csvTable
local f10_local2 = CoD.GetStatsGroupForGameMode()
local f10_local3 = f10_local0.exclusiveController
local f10_local4 = Cac.GetSquadLoc()
local f10_local5 = Cac.GetEditSquadMember()
for f10_local6 = 0, Cac.Settings.DataLoc.loadouts.baseClassSlots - 1, 1 do
Cac.SetCacConfig( f10_local3, f10_local4, f10_local5, "loadouts", f10_local6, "name", Engine.Localize( f0_local4( f10_local1, f10_local6, "loadoutName" ) ) )
f0_local6( f10_local3, f10_local2, f10_local4, f10_local5, f10_local6, 0, "Primary", f10_local1 )
f0_local6( f10_local3, f10_local2, f10_local4, f10_local5, f10_local6, 1, "Secondary", f10_local1 )
f0_local5( f10_local3, f10_local2, f10_local4, f10_local5, f10_local6, f10_local1 )
f0_local7( f10_local3, f10_local2, f10_local4, f10_local5, f10_local6, f10_local1 )
f0_local8( f10_local3, f10_local2, f10_local4, f10_local5, f10_local6, f10_local1 )
local f10_local9 = false
if f10_local6 <= 2 then
f10_local9 = true
end
Cac.SetClassInUse( f10_local3, f10_local4, f10_local5, "loadouts", f10_local6, f10_local9 )
end
Engine.SetPlayerDataEx( f10_local3, f10_local2, f10_local4, f10_local5, "defaultSet", true )
LUI.FlowManager.RequestLeaveMenu( self, true )
if f10_local5 == 0 and f10_local0.findMatch then
LUI.FlowManager.RequestAddMenu( f10_arg0, "menu_xboxlive", false, f10_local3, true )
if SvS.IsSvS() then
LUI.FlowManager.RequestSetStack( self, {
{
name = "mp_main_menu"
},
{
name = "squads_mode_select_menu"
}
} )
else
LUI.FlowManager.RequestSetStack( self, {
{
name = "mp_main_menu"
}
} )
end
else
LUI.FlowManager.RequestLeaveMenu( self, true )
end
end
function confirmation_popup()
local f11_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "menu_archetype_select" )
return {
type = "generic_yesno_popup",
properties = {
message_text = Engine.Localize( "@LUA_MENU_STARTING_UNLOCKS_DESC", f11_local0.loadoutType, Engine.MarkLocalized( Cac.GetSquadMemberName( f11_local0.exclusiveController, Cac.GetSquadLoc(), Cac.GetEditSquadMember() ) ) ),
popup_title = Engine.Localize( "@LUA_MENU_CONFIRM" ),
yes_action = f0_local9
}
}
end
local f0_local10 = function ( f12_arg0 )
local f12_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "menu_archetype_select" )
f12_local0.csvTable = f12_arg0.properties.csvTable
f12_local0.loadoutType = f12_arg0.properties.button_text
LUI.FlowManager.RequestPopupMenu( f12_arg0, "confirmation_popup", true, f12_arg0.properties.exclusiveController, false, f12_local0 )
end
function updateArchetypeDetailsInfo( f13_arg0, f13_arg1 )
local f13_local0 = f13_arg0.properties.csvTable
local f13_local1 = Engine.TableLookup( f13_local0, 0, "loadoutPrimary", 1 )
local f13_local2 = Engine.TableLookup( f13_local0, 0, "loadoutPrimaryAttachment", 1 )
local f13_local3 = Engine.TableLookup( f13_local0, 0, "loadoutPrimaryAttachment2", 1 )
local f13_local4 = Engine.TableLookup( f13_local0, 0, "loadoutPrimaryAttachment3", 1 )
local f13_local5 = Engine.TableLookup( "mp/statsTable.csv", 4, Engine.TableLookup( f13_local0, 0, "loadoutPrimary", 1 ), 6 ) .. "_360"
local f13_local6 = Engine.Localize( f13_arg0.properties.archetype_primary_desc, Engine.Localize( "@" .. Engine.TableLookup( "mp/statsTable.csv", 4, f13_local1, 3 ) ) )
local f13_local7 = Engine.TableLookup( f13_local0, 0, "loadoutSecondary", 1 )
local f13_local8 = Engine.TableLookup( f13_local0, 0, "loadoutSecondaryAttachment", 1 )
local f13_local9 = Engine.TableLookup( f13_local0, 0, "loadoutSecondaryAttachment2", 1 )
local f13_local10 = Engine.TableLookup( "mp/statsTable.csv", 4, Engine.TableLookup( f13_local0, 0, "loadoutSecondary", 1 ), 6 ) .. "_360"
local f13_local11 = Engine.Localize( f13_arg0.properties.archetype_secondary_desc, Engine.Localize( "@" .. Engine.TableLookup( "mp/statsTable.csv", 4, f13_local7, 3 ) ) )
f13_local1 = Cac.BuildWeaponName( f13_local1, f13_local2, f13_local3, nil, nil, f13_local4 )
f13_local7 = Cac.BuildWeaponName( f13_local7, f13_local8, f13_local9 )
local f13_local12 = {}
for f13_local13 = 1, 4, 1 do
f13_local12[f13_local13] = {
newArchetypePerkIcon = Engine.TableLookup( "mp/perkTable.csv", 11, Engine.TableLookup( f13_local0, 0, "loadoutPerk" .. f13_local13, 1 ), 3 ),
newArchetypePerkTitle = Engine.Localize( Engine.TableLookup( "mp/perkTable.csv", 11, Engine.TableLookup( f13_local0, 0, "loadoutPerk" .. f13_local13, 1 ), 2 ) ),
newArchetypePerkDesc = Engine.Localize( Engine.TableLookup( "mp/perkTable.csv", 11, Engine.TableLookup( f13_local0, 0, "loadoutPerk" .. f13_local13, 1 ), 4 ) )
}
end
f13_arg0:dispatchEventToRoot( {
name = "updateArchetypeLoadoutInfo",
newArchetypeIcon = f13_arg0.properties.archetype_icon,
newArchetypeTitle = f13_arg0.properties.archetype_title,
newArchetypeDesc = f13_arg0.properties.archetype_desc,
newArchetypePrimaryIcon = f13_local5,
newArchetypeSecondaryIcon = f13_local10,
newArchetypePrimaryDesc = f13_local6,
newArchetypeSecondaryDesc = f13_local11,
newArchetypePerkData = f13_local12,
immediate = true
} )
f13_arg0:dispatchEventToRoot( {
name = "update_squad_member_window_weapon",
weapon = f13_local1
} )
f13_arg0:dispatchEventToRoot( {
name = "update_squad_member_window_stowed_weapon",
weapon = f13_local7
} )
end
function ArchetypeSelectOptionsFeeder( f14_arg0 )
local f14_local0 = {
[#f14_local0 + 1] = {
type = "UIGenericButton",
id = "assaultSetButtonID",
properties = {
button_text = Engine.Localize( "@LUA_MENU_ASSAULT" ),
button_action_func = f0_local10,
button_over_func = updateArchetypeDetailsInfo,
csvTable = "mp/classTableAssault.csv",
archetype_icon = "icon_loadout_assault",
archetype_title = "@LUA_MENU_ASSAULT",
archetype_desc = "@LUA_MENU_ASSAULT_DESC",
archetype_primary_desc = "@LUA_MENU_ASSAULT_WEAPON_DESC",
archetype_secondary_desc = "@LUA_MENU_HANDGUN_WEAPON_DESC"
}
},
[#f14_local0 + 1] = {
type = "UIGenericButton",
id = "cqbSetButtonID",
properties = {
button_text = Engine.Localize( "@LUA_MENU_CQB" ),
button_action_func = f0_local10,
button_over_func = updateArchetypeDetailsInfo,
csvTable = "mp/classTableCQB.csv",
archetype_icon = "icon_loadout_cqb",
archetype_title = "@LUA_MENU_CQB",
archetype_desc = "@LUA_MENU_CQB_DESC",
archetype_primary_desc = "@LUA_MENU_CQB_WEAPON_DESC",
archetype_secondary_desc = "@LUA_MENU_HANDGUN_WEAPON_DESC"
}
},
[#f14_local0 + 1] = {
type = "UIGenericButton",
id = "covertOpsSetButtonID",
properties = {
button_text = Engine.Localize( "@LUA_MENU_COVERT_OPS" ),
button_action_func = f0_local10,
button_over_func = updateArchetypeDetailsInfo,
csvTable = "mp/classTableAssassin.csv",
archetype_icon = "icon_loadout_covertops",
archetype_title = "@LUA_MENU_COVERT_OPS",
archetype_desc = "@LUA_MENU_COVERT_OPS_DESC",
archetype_primary_desc = "@LUA_MENU_COVERT_DESC",
archetype_secondary_desc = "@LUA_MENU_HANDGUN_WEAPON_DESC"
}
},
[#f14_local0 + 1] = {
type = "UIGenericButton",
id = "heavyGunnerSetButtonID",
properties = {
button_text = Engine.Localize( "@LUA_MENU_HEAVY_GUNNER" ),
button_action_func = f0_local10,
button_over_func = updateArchetypeDetailsInfo,
csvTable = "mp/classTableHeavyGunner.csv",
archetype_icon = "icon_loadout_heavygunner",
archetype_title = "@LUA_MENU_HEAVY_GUNNER",
archetype_desc = "@LUA_MENU_HEAVY_GUNNER_DESC",
archetype_primary_desc = "@LUA_MENU_HEAVY_GUNNER_WEAPON_DESC",
archetype_secondary_desc = "@LUA_MENU_GL_WEAPON_DESC"
}
},
[#f14_local0 + 1] = {
type = "UIGenericButton",
id = "marksmanSetButtonID",
properties = {
button_text = Engine.Localize( "@LUA_MENU_MARKSMAN" ),
button_action_func = f0_local10,
button_over_func = updateArchetypeDetailsInfo,
csvTable = "mp/classTableSniper.csv",
archetype_icon = "icon_loadout_marksman",
archetype_title = "@LUA_MENU_MARKSMAN",
archetype_desc = "@LUA_MENU_MARKSMAN_DESC",
archetype_primary_desc = "@LUA_MENU_MARKSMAN_RIFLE_DESC",
archetype_secondary_desc = "@LUA_MENU_HANDGUN_BURST_WEAPON_DESC"
}
}
}
return f14_local0
end
function ArchetypePerkFeeder( f15_arg0 )
local f15_local0 = {
[#f15_local0 + 1] = {
type = "archetype_loadout_perk_widget",
properties = {
perkNum = 1
}
},
[#f15_local0 + 1] = {
type = "archetype_loadout_perk_widget",
properties = {
perkNum = 2
}
},
[#f15_local0 + 1] = {
type = "archetype_loadout_perk_widget",
properties = {
perkNum = 3
}
},
[#f15_local0 + 1] = {
type = "archetype_loadout_perk_widget",
properties = {
perkNum = 4
}
}
}
return f15_local0
end
function archetype_loadout_header()
return {
type = "UIElement",
properties = {
topOffset = 0,
titleText = "",
decText = "",
isForPrimary = false
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = MBh.Property( "topOffset" ),
left = 1,
right = -1,
height = 30
}
},
children = {
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Swatches.GenericMenu.Border, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "white" ),
alpha = Swatches.GenericMenu.BorderAlpha
} )
}
},
{
type = "UIText",
id = "archetype_loadout_header_title_id",
properties = {
text = MBh.Property( "titleText" ),
textStyle = CoD.TextStyle.Shadowed
},
states = {
default = CoD.ColorizeState( Colors.white, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 4,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left
} )
}
},
{
type = "UIMarqueeText",
id = "archetype_loadout_header_desc_id",
properties = {
text = MBh.Property( "decText" ),
textStyle = CoD.TextStyle.Shadowed
},
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = -4,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left
} )
}
}
},
handlers = {
updateArchetypeLoadoutInfo = function ( f17_arg0, f17_arg1 )
local f17_local0 = 8
local f17_local1, f17_local2, f17_local3, f17_local4 = GetTextDimensions( f17_arg0.properties.titleText, CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
local f17_local5 = f17_local3 - f17_local1
local f17_local6 = f17_arg0.properties.isForPrimary and f17_arg1.newArchetypePrimaryDesc or f17_arg1.newArchetypeSecondaryDesc
local f17_local7 = f17_arg0:getChildById( "archetype_loadout_header_desc_id" )
f17_local7:registerAnimationState( "updated", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = f17_local5 + f17_local0,
right = -3,
height = CoD.TextSettings.NormalFont.Height
} )
f17_local7:animateToState( "updated", 0 )
f17_local7:setText( f17_local6 )
end
}
}
end
function archetype_loadout_perk_widget()
return {
type = "UIElement",
properties = {
topOffset = 0,
perkNum = 1
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = MBh.Property( "topOffset" ),
left = 0,
right = 0,
height = 50
}
},
children = {
{
type = "UIImage",
id = "archetype_loadout_perk_icon_id",
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
left = 0,
width = 48,
height = 48
}
}
},
{
type = "UIText",
id = "archetype_loadout_perk_title_id",
properties = {
textStyle = CoD.TextStyle.Shadowed
},
states = {
default = CoD.ColorizeState( Colors.white, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
bottom = 2,
left = 50,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left
} )
}
},
{
type = "UIMarqueeText",
id = "archetype_loadout_per_desc_id",
properties = {
textStyle = CoD.TextStyle.Shadowed
},
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = -2,
left = 50,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left
} )
}
}
},
handlers = {
updateArchetypeLoadoutInfo = function ( f19_arg0, f19_arg1 )
local f19_local0 = f19_arg1.newArchetypePerkData[f19_arg0.properties.perkNum]
local f19_local1 = f19_arg0:getChildById( "archetype_loadout_perk_icon_id" )
local f19_local2 = f19_arg0:getChildById( "archetype_loadout_perk_title_id" )
local f19_local3 = f19_arg0:getChildById( "archetype_loadout_per_desc_id" )
f19_local1:setImage( RegisterMaterial( f19_local0.newArchetypePerkIcon ) )
f19_local2:setText( f19_local0.newArchetypePerkTitle )
f19_local3:setText( f19_local0.newArchetypePerkDesc )
end
}
}
end
function archetype_details_panel()
return {
type = "UIElement",
id = "archetype_deatails_container_id",
properties = {
topOffset = 0,
leftOffset = 0
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = MBh.Property( "topOffset" ),
left = MBh.Property( "leftOffset" ),
width = 370,
height = 330
}
},
children = {
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Colors.white, {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 3,
left = 0,
width = 5,
height = 13,
alpha = 0.5
} )
}
},
{
type = "UIText",
properties = {
text = Engine.Localize( "@LUA_MENU_ASSAULT" ),
textStyle = CoD.TextStyle.Shadowed
},
states = {
default = CoD.ColorizeState( Colors.white, {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
left = 10,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left
} )
},
handlers = {
updateArchetypeLoadoutInfo = function ( f21_arg0, f21_arg1 )
f21_arg0:setText( Engine.Localize( f21_arg1.newArchetypeTitle ) )
end
}
},
{
type = "UIText",
properties = {
text = Engine.Localize( "@LUA_MENU_ASSAULT_DESC" ),
textStyle = CoD.TextStyle.Shadowed
},
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = CoD.TextSettings.NormalFont.Height,
left = 10,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left
} )
},
handlers = {
updateArchetypeLoadoutInfo = function ( f22_arg0, f22_arg1 )
f22_arg0:setText( Engine.Localize( f22_arg1.newArchetypeDesc ) )
end
}
},
{
type = "UIImage",
states = {
default = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = false,
bottom = 0,
width = 300,
height = 300,
material = RegisterMaterial( "icon_loadout_assault" )
}
},
handlers = {
updateArchetypeLoadoutInfo = function ( f23_arg0, f23_arg1 )
f23_arg0:setImage( RegisterMaterial( f23_arg1.newArchetypeIcon ) )
end
}
}
}
}
end
function archetype_loadout_panel()
return {
type = "UIElement",
id = "loadout_deatails_container_id",
properties = {
topOffset = 0,
leftOffset = 0
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = MBh.Property( "topOffset" ),
left = MBh.Property( "leftOffset" ),
width = 380,
height = 530
}
},
children = {
{
type = "generic_menu_background_withfade",
properties = {
top_offset = 0
}
},
{
type = "archetype_loadout_header",
properties = {
topOffset = 1,
titleText = Engine.Localize( "@LUA_MENU_PRIMARY_CAPS" ),
isForPrimary = true
}
},
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 45,
width = 192,
height = 96
}
},
handlers = {
updateArchetypeLoadoutInfo = function ( f25_arg0, f25_arg1 )
f25_arg0:setImage( RegisterMaterial( f25_arg1.newArchetypePrimaryIcon ) )
end
}
},
{
type = "archetype_loadout_header",
properties = {
topOffset = 150,
titleText = Engine.Localize( "@LUA_MENU_SECONDARY_CAPS" )
}
},
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 200,
width = 192,
height = 96
}
},
handlers = {
updateArchetypeLoadoutInfo = function ( f26_arg0, f26_arg1 )
f26_arg0:setImage( RegisterMaterial( f26_arg1.newArchetypeSecondaryIcon ) )
end
}
},
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Swatches.GenericMenu.Border, {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 310,
left = 1,
right = -1,
height = 1,
material = RegisterMaterial( "white" ),
alpha = Swatches.GenericMenu.BorderAlpha
} )
}
},
{
type = "UIVerticalList",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 315,
left = 3,
right = -10,
height = 220,
spacing = 4,
alignment = LUI.Alignment.Center
}
},
childrenFeeder = ArchetypePerkFeeder
}
}
}
end
function menu_archetype_select()
return {
type = "UIElement",
id = "menu_archetype_select_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 1
}
},
handlers = {
menu_create = function ( f28_arg0, f28_arg1 )
local f28_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "cac_member_select_main" )
f28_local0.alreadyWelcomed = true
f28_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_secondary",
helper_text = Engine.Localize( "@LUA_MENU_BACK" ),
side = "left",
clickable = true
} )
f28_arg0:dispatchEventToChildren( {
name = "update_header_text",
string = Engine.Localize( "@LUA_MENU_LOADOUT_SELECT", Engine.MarkLocalized( Cac.GetSquadMemberName( f28_local0.exclusiveController, Cac.GetSquadLoc(), Cac.GetEditSquadMember() ) ) ),
immediate = true
} )
end
},
children = {
{
type = "UIImage",
id = "member_select_background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "bkgd_cas" )
}
}
},
{
type = "generic_menu_title"
},
{
type = "archetype_details_panel",
properties = {
topOffset = 330,
leftOffset = 80
}
},
{
type = "archetype_loadout_panel",
properties = {
topOffset = 100,
leftOffset = 500
}
},
{
type = "archetype_select_vlist",
id = "archetype_select_vlist_id",
childrenFeeder = ArchetypeSelectOptionsFeeder
},
{
type = "UISquadMemberWindow",
id = "member_select_member_window_id",
properties = {
use_3d_model = true,
use_2d_character_image = false,
use_member_name = false,
use_prestige_icon = false,
use_playercard = false,
use_background = true,
use_border = false,
default_anim = Cac.Customization.Animations.default,
char_window_dims = {
top = 0,
bottom = 610,
left = -175,
right = 435
},
uv_values = {
0,
0,
1,
1
},
character_pos = CharacterCameraPresets.MemberSelect.Position,
controller = MBh.Property( "exclusiveController" ),
squad_location = Cac.GetSquadLoc(),
mask_pos_data = {
top = 17,
bottom = 0,
left = 0,
right = 0
},
squad_member_index = MBh.Property( "squadMemberIndex" )
},
states = {
default = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 70,
left = 0 + Cac.Layout.CacEditPanel.shift_delta,
bottom = 670,
right = 746 + Cac.Layout.CacEditPanel.shift_delta
}
},
handlers = {
menu_close = function ( f29_arg0, f29_arg1 )
LUI.UISquadMemberWindow.Shutdown( f29_arg0 )
end
,
update_squad_member_window_weapon = function ( f30_arg0, f30_arg1 )
assert( f30_arg1.weapon )
f30_arg0:processEvent( {
name = "weapon_change_start",
offline_weapon = f30_arg1.weapon,
prev_weapon = f30_arg0.current_weapon
} )
end
,
update_squad_member_window_stowed_weapon = function ( f31_arg0, f31_arg1 )
assert( f31_arg1.weapon )
f31_arg0:processEvent( {
name = "weapon_changed_stowed",
weapon = f31_arg1.weapon
} )
end
}
},
{
type = "button_helper_text_main",
id = "cac_button_helper_text_id"
},
{
type = "generic_back_button"
}
}
}
end
function archetype_select_vlist()
return {
type = "UIVerticalList",
focusable = true,
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom,
alpha = 1
}
}
}
end
LUI.MenuBuilder.registerDef( "menu_archetype_select", menu_archetype_select )
LUI.MenuBuilder.registerDef( "archetype_select_vlist", archetype_select_vlist )
LUI.MenuBuilder.registerDef( "archetype_loadout_header", archetype_loadout_header )
LUI.MenuBuilder.registerDef( "archetype_loadout_perk_widget", archetype_loadout_perk_widget )
LUI.MenuBuilder.registerDef( "archetype_loadout_panel", archetype_loadout_panel )
LUI.MenuBuilder.registerDef( "archetype_details_panel", archetype_details_panel )
LUI.MenuBuilder.registerDef( "confirmation_popup", confirmation_popup )
LockTable( _M )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,699 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function CacEditRestoreFocusability( f1_arg0, f1_arg1 )
f1_arg0:enableTreeFocus()
end
function SetMenuTitleToSquadMemberName( f2_arg0 )
local f2_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f2_arg0 )
f2_arg0:dispatchEventToRoot( {
name = "update_header_text",
string = Cac.GetSquadMemberName( f2_local0.exclusiveControllerIndex, f2_local0.squadLocation, f2_local0.squadMemberIndex ),
immediate = true
} )
end
function SetMenuTitleToLoadoutName( f3_arg0 )
local f3_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f3_arg0 )
f3_arg0:dispatchEventToRoot( {
name = "update_header_text",
string = Cac.GetLoadoutName( f3_local0.exclusiveControllerIndex, f3_local0.squadLocation, f3_local0.squadMemberIndex, f3_local0.classLocation, f3_local0.slot )
} )
end
function SwitchToMemberSelect( f4_arg0, f4_arg1 )
LUI.FlowManager.RequestAddMenu( f4_arg0, "cac_member_select_main", true, f4_arg1.controller, true, {
next_screen = "cac_edit_main",
squadLocation = f4_arg0.properties.squadLocation,
classLocation = f4_arg0.properties.classLocation,
force_to_next_screen = true
} )
LUI.FlowManager.RequestLeaveMenuByName( "cac_edit_main" )
end
function CacEditCreateHandler( f5_arg0, f5_arg1 )
local f5_local0 = f5_arg0.properties
local f5_local1 = f5_local0.exclusiveController
if not f5_local1 then
DebugPrint( "[WARNING] CAC: using controller index 0, this is only ok if you are editing a menu" )
f5_local1 = 0
end
local f5_local2 = LUI.FlowManager.GetMenuScopedDataFromElement( f5_arg0 )
f5_local2.controller = f5_local1
f5_local2.squadLocation = f5_local0.squadLocation
f5_local2.squadMemberIndex = f5_local0.squadMemberIndex
f5_local2.classLocation = Cac.GetCustomClassLoc( f5_local0.classLocation )
f5_local2.slot = f5_local0.slot
SetMenuTitleToSquadMemberName( f5_arg0 )
if f5_arg1.stackRestore then
f5_arg0:enableTreeFocus()
f5_arg0:animateToState( "visible", 0 )
else
f5_arg0:disableTreeFocus()
if Engine.GetDvarBool( "cac_open_char_list" ) or f5_local0.open_char_list then
f5_arg0:dispatchEventToRoot( {
name = "open_char_select",
controller = f5_local1,
slot = f5_local0.slot,
immediate = true
} )
Engine.SetDvarBool( "cac_open_char_list", false )
f5_arg0:animateToState( "visible", 0 )
else
local f5_local3 = Engine.GetDvarInt( "lui_remember_classIndex" )
f5_arg0:animateToState( "visible", 0 )
f5_arg0:processEvent( {
name = "cac_set_slot",
slot = f5_local3,
controller = f5_local1,
dispatchChildren = true,
immediate = true
} )
f5_arg0:processEvent( {
name = "update_cac_info_panel",
controller = f5_local1,
dispatchChildren = true,
immediate = true
} )
self:dispatchEventToRoot( {
name = "refresh_specialist_abilities_recap",
controller = f5_local1,
specialistType = Cac.GetPerk( f5_local1, f5_local2.squadLocation, f5_local2.squadMemberIndex, f5_local2.classLocation, f5_local2.slot, Cac.Indices.StreakType ) == "streaktype_specialist",
selected = false
} )
end
end
end
function CacSetCurrentSlot( f6_arg0, f6_arg1 )
assert( f6_arg0.properties.slot, "there is no slot property, something went wrong" )
local f6_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f6_arg0 )
f6_local0.slot = f6_arg1.slot
f6_local0.classLocation = f6_arg1.classLocation
f6_arg0.properties.slot = f6_arg1.slot
f6_arg0.properties.classLocation = f6_arg1.classLocation
f6_arg0:processEvent( {
name = "update_squad_member_window_weapon",
weapon = Cac.BuildPrimaryWeaponName( f6_arg1.controller, f6_local0.squadLocation, f6_local0.squadMemberIndex, f6_local0.classLocation, f6_local0.slot )
} )
f6_arg0:processEvent( {
name = "update_squad_member_window_stowed_weapon",
weapon = Cac.BuildSecondaryWeaponName( f6_arg1.controller, f6_local0.squadLocation, f6_local0.squadMemberIndex, f6_local0.classLocation, f6_local0.slot )
} )
end
function CacOpenCharSelectHandler( f7_arg0, f7_arg1 )
Engine.Exec( "uploadstats", f7_arg1.controller )
SetMenuTitleToSquadMemberName( f7_arg0 )
LUI.FlowManager.RequestPopupMenu( f7_arg0, "cac_main", true, f7_arg1.controller, false, {
currSlot = f7_arg0.properties.slot,
alternateCacMenus = f7_arg0.properties.alternateCacMenus,
squadLocation = f7_arg0.properties.squadLocation,
squadMemberIndex = f7_arg0.properties.squadMemberIndex,
classLocation = f7_arg0.properties.classLocation,
allowMemberSwap = f7_arg0.properties.allowMemberSwap
}, true )
f7_arg0:dispatchEventToRoot( {
name = "cac_update_currency_text"
} )
end
function cac_edit_back_button()
return {
type = "generic_back_button",
properties = {
slot = 0,
classLocation = MBh.Property( "classLocation" ),
squadLocation = MBh.Property( "squadLocation" ),
squadMemberIndex = MBh.Property( "squadMemberIndex" ),
allowMemberSwap = MBh.Property( "allowMemberSwap" )
},
handlers = {
button_secondary = function ( f9_arg0, f9_arg1 )
CacOpenCharSelectHandler( f9_arg0, f9_arg1 )
f9_arg0:dispatchEventToRoot( {
name = "cac_recap_slide_right",
immediate = true
} )
f9_arg0:dispatchEventToRoot( {
name = "close_info_column",
immediate = true
} )
end
,
cac_set_slot = CacSetCurrentSlot
}
}
end
f0_local0 = function ( f10_arg0, f10_arg1 )
f10_arg0:setText( f10_arg1.string )
end
function cac_edit_currency()
return {
type = "UIElement",
id = "cac_edit_currency",
properties = {
tokenWidth = 16,
tokenHeight = 16,
rankIconWidth = 24,
rankIconHeight = 24
},
states = {
default = {
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
top = 58,
right = -100,
width = 500,
height = CoD.TextSettings.NormalFont.Height
}
},
handlers = {
menu_create = MBh.EmitEvent( "cac_update_currency_text" ),
cac_update_currency_text = function ( f12_arg0, f12_arg1 )
local f12_local0 = 3
local f12_local1 = LUI.FlowManager.GetMenuScopedDataFromElement( f12_arg0 )
local f12_local2 = f12_arg0.properties.exclusiveController
local f12_local3 = Cac.GetCurrency( f12_local2 )
local f12_local4, f12_local5, f12_local6, f12_local7 = GetTextDimensions( tostring( f12_local3 ), CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
local f12_local8 = f12_arg0:getChildById( "count" )
local f12_local9 = f12_local6 - f12_local4
f12_local8:setText( tostring( f12_local3 ) )
f12_local8:registerAnimationState( "updated", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
height = CoD.TextSettings.NormalFont.Height,
right = 0,
width = f12_local9
} )
f12_local8:animateToState( "updated", 0 )
local f12_local10 = f12_arg0:getChildById( "token" )
f12_local10:registerAnimationState( "updated", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
width = f12_arg0.properties.tokenWidth,
height = f12_arg0.properties.tokenHeight,
right = -(f12_local9 + f12_local0)
} )
f12_local10:animateToState( "updated", 0 )
local f12_local11 = f12_arg0:getChildById( "title" )
f12_local11:registerAnimationState( "updated", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
height = CoD.TextSettings.NormalFont.Height,
right = -(f12_arg0.properties.tokenWidth + f12_local9 + f12_local0 * 2)
} )
f12_local11:animateToState( "updated", 0 )
local f12_local12 = f12_arg0:getChildById( "rank" )
local f12_local13 = f12_arg0:getChildById( "rank_icon" )
local f12_local14 = f12_arg0:getChildById( "rank_title" )
local f12_local15 = Engine.GetLuiRoot()
if not f12_local15:IsMenuOpenAndVisible( "cac_member_select_main" ) then
f12_local15 = Engine.GetLuiRoot()
if f12_local15:IsMenuOpenAndVisible( "prestige_details_main" ) then
f12_local12:animateToState( "hidden" )
f12_local13:animateToState( "hidden" )
f12_local14:animateToState( "hidden" )
end
f12_local15 = 250
local f12_local16 = Engine.GetPlayerDataEx
local f12_local17 = f12_local2
local f12_local18 = CoD.StatsGroup.Ranked
local f12_local19 = f12_local1.squadLocation
if not f12_local19 then
f12_local19 = Cac.GetSquadLoc()
end
local f12_local20 = f12_local1.squadMemberIndex
if not f12_local20 then
f12_local20 = Cac.GetActiveSquadMember( f12_local2 )
end
f12_local17 = Rank.GetRankDisplay( Lobby.GetRankForXP( f12_local16( f12_local17, f12_local18, f12_local19, f12_local20, "squadMemXP" ) ) )
f12_local18 = Cac.GetPrestigeLevel
f12_local19 = f12_local2
f12_local20 = f12_local1.squadLocation
if not f12_local20 then
f12_local20 = Cac.GetSquadLoc()
end
f12_local19 = RegisterMaterial( Rank.GetRankIcon( f12_local17 - 1, f12_local18( f12_local19, f12_local20 ) ) )
local f12_local20, f12_local21, f12_local22, f12_local23 = GetTextDimensions( tostring( f12_local17 ), CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
local f12_local24 = f12_local22 - f12_local20
f12_local12:setText( tostring( f12_local17 ) )
f12_local12:registerAnimationState( "updated", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
height = CoD.TextSettings.NormalFont.Height,
right = 0 - f12_local15,
width = rankIconWidth
} )
f12_local12:animateToState( "updated", 0 )
local f12_local25 = -(f12_local24 + f12_local0)
CoD.SetMaterial( f12_local13, f12_local19 )
f12_local13:registerAnimationState( "updated", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
width = f12_arg0.properties.rankIconWidth,
height = f12_arg0.properties.rankIconHeight,
right = f12_local25 - f12_local15
} )
f12_local13:animateToState( "updated", 0 )
f12_local14:registerAnimationState( "updated", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
height = CoD.TextSettings.NormalFont.Height,
right = -(f12_arg0.properties.rankIconWidth + f12_local24 + f12_local0 * 2) - f12_local15
} )
f12_local14:animateToState( "updated", 0 )
end
f12_local12:animateToState( "hidden" )
f12_local13:animateToState( "hidden" )
f12_local14:animateToState( "hidden" )
end
},
children = {
{
type = "UIText",
id = "title",
properties = {
text = Engine.Localize( "@LUA_MENU_CAC_COMMENDATIONS" )
},
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Right
} )
}
},
{
type = "UIImage",
id = "token",
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
material = RegisterMaterial( "icon_unlock_token_active" ),
right = 0,
width = MBh.Property( "tokenWidth" ),
height = MBh.Property( "tokenHeight" )
}
}
},
{
type = "UIText",
id = "count",
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Right
} )
},
handlers = {
update_squad_points_count = function ( f13_arg0, f13_arg1 )
if f13_arg1.controller then
f13_arg0:setText( tostring( Engine.GetPlayerDataEx( f13_arg1.controller, CoD.StatsGroup.Ranked, "unlockPoints" ) ) )
end
end
}
},
{
type = "UIText",
id = "rank_title",
properties = {
text = Engine.Localize( "@MENU_RANK" )
},
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Right,
alpha = 1
} ),
hidden = {
alpha = 0
}
}
},
{
type = "UIImage",
id = "rank_icon",
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
material = RegisterMaterial( "white" ),
right = 0,
width = MBh.Property( "rankIconWidth" ),
height = MBh.Property( "rankIconHeight" ),
alpha = 1
},
hidden = {
alpha = 0
}
}
},
{
type = "UIText",
id = "rank",
states = {
default = CoD.ColorizeState( Colors.primary_text_color, {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Right,
alpha = 1
} ),
hidden = {
alpha = 0
}
}
}
}
}
end
function cac_edit_main()
return {
type = "UIElement",
id = "cac_edit_root",
properties = {
slot = 0,
classLocation = "loadouts",
alternateCacMenus = false,
squadLocation = "privateMatchSquadMembers",
squadMemberIndex = 0,
allowMemberSwap = false
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0
},
visible = {
alpha = 1
}
},
children = {
{
type = "UIImage",
id = "CAC_root_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",
id = "edit_squad_header",
properties = {
menu_title = "Member"
}
},
{
type = "button_helper_text_main",
id = "cac_button_helper_text_id"
},
{
type = "cac_recap",
properties = {
exclusiveController = MBh.Property( "exclusiveController" ),
squad_location = MBh.Property( "squadLocation" ),
member_index = MBh.Property( "squadMemberIndex" ),
class_location = MBh.Property( "classLocation" ),
loadout_slot = MBh.Property( "slot" )
}
},
{
type = "UIElement",
id = "class_restrictions_warning",
states = {
default = {
leftAnchor = false,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
top = -66,
right = -100,
width = 500,
height = 28,
alpha = 0
},
visible = {
alpha = 1
}
},
handlers = {
show_class_restrictions_warning = MBh.AnimateToState( "visible" ),
hide_class_restrictions_warning = MBh.AnimateToState( "default" )
},
children = {
{
type = "UIImage",
id = "class_restrictions_warning_icon",
states = {
default = {
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
right = 0,
top = 2,
width = 28,
height = 28,
material = RegisterMaterial( "icon_new_3" ),
alpha = 1
}
}
},
{
type = "UIText",
id = "class_restrictions_warning_text",
properties = {
text = Engine.Localize( "PATCH_MENU_ITEM_RESTRICTED" )
},
states = {
default = CoD.ColorizeState( Colors.orange, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
font = CoD.TextSettings.NormalFont.Font,
left = 0,
right = -35,
top = 5,
bottom = 5 + CoD.TextSettings.NormalFont.Height,
alignment = LUI.Alignment.Right
} )
}
}
}
},
{
type = "UIVerticalList",
id = "cac_edit_main_container_id",
properties = {
spacing = 5,
slot = MBh.Property( "slot" ),
classLocation = MBh.Property( "classLocation" ),
squadLocation = MBh.Property( "squadLocation" ),
squadMemberIndex = MBh.Property( "squadMemberIndex" ),
additional_handlers = {
close_info_column = MBh.AnimateToState( "default", 100 ),
collapse_info_column = MBh.AnimateToState( "collapsed", 100 ),
expand_info_column = MBh.AnimateToState( "expanded", 100 )
}
},
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = Cac.Layout.CacEditPanel.left + 320,
right = Cac.Layout.CacEditPanel.right + 320,
top = Cac.Layout.CacEditPanel.top,
bottom = 0,
alpha = 0
},
expanded = MBh.BaseState( "default", {
alpha = 1
} ),
collapsed = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = Cac.Layout.CacEditPanel.left,
right = Cac.Layout.CacEditPanel.right,
top = Cac.Layout.CacEditPanel.top,
bottom = 0,
alpha = 1
}
},
children = {
{
type = "selection_info_panel_main",
id = "selection_info_panel_main_id"
},
{
type = "cac_basic_info_pane_container",
id = "cac_basic_info_pane_container_id"
}
}
},
{
type = "UISquadMemberWindow",
id = "character_not_so_temp",
properties = {
use_background = true,
charHandle = "customize_char_handle",
default_anim = Cac.Customization.Animations.default,
char_window_dims = {
top = 0,
bottom = 610,
left = -175,
right = 435
},
uv_values = {
0,
0,
1,
1
},
character_pos = CharacterCameraPresets.LoadoutMenu.Position,
controller = MBh.Property( "exclusiveController" ),
squad_member_index = MBh.Property( "squadMemberIndex" ),
squad_location = MBh.Property( "squadLocation" ),
loadout_slot = MBh.Property( "slot" ),
mask_pos_data = {
top = 17,
bottom = 0,
left = 0,
right = 0
}
},
states = {
default = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 70,
left = 0 + Cac.Layout.CacEditPanel.shift_delta,
bottom = 670,
right = 746 + Cac.Layout.CacEditPanel.shift_delta,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
show_character_image = MBh.AnimateToState( "default", 100 ),
hide_character_image = MBh.AnimateToState( "hidden", 100 ),
update_squad_member_window_weapon = function ( f15_arg0, f15_arg1 )
assert( f15_arg1.weapon )
f15_arg0:processEvent( {
name = "weapon_change_start",
new_weapon = f15_arg1.weapon,
prev_weapon = f15_arg0.current_weapon
} )
end
,
update_squad_member_window_stowed_weapon = function ( f16_arg0, f16_arg1 )
assert( f16_arg1.weapon )
f16_arg0:processEvent( {
name = "weapon_changed_stowed",
weapon = f16_arg1.weapon
} )
end
}
},
Cac.GetEditCurrency( "currency_header" ),
{
type = "cac_edit_back_button",
id = "cac_edit_back_button",
properties = {
classLocation = MBh.Property( "classLocation" )
}
}
},
handlers = {
menu_create = CacEditCreateHandler,
open_char_select = CacOpenCharSelectHandler,
cac_exit = function ( f17_arg0, f17_arg1 )
LUI.FlowManager.RequestLeaveMenu( f17_arg0, true )
end
,
cac_set_slot = CacSetCurrentSlot,
popup_active = CacEditRestoreFocusability,
switch_to_member_select = SwitchToMemberSelect
}
}
end
LUI.MenuBuilder.registerDef( "cac_edit_main", cac_edit_main )
LUI.MenuBuilder.registerDef( "cac_edit_back_button", cac_edit_back_button )
LUI.MenuBuilder.registerDef( "cac_edit_currency", cac_edit_currency )
LockTable( _M )

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,213 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function AltButtonPressed( f1_arg0, f1_arg1 )
local f1_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f1_arg0 )
if f1_local0.overrideAltButtonPressed then
f1_arg1.itemType = f1_local0.currentHighlightedType
Engine.PlaySound( CoD.SFX.RestrictClass )
f1_local0.overrideAltButtonPressed( f1_arg0, f1_arg1 )
end
end
function defaultActionToAvoidAssert( f2_arg0, f2_arg1 )
DebugPrint( "[WARNING] CacEditPopup.lua: defaultActionToAvoidAssert() triggered." )
end
function OnMenuCreate( f3_arg0, f3_arg1 )
local f3_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f3_arg0 )
f3_local0.squadLocation = f3_arg0.properties.squadLocation
assert( f3_local0.squadLocation, "Cac: No squad location specified, something went wrong" )
f3_local0.squadMemberIndex = f3_arg0.properties.squadMemberIndex
if not f3_local0.squadMemberIndex then
DebugPrint( "[WARNING] CAC: using squad member index 0, this is only ok if you are editing a menu" )
f3_local0.squadMemberIndex = 0
end
f3_local0.slot = f3_arg0.properties.slot
if not f3_local0.slot then
DebugPrint( "[WARNING] CAC: using cac slot index 0, this is only ok if you are editing a menu" )
f3_local0.slot = 0
end
f3_local0.classLocation = f3_arg0.properties.classLocation
assert( f3_local0.classLocation, "Cac: No class location specified, something went wrong" )
f3_local0.itemIndex = f3_arg0.properties.itemIndex
f3_local0.buttonFeeder = f3_arg0.properties.buttonFeeder
f3_local0.customTop = f3_arg0.properties.customTop
f3_local0.customLeft = f3_arg0.properties.customLeft
f3_local0.customRight = f3_arg0.properties.customRight
f3_local0.customBottom = f3_arg0.properties.customBottom
f3_local0.overrideChooseAction = f3_arg0.properties.overrideChooseAction
f3_local0.disableSetDefaultFocus = f3_arg0.properties.disableSetDefaultFocus
f3_local0.overrideChooseDisableCheck = f3_arg0.properties.overrideChooseDisableCheck
f3_arg0:processEvent( {
name = "update_title",
title_text = f3_arg0.properties.titleBarText
} )
if f3_local0.overrideAltButtonPressed and not MLG.AreMLGRulesEnabled() then
f3_arg0:dispatchEventToRoot( {
name = "add_button_helper_text",
button_ref = "button_alt1",
helper_text = Engine.Localize( "@MPUI_RULES_EXCLUDE_CATEGORY" ),
side = "right",
clickable = true,
immediate = true
} )
end
f3_arg0:processEvent( {
name = "menu_refresh"
} )
f3_arg0:processEvent( {
name = "gain_focus"
} )
end
function OnMenuClose( f4_arg0, f4_arg1 )
local f4_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f4_arg0 )
if f4_local0.overrideAltButtonPressed then
f4_arg0:dispatchEventToRoot( {
name = "add_button_helper_text",
button_ref = "button_alt1",
helper_text = "",
side = "right",
immediate = true
} )
end
end
function cac_edit_popup_main()
return {
type = "UIElement",
id = "cac_edit_popup_root",
properties = {
squadLocation = "privateMatchSquadMembers",
squadMemberIndex = 0,
slot = 0,
classLocation = "privateMatchCustomClasses",
itemIndex = 0,
buttonFeeder = function ()
end
,
titleBarText = "",
overrideChooseAction = nil,
disableSetDefaultFocus = false,
overrideChooseDisableCheck = nil,
customTop = 0,
customLeft = 0,
customRight = 0,
customBottom = 0
},
handlers = {
menu_create = OnMenuCreate,
menu_close = OnMenuClose,
hide_cac_edit_popup = function ( f7_arg0, f7_arg1 )
f7_arg0:animateToState( "hidden", 0 )
end
,
show_cac_edit_popup = function ( f8_arg0, f8_arg1 )
f8_arg0:animateToState( "default", 0 )
end
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = MBh.Property( "customTop" ),
bottom = MBh.Property( "customBottom" ),
left = MBh.Property( "customLeft" ),
right = MBh.Property( "customRight" ),
alpha = 1
},
hidden = {
alpha = 0
}
},
children = {
{
type = "UIElement",
id = "edit_weapon_list",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
left = Cac.Layout.ChooseDialog.left,
top = Cac.Layout.ChooseDialog.top,
width = 305,
height = 540
}
},
properties = {
play_intro_anim = 1,
buttonFeeder = MBh.Property( "buttonFeeder" )
},
children = {
{
type = "generic_menu_titlebar",
id = "cac_weapon_types_titlebar",
properties = {
title_bar_text = genericTitle,
font = CoD.TextSettings.BoldFont,
title_bar_text_indent = 25,
title_bar_alignment = LUI.Alignment.Left
}
},
{
type = "generic_menu_background_withfade",
id = "cac_weapon_background_id",
properties = {
fade_height = 100,
shadow_alpha = Cac.Swatches.Alphas.cac_panel_background_shadow
}
},
{
type = "UIVerticalList",
id = "cac_weapon_types_list",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = GenericTitleBarDims.TitleBarHeight + 4,
bottom = 0,
left = 4,
right = -4,
spacing = 4
}
},
childrenFeeder = MBh.Property( "buttonFeeder" )
}
}
},
{
type = "UIBindButton",
id = "cac_edit_weapon_button_bind_id",
handlers = {
button_alt1 = AltButtonPressed,
button_secondary = function ( f9_arg0, f9_arg1 )
local f9_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f9_arg0 )
if f9_local0.OnMenuBack then
f9_local0.OnMenuBack( f9_arg0, f9_arg1 )
end
if f9_local0.editPopupOpenMenuOnClose then
LUI.FlowManager.RequestPopupMenu( f9_arg0, f9_local0.editPopupOpenMenuOnClose.menu, true, f9_arg1.controller, true, f9_local0.editPopupOpenMenuOnClose )
else
LUI.FlowManager.RequestLeaveMenu( f9_arg0 )
end
end
}
}
}
}
end
LUI.MenuBuilder.registerDef( "cac_edit_popup_main", cac_edit_popup_main )
LUI.MenuBuilder.registerDef( "cac_edit_popup_main_second", cac_edit_popup_main )
LockTable( _M )

View File

@@ -0,0 +1,846 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function selection_info_panel_header()
return {
type = "UIElement",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 30,
height = GenericButtonDims.button_height
}
},
children = {
{
type = "UIText",
id = "info_panel_header_text",
properties = {
text = ""
},
handlers = {
selection_info_set_header_text = function ( f2_arg0, f2_arg1 )
assert( f2_arg1.newText )
f2_arg0:setText( f2_arg1.newText )
end
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = false,
left = 25,
right = 0,
top = -0.5 * CoD.TextSettings.BoldFont.Height,
bottom = 0.5 * CoD.TextSettings.BoldFont.Height,
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b
}
}
}
}
}
end
function selection_info_panel_footer()
return {
type = "UIElement",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = Cac.Layout.SelectionInfo.textTop,
bottom = Cac.Layout.SelectionInfo.textTop + 40
}
},
children = {
{
type = "UIImage",
id = "info_panel_description_new_icon",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
top = 0,
left = -8,
width = 32,
height = 32,
material = RegisterMaterial( "icon_new" ),
red = Colors.yellow.r,
green = Colors.yellow.g,
blue = Colors.yellow.b,
alpha = 0
},
visible = {
alpha = 1
}
},
handlers = {
selection_info_set_footer_text = function ( f4_arg0, f4_arg1 )
if f4_arg1.newIcon then
f4_arg0:animateToState( "visible" )
if f4_arg1.newIconMaterial then
CoD.SetMaterial( f4_arg0, RegisterMaterial( f4_arg1.newIconMaterial ) )
end
else
f4_arg0:animateToState( "default" )
end
end
}
},
{
type = "UIText",
id = "info_panel_footer_text",
properties = {
text = ""
},
handlers = {
selection_info_set_footer_text = function ( f5_arg0, f5_arg1 )
assert( f5_arg1.newText )
f5_arg0:setText( f5_arg1.newText )
end
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 25,
right = 0,
top = 0,
bottom = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.secondary_text_color.r,
green = Colors.secondary_text_color.g,
blue = Colors.secondary_text_color.b
}
}
},
{
type = "UIImage",
id = "warning_exclamation",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
left = 0,
top = 0,
width = 32,
height = 32,
material = RegisterMaterial( "icon_new" ),
alpha = 0
}
},
handlers = {
update_warning_text = function ( f6_arg0, f6_arg1 )
if f6_arg1.conflictFooter then
local f6_local0 = f6_arg0:getParent()
f6_local0 = f6_local0:getChildById( "info_panel_footer_text" )
local f6_local1, f6_local2 = f6_local0:getElementTextDims()
f6_arg0:registerAnimationState( "visible", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
left = -10,
top = f6_local2 + 5,
width = 32,
height = 32,
alpha = 1
} )
f6_arg0:animateToState( "visible" )
else
f6_arg0:animateToState( "default" )
end
end
}
},
{
type = "UIMarqueeText",
id = "warning_text",
properties = {
text = Engine.Localize( "@LUA_MENU_LETHAL_WARNING" )
},
states = {
default = CoD.ColorizeState( Cac.Swatches.warning_text, {
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 32,
right = 0,
top = 10 + CoD.TextSettings.NormalFont.Height * 3,
bottom = 10 + CoD.TextSettings.NormalFont.Height * 4,
alpha = 0
} )
},
properties = {
scrollSpeed = 100
},
handlers = {
update_warning_text = function ( f7_arg0, f7_arg1 )
if f7_arg1.conflictFooter then
f7_arg0:setText( f7_arg1.conflictFooter )
local f7_local0 = f7_arg0:getParent()
f7_local0 = f7_local0:getChildById( "info_panel_footer_text" )
local f7_local1, f7_local2 = f7_local0:getElementTextDims()
f7_arg0:registerAnimationState( "visible", {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 25,
right = 300,
top = 10 + f7_local2,
bottom = 10 + f7_local2 + CoD.TextSettings.NormalFont.Height,
alpha = 1
} )
f7_arg0:animateToState( "visible" )
else
f7_arg0:animateToState( "default" )
end
end
}
}
}
}
end
function UpdateAbilitiesInfoPanel( f8_arg0, f8_arg1 )
f8_arg0:closeChildren()
if f8_arg1.selection_id == "edit_abilities" then
for f8_local6, f8_local7 in ipairs( Cac.GetAbilityTypes() ) do
for f8_local5 = 1, Cac.Abilities.Settings.AbilitiesPerCategory, 1 do
if Cac.IsAbilityPicked( f8_arg1.controller, f8_arg1.squadLocation, f8_arg1.squadMemberIndex, f8_arg1.classLocation, f8_arg1.slot, f8_local7, f8_local5 - 1, "abilitiesPicked" ) then
local f8_local3 = Cac.GetAbilityRef( f8_local7 )
local f8_local4 = Cac.GetAbilitySlotRef( f8_local3, f8_local5 )
f8_arg0:addElement( abilities_info_container( nil, {
categoryColor = Colors.cac_ability[f8_local3],
iconImage = Cac.GetPerkImage( f8_local4 ),
costText = Cac.GetPerkCost( f8_local4 ),
title = Cac.GetPerkName( f8_local4 ),
description = Cac.GetPerkDesc( f8_local4 ),
iconSize = CoD.TextSettings.BoldFont.Height + CoD.TextSettings.NormalFont.Height,
id = "abilities_info_container_" .. f8_local5 .. "_" .. f8_local7,
menu_left = 10,
description_right = 325,
cost_left = 0
} ) )
end
end
end
f8_local0 = Cac.GetNumberAbilitiesPicked( f8_arg1.controller, f8_arg1.squadLocation, f8_arg1.squadMemberIndex, f8_arg1.classLocation, f8_arg1.slot, "abilitiesPicked" )
f8_arg0:registerAnimationState( "compressed", {
spacing = math.min( (550 - f8_local0 * (CoD.TextSettings.BoldFont.Height + CoD.TextSettings.NormalFont.Height)) / f8_local0, 27 )
} )
f8_arg0:animateToState( "compressed" )
elseif f8_arg1.selection_id == "edit_killstreaks" then
local f8_local0 = Cac.GetStreakType( f8_arg1.controller, f8_arg1.squadLocation, f8_arg1.squadMemberIndex, f8_arg1.classLocation, f8_arg1.slot )
if f8_local0 == "specialty_null" then
f8_local0 = "streaktype_assault"
end
f8_local0 = Cac.GetStreakTypeReference( f8_local0 )
local f8_local1 = 0
for f8_local2 = 0, 2, 1 do
local f8_local8 = Cac.GetStreak( f8_arg1.controller, f8_arg1.squadLocation, f8_arg1.squadMemberIndex, f8_arg1.classLocation, f8_arg1.slot, f8_local0, f8_local2 )
local f8_local9 = Cac.GetStreakIcon( f8_local8, f8_arg1.controller )
local f8_local10 = 64
local f8_local11 = 10
local f8_local3 = -25
if f8_local0 == "specialistStreaks" then
local f8_local4 = Cac.GetPerkCost( Cac.StripSuffix( f8_local8, "_ks" ) )
if f8_local4 ~= "" and f8_local4 then
f8_local1 = f8_local1 + f8_local4 + 1
end
else
f8_local1 = Cac.GetStreakCost( f8_local8 )
end
local f8_local4 = abilities_info_container( nil, {
categoryColor = Colors.even_stripe,
iconImage = f8_local9,
costText = f8_local1,
title = Cac.GetStreakName( f8_local8 ),
iconSize = f8_local10,
description = Cac.GetStreakDesc( f8_local8 ),
id = "abilities_info_container_" .. f8_local2,
menu_left = f8_local11,
description_right = 300,
cost_left = f8_local3
} )
if f8_local8 ~= "none" then
f8_arg0:addElement( f8_local4 )
end
end
f8_arg0:animateToState( "strike_spaced" )
end
f8_arg0:animateToState( "visible" )
end
function abilities_info_container( menu, controller )
local self = LUI.UIElement.new()
self.id = controller.id
self.properties = controller
self:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = controller.menu_left + math.abs( controller.cost_left ),
right = 0,
top = 0,
height = CoD.TextSettings.BoldFont.Height + CoD.TextSettings.NormalFont.Height
} )
self:animateToState( "default" )
local f9_local1 = LUI.UIElement.new()
f9_local1.id = "abilities_info_image_container"
f9_local1:registerAnimationState( "default", {
leftAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
width = 60,
top = 0,
bottom = 0
} )
f9_local1:animateToState( "default" )
local f9_local2 = LUI.UIImage.new()
f9_local2.id = "abilities_info_tab_id"
f9_local2:registerAnimationState( "default", CoD.ColorizeState( controller.categoryColor, {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 16,
left = 0,
right = 16,
material = RegisterMaterial( "widg_triangle" )
} ) )
f9_local2:animateToState( "default" )
f9_local1:addElement( f9_local2 )
local f9_local3 = LUI.UIImage.new()
f9_local3.id = "abilities_info_icon_id"
f9_local3:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
right = -3,
width = controller.iconSize,
height = controller.iconSize,
material = RegisterMaterial( controller.iconImage ),
alpha = 1
} )
f9_local3:animateToState( "default" )
f9_local1:addElement( f9_local3 )
local f9_local4 = LUI.UIText.new()
f9_local4.id = "abilities_info_cost_id"
f9_local4:registerAnimationState( "default", CoD.ColorizeState( Colors.secondary_text_color, {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
bottom = 0,
left = controller.cost_left,
right = 0,
height = CoD.TextSettings.SmallFont.Height,
font = CoD.TextSettings.SmallFont.Font,
alignment = LUI.Alignment.Left,
alpha = 1
} ) )
f9_local4:animateToState( "default" )
f9_local4:setText( controller.costText )
f9_local1:addElement( f9_local4 )
self:addElement( f9_local1 )
local f9_local5 = LUI.UIElement.new()
f9_local5.id = "abilities_info_description_container_id"
f9_local5:registerAnimationState( "default", {
leftAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 60,
right = 0,
top = 0,
bottom = 0
} )
f9_local5:animateToState( "default" )
local f9_local6 = LUI.UIText.new()
f9_local6.id = "abilities_info_description_title_id"
f9_local6:setText( controller.title )
f9_local6:registerAnimationState( "default", {
font = CoD.TextSettings.BoldFont.Font,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 5,
right = 350 - controller.menu_left,
top = 0,
height = CoD.TextSettings.BoldFont.Height,
alignment = LUI.Alignment.Left
} )
f9_local6:animateToState( "default" )
f9_local5:addElement( f9_local6 )
local f9_local7 = LUI.UIMarqueeText.new()
LUI.UIMarqueeText.SetSpeed( f9_local7, 100 )
f9_local7.id = "abilities_info_description_text_id"
f9_local7:setText( controller.description )
f9_local7:registerAnimationState( "default", CoD.ColorizeState( Colors.secondary_text_color, {
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 5,
right = controller.description_right,
top = CoD.TextSettings.BoldFont.Height,
bottom = CoD.TextSettings.BoldFont.Height + CoD.TextSettings.NormalFont.Height
} ) )
f9_local7:animateToState( "default" )
f9_local5:addElement( f9_local7 )
self:addElement( f9_local5 )
return self
end
function abilities_info_panel()
return {
type = "UIVerticalList",
id = "abilities_info_panel_id",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 145,
bottom = 400,
alignment = LUI.Alignment.Middle,
spacing = 27
},
strike_spaced = {
spacing = 80
}
},
handlers = {
update_abilities_info_panel = UpdateAbilitiesInfoPanel,
hide_abilities_info_panel = function ( f11_arg0, f11_arg1 )
f11_arg0:closeChildren()
end
}
}
end
function UpdateSelectionInfoPanelMainImage( f12_arg0, f12_arg1 )
assert( f12_arg1.newImage )
f12_arg0:animateToState( "visible", 0 )
f12_arg0.properties.material = f12_arg1.newImage
f12_arg0:setImage( f12_arg1.newImage )
end
f0_local0 = function ()
local f13_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "cac_edit_main" )
local f13_local1 = false
if GetCurrentGameType() == "infect" and Cac.IsDefaultClass( f13_local0.classLocation ) and f13_local0.currTeam == Teams.axis then
f13_local1 = true
end
return f13_local1
end
function UpdateSelectionInfoPanel( f14_arg0, f14_arg1 )
assert( f14_arg1.selection_id )
assert( f14_arg1.classLocation )
assert( f14_arg1.slot )
assert( f14_arg1.controller )
local f14_local0 = f14_arg1.selection_id
local f14_local1 = f14_arg1.squadLocation
local f14_local2 = f14_arg1.squadMemberIndex
local f14_local3 = f14_arg1.classLocation
local f14_local4 = f14_arg1.slot
local f14_local5 = f14_arg1.controller
local f14_local6 = "UnknownSelectionId"
local f14_local7 = ""
local f14_local8 = ""
local f14_local9 = false
local f14_local10 = false
local f14_local11 = false
local f14_local12 = "icon_new"
if f14_local0 == "edit_weapon_primary" or f14_local0 == "edit_weapon_primary_camo" or f14_local0 == "edit_weapon_primary_reticle" then
if f14_arg1.viewingItem then
f14_local7 = f14_arg1.viewingItem
else
f14_local7 = Cac.GetWeapon( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, Cac.Indices.Weapons.Primary )
end
f14_arg0:dispatchEventToRoot( {
name = "update_selection_info_panel_main_image",
newImage = RegisterMaterial( Cac.GetWeaponFullImage( f14_local7 ) ),
immediate = true
} )
if f14_local7 == "iw6_knifeonly" then
f14_local9 = Engine.Localize( "@LUA_MENU_NONE_DESC", "LUA_MENU_PRIMARY" )
end
f14_local6 = Cac.GetWeaponName( f14_local7 )
elseif f14_local0 == "edit_weapon_secondary" then
if f14_arg1.viewingItem then
f14_local7 = f14_arg1.viewingItem
else
f14_local7 = Cac.GetWeapon( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, Cac.Indices.Weapons.Secondary )
end
f14_arg0:dispatchEventToRoot( {
name = "update_selection_info_panel_main_image",
newImage = RegisterMaterial( Cac.GetWeaponFullImage( f14_local7 ) ),
immediate = true
} )
f14_local6 = Cac.GetWeaponName( f14_local7 )
if f14_local0 == "edit_weapon_secondary" and Cac.IsAbilityPickedBySlotName( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, "Elite", "specialty_twoprimaries", "abilitiesPicked" ) and not f14_arg1.viewingItem and Cac.IsWeaponClassSecondary( Cac.GetWeaponClass( Cac.GetWeapon( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, 1 ) ), true ) then
f14_local9 = Engine.Localize( "@LUA_MENU_SELECT_SECOND_PRIMARY" )
f14_local11 = true
f14_local12 = "icon_perks_overkill"
elseif f14_local7 == "none" then
f14_local6 = ""
f14_local9 = Engine.Localize( "@LUA_MENU_NONE_DESC", "LUA_MENU_SECONDARY" )
end
elseif f14_local0 == "edit_weapon_primary_attach1" or f14_local0 == "edit_weapon_primary_attach2" or f14_local0 == "edit_weapon_primary_attach3" or f14_local0 == "edit_weapon_secondary_attach1" or f14_local0 == "edit_weapon_secondary_attach2" then
local f14_local13 = nil
if f14_local0 == "edit_weapon_primary_attach1" then
f14_local13 = Cac.Indices.Attachments.PrimaryAttachment1
elseif f14_local0 == "edit_weapon_primary_attach2" then
f14_local13 = Cac.Indices.Attachments.PrimaryAttachment2
elseif f14_local0 == "edit_weapon_primary_attach3" then
f14_local13 = Cac.Indices.Attachments.PrimaryAttachment3
elseif f14_local0 == "edit_weapon_secondary_attach1" then
f14_local13 = Cac.Indices.Attachments.SecondaryAttachment1
elseif f14_local0 == "edit_weapon_secondary_attach2" then
f14_local13 = Cac.Indices.Attachments.SecondaryAttachment2
else
assert( false, "How the hell did I get here?!" )
end
local f14_local14 = f14_arg1.weaponIndex or 0
local f14_local15 = Cac.GetWeapon( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, f14_local14 )
local f14_local16 = Cac.GetWeaponClass( f14_local15 )
local f14_local17 = Cac.GetAttachment( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, f14_local14, f14_local13 )
local f14_local18 = RegisterMaterial( Cac.GetAttachmentImageFull( f14_local17, f14_local15 ) )
f14_local7 = f14_local17
f14_local6 = Cac.GetAttachmentName( f14_local17, f14_local15 )
f14_local9 = Cac.GetAttachmentDesc( f14_local17, f14_local15 )
if f14_local17 == "none" then
f14_local6 = ""
f14_local9 = ""
end
f14_arg0:dispatchEventToRoot( {
name = "update_selection_info_panel_main_image",
newImage = f14_local18,
immediate = true
} )
if f14_local0 == "edit_weapon_primary_attach3" or f14_local0 == "edit_weapon_secondary_attach2" then
local f14_local19 = Cac.IsAbilityPickedBySlotName( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, "Equipment", "specialty_extra_attachment", "abilitiesPicked" )
if f14_local19 and Cac.GetAttachment( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, 0, 2 ) == "none" and f14_local0 == "edit_weapon_primary_attach3" then
if f14_local15 == "iw6_knifeonly" or f14_local15 == "iw6_riotshield" then
f14_local9 = Engine.Localize( "PATCH_MENU_THIRD_ATTACHMENT_LOCKED" )
else
f14_local9 = Engine.Localize( "LUA_MENU_SELECT_THIRD_ATTACHMENT" )
end
f14_local11 = true
f14_local12 = "icon_perks_extra_attach"
elseif f14_local19 and Cac.GetAttachment( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, 1, 1 ) == "none" and f14_local0 == "edit_weapon_secondary_attach2" then
if f14_local15 == "iw6_riotshield" or f14_local15 == "none" or f14_local16 == "weapon_projectile" then
f14_local9 = Engine.Localize( "PATCH_MENU_SECOND_ATTACHMENT_LOCKED" )
else
f14_local9 = Engine.Localize( "LUA_MENU_SELECT_SECOND_ATTACHMENT" )
end
f14_local11 = true
f14_local12 = "icon_perks_extra_attach"
elseif not f14_local19 then
f14_local9 = Engine.Localize( "LUA_MENU_EQUIP_EXTRA_ATTACH" )
end
end
elseif f14_local0 == "edit_lethal" then
if f14_arg1.viewingItem then
f14_local7 = f14_arg1.viewingItem
f14_local8 = Cac.StripSuffix( f14_local7, "_mp" )
else
f14_local7 = Cac.GetPrimaryGrenade( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4 )
f14_local8 = Cac.StripSuffix( f14_local7, "_mp" )
end
local f14_local13 = nil
for f14_local17, f14_local18 in pairs( Cac.Indices.Weapons ) do
local f14_local19
if f14_local18 == Cac.Indices.Weapons.Primary then
f14_local19 = 2
if not f14_local19 then
else
local f14_local20 = false
for f14_local21 = 0, f14_local19, 1 do
local f14_local24 = Cac.GetAttachment( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, f14_local18, f14_local21 )
if f14_local24 == "shotgun" or f14_local24 == "gl" then
if f14_local7 == "specialty_null" and not f14_arg1.viewingItem then
else
f14_local10 = Engine.Localize( "@LUA_MENU_LETHAL_WARNING" )
end
local f14_local25 = Cac.GetWeapon( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, f14_local18 )
f14_local6 = Cac.GetAttachmentName( f14_local24, f14_local25 )
f14_local9 = Cac.GetAttachmentDesc( f14_local24, f14_local25 )
f14_local10 = Engine.Localize( "@LUA_MENU_LETHAL_REPLACED_WARNING" )
f14_local13 = RegisterMaterial( Cac.GetAttachmentImageFull( f14_local24, f14_local25 ) )
end
end
if f14_local20 then
end
end
end
f14_local19 = 1
end
if not f14_local13 then
f14_local13 = RegisterMaterial( Cac.GetWeaponFullImage( f14_local8 ) )
f14_local6 = Cac.GetWeaponName( f14_local8 )
if f14_local7 == "specialty_null" then
f14_local6 = ""
f14_local9 = Engine.Localize( "@LUA_MENU_NONE_DESC", "MENU_EQUIPMENT" )
end
end
if Cac.IsAbilityPickedBySlotName( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, "Equipment", "specialty_extra_deadly", "abilitiesPicked" ) and f14_local7 == "specialty_null" then
f14_local9 = Engine.Localize( "@LUA_MENU_SELECT_LETHAL" )
f14_local11 = true
f14_local12 = "icon_perks_extra_lethal"
end
f14_arg0:dispatchEventToRoot( {
name = "update_selection_info_panel_main_image",
newImage = f14_local13,
immediate = true
} )
elseif f14_local0 == "edit_tactical" then
if f14_arg1.viewingItem then
f14_local7 = f14_arg1.viewingItem
f14_local8 = Cac.StripSuffix( f14_local7, "_mp" )
else
f14_local7 = Cac.GetSecondaryGrenade( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4 )
f14_local8 = Cac.StripSuffix( f14_local7, "_mp" )
end
f14_local6 = Cac.GetWeaponName( f14_local8 )
if Cac.IsAbilityPickedBySlotName( f14_local5, f14_local1, f14_local2, f14_local3, f14_local4, "Equipment", "specialty_extra_equipment", "abilitiesPicked" ) and f14_local7 == "specialty_null" then
f14_local6 = ""
if f0_local0() then
f14_local9 = Engine.Localize( "@LUA_MENU_MP_INFECTED_SELECT_TACTICAL" )
else
f14_local9 = Engine.Localize( "@LUA_MENU_SELECT_TACTICAL" )
end
f14_local11 = true
f14_local12 = "icon_perks_extra_tactical"
elseif f14_local7 == "specialty_null" then
f14_local6 = ""
if f0_local0() then
f14_local9 = Engine.Localize( "@LUA_MENU_MP_INFECTED_TACTICAL" )
f14_local11 = true
f14_local12 = "icon_perks_extra_tactical"
else
f14_local9 = Engine.Localize( "@LUA_MENU_NONE_DESC", "MENU_TACTICAL" )
end
end
f14_arg0:dispatchEventToRoot( {
name = "update_selection_info_panel_main_image",
newImage = RegisterMaterial( Cac.GetWeaponFullImage( f14_local8 ) ),
immediate = true
} )
elseif f14_local0 == "edit_killstreaks" or f14_local0 == "edit_abilities" then
f14_arg0:processEvent( {
name = "update_abilities_info_panel",
controller = f14_local5,
squadLocation = f14_local1,
squadMemberIndex = f14_local2,
classLocation = f14_local3,
slot = f14_local4,
selection_id = f14_local0
} )
f14_arg0:processEvent( {
name = "hide_main_info_panel"
} )
else
assert( false, "Unknown selection_id in UpdateSelectionInfoPanel" )
end
if f14_local0 ~= "edit_killstreaks" and f14_local0 ~= "edit_abilities" then
f14_arg0:processEvent( {
name = "hide_abilities_info_panel"
} )
f14_arg0:processEvent( {
name = "show_main_info_panel"
} )
end
if f14_local0 == "edit_lethal" or f14_local0 == "edit_tactical" or not IsOnlineMatch() or Engine.GetDvarBool( "xblive_privatematch" ) then
f14_arg0:dispatchEventToRoot( {
name = "hide_lt",
immediate = true
} )
f14_arg0:dispatchEventToRoot( {
name = "hide_rt",
immediate = true
} )
else
f14_arg0:dispatchEventToRoot( {
name = "show_lt"
} )
f14_arg0:dispatchEventToRoot( {
name = "show_rt"
} )
end
local f14_local13 = f14_arg0:getFirstDescendentById( "focus_dialog_header_id" )
if f14_local13 then
f14_local13:processEvent( {
name = "selection_info_set_header_text",
newText = f14_local6,
immediate = true,
dispatchChildren = true
} )
end
local f14_local14 = f14_arg0:getFirstDescendentById( "focus_dialog_footer_id" )
if f14_local14 and f14_local7 ~= "" then
local f14_local15 = ""
if f14_local9 then
f14_local15 = f14_local9
else
local f14_local16 = f14_local7
if f14_local0 == "edit_tactical" or f14_local0 == "edit_lethal" then
f14_local16 = Cac.StripSuffix( f14_local7, "_mp" )
end
f14_local15 = Cac.GetWeaponDesc( f14_local16 )
end
f14_local14:processEvent( {
name = "selection_info_set_footer_text",
newText = f14_local15,
immediate = true,
dispatchChildren = true,
newIcon = f14_local11,
newIconMaterial = f14_local12
} )
f14_local14:processEvent( {
name = "update_warning_text",
attachment = attachFooter,
conflictFooter = f14_local10
} )
end
end
function selection_info_panel_main()
return {
type = "UIElement",
id = "selection_info_panel_container_id",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = Cac.Layout.SelectionInfo.height
}
},
handlers = {
menu_create = CreateSelectionInfoPanel,
update_selection_info = UpdateSelectionInfoPanel
},
children = {
{
type = "abilities_info_panel",
id = "abilities_info_panel_id"
},
{
type = "UIElement",
id = "selection_main_info_panel_container",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
show_main_info_panel = MBh.AnimateToState( "default" ),
hide_main_info_panel = MBh.AnimateToState( "hidden" )
},
children = {
{
type = "selection_info_panel_header",
id = "focus_dialog_header_id"
},
{
type = "UIImage",
id = "selection_info_panel_main_image_id",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 85,
height = 155,
alpha = 0
},
visible = {
alpha = 1
}
},
handlers = {
update_selection_info_panel_main_image = UpdateSelectionInfoPanelMainImage
}
},
{
type = "selection_info_panel_footer",
id = "focus_dialog_footer_id"
}
}
}
}
}
end
LUI.MenuBuilder.registerDef( "selection_info_panel_header", selection_info_panel_header )
LUI.MenuBuilder.registerDef( "selection_info_panel_footer", selection_info_panel_footer )
LUI.MenuBuilder.registerDef( "selection_info_panel_main", selection_info_panel_main )
LUI.MenuBuilder.registerDef( "abilities_info_panel", abilities_info_panel )
LUI.MenuBuilder.registerDef( "abilities_info_container", abilities_info_container )
LockTable( _M )

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,468 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function CacWeaponPerformance( f1_arg0, f1_arg1 )
local f1_local0 = f1_arg0.properties
if f1_arg1 ~= "specialty_null" then
if f1_arg1 == "uav" then
f1_arg1 = "iw6_knifeonly" or f1_arg1
end
if f1_arg1 == "laser_designator" then
f1_arg1 = "iw6_pdw" or f1_arg1
end
local f1_local1 = f1_local0.CacWeaponPerformanceFunc( f1_local0.exclusiveController, Cac.StripSuffix( f1_arg1, "_mp" ) )
if f1_local0.isDecimal then
if f1_local0.isPercent then
f1_arg0:setText( string.format( "%3.2f", f1_local1 ) .. "%" )
else
f1_arg0:setText( string.format( "%3.2f", f1_local1 ) )
end
else
f1_arg0:setText( string.format( "%d", f1_local1 ) )
end
end
end
function CacViewingWeaponPerformance( f2_arg0, f2_arg1 )
if f2_arg1.viewingWeapon then
CacWeaponPerformance( f2_arg0, f2_arg1.viewingWeapon )
end
end
function CacEquippedWeaponPerformance( f3_arg0, f3_arg1 )
local f3_local0 = nil
if f3_arg1.selection_id == "edit_lethal" or f3_arg1.selection_id == "edit_tactical" then
f3_local0 = Cac.GetPerk( f3_arg1.controller, f3_arg1.squadLocation, f3_arg1.squadMemberIndex, f3_arg1.classLocation, f3_arg1.slot, f3_arg1.weaponIndex )
else
f3_local0 = Cac.GetWeapon( f3_arg1.controller, f3_arg1.squadLocation, f3_arg1.squadMemberIndex, f3_arg1.classLocation, f3_arg1.slot, f3_arg1.weaponIndex )
end
if f3_local0 then
CacWeaponPerformance( f3_arg0, f3_local0 )
end
end
function CacPerformanceStatCompare( f4_arg0, f4_arg1 )
local f4_local0 = nil
if f4_arg1.selection_id == "edit_lethal" or f4_arg1.selection_id == "edit_tactical" then
f4_local0 = Cac.GetPerk( f4_arg1.controller, f4_arg1.squadLocation, f4_arg1.squadMemberIndex, f4_arg1.classLocation, f4_arg1.slot, f4_arg1.weaponIndex )
else
f4_local0 = Cac.GetWeapon( f4_arg1.controller, f4_arg1.squadLocation, f4_arg1.squadMemberIndex, f4_arg1.classLocation, f4_arg1.slot, f4_arg1.weaponIndex )
end
if f4_arg1.viewingWeapon and f4_arg1.viewingWeapon ~= f4_local0 and f4_arg1.viewingWeapon ~= "specialty_null" then
f4_arg0:animateToState( "statcompare", 0 )
else
f4_arg0:animateToState( "statview", 0 )
end
end
function cac_weapon_info_pane_performance_stat()
return {
type = "UIElement",
properties = {
statTitle = "Empty",
isPercent = false,
isDecimal = false,
shadeAlpha = 1,
CacWeaponPerformanceFunc = MBh.Property( "CacWeaponPerformanceFunc" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = 25,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
refresh_info_pane = function ( f6_arg0, f6_arg1 )
f6_arg0:dispatchEventToChildren( f6_arg1 )
local f6_local0 = false
local f6_local1 = f6_arg0.properties.CacWeaponPerformanceFunc
local f6_local2 = nil
if f6_arg1.selection_id == "edit_weapon_primary" or f6_arg1.selection_id == "edit_weapon_secondary" then
local f6_local3 = f6_arg1.viewingWeapon
if not f6_local3 then
f6_local3 = Cac.GetWeapon( f6_arg1.controller, f6_arg1.squadLocation, f6_arg1.squadMemberIndex, f6_arg1.classLocation, f6_arg1.slot, f6_arg1.weaponIndex )
end
f6_local2 = Cac.GetWeaponClass( f6_local3 )
for f6_local7, f6_local8 in pairs( Cac.Weapons.weapon_riot ) do
if not f6_local0 then
f6_local0 = f6_local3 == f6_local8
end
end
end
if not (not f6_local0 or f6_local1 ~= Cac.GetPerformanceHeadshots and f6_local1 ~= Cac.GetPerformanceAccuracy) or f6_local2 == "weapon_projectile" and f6_local1 == Cac.GetPerformanceHeadshots then
f6_arg0:animateToState( "hidden" )
else
f6_arg0:animateToState( "default" )
end
end
},
children = {
{
type = "UIImage",
id = "performance_stat_outline",
states = {
default = CoD.ColorizeState( Colors.white, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
material = RegisterMaterial( "white" ),
alpha = MBh.Property( "shadeAlpha" )
} )
}
},
{
type = "UIText",
properties = {
text = MBh.Property( "statTitle" )
},
states = {
default = {
alignment = LUI.Alignment.Left,
leftAnchor = true,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = 10,
right = 180,
top = -0.5 * CoD.TextSettings.NormalFont.Height,
bottom = 0.5 * CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
red = Colors.window_title_text_color.r,
green = Colors.window_title_text_color.g,
blue = Colors.window_title_text_color.b
}
}
},
{
type = "UIText",
properties = {
text = "100.00",
isDecimal = MBh.Property( "isDecimal" ),
CacWeaponPerformanceFunc = MBh.Property( "CacWeaponPerformanceFunc" ),
isPercent = MBh.Property( "isPercent" )
},
states = {
default = CoD.ColorizeState( Colors.cac_performance_header, {
alignment = LUI.Alignment.Right,
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = false,
left = 200,
right = -110,
top = -0.5 * CoD.TextSettings.NormalFont.Height,
bottom = 0.5 * CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alpha = 0
} ),
statcompare = {
alpha = 1
},
statview = {
alpha = 0
}
},
handlers = {
refresh_info_pane = MBh.DoMultiple( {
CacPerformanceStatCompare,
CacViewingWeaponPerformance
} )
}
},
{
type = "UIText",
properties = {
text = "0",
isDecimal = MBh.Property( "isDecimal" ),
CacWeaponPerformanceFunc = MBh.Property( "CacWeaponPerformanceFunc" ),
isPercent = MBh.Property( "isPercent" )
},
states = {
default = CoD.ColorizeState( Colors.cac_performance_header, {
alignment = LUI.Alignment.Right,
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = false,
left = 299,
right = -10,
top = -0.5 * CoD.TextSettings.NormalFont.Height,
bottom = 0.5 * CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alpha = 0.5
} )
},
handlers = {
refresh_info_pane = CacEquippedWeaponPerformance
}
}
}
}
end
function weapon_performance_stats()
return {
type = "UIVerticalList",
id = "cac_weapon_info_pane_performance_stats",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 20,
bottom = 0
}
},
children = {
{
type = "cac_weapon_info_pane_performance_stat",
id = "weapon_stats_info_1",
properties = {
shadeAlpha = 0.1,
statTitle = Cac.WeaponPerformanceTypes.KDR.Title,
CacWeaponPerformanceFunc = Cac.GetPerformanceKDR,
isDecimal = true
}
},
{
type = "cac_weapon_info_pane_performance_stat",
id = "weapon_stats_info_2",
properties = {
shadeAlpha = 0,
statTitle = Cac.WeaponPerformanceTypes.Kills.Title,
CacWeaponPerformanceFunc = Cac.GetPerformanceKills
}
},
{
type = "cac_weapon_info_pane_performance_stat",
id = "weapon_stats_info_3",
properties = {
shadeAlpha = 0.1,
statTitle = Cac.WeaponPerformanceTypes.Deaths.Title,
CacWeaponPerformanceFunc = Cac.GetPerformanceDeaths
}
},
{
type = "cac_weapon_info_pane_performance_stat",
id = "weapon_stats_info_4",
properties = {
shadeAlpha = 0,
statTitle = Cac.WeaponPerformanceTypes.Accuracy.Title,
isPercent = true,
isDecimal = true,
CacWeaponPerformanceFunc = Cac.GetPerformanceAccuracy
}
},
{
type = "cac_weapon_info_pane_performance_stat",
id = "weapon_stats_info_5",
properties = {
shadeAlpha = 0.1,
statTitle = Cac.WeaponPerformanceTypes.Headshots.Title,
CacWeaponPerformanceFunc = Cac.GetPerformanceHeadshots
}
}
}
}
end
function lethal_performance_stats()
return {
type = "UIVerticalList",
id = "cac_lethal_info_pane_performance_stats",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 20,
bottom = 0
}
},
children = {
{
type = "cac_weapon_info_pane_performance_stat",
id = "lethal_stats_info_1",
properties = {
shadeAlpha = 0.1,
statTitle = Cac.WeaponPerformanceTypes.Usage.Title,
CacWeaponPerformanceFunc = Cac.GetPerformanceShots
}
},
{
type = "cac_weapon_info_pane_performance_stat",
id = "lethal_stats_info_2",
properties = {
shadeAlpha = 0,
statTitle = Cac.WeaponPerformanceTypes.Kills.Title,
CacWeaponPerformanceFunc = Cac.GetPerformanceKills
}
},
{
type = "cac_weapon_info_pane_performance_stat",
id = "lethal_stats_info_3",
properties = {
shadeAlpha = 0.1,
statTitle = Cac.WeaponPerformanceTypes.Hits.Title,
CacWeaponPerformanceFunc = Cac.GetPerformanceHits
}
}
}
}
end
function tactical_performance_stats()
return {
type = "UIVerticalList",
id = "cac_tactical_info_pane_performance_stats",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 20,
bottom = 0
}
},
children = {
{
type = "cac_weapon_info_pane_performance_stat",
id = "tactical_stats_info_1",
properties = {
shadeAlpha = 0,
statTitle = Cac.WeaponPerformanceTypes.Usage.Title,
CacWeaponPerformanceFunc = Cac.GetPerformanceShots
}
},
{
type = "cac_weapon_info_pane_performance_stat",
id = "tactical_stats_info_2",
properties = {
shadeAlpha = 0.1,
statTitle = Cac.WeaponPerformanceTypes.Hits.Title,
CacWeaponPerformanceFunc = Cac.GetPerformanceHits
}
}
}
}
end
function cac_weapon_info_pane_performance_page( f10_arg0 )
return function ()
return {
type = "cac_basic_info_pane_page",
id = "cac_basic_info_pane_page_" .. f10_arg0,
children = {
{
type = "UIImage",
id = "text_header_shade_id",
states = {
default = CoD.ColorizeState( Colors.black, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = 20,
material = RegisterMaterial( "white" ),
alpha = 0.2
} )
}
},
{
type = "UIText",
properties = {
text = Engine.Localize( "@LUA_MENU_VIEWING_CAPS" )
},
states = {
default = CoD.ColorizeState( Colors.cac_sub_popup_text, {
alignment = LUI.Alignment.Right,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = -110,
top = 0,
bottom = CoD.TextSettings.SmallFont.Height,
font = CoD.TextSettings.SmallFont.Font,
alpha = 0
} ),
statcompare = {
alpha = 1
},
statview = {
alpha = 0
}
},
handlers = {
refresh_info_pane = CacPerformanceStatCompare
}
},
{
type = "UIText",
properties = {
text = Engine.Localize( "@LUA_MENU_EQUIPPED_CAPS" )
},
states = {
default = CoD.ColorizeState( Colors.cac_sub_popup_text, {
alignment = LUI.Alignment.Right,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = -10,
top = 0,
bottom = CoD.TextSettings.SmallFont.Height,
font = CoD.TextSettings.SmallFont.Font,
alpha = 1
} )
}
},
{
type = f10_arg0
}
}
}
end
end
LUI.MenuBuilder.registerDef( "cac_weapon_info_pane_performance_page", cac_weapon_info_pane_performance_page )
LUI.MenuBuilder.registerDef( "cac_weapon_info_pane_performance_stat", cac_weapon_info_pane_performance_stat )
LUI.MenuBuilder.registerDef( "weapon_performance_stats", weapon_performance_stats )
LUI.MenuBuilder.registerDef( "lethal_performance_stats", lethal_performance_stats )
LUI.MenuBuilder.registerDef( "tactical_performance_stats", tactical_performance_stats )
LUI.MenuBuilder.registerDef( "cac_weapon_info_pane_performance_page_weapon", cac_weapon_info_pane_performance_page( "weapon_performance_stats" ) )
LUI.MenuBuilder.registerDef( "cac_weapon_info_pane_performance_page_lethal", cac_weapon_info_pane_performance_page( "lethal_performance_stats" ) )
LUI.MenuBuilder.registerDef( "cac_weapon_info_pane_performance_page_tactical", cac_weapon_info_pane_performance_page( "tactical_performance_stats" ) )
LockTable( _M )

View File

@@ -0,0 +1,602 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function CacEditWeaponStatsInfoMeter( f1_arg0, f1_arg1, f1_arg2 )
local f1_local0 = Cac.Layout.CacWeaponMeter.offset_max * f1_arg1 / 100
if f1_arg2 < 0 then
f1_local0 = LUI.clamp( f1_local0 + Cac.Layout.CacWeaponMeter.offset_max * f1_arg2 / 100, 0, Cac.Layout.CacWeaponMeter.offset_max )
end
f1_arg0:registerAnimationState( "meter", {
right = f1_local0
} )
f1_arg0:animateToState( "meter", 100 )
end
function CacEditWeaponStatsInfoViewingMeter( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg0.properties
local f2_local1 = nil
if f2_arg1.viewingWeapon then
f2_local1 = f2_arg1.viewingWeapon
else
f2_local1 = Cac.GetWeapon( f2_arg1.controller, f2_arg1.squadLocation, f2_arg1.squadMemberIndex, f2_arg1.classLocation, f2_arg1.slot, f2_arg1.weaponIndex )
end
local f2_local2 = 0
if f2_local1 then
f2_local2 = f2_local0.CacWeaponStatFunc( f2_local1 )
if f2_local2 == nil or f2_local2 == "" then
f2_local2 = 0
end
end
local f2_local3 = 0
if not f2_arg1.viewingWeapon then
local f2_local4 = nil
if f2_arg1.viewingAttach0 then
f2_local4 = f2_arg1.viewingAttach0
else
f2_local4 = Cac.GetAttachment( f2_arg1.controller, f2_arg1.squadLocation, f2_arg1.squadMemberIndex, f2_arg1.classLocation, f2_arg1.slot, f2_arg1.weaponIndex, 0 )
end
local f2_local5 = nil
if f2_arg1.viewingAttach1 then
f2_local5 = f2_arg1.viewingAttach1
else
f2_local5 = Cac.GetAttachment( f2_arg1.controller, f2_arg1.squadLocation, f2_arg1.squadMemberIndex, f2_arg1.classLocation, f2_arg1.slot, f2_arg1.weaponIndex, 1 )
end
local f2_local6 = nil
if f2_arg1.viewingAttach2 then
f2_local6 = f2_arg1.viewingAttach2
else
f2_local6 = Cac.GetAttachment( f2_arg1.controller, f2_arg1.squadLocation, f2_arg1.squadMemberIndex, f2_arg1.classLocation, f2_arg1.slot, f2_arg1.weaponIndex, 2 )
end
if f2_local4 and f2_local4 ~= "none" then
f2_local3 = f2_local3 + f2_local0.CacWeaponAttachStatFunc( f2_local4, f2_local1 )
end
if f2_local5 and f2_local5 ~= "none" then
f2_local3 = f2_local3 + f2_local0.CacWeaponAttachStatFunc( f2_local5, f2_local1 )
end
if f2_local6 and f2_local6 ~= "none" then
f2_local3 = f2_local3 + f2_local0.CacWeaponAttachStatFunc( f2_local6, f2_local1 )
end
end
CacEditWeaponStatsInfoMeter( f2_arg0, f2_local2, f2_local3 )
end
function CacEditWeaponStatsInfoEquippedMeter( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg0.properties
local f3_local1 = Cac.GetWeapon( f3_arg1.controller, f3_arg1.squadLocation, f3_arg1.squadMemberIndex, f3_arg1.classLocation, f3_arg1.slot, f3_arg1.weaponIndex )
if f3_local1 then
local f3_local2 = f3_local0.CacWeaponStatFunc( f3_local1 )
if f3_local2 == nil or f3_local2 == "" then
f3_local2 = 0
end
local f3_local3 = Cac.GetAttachment( f3_arg1.controller, f3_arg1.squadLocation, f3_arg1.squadMemberIndex, f3_arg1.classLocation, f3_arg1.slot, f3_arg1.weaponIndex, 0 )
local f3_local4 = Cac.GetAttachment( f3_arg1.controller, f3_arg1.squadLocation, f3_arg1.squadMemberIndex, f3_arg1.classLocation, f3_arg1.slot, f3_arg1.weaponIndex, 1 )
local f3_local5 = Cac.GetAttachment( f3_arg1.controller, f3_arg1.squadLocation, f3_arg1.squadMemberIndex, f3_arg1.classLocation, f3_arg1.slot, f3_arg1.weaponIndex, 2 )
local f3_local6 = 0
if f3_local3 and f3_local3 ~= "none" then
f3_local6 = f3_local6 + f3_local0.CacWeaponAttachStatFunc( f3_local3, f3_local1 )
end
if f3_local4 and f3_local4 ~= "none" then
f3_local6 = f3_local6 + f3_local0.CacWeaponAttachStatFunc( f3_local4, f3_local1 )
end
if f3_local5 and f3_local5 ~= "none" then
f3_local6 = f3_local6 + f3_local0.CacWeaponAttachStatFunc( f3_local5, f3_local1 )
end
CacEditWeaponStatsInfoMeter( f3_arg0, f3_local2, f3_local6 )
end
end
function CacEditWeaponStatsInfoAttachmentMeter( f4_arg0, f4_arg1, f4_arg2, f4_arg3, f4_arg4 )
local f4_local0 = Colors.cac_weapon_meter_main.r
local f4_local1 = Colors.cac_weapon_meter_main.g
local f4_local2 = Colors.cac_weapon_meter_main.b
local f4_local3 = 1
local f4_local4 = LUI.clamp( Cac.Layout.CacWeaponMeter.offset_max * f4_arg1 / 100, 0, Cac.Layout.CacWeaponMeter.offset_max )
if f4_arg2 < 0 then
if f4_arg4 then
f4_local0 = Colors.cac_weapon_meter_worse_dark.r
f4_local1 = Colors.cac_weapon_meter_worse_dark.g
f4_local2 = Colors.cac_weapon_meter_worse_dark.b
else
f4_local0 = Colors.cac_weapon_meter_worse.r
f4_local1 = Colors.cac_weapon_meter_worse.g
f4_local2 = Colors.cac_weapon_meter_worse.b
end
f4_local3 = 1
elseif f4_arg2 > 0 then
if f4_arg4 then
f4_local0 = Colors.cac_weapon_meter_better_dark.r
f4_local1 = Colors.cac_weapon_meter_better_dark.g
f4_local2 = Colors.cac_weapon_meter_better_dark.b
else
f4_local0 = Colors.cac_weapon_meter_better.r
f4_local1 = Colors.cac_weapon_meter_better.g
f4_local2 = Colors.cac_weapon_meter_better.b
end
f4_local3 = 1
f4_local4 = LUI.clamp( f4_local4 + Cac.Layout.CacWeaponMeter.offset_max * f4_arg2 / 100, 0, Cac.Layout.CacWeaponMeter.offset_max )
else
f4_local3 = 0
end
f4_arg0:registerAnimationState( "meter", {
right = f4_local4,
red = f4_local0,
green = f4_local1,
blue = f4_local2,
alpha = f4_local3
} )
f4_arg0:animateToState( "meter", 100 )
local f4_local5 = f4_arg0:getChildById( "generic_border_id" )
if f4_local5 then
f4_local5:registerAnimationState( "meter", {
alpha = 1
} )
end
end
function CacEditWeaponStatsInfoViewingAttachmentMeter( f5_arg0, f5_arg1 )
local f5_local0 = f5_arg0.properties
local f5_local1, f5_local2 = nil
if f5_arg1.viewingWeapon then
f5_local1 = f5_arg1.viewingWeapon
f5_local2 = Cac.GetWeapon( f5_arg1.controller, f5_arg1.squadLocation, f5_arg1.squadMemberIndex, f5_arg1.classLocation, f5_arg1.slot, f5_arg1.weaponIndex )
else
f5_local1 = Cac.GetWeapon( f5_arg1.controller, f5_arg1.squadLocation, f5_arg1.squadMemberIndex, f5_arg1.classLocation, f5_arg1.slot, f5_arg1.weaponIndex )
end
local f5_local3 = 0
if f5_local1 then
f5_local3 = f5_local0.CacWeaponStatFunc( f5_local1 )
if f5_local3 == nil or f5_local3 == "" then
f5_local3 = 0
end
end
local f5_local4 = nil
if f5_local2 then
f5_local4 = f5_local0.CacWeaponStatFunc( f5_local2 )
if f5_local4 == nil or f5_local4 == "" then
f5_local4 = 0
end
end
local f5_local5 = nil
if f5_arg1.viewingAttach0 then
f5_local5 = f5_arg1.viewingAttach0
else
f5_local5 = Cac.GetAttachment( f5_arg1.controller, f5_arg1.squadLocation, f5_arg1.squadMemberIndex, f5_arg1.classLocation, f5_arg1.slot, f5_arg1.weaponIndex, 0 )
end
local f5_local6 = nil
if f5_arg1.viewingAttach1 then
f5_local6 = f5_arg1.viewingAttach1
else
f5_local6 = Cac.GetAttachment( f5_arg1.controller, f5_arg1.squadLocation, f5_arg1.squadMemberIndex, f5_arg1.classLocation, f5_arg1.slot, f5_arg1.weaponIndex, 1 )
end
local f5_local7 = nil
if f5_arg1.viewingAttach2 then
f5_local7 = f5_arg1.viewingAttach2
else
f5_local7 = Cac.GetAttachment( f5_arg1.controller, f5_arg1.squadLocation, f5_arg1.squadMemberIndex, f5_arg1.classLocation, f5_arg1.slot, f5_arg1.weaponIndex, 2 )
end
local f5_local8 = 0
if f5_local5 and f5_local5 ~= "none" then
f5_local8 = f5_local8 + f5_local0.CacWeaponAttachStatFunc( f5_local5, f5_local1 )
end
if f5_local6 and f5_local6 ~= "none" then
f5_local8 = f5_local8 + f5_local0.CacWeaponAttachStatFunc( f5_local6, f5_local1 )
end
if f5_local7 and f5_local7 ~= "none" then
f5_local8 = f5_local8 + f5_local0.CacWeaponAttachStatFunc( f5_local7, f5_local1 )
end
CacEditWeaponStatsInfoAttachmentMeter( f5_arg0, f5_local3, f5_local8, f5_local4 )
end
function CacEditWeaponStatsInfoEquippedAttachmentMeter( f6_arg0, f6_arg1 )
local f6_local0 = f6_arg0.properties
local f6_local1 = Cac.GetWeapon( f6_arg1.controller, f6_arg1.squadLocation, f6_arg1.squadMemberIndex, f6_arg1.classLocation, f6_arg1.slot, f6_arg1.weaponIndex )
if f6_local1 then
local f6_local2 = f6_local0.CacWeaponStatFunc( f6_local1 )
if f6_local2 == nil or f6_local2 == "" then
f6_local2 = 0
end
local f6_local3 = Cac.GetAttachment( f6_arg1.controller, f6_arg1.squadLocation, f6_arg1.squadMemberIndex, f6_arg1.classLocation, f6_arg1.slot, f6_arg1.weaponIndex, 0 )
local f6_local4 = Cac.GetAttachment( f6_arg1.controller, f6_arg1.squadLocation, f6_arg1.squadMemberIndex, f6_arg1.classLocation, f6_arg1.slot, f6_arg1.weaponIndex, 1 )
local f6_local5 = Cac.GetAttachment( f6_arg1.controller, f6_arg1.squadLocation, f6_arg1.squadMemberIndex, f6_arg1.classLocation, f6_arg1.slot, f6_arg1.weaponIndex, 2 )
local f6_local6 = 0
if f6_local3 and f6_local3 ~= "none" then
f6_local6 = f6_local6 + f6_local0.CacWeaponAttachStatFunc( f6_local3, f6_local1 )
end
if f6_local4 and f6_local4 ~= "none" then
f6_local6 = f6_local6 + f6_local0.CacWeaponAttachStatFunc( f6_local4, f6_local1 )
end
if f6_local5 and f6_local5 ~= "none" then
f6_local6 = f6_local6 + f6_local0.CacWeaponAttachStatFunc( f6_local5, f6_local1 )
end
CacEditWeaponStatsInfoAttachmentMeter( f6_arg0, f6_local2, f6_local6, nil, true )
end
end
function CacWeaponStatCompare( f7_arg0, f7_arg1 )
if f7_arg1.viewingWeapon then
f7_arg0:animateToState( "statcompare", 0 )
else
f7_arg0:animateToState( "statview", 0 )
end
end
function cac_weapon_info_pane_stat()
return {
type = "UIElement",
properties = {
statTitle = "Title",
CacWeaponStatFunc = MBh.Property( "CacWeaponStatFunc" ),
CacWeaponAttachStatFunc = MBh.Property( "CacWeaponAttachStatFunc" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 50,
right = 0,
top = 0,
bottom = 30
}
},
children = {
{
type = "UIVerticalList",
properties = {
statTitle = MBh.Property( "statTitle" ),
CacWeaponStatFunc = MBh.Property( "CacWeaponStatFunc" ),
CacWeaponAttachStatFunc = MBh.Property( "CacWeaponAttachStatFunc" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 4,
right = 0,
top = 2,
bottom = 0,
spacing = 1
},
statcompare = {
spacing = 1
},
statview = {
spacing = 9
}
},
handlers = {
refresh_info_pane = CacWeaponStatCompare
},
children = {
{
type = "UIHorizontalList",
id = "viewing_meter",
properties = {
CacWeaponStatFunc = MBh.Property( "CacWeaponStatFunc" ),
CacWeaponAttachStatFunc = MBh.Property( "CacWeaponAttachStatFunc" ),
statTitle = MBh.Property( "statTitle" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = 14,
spacing = 12
}
},
children = {
{
type = "UIText",
properties = {
text = MBh.Property( "statTitle" ),
statTitle = MBh.Property( "statTitle" )
},
states = {
default = {
alignment = LUI.Alignment.Right,
leftAnchor = true,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = 0,
right = 97,
top = -0.5 * CoD.TextSettings.SmallFont.Height + 4,
bottom = 0.5 * CoD.TextSettings.SmallFont.Height + 4,
font = CoD.TextSettings.SmallFont.Font,
red = Colors.cac_sub_popup_text.r,
green = Colors.cac_sub_popup_text.g,
blue = Colors.cac_sub_popup_text.b,
alpha = 1
}
},
handlers = {
refresh_info_pane = CacViewingMeterText
}
},
{
type = "UIElement",
id = "large_meter_id",
properties = {
CacWeaponStatFunc = MBh.Property( "CacWeaponStatFunc" ),
CacWeaponAttachStatFunc = MBh.Property( "CacWeaponAttachStatFunc" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
children = {
{
type = "UIImage",
properties = {
CacWeaponStatFunc = MBh.Property( "CacWeaponStatFunc" ),
CacWeaponAttachStatFunc = MBh.Property( "CacWeaponAttachStatFunc" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = Cac.Layout.CacWeaponMeter.left,
right = Cac.Layout.CacWeaponMeter.left,
top = Cac.Layout.CacWeaponMeter.top,
bottom = Cac.Layout.CacWeaponMeter.bottom,
material = RegisterMaterial( "white" ),
red = Colors.cac_weapon_meter_main.r,
green = Colors.cac_weapon_meter_main.g,
blue = Colors.cac_weapon_meter_main.b,
alpha = 1
},
statcompare = {
alpha = 0
},
statview = {
alpha = 1
}
},
handlers = {
refresh_info_pane = MBh.DoMultiple( {
CacEditWeaponStatsInfoViewingAttachmentMeter,
CacWeaponStatCompare
} )
}
},
{
type = "UIImage",
id = "large_front_bar_id",
properties = {
CacWeaponStatFunc = MBh.Property( "CacWeaponStatFunc" ),
CacWeaponAttachStatFunc = MBh.Property( "CacWeaponAttachStatFunc" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = Cac.Layout.CacWeaponMeter.left,
right = Cac.Layout.CacWeaponMeter.left,
top = Cac.Layout.CacWeaponMeter.top,
bottom = Cac.Layout.CacWeaponMeter.bottom,
material = RegisterMaterial( "white" ),
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
}
},
handlers = {
refresh_info_pane = CacEditWeaponStatsInfoViewingMeter
}
}
}
}
}
},
{
type = "UIHorizontalList",
id = "equipped_meter",
properties = {
CacWeaponStatFunc = MBh.Property( "CacWeaponStatFunc" ),
CacWeaponAttachStatFunc = MBh.Property( "CacWeaponAttachStatFunc" ),
statTitle = MBh.Property( "statTitle" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 109,
right = 0,
top = 0,
bottom = 6,
spacing = 12
},
statcompare = {
alpha = 1
},
statview = {
alpha = 0
}
},
handlers = {
refresh_info_pane = CacWeaponStatCompare
},
children = {
{
type = "UIElement",
id = "equipped_select_overflow_meter",
properties = {
CacWeaponStatFunc = MBh.Property( "CacWeaponStatFunc" ),
CacWeaponAttachStatFunc = MBh.Property( "CacWeaponAttachStatFunc" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
children = {
{
type = "UIImage",
properties = {
CacWeaponStatFunc = MBh.Property( "CacWeaponStatFunc" ),
CacWeaponAttachStatFunc = MBh.Property( "CacWeaponAttachStatFunc" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = Cac.Layout.CacWeaponMeter.left,
right = Cac.Layout.CacWeaponMeter.left,
top = 0,
bottom = -Cac.Layout.CacWeaponMeter.bottom,
material = RegisterMaterial( "white" ),
red = Colors.cac_weapon_meter_main.r,
green = Colors.cac_weapon_meter_main.g,
blue = Colors.cac_weapon_meter_main.b,
alpha = 1
}
},
handlers = {
refresh_info_pane = CacEditWeaponStatsInfoEquippedAttachmentMeter
}
},
{
type = "UIImage",
properties = {
CacWeaponStatFunc = MBh.Property( "CacWeaponStatFunc" ),
CacWeaponAttachStatFunc = MBh.Property( "CacWeaponAttachStatFunc" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = Cac.Layout.CacWeaponMeter.left,
right = Cac.Layout.CacWeaponMeter.left,
top = 0,
bottom = -Cac.Layout.CacWeaponMeter.bottom,
material = RegisterMaterial( "white" ),
red = Cac.Swatches.highlight.r,
green = Cac.Swatches.highlight.g,
blue = Cac.Swatches.highlight.b,
alpha = 1
}
},
handlers = {
refresh_info_pane = CacEditWeaponStatsInfoEquippedMeter
}
}
}
}
}
}
}
}
}
}
end
function cac_weapon_info_pane_stats_page()
return {
type = "cac_basic_info_pane_page",
children = {
{
type = "UIVerticalList",
id = "cac_weapon_info_pane_stats",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 2,
bottom = 0,
spacing = 0
}
},
children = {
{
type = "cac_weapon_info_pane_stat",
id = "weapon_stats_info_1",
properties = {
statTitle = Cac.WeaponStatTypes.Accuracy.Title,
CacWeaponStatFunc = Cac.GetWeaponAccuracy,
CacWeaponAttachStatFunc = Cac.GetAttachmentAccuracy
}
},
{
type = "cac_weapon_info_pane_stat",
id = "weapon_stats_info_2",
properties = {
statTitle = Cac.WeaponStatTypes.Damage.Title,
CacWeaponStatFunc = Cac.GetWeaponDamage,
CacWeaponAttachStatFunc = Cac.GetAttachmentDamage
}
},
{
type = "cac_weapon_info_pane_stat",
id = "weapon_stats_info_3",
properties = {
statTitle = Cac.WeaponStatTypes.Range.Title,
CacWeaponStatFunc = Cac.GetWeaponRange,
CacWeaponAttachStatFunc = Cac.GetAttachmentRange
}
},
{
type = "cac_weapon_info_pane_stat",
id = "weapon_stats_info_4",
properties = {
statTitle = Cac.WeaponStatTypes.FireRate.Title,
CacWeaponStatFunc = Cac.GetWeaponFireRate,
CacWeaponAttachStatFunc = Cac.GetAttachmentFireRate
}
},
{
type = "cac_weapon_info_pane_stat",
id = "weapon_stats_info_5",
properties = {
statTitle = Cac.WeaponStatTypes.Mobility.Title,
CacWeaponStatFunc = Cac.GetWeaponMobility,
CacWeaponAttachStatFunc = Cac.GetAttachmentMobility
}
}
}
}
}
}
end
LUI.MenuBuilder.registerDef( "cac_weapon_info_pane_stats_page", cac_weapon_info_pane_stats_page )
LUI.MenuBuilder.registerDef( "cac_weapon_info_pane_stat", cac_weapon_info_pane_stat )
LockTable( _M )

View File

@@ -0,0 +1,740 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function cac_weapon_stats_full_pane()
return {
type = "UIElement",
id = "cac_weapon_stats_full_pane_id",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alpha = 0
},
hidden = {
alpha = 0
},
visible = {
alpha = 1
}
},
children = {
{
type = "cac_basic_info_pane_header",
id = "cac_info_pane_header_stats",
properties = {
titleText = Engine.Localize( "LUA_MENU_WEAPON_STATS_CAPS" )
}
},
{
type = "cac_basic_info_pane_background"
},
{
type = "cac_weapon_info_pane_stats_page",
id = "cac_weapon_info_pane_stats"
}
}
}
end
function cac_performance_stats_full_pane( f2_arg0 )
return function ()
return {
type = "UIElement",
id = "cac_performance_stats_full_pane_" .. f2_arg0,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alpha = 0
},
hidden = {
alpha = 0
},
visible = {
alpha = 1
}
},
handlers = {
refresh_info_pane = function ( f4_arg0, f4_arg1 )
if f4_arg1.selection_id == "edit_lethal" and f2_arg0 == "cac_weapon_info_pane_performance_page_lethal" then
local f4_local0 = false
for f4_local9, f4_local10 in pairs( Cac.Indices.Weapons ) do
local f4_local4
if f4_local10 == Cac.Indices.Weapons.Primary then
f4_local4 = 2
if not f4_local4 then
else
for f4_local5 = 0, f4_local4, 1 do
local f4_local8 = Cac.GetAttachment( f4_arg1.controller, f4_arg1.squadLocation, f4_arg1.squadMemberIndex, f4_arg1.classLocation, f4_arg1.slot, f4_local10, f4_local5 )
if f4_local8 == "shotgun" or f4_local8 == "gl" then
f4_arg0:animateToState( "hidden" )
f4_local0 = true
end
end
end
end
f4_local4 = 1
end
if not f4_local0 then
f4_arg0:animateToState( "visible" )
end
end
end
},
children = {
{
type = "cac_basic_info_pane_header",
id = "cac_info_pane_header_performance",
properties = {
titleText = Engine.Localize( "LUA_MENU_PERFORMANCE_CAPS" )
}
},
{
type = "cac_basic_info_pane_background"
},
{
type = f2_arg0,
id = "cac_weapon_info_performance_stats"
}
}
}
end
end
function CacRefreshInfoPaneHeaderTitle( f5_arg0, f5_arg1 )
if f5_arg1.header ~= nil then
f5_arg0:setText( f5_arg1.header )
end
end
function cac_basic_info_pane_background()
return {
type = "generic_menu_background_withfade",
properties = {
fade_height = 100,
shadow_alpha = Cac.Swatches.Alphas.cac_panel_background_shadow,
top_offset = Cac.Layout.InfoPane.header_height - 1
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
right = 0,
height = 180
}
}
}
end
function cac_basic_info_pane_header( f7_arg0, f7_arg1 )
local f7_local0 = f7_arg1.titleText or ""
local f7_local1 = f7_arg1.backgroundAlpha or 1
local f7_local2 = f7_arg1.width
if not f7_local2 then
f7_local2 = Cac.Layout.CacEditPanel.right - Cac.Layout.CacEditPanel.left
end
local f7_local3 = f7_arg1.height
if not f7_local3 then
f7_local3 = Cac.Layout.InfoPane.header_height
end
local f7_local4 = Engine.IsConsoleGame()
if not f7_local4 then
f7_local4 = 1 == Engine.IsGamepadEnabled()
end
local self = LUI.UIElement.new()
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
left = 0,
width = f7_local2,
height = f7_local3
} )
self:animateToState( "default" )
local f7_local6 = LUI.MenuGenerics.generic_menu_background( {}, {
hide_bottom = true
} )
f7_local6:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
right = 0,
height = f7_local3
} )
f7_local6:animateToState( "default" )
self:addElement( f7_local6 )
local f7_local7 = LUI.UIText.new()
f7_local7.id = "info_pane_header_text"
f7_local7:setText( f7_local0 )
f7_local7:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
height = CoD.TextSettings.BoldFont.Height,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.BoldFont.Font,
red = Colors.window_title_text_color.r,
green = Colors.window_title_text_color.g,
blue = Colors.window_title_text_color.b
} )
f7_local7:animateToState( "default" )
f7_local7:registerEventHandler( "menu_create", CacRefreshInfoPaneHeaderTitle )
f7_local7:registerEventHandler( "refresh_info_pane_header", CacRefreshInfoPaneHeaderTitle )
self:addElement( f7_local7 )
local f7_local8
if f7_local4 then
f7_local8 = 40
if not f7_local8 then
else
local f7_local9
if f7_local4 then
f7_local9 = 20
if not f7_local9 then
else
if IsOnlineMatch() then
local f7_local10 = LUI.UIButton.new()
f7_local10.id = "info_pane_header_page_lt_btn"
f7_local10.m_requireFocusType = FocusType.MouseOver
f7_local10:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
left = 5,
width = f7_local8,
height = f7_local9,
alpha = 0
} )
f7_local10:registerAnimationState( "visible", {
alpha = 1
} )
f7_local10:animateToState( "default" )
f7_local10:registerEventHandler( "show_lt", MBh.AnimateToState( "visible" ) )
f7_local10:registerEventHandler( "hide_lt", MBh.AnimateToState( "default" ) )
f7_local10:registerEventHandler( "button_action", MBh.EmitEventToParent( "info_panel_go_left" ) )
f7_local10:registerEventHandler( "popup_active", nil )
self:addElement( f7_local10 )
local f7_local11 = nil
if f7_local4 then
f7_local11 = LUI.UIText.new()
f7_local11:setText( Engine.Localize( ButtonMap.button_shoulderl.string ) )
f7_local11:registerAnimationState( "default", {
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.ExtraBigFont.Font,
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = -CoD.TextSettings.ExtraBigFont.Height / 2,
bottom = CoD.TextSettings.ExtraBigFont.Height / 2,
left = 0,
right = 0
} )
else
f7_local11 = LUI.UIImage.new()
f7_local11:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = f7_local8,
right = -f7_local8,
material = RegisterMaterial( "widg_lobby_arrow" )
} )
end
f7_local11:animateToState( "default" )
f7_local10:addElement( f7_local11 )
local f7_local12 = LUI.UIButton.new()
f7_local12.id = "info_pane_header_page_rt_btn"
f7_local12.m_requireFocusType = FocusType.MouseOver
f7_local12:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
right = -5,
width = f7_local8,
height = f7_local9,
alpha = 0
} )
f7_local12:registerAnimationState( "visible", {
alpha = 1
} )
f7_local12:animateToState( "default" )
f7_local12:registerEventHandler( "show_rt", MBh.AnimateToState( "visible" ) )
f7_local12:registerEventHandler( "hide_rt", MBh.AnimateToState( "default" ) )
f7_local12:registerEventHandler( "button_action", MBh.EmitEventToParent( "info_panel_go_right" ) )
f7_local12:registerEventHandler( "popup_active", nil )
self:addElement( f7_local12 )
local f7_local13 = nil
if f7_local4 then
f7_local13 = LUI.UIText.new()
f7_local13:setText( Engine.Localize( ButtonMap.button_shoulderr.string ) )
f7_local13:registerAnimationState( "default", {
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.ExtraBigFont.Font,
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = -CoD.TextSettings.ExtraBigFont.Height / 2,
bottom = CoD.TextSettings.ExtraBigFont.Height / 2,
left = 0,
right = 0
} )
else
f7_local13 = LUI.UIImage.new()
f7_local13:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "widg_lobby_arrow" )
} )
end
f7_local13:animateToState( "default" )
f7_local12:addElement( f7_local13 )
end
return self
end
end
f7_local9 = 16
end
end
f7_local8 = 16
end
function cac_abilities_perks_info_pane_header()
return {
type = "UIElement",
properties = {
titleText = "Title",
header_height = GenericButtonDims.button_height,
left_cap_width = GenericButtonDims.button_height,
right_cap_width = 4
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 1,
right = -1,
top = 0,
bottom = MBh.Property( "header_height" )
}
},
children = {
{
type = "UIElement",
id = "choose_item_box_header_container_id",
properties = {
left_cap_width = MBh.Property( "left_cap_width" ),
right_cap_width = MBh.Property( "right_cap_width" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = -4,
top = 0,
bottom = 0
}
},
children = {
{
type = "UIImage",
id = "lefty_cap",
properties = {
left_cap_width = MBh.Property( "left_cap_width" )
},
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = MBh.Property( "left_cap_width" ),
top = 0,
bottom = 0,
red = 0.3,
green = 0.3,
blue = 0.3,
alpha = 0.5
}
}
},
{
type = "UIImage",
id = "middy_seg",
properties = {
left_cap_width = MBh.Property( "left_cap_width" ),
right_cap_width = MBh.Property( "right_cap_width" )
},
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = MBh.Property( "left_cap_width" ),
right = MBh.Property( "right_cap_width" ),
top = 0,
bottom = 0,
red = 0.3,
green = 0.3,
blue = 0.3,
alpha = 0.5
}
}
}
}
},
{
type = "UIText",
id = "info_pane_header_text",
properties = {
text = MBh.Property( "titleText" ),
button_text_indent = 30
},
states = {
default = {
alignment = LUI.Alignment.Left,
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = false,
left = MBh.Property( "button_text_indent" ),
right = 0,
top = -0.5 * CoD.TextSettings.BoldFont.Height,
bottom = 0.5 * CoD.TextSettings.BoldFont.Height,
font = CoD.TextSettings.BoldFont.Font,
red = Colors.window_title_text_color.r,
green = Colors.window_title_text_color.g,
blue = Colors.window_title_text_color.b
}
},
handlers = {
menu_create = CacRefreshInfoPaneHeaderTitle,
refresh_info_pane_header = CacRefreshInfoPaneHeaderTitle
}
}
}
}
end
function cac_basic_info_pane_page()
return {
type = "UIElement",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 1,
right = -1,
top = Cac.Layout.InfoPane.header_height,
bottom = Cac.Layout.InfoPane.height
}
}
}
end
function InfoPaneHandleRightBumper( f10_arg0, f10_arg1 )
assert( f10_arg0.properties.selection_id )
assert( f10_arg0.properties.currentPaneIndex )
assert( f10_arg0.properties.currentPaneId )
assert( f10_arg0.properties.InfoPaneMap[f10_arg0.properties.selection_id] )
local f10_local0 = f10_arg0.properties.selection_id
local f10_local1 = f10_arg0.properties.currentPaneIndex
local f10_local2 = f10_arg0.properties.currentPaneId
local f10_local3 = f10_arg0.properties.InfoPaneMap[f10_arg0.properties.selection_id]
if #f10_local3 >= 1 then
local f10_local4 = f10_local1 + 1
if #f10_local3 < f10_local4 then
f10_local4 = 1
end
f10_arg0.properties.currentPaneIndex = f10_local4
f10_arg0.properties.currentPaneId = f10_local3[f10_local4] .. "_id"
f10_arg0.properties.LastOpenPane[f10_local0] = f10_local4
f10_arg0:dispatchEventToRoot( {
name = "refresh_info_pane_view",
immediate = true
} )
end
end
function InfoPaneHandleLeftBumper( f11_arg0, f11_arg1 )
assert( f11_arg0.properties.selection_id )
assert( f11_arg0.properties.currentPaneIndex )
assert( f11_arg0.properties.currentPaneId )
assert( f11_arg0.properties.InfoPaneMap[f11_arg0.properties.selection_id] )
local f11_local0 = f11_arg0.properties.selection_id
local f11_local1 = f11_arg0.properties.currentPaneIndex
local f11_local2 = f11_arg0.properties.currentPaneId
local f11_local3 = f11_arg0.properties.InfoPaneMap[f11_arg0.properties.selection_id]
if #f11_local3 >= 1 then
local f11_local4 = f11_local1 - 1
if f11_local4 <= 0 then
f11_local4 = #f11_local3
end
f11_arg0.properties.currentPaneIndex = f11_local4
f11_arg0.properties.currentPaneId = f11_local3[f11_local4] .. "_id"
f11_arg0.properties.LastOpenPane[f11_local0] = f11_local4
f11_arg0:dispatchEventToRoot( {
name = "refresh_info_pane_view",
immediate = true
} )
end
end
function UpdateSelectionId( f12_arg0, f12_arg1 )
assert( f12_arg1.selection_id )
assert( f12_arg1.classLocation )
assert( f12_arg1.slot )
assert( f12_arg1.controller )
assert( f12_arg0.properties.InfoPaneMap[f12_arg1.selection_id] )
assert( f12_arg0.properties.PaneList )
assert( f12_arg0.properties.currentPaneId )
assert( f12_arg0.properties.selection_id )
local f12_local0 = f12_arg1.selection_id
f12_arg0.properties.selection_id = f12_local0
local f12_local1 = f12_arg0.properties.currentPaneId
local f12_local2 = f12_arg0.properties.InfoPaneMap[f12_arg1.selection_id]
local f12_local3 = f12_arg0.properties.PaneList
local f12_local4 = true
for f12_local5 = 1, #f12_local3, 1 do
local f12_local8 = f12_local3[f12_local5]
local f12_local9 = f12_local3[f12_local5] .. "_id"
local f12_local10 = false
local f12_local11 = 0
for f12_local12 = 1, #f12_local2, 1 do
if f12_local3[f12_local5] == f12_local2[f12_local12] then
f12_local10 = true
f12_local11 = f12_local12
break
end
end
local f12_local12 = f12_arg0:getChildById( f12_local9 )
if f12_local10 then
if f12_local12 ~= nil and f12_local12.id == f12_local1 then
f12_local4 = false
f12_arg0.properties.LastOpenPane[f12_local0] = f12_local11
end
if f12_local12 == nil then
local f12_local14 = LUI.MenuBuilder.buildMenu( f12_local8, {
exclusiveController = f12_arg0.properties.exclusiveController
} )
f12_local14.id = f12_local9
f12_arg0:addElement( f12_local14 )
end
end
if f12_local12 then
f12_local12:close()
end
end
if f12_local4 then
if #f12_local2 >= 1 then
f12_arg0.properties.currentPaneIndex = f12_arg0.properties.LastOpenPane[f12_local0]
f12_arg0.properties.currentPaneId = f12_local2[f12_arg0.properties.currentPaneIndex] .. "_id"
f12_arg0:dispatchEventToRoot( {
name = "refresh_info_pane_view",
immediate = true
} )
else
f12_arg0.properties.currentPaneIndex = 0
f12_arg0.properties.currentPaneId = ""
end
end
end
function refreshInfoPaneView( f13_arg0, f13_arg1 )
assert( f13_arg0.properties.selection_id )
assert( f13_arg0.properties.currentPaneIndex )
assert( f13_arg0.properties.currentPaneId )
assert( f13_arg0.properties.InfoPaneMap[f13_arg0.properties.selection_id] )
local f13_local0 = f13_arg0.properties.selection_id
local f13_local1 = f13_arg0.properties.currentPaneIndex
local f13_local2 = f13_arg0.properties.currentPaneId
local f13_local3 = f13_arg0.properties.InfoPaneMap[f13_arg0.properties.selection_id]
for f13_local4 = 1, #f13_local3, 1 do
local f13_local7 = f13_local3[f13_local4] .. "_id"
local f13_local8 = f13_arg0:getChildById( f13_local7 )
if f13_local8 then
if f13_local7 == f13_local2 then
f13_local8:animateToState( "visible", 0 )
f13_local8.m_ignoreMouseFocus = nil
else
f13_local8:animateToState( "default", 0 )
f13_local8.m_ignoreMouseFocus = true
end
end
end
end
function ReEnable( f14_arg0, f14_arg1 )
f14_arg0:processEvent( {
name = "enable"
} )
end
function cac_basic_info_pane_container()
local f15_local0 = {
"cac_weapon_stats_full_pane",
"cac_performance_stats_full_pane_weapon"
}
local f15_local1 = {
"cac_performance_stats_full_pane_lethal"
}
local f15_local2 = {
"cac_performance_stats_full_pane_tactical"
}
if not IsOnlineMatch() or Engine.GetDvarBool( "xblive_privatematch" ) then
f15_local0 = {
"cac_weapon_stats_full_pane"
}
f15_local1 = {}
f15_local2 = {}
end
return {
type = "UIBindButton",
properties = {
selection_id = "edit_weapon_primary",
slot = 0,
classLocation = "",
currentPaneIndex = 1,
currentPaneId = "",
InfoPaneMap = {
edit_weapon_primary = f15_local0,
edit_weapon_primary_attach1 = f15_local0,
edit_weapon_primary_attach2 = f15_local0,
edit_weapon_primary_attach3 = f15_local0,
edit_weapon_primary_camo = f15_local0,
edit_weapon_primary_reticle = f15_local0,
edit_weapon_secondary = f15_local0,
edit_weapon_secondary_attach = f15_local0,
edit_weapon_secondary_attach1 = f15_local0,
edit_weapon_secondary_attach2 = f15_local0,
edit_lethal = f15_local1,
edit_tactical = f15_local2,
edit_killstreaks = {},
edit_abilities = {},
edit_perk1 = {},
edit_perk2 = {},
edit_perk3 = {}
},
LastOpenPane = {
edit_weapon_primary = 1,
edit_weapon_primary_attach1 = 1,
edit_weapon_primary_attach2 = 1,
edit_weapon_primary_attach3 = 1,
edit_weapon_primary_camo = 1,
edit_weapon_primary_reticle = 1,
edit_weapon_secondary = 1,
edit_weapon_secondary_attach1 = 1,
edit_weapon_secondary_attach2 = 1,
edit_lethal = 1,
edit_tactical = 1,
edit_killstreaks = 0,
edit_abilities = 0,
edit_perk1 = 0,
edit_perk2 = 0,
edit_perk3 = 0
},
PaneList = {
"cac_weapon_stats_full_pane",
"cac_performance_stats_full_pane_weapon",
"cac_performance_stats_full_pane_lethal",
"cac_performance_stats_full_pane_tactical"
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = Cac.Layout.InfoPane.height,
alpha = 1
},
shown = {
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
show_info_pane = MBh.AnimateToState( "shown", 0 ),
hide_info_pane = MBh.AnimateToState( "hidden", 0 ),
button_shoulderr = InfoPaneHandleRightBumper,
button_shoulderl = InfoPaneHandleLeftBumper,
info_panel_go_right = InfoPaneHandleRightBumper,
info_panel_go_left = InfoPaneHandleLeftBumper,
update_selection_info = UpdateSelectionId,
refresh_info_pane_view = refreshInfoPaneView,
popup_active = ReEnable
},
children = {}
}
end
LUI.MenuBuilder.registerDef( "cac_basic_info_pane_page", cac_basic_info_pane_page )
LUI.MenuBuilder.registerType( "cac_basic_info_pane_header", cac_basic_info_pane_header )
LUI.MenuBuilder.registerDef( "cac_basic_info_pane_container", cac_basic_info_pane_container )
LUI.MenuBuilder.registerDef( "cac_basic_info_pane_background", cac_basic_info_pane_background )
LUI.MenuBuilder.registerDef( "cac_weapon_stats_full_pane", cac_weapon_stats_full_pane )
LUI.MenuBuilder.registerDef( "cac_performance_stats_full_pane", cac_performance_stats_full_pane )
LUI.MenuBuilder.registerDef( "cac_performance_stats_full_pane_weapon", cac_performance_stats_full_pane( "cac_weapon_info_pane_performance_page_weapon" ) )
LUI.MenuBuilder.registerDef( "cac_performance_stats_full_pane_tactical", cac_performance_stats_full_pane( "cac_weapon_info_pane_performance_page_tactical" ) )
LUI.MenuBuilder.registerDef( "cac_performance_stats_full_pane_lethal", cac_performance_stats_full_pane( "cac_weapon_info_pane_performance_page_lethal" ) )
LUI.MenuBuilder.registerDef( "cac_abilities_perks_info_pane_header", cac_abilities_perks_info_pane_header )
LockTable( _M )

File diff suppressed because it is too large Load Diff

1355
lui/mp_menus/cacmain.dec.lua Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,369 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function HandlePrestigeDateCreate( f1_arg0, f1_arg1 )
local f1_local0 = f1_arg0.properties
local f1_local1 = f1_local0.squad_location
f1_arg0:setText( Engine.Localize( "@LUA_MENU_PRESTIGED_ON", Engine.GetFormattedDate( Engine.GetPlayerDataEx( f1_local0.exclusiveController, CoD.GetStatsGroupForGameMode(), "characterXP", f1_local0.squadMemberIndex ) ) ) )
end
function HandlePrestigeTimeTakenCreate( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg0.properties
local f2_local1 = Engine.GetPlayerDataEx( f2_local0.exclusiveController, CoD.GetStatsGroupForGameMode(), f2_local0.squad_location, f2_local0.squadMemberIndex, "experienceToPrestige" )
local f2_local2 = string.format( "%02d", f2_local1 % 60 )
f2_local1 = f2_local1 / 60
local f2_local3 = string.format( "%02d", f2_local1 % 60 )
f2_local1 = f2_local1 / 60
f2_arg0:setText( Engine.Localize( "@LUA_MENU_TOTAL_TIME_TAKEN", Engine.Localize( "@LUA_MENU_DAYS_HOURS_MINUTES_SECONDS", string.format( "%d", f2_local1 / 24 ), string.format( "%02d", f2_local1 % 24 ), f2_local3, f2_local2 ) ) )
end
function HandleSquadMemberWindowCreate( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg0.properties
local f3_local1 = f3_local0.squad_location
local f3_local2 = f3_local0.squadMemberIndex
local f3_local3 = f3_local0.exclusiveController
local f3_local4 = Cac.GetSquadMemberName( f3_local3, f3_local1, f3_local2 )
local f3_local5 = Engine.TableLookup( "mp/cac/backgrounds.csv", 0, Cac.GetBackgroundIndex( f3_local3, f3_local1, f3_local2 ), 1 )
local f3_local6 = Cac.GetPatchIndex( f3_local3, f3_local1, f3_local2 )
local f3_local7 = Cac.GetPatchbackingIndex( f3_local3, f3_local1, f3_local2 )
local f3_local8 = Lobby.GetRankForXP( tonumber( Engine.GetPlayerDataEx( f3_local3, CoD.GetStatsGroupForGameMode(), f3_local1, f3_local2, "squadMemXP" ) ) )
local f3_local9 = Cac.GetPrestigeLevel( f3_local3, f3_local1 )
local f3_local10 = Engine.GetUsernameByController and Engine.GetUsernameByController( f3_local3 ) or f3_local4
local f3_local11 = Engine.GetProfileDataUseEliteClanTag( f3_local3 ) and Clan.GetTag( f3_local3 ) or Engine.GetCustomClanTag( f3_local3 )
f3_arg0:updateSquadMember( f3_local3, f3_local2 )
f3_arg0:processEvent( {
name = "update_playercard",
gamertag = f3_local10,
clantag = f3_local11,
background = Cac.GetBackgroundIndex( f3_local3, f3_local1, f3_local2 ),
rank = f3_local8,
prestige = f3_local9,
patchShape = f3_local7,
patchEmblem = f3_local6
} )
end
function HandlePrestigeDetailsCreate( f4_arg0, f4_arg1 )
local f4_local0 = f4_arg0.properties
local f4_local1 = f4_local0.squad_location
local f4_local2 = f4_local0.squadMemberIndex
local f4_local3 = f4_local0.exclusiveController
f4_arg0:processEvent( {
name = "update_header_text",
string = Cac.GetSquadMemberName( f4_local3, f4_local1, f4_local2 )
} )
f4_arg0:processEvent( {
name = "update_title",
title_text = Engine.Localize( "@LUA_MENU_PRESTIGE_UNLOCKS_TITLE", Cac.GetSquadMemberPrestigeLevel( f4_local3, f4_local1, f4_local2 ) )
} )
f4_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_secondary",
helper_text = Engine.Localize( "@LUA_MENU_BACK" ),
side = "left",
clickable = true
} )
end
function getUnlockItemsForPrestigeLevel( f5_arg0 )
local f5_local0 = {}
local f5_local1 = 0
while true do
local f5_local2 = Engine.TableLookupByRow( UnlockTable.File, f5_local1, UnlockTable.Cols.ItemId )
if f5_local2 == "" then
return f5_local0
elseif f5_arg0 == tonumber( Engine.TableLookupByRow( UnlockTable.File, f5_local1, UnlockTable.Cols.Prestige ) ) then
f5_local0[#f5_local0 + 1] = {
row = f5_local1,
id = f5_local2,
type = Engine.TableLookupByRow( UnlockTable.File, f5_local1, UnlockTable.Cols.Type )
}
end
f5_local1 = f5_local1 + 1
end
end
function UnlockedItemsFeeder( f6_arg0 )
local f6_local0 = Cac.GetSquadMemberPrestigeLevel( f6_arg0.exclusiveController, f6_arg0.squad_location, f6_arg0.squadMemberIndex )
local f6_local1 = getUnlockItemsForPrestigeLevel( f6_local0 )
local f6_local2 = {}
for f6_local8, f6_local9 in pairs( f6_local1 ) do
local f6_local6 = ""
local f6_local7 = RegisterMaterial( "white" )
local f6_local10 = ""
if f6_local9.type == "Background" then
f6_local6 = Engine.Localize( "@LUA_MENU_BACKGROUND" )
f6_local7 = Engine.TableLookup( BackgroundsTable.File, BackgroundsTable.Cols.Ref, f6_local9.id, BackgroundsTable.Cols.Image )
elseif f6_local9.type == "Prestige" then
f6_local6 = Engine.Localize( "@LUA_MENU_ICON" )
f6_local7 = Rank.GetRankIcon( 1, f6_local0 )
end
f6_local2[#f6_local2 + 1] = {
type = "aar_unlocked_item",
id = "item_" .. f6_local8,
properties = {
item_name = f6_local6,
item_icon = RegisterMaterial( f6_local7 ),
icon_width = 96,
icon_height = 96,
item_detail_1 = f6_local10
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 150,
left = 0,
right = 150
}
}
}
end
return f6_local2
end
function prestige_details_main()
return {
type = "UIElement",
id = "prestige_details_root",
properties = {
squad_location = Cac.GetSquadLoc(),
squadMemberIndex = 0
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = HandlePrestigeDetailsCreate
},
children = {
{
type = "UIImage",
id = "prestige_details_bg_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",
id = "prestige_details_title_id",
properties = {
menu_title = ""
}
},
{
type = "generic_menu_titlebar",
id = "prestige_details_titlebar_id",
properties = {
font = CoD.TextSettings.BoldFont,
title_bar_text = "",
title_bar_text_indent = GenericTitleBarDims.TitleBarLCapWidth,
title_bar_alignment = LUI.Alignment.Left
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 120,
bottom = 145,
left = 100,
right = 590
}
}
},
{
type = "generic_menu_background_withfade",
id = "prestige_details_background_id",
properties = {
fill_alpha = 0.5
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 112,
bottom = 512,
left = 100,
right = 590
}
}
},
{
type = "UIText",
id = "prestige_details_date_id",
properties = {
text = "",
squad_location = MBh.Property( "squad_location" ),
squadMemberIndex = MBh.Property( "squadMemberIndex" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 200,
bottom = 200 + CoD.TextSettings.NormalFont.Height,
left = 100,
right = 590,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.NormalFont.Font
}
},
handlers = {
menu_create = HandlePrestigeDateCreate
}
},
{
type = "UIText",
id = "prestige_details_time_taken_id",
properties = {
text = "",
squad_location = MBh.Property( "squad_location" ),
squadMemberIndex = MBh.Property( "squadMemberIndex" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 230,
bottom = 230 + CoD.TextSettings.NormalFont.Height,
left = 100,
right = 590,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.NormalFont.Font
}
},
handlers = {
menu_create = HandlePrestigeTimeTakenCreate
}
},
{
type = "UIHorizontalList",
id = "prestige_details_unlock_list_id",
properties = {
squad_location = MBh.Property( "squad_location" ),
squadMemberIndex = MBh.Property( "squadMemberIndex" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 280,
bottom = 480,
left = 100,
right = 590,
alignment = LUI.Alignment.Center,
spacing = 10
}
},
childrenFeeder = UnlockedItemsFeeder
},
Cac.GetEditCurrency( "prestige_details_currency_display_id" ),
{
type = "UISquadMemberWindow",
id = "prestige_details_member_window_id",
properties = {
use_3d_model = true,
use_2d_character_image = false,
use_member_name = false,
use_prestige_icon = false,
use_playercard = true,
use_background = true,
use_border = false,
card_props = {},
card_dims = {
top = -130,
bottom = -165,
left = -725,
right = -725
},
card_scale = -0.15,
default_anim = Cac.Customization.Animations.default,
char_window_dims = {
top = 0,
bottom = 610,
left = -175,
right = 435
},
uv_values = {
0,
0,
1,
1
},
character_pos = CharacterCameraPresets.MemberSelect.Position,
controller = MBh.Property( "exclusiveController" ),
squad_location = MBh.Property( "squad_location" ),
squadMemberIndex = MBh.Property( "squadMemberIndex" ),
mask_pos_data = {
top = 17,
bottom = 0,
left = 0,
right = 0
}
},
states = {
default = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 70,
left = 0 + Cac.Layout.CacEditPanel.shift_delta,
bottom = 670,
right = 746 + Cac.Layout.CacEditPanel.shift_delta
}
},
handlers = {
menu_create = HandleSquadMemberWindowCreate
}
},
{
type = "button_helper_text_main",
id = "prestige_details_helper_text_id"
},
{
type = "online_friends_widget",
id = "prestige_details_friends_widget_id"
},
{
type = "generic_back_button"
}
}
}
end
LUI.MenuBuilder.registerDef( "prestige_details_main", prestige_details_main )
LockTable( _M )

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,648 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
menupos_left = 100
menupos_right = 750
menupos_top = 100
menupos_bottom = 308
wide_amount = 200
spacer_height = 1
cap_width = 32
cap_height = 32
button_height = 40
text_height = 26
function ability_button_template()
return {
type = "UIButton",
focusable = true,
properties = {
button_text_alignment = LUI.Alignment.Center,
button_text = "Button Text ",
action_func = function ()
DebugPrint( "Button Action Func: Override me in specific button instances" )
end
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = button_height
}
},
handlers = {
button_action = MBh.Property( "action_func" )
},
children = {
{
type = "ability_button"
}
}
}
end
function ability_button()
return {
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 2,
right = menupos_right - 112
}
},
children = {
{
type = "UIImage",
id = "button_texture",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 2,
right = menupos_right - 112,
red = 1,
green = 1,
blue = 1,
alpha = 0,
material = RegisterMaterial( "btn_cas_fill_f" )
},
dim = {
red = 0.8,
green = 0.8,
blue = 0.8,
alpha = 1
},
brite = {
red = 1,
green = 1,
blue = 1,
alpha = 1
}
},
handlers = {
button_over = MBh.AnimateLoop( {
{
"dim",
800
},
{
"brite",
800
}
} ),
button_up = MBh.AnimateToState( "default", 0 )
}
},
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 1,
bottom = -1,
left = menupos_right - 152,
right = menupos_right - 100,
material = RegisterMaterial( "btn_cas_end_f" ),
alpha = 0
},
over = {
alpha = 1
}
},
handlers = {
button_over = MBh.AnimateToState( "over", 0 ),
button_up = MBh.AnimateToState( "default", 0 )
},
children = {}
},
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = -18,
left = 2,
right = menupos_right - 102,
material = RegisterMaterial( "white" ),
alpha = 0
},
over = {
alpha = 0.15
}
},
handlers = {
button_over = MBh.AnimateToState( "over", 0 ),
button_up = MBh.AnimateToState( "default", 0 )
}
},
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 12,
bottom = -12,
left = menupos_right - 142,
right = menupos_right - 110,
material = RegisterMaterial( "fluff_arrow_outline" ),
alpha = 1
},
button_over = {
alpha = 0
}
},
handlers = {
button_over = MBh.AnimateToState( "button_over" ),
button_up = MBh.AnimateToState( "default" )
}
}
}
}
end
function ability_horizontal_spacer()
return {
type = "UIImage",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = false,
left = 10,
right = -10,
top = 0,
bottom = spacer_height,
material = RegisterMaterial( "white" ),
red = 0,
green = 0,
blue = 0,
alpha = 0.8
}
},
children = {
{
type = "UIImage",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = false,
left = 0,
right = 0,
top = 1,
bottom = spacer_height + 1,
material = RegisterMaterial( "white" ),
red = 0.35,
green = 0.35,
blue = 0.35,
alpha = 1
}
}
}
}
}
end
function ability_button_design_template_list()
return {
type = "UIVerticalList",
focusable = true,
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = menupos_left,
right = menupos_right,
top = menupos_top,
bottom = menupos_bottom,
spacing = 0
}
}
}
end
function CasAbilityButton()
return {
type = "UIElement",
id = "ability_button_template_main_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "UIImage",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = 1,
green = 1,
blue = 1,
alpha = 1,
material = RegisterMaterial( "white" )
}
}
},
{
type = "UIVerticalList",
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = menupos_left,
right = menupos_right,
top = menupos_top,
bottom = menupos_bottom
}
},
children = {
{
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 24,
left = 0,
right = 0
}
},
children = {
{
type = "UIHorizontalList",
id = "title_box_list",
states = {
default = {
alignment = LUI.Alignment.Left,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 200,
top = 0,
bottom = 24
}
},
children = {
{
type = "UIImage",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 32,
top = 0,
bottom = 0,
red = 1,
green = 1,
blue = 1,
alpha = 1,
material = RegisterMaterial( "box_titlebar_angle_lt" )
}
}
},
{
type = "UIImage",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 492,
top = 0,
bottom = 0,
red = 1,
green = 1,
blue = 1,
alpha = 1,
material = RegisterMaterial( "box_titlebar_angle_mid" )
}
}
},
{
type = "UIImage",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 64,
top = 0,
bottom = 0,
red = 1,
green = 1,
blue = 1,
alpha = 1,
material = RegisterMaterial( "box_titlebar_angle_rt" )
}
}
}
}
},
{
type = "UIHorizontalList",
id = "title_text_list",
states = {
default = {
alignment = LUI.Alignment.Left,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 10,
right = 200,
top = -2,
bottom = 24,
spacing = 5
}
},
children = {
{
type = "UIText",
id = "ability_title_text",
properties = {
text = "ABILITIES"
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 10,
right = 400,
top = 0,
bottom = 0,
red = 1,
green = 1,
blue = 1,
alpha = 1,
font = RegisterFont( "fonts/smallfont" )
}
}
},
{
type = "UIImage",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 29,
top = 2,
bottom = -2,
red = 1,
green = 1,
blue = 1,
alpha = 1,
material = RegisterMaterial( "box_number" )
}
},
children = {
{
type = "UIText",
id = "slot_unlock_text",
properties = {
text = "0"
},
states = {
default = {
alignment = LUI.Alignment.Center,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = -1,
bottom = -1,
red = 1,
green = 0.29,
blue = 0.24,
alpha = 1,
font = RegisterFont( "fonts/smallfont" )
}
}
}
}
},
{
type = "UIText",
id = "slot_unlock_title",
properties = {
text = "Slot Unlocks"
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 42,
top = 3,
bottom = -3,
red = 1,
green = 1,
blue = 1,
alpha = 1,
font = RegisterFont( "fonts/smallfont" )
}
}
}
}
}
}
},
{
type = "UIImage",
id = "list_backround_texure",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = 0.3,
green = 0.3,
blue = 0.3,
alpha = 1,
material = RegisterMaterial( "white" )
}
},
children = {
{
type = "UIImage",
states = {
default = {
topAnchor = true,
rightAnchor = true,
leftAnchor = true,
bottomAnchor = true,
top = 2,
bottom = -2,
left = 2,
right = -2,
material = RegisterMaterial( "box_gradient_fill" )
}
}
},
{
type = "UIImage",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = -9,
right = 16,
top = -9,
bottom = 16,
red = 1,
green = 1,
blue = 1,
alpha = 1,
material = RegisterMaterial( "box_ability_shadow" )
}
}
}
}
}
}
},
{
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 25,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "ability_button_design_template_list",
id = "button_list_id",
children = {
{
type = "ability_button_template",
id = "button_0"
},
{
type = "ability_horizontal_spacer",
id = "spacer_0"
},
{
type = "ability_button_template",
id = "button_1"
},
{
type = "ability_horizontal_spacer",
id = "spacer_1"
},
{
type = "ability_button_template",
id = "button_2"
},
{
type = "ability_horizontal_spacer",
id = "spacer_3"
},
{
type = "ability_button_template",
id = "button_3"
},
{
type = "ability_horizontal_spacer",
id = "spacer_4"
},
{
type = "ability_button_template",
id = "button_4"
}
}
}
}
}
}
}
end
LUI.MenuBuilder.registerDef( "ability_button_template", ability_button_template )
LUI.MenuBuilder.registerDef( "ability_button", ability_button )
LUI.MenuBuilder.registerDef( "ability_horizontal_spacer", ability_horizontal_spacer )
LUI.MenuBuilder.registerDef( "ability_button_design_template_list", ability_button_design_template_list )
LUI.MenuBuilder.registerDef( "CasAbilityButton", CasAbilityButton )
LockTable( _M )

View File

@@ -0,0 +1,618 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function popup_choose_platform_intro_create( f1_arg0, f1_arg1 )
local f1_local0 = nil
if CoDAnywhere.HasUCDSaveGame( f1_arg1.controller ) then
f1_local0 = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_PLATFORM_CHOOSE_INTRO_UCD" )
else
f1_local0 = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_PLATFORM_CHOOSE_INTRO_NO_UCD" )
end
f1_arg0:dispatchEventToChildren( {
name = "update_message",
message_text = f1_local0
} )
end
function popup_choose_platform_intro()
return {
type = "generic_confirmation_popup",
id = "popup_choose_platform_intro_id",
properties = {
popup_title = Engine.Localize( "@LUA_MENU_COD_ANYWHERE" ),
message_text = "",
confirmation_action = MBh.LeaveMenu()
},
handlers = {
menu_create = popup_choose_platform_intro_create
}
}
end
function popup_choose_platform_are_you_sure()
return {
type = "generic_yesno_popup",
id = "popup_choose_platform_are_you_sure",
properties = {
platformIndex = -1,
popup_title = Engine.Localize( "@LUA_MENU_COD_ANYWHERE" ),
message_text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_USE_PLATFORM_FOR_GLOBAL" ),
yes_text = Engine.Localize( "@LUA_MENU_YES" ),
no_text = Engine.Localize( "@LUA_MENU_CANCEL" ),
yes_action = function ( f4_arg0, f4_arg1 )
CoDAnywhere.StartContextSwitch( f4_arg1.controller, f4_arg0.properties.callback_params.platformIndex )
end
}
}
end
function ChoosePlatform( f5_arg0, f5_arg1 )
LUI.FlowManager.RequestPopupMenu( f5_arg0, "popup_choose_platform_are_you_sure", true, f5_arg1.controller, false, {
callback_params = {
platformIndex = f5_arg0.properties.index
}
} )
end
function CoDAnywherePlatformFeeder( f6_arg0 )
local f6_local0 = {}
local f6_local1 = CoDAnywhere.NumFoundNonUCDPlatforms( f6_arg0.exclusiveController ) - 1
if f6_local1 == -1 then
return f6_local0
end
for f6_local2 = 0, f6_local1, 1 do
f6_local0[#f6_local0 + 1] = {
type = "UIGenericButton",
id = "cod_anywhere_platform_button_" .. f6_local2,
disabled = CoDAnywhere.IsUCDAccount( f6_local2 ),
listDefaultFocus = f6_local2 == 0,
properties = {
index = f6_local2,
button_text = CoDAnywhere.GetPlatformDescriptionString( f6_arg0.exclusiveController, f6_local2, CoD.CoDAnywhere.COD_ANYWHERE_PLATFORM_TEXT_TYPE_PLATFORM_NAME ),
button_action_func = ChoosePlatform,
button_over_disable_func = MBh.EmitEventToRoot( {
name = "update_desc",
platform_index = f6_local2
} ),
button_over_func = MBh.EmitEventToRoot( {
name = "update_desc",
platform_index = f6_local2
} )
}
}
end
return f6_local0
end
function choose_cod_anywhere_platform_vlist()
return {
type = "UIVerticalList",
focusable = true,
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
}
}
end
function UpdatePlatformLastPlayed( f8_arg0, f8_arg1 )
if f8_arg1.platform_index == nil then
return
end
local f8_local0 = f8_arg0:getParent()
local f8_local1 = f8_local0:getChildById( "platform_last_played" )
if f8_local1 then
f8_local1:setText( CoDAnywhere.GetPlatformDescriptionString( f8_local0.properties.exclusiveController, f8_arg1.platform_index, CoD.CoDAnywhere.COD_ANYWHERE_PLATFORM_TEXT_TYPE_LAST_PLAYED ) )
end
end
function UpdatePlatformTimePlayed( f9_arg0, f9_arg1 )
if f9_arg1.platform_index == nil then
return
end
local f9_local0 = f9_arg0:getParent()
local f9_local1 = f9_local0:getChildById( "platform_time_played" )
if f9_local1 then
f9_local1:setText( CoDAnywhere.GetPlatformDescriptionString( f9_local0.properties.exclusiveController, f9_arg1.platform_index, CoD.CoDAnywhere.COD_ANYWHERE_PLATFORM_TEXT_TYPE_TIME_PLAYED ) )
end
end
function UpdatePlatformSquadMember( f10_arg0, f10_arg1, f10_arg2 )
if f10_arg1.platform_index == nil then
return
end
local f10_local0 = f10_arg0:getParent()
local f10_local1 = f10_local0:getChildById( "platform_squad_member" .. tostring( f10_arg2 ) )
local f10_local2 = ""
if f10_local1 then
f10_local1:setText( Engine.Localize( "@LUA_MENU_CODA_PROFILE_SQUAD_MEMBER" ) .. " " .. f10_arg2 .. ": " .. CoDAnywhere.GetPlatformDescriptionString( f10_local0.properties.exclusiveController, f10_arg1.platform_index, f10_arg2 + 1 ) )
end
end
function UpdatePlatformSquadMemberRank( f11_arg0, f11_arg1, f11_arg2 )
if f11_arg1.platform_index == nil then
return
end
local f11_local0 = f11_arg0:getParent()
local f11_local1 = f11_arg0:getChildById( "platform_squad_member_rank" .. tostring( f11_arg2 ) )
local f11_local2 = "1"
if f11_local1 then
f11_local1:setText( CoDAnywhere.GetPlatformDescriptionString( f11_local0.properties.exclusiveController, f11_arg1.platform_index, f11_arg2 + 11 ) )
end
end
function UpdatePlatformTokensEarned( f12_arg0, f12_arg1 )
if f12_arg1.platform_index == nil then
return
end
local f12_local0 = f12_arg0:getParent()
local f12_local1 = f12_local0:getChildById( "platform_points_avail" )
if f12_local1 then
f12_local1:setText( CoDAnywhere.GetPlatformDescriptionString( f12_local0.properties.exclusiveController, f12_arg1.platform_index, CoD.CoDAnywhere .. COD_ANYWHERE_PLATFORM_TEXT_TYPE_TOKENS_AVAILABLE ) )
end
end
function LeaveChooseCoDAnywherePlatformMenu( f13_arg0, f13_arg1 )
LUI.FlowManager.RequestLeaveMenu( f13_arg0 )
end
function OpenIntroPopup( f14_arg0, f14_arg1 )
LUI.FlowManager.RequestPopupMenu( f14_arg0, "popup_choose_platform_intro", true, f14_arg1.controller )
end
function CoDAnywhereMenuCreate( f15_arg0, f15_arg1 )
f15_arg0:dispatchEventToRoot( {
name = "open_intro",
controller = f15_arg1.controller
} )
end
function OpenCoDAnywhereErrorPopup( f16_arg0, f16_arg1 )
LUI.FlowManager.RequestPopupMenu( f16_arg0, "cod_anywhere_error_popup_menu", true, f16_arg1.controller )
end
function OpenCoDAnywhereSuccessPopup( f17_arg0, f17_arg1 )
LUI.FlowManager.RequestPopupMenu( f17_arg0, "cod_anywhere_success_popup_menu", true, f17_arg1.controller )
end
function SquadMemberBoxFactory( f18_arg0 )
return {
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 1,
right = -1,
top = 114 + f18_arg0 * 32,
bottom = 144 + f18_arg0 * 32,
alpha = 0.1,
material = RegisterMaterial( "white" )
}
}
}
end
function SquadMemberFactory( f19_arg0, f19_arg1 )
return {
type = "UIText",
id = "platform_squad_member" .. tostring( f19_arg0 ),
states = {
default = {
left = -65,
top = -106 + f19_arg0 * 32,
width = 450,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
alpha = 1,
red = Colors.generic_button_text_default_color.r,
green = Colors.generic_button_text_default_color.g,
blue = Colors.generic_button_text_default_color.b
}
},
properties = {
text = Engine.Localize( "@LUA_MENU_CODA_PROFILE_SQUAD_MEMBER" ) .. " " .. f19_arg0 .. ": "
},
handlers = {
update_desc = function ( f20_arg0, f20_arg1 )
UpdatePlatformSquadMember( f20_arg0, f20_arg1, f19_arg0 )
UpdatePlatformSquadMemberRank( f20_arg0, f20_arg1, f19_arg0 )
end
},
children = {
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = true,
material = RegisterMaterial( Rank.GetRankIcon( 22, 0 ) ),
left = -10,
right = 10,
alpha = 1
}
}
},
{
type = "UIText",
id = "platform_squad_member_rank" .. tostring( f19_arg0 ),
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = true,
right = 40,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Right,
alpha = 1
}
},
properties = {
text = ""
}
}
}
}
end
function choose_cod_anywhere_platform()
local f21_local0 = {
type = "UIElement",
id = "choose_cod_anywhere_platform",
handlers = {
menu_create = CoDAnywhereMenuCreate,
open_intro = OpenIntroPopup,
open_cod_anywhere_error_popup = OpenCoDAnywhereErrorPopup,
open_cod_anywhere_success_popup = OpenCoDAnywhereSuccessPopup,
leave_platform_screen = LeaveChooseCoDAnywherePlatformMenu
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
}
}
local f21_local1 = {}
local f21_local2 = {
type = "generic_menu_title",
id = "cod_anywhere_title_text_id",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_COD_ANYWHERE" )
}
}
local f21_local3 = {
type = "generic_menu_background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 135,
bottom = -120,
left = 550,
right = -200
}
}
}
local f21_local4 = {}
local f21_local5 = {
type = "generic_menu_titlebar",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = -30,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "UIText",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 25,
top = 5,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
alpha = 1
}
},
properties = {
text = Engine.Localize( "@LUA_MENU_CODA_PROFILE_TITLE" )
}
}
}
}
local f21_local6 = {
type = "UIText",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
left = 25,
right = 140,
top = 10,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
alpha = 1,
red = Colors.generic_button_text_default_color.r,
green = Colors.generic_button_text_default_color.g,
blue = Colors.generic_button_text_default_color.b
}
},
properties = {
text = Engine.Localize( "@LUA_MENU_CODA_PROFILE_LAST_PLAY" )
},
children = {
{
type = "UIText",
id = "platform_last_played",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = true,
left = 0,
right = 200,
top = 0,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
alpha = 1
}
},
properties = {
text = ""
},
handlers = {
update_desc = UpdatePlatformLastPlayed
}
}
}
}
local f21_local7 = {
type = "UIText",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
left = 25,
right = 145,
top = 43,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
alpha = 1,
red = Colors.generic_button_text_default_color.r,
green = Colors.generic_button_text_default_color.g,
blue = Colors.generic_button_text_default_color.b
}
},
properties = {
text = Engine.Localize( "@LUA_MENU_CODA_PROFILE_TIME_PLAY" )
},
children = {
{
type = "UIText",
id = "platform_time_played",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = true,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
left = 0,
right = 200,
top = 0,
alpha = 1
}
},
properties = {
text = ""
},
handlers = {
update_desc = UpdatePlatformTimePlayed
}
}
}
}
local f21_local8 = {
type = "UIText",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
left = 25,
right = 225,
top = 75,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
alpha = 1,
red = Colors.generic_button_text_default_color.r,
green = Colors.generic_button_text_default_color.g,
blue = Colors.generic_button_text_default_color.b
}
},
properties = {
text = Engine.Localize( "@LUA_MENU_CODA_PROFILE_SQUAD_POINTS" )
},
children = {
{
type = "UIText",
id = "platform_points_avail",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = true,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
left = 15,
right = 200,
top = 0,
alpha = 1
}
},
properties = {
text = ""
},
handlers = {
update_desc = UpdatePlatformTokensEarned
}
},
{
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = true,
material = RegisterMaterial( "icon_unlock_token_32" ),
left = -10,
right = 10,
alpha = 1
}
}
}
}
}
local f21_local9 = {
type = "UIImage",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 1,
right = -1,
top = 112,
bottom = 142,
alpha = 0.2,
material = RegisterMaterial( "white" )
}
}
}
local f21_local10 = {
type = "UIText",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 25,
top = 117,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
alpha = 1
}
},
properties = {
text = Engine.Localize( "@LUA_MENU_CODA_PROFILE_SQUAD_NAME" )
}
}
local f21_local11 = SquadMemberBoxFactory( 2 )
local f21_local12 = SquadMemberBoxFactory( 4 )
local f21_local13 = SquadMemberBoxFactory( 6 )
local f21_local14 = SquadMemberBoxFactory( 8 )
local f21_local15 = SquadMemberBoxFactory( 10 )
f21_local3.children = f21_local5
f21_local4 = SquadMemberFactory( 1 )
f21_local5 = SquadMemberFactory( 2 )
f21_local6 = SquadMemberFactory( 3 )
f21_local7 = SquadMemberFactory( 4 )
f21_local8 = SquadMemberFactory( 5 )
f21_local9 = SquadMemberFactory( 6 )
f21_local10 = SquadMemberFactory( 7 )
f21_local11 = SquadMemberFactory( 8 )
f21_local12 = SquadMemberFactory( 9 )
f21_local13 = SquadMemberFactory( 10 )
f21_local14 = {
type = "choose_cod_anywhere_platform_vlist",
id = "choose_cod_anywhere_platform_vlist_id",
childrenFeeder = CoDAnywherePlatformFeeder
}
f21_local15 = {
type = "button_helper_text_main",
id = "barracks_button_helper_text_id"
}
local f21_local16 = {
type = "UIBindButton",
id = "squad_results_back_id",
handlers = {
button_secondary = LeaveChooseCoDAnywherePlatformMenu
}
}
f21_local1[1] = f21_local2
f21_local1[2] = f21_local3
f21_local1[3] = f21_local4
f21_local1[4] = f21_local5
f21_local1[5] = f21_local6
f21_local1[6] = f21_local7
f21_local1[7] = f21_local8
f21_local1[8] = f21_local9
f21_local1[9] = f21_local10
f21_local1[10] = f21_local11
f21_local1[11] = f21_local12
f21_local1[12] = f21_local13
f21_local1[13] = f21_local14
f21_local1[14] = f21_local15
f21_local1[15] = f21_local16
f21_local0.children = f21_local1
return f21_local0
end
LUI.MenuBuilder.registerDef( "choose_cod_anywhere_platform", choose_cod_anywhere_platform )
LUI.MenuBuilder.registerDef( "choose_cod_anywhere_platform_vlist", choose_cod_anywhere_platform_vlist )
LUI.MenuBuilder.registerDef( "popup_choose_platform_are_you_sure", popup_choose_platform_are_you_sure )
LUI.MenuBuilder.registerDef( "popup_choose_platform_intro", popup_choose_platform_intro )
LockTable( _M )

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,540 @@
LUI.ClanCard = {}
LUI.ClanMembersWindow = InheritFrom( LUI.UIElement )
XP_BAR_WIDTH = 212
LUI.ClanCard.new = function ( f1_arg0, f1_arg1, f1_arg2 )
local f1_local0 = 128
local self = LUI.UIElement.new( CoD.CreateState( 80, 110, 520, 390, CoD.AnchorTypes.TopLeft ) )
self.id = "clan_card_id"
local f1_local2 = LUI.UIElement.new( CoD.CreateState( 0, 0, 0, 180, CoD.AnchorTypes.TopLeftRight ) )
f1_local2.id = "clan_card_top_id"
self:addElement( f1_local2 )
self.cardBG = LUI.UIImage.new( CoD.CreateState( 0, 0, 0, 144, CoD.AnchorTypes.TopLeftRight ) )
f1_local2:addElement( self.cardBG )
local f1_local3 = CoD.CreateState( -130, -10, -80, 40, CoD.AnchorTypes.TopRight )
f1_local3.material = RegisterMaterial( "icon_clan_xp" )
f1_local3.alpha = 0
self.cxpIcon = LUI.UIImage.new( f1_local3 )
self.cxpIcon:registerAnimationState( "visible", {
alpha = 1
} )
self.cxpIcon.id = "clan_card_dcxp_label_id"
f1_local2:addElement( self.cxpIcon )
f1_local3 = CoD.CreateState( -60, 5, -3, 5 + CoD.TextSettings.NormalFont.Height, CoD.AnchorTypes.TopRight )
f1_local3.font = CoD.TextSettings.NormalFont.Font
f1_local3.alignment = LUI.Alignment.Right
CoD.ColorizeState( Colors.primary_text_color, f1_local3 )
f1_local3.alpha = 0
self.cxpText = LUI.UIText.new( f1_local3 )
self.cxpText:registerAnimationState( "visible", {
alpha = 1
} )
self.cxpText.id = "clan_card_dcxp_id"
f1_local2:addElement( self.cxpText )
f1_local3 = CoD.CreateState( 20, 10, -10, -CoD.TextSettings.NormalFont.Height, CoD.AnchorTypes.All )
f1_local3.spacing = 3
local f1_local4 = LUI.UIVerticalList.new( f1_local3 )
f1_local2:addElement( f1_local4 )
f1_local3 = CoD.CreateState( 0, 0, 0, CoD.TextSettings.BigFont.Height, CoD.AnchorTypes.TopLeftRight )
f1_local3.font = CoD.TextSettings.BigFont.Font
f1_local3.alignment = LUI.Alignment.Left
CoD.ColorizeState( Colors.primary_text_color, f1_local3 )
self.clanTag = LUI.UIText.new( f1_local3 )
self.clanTag.id = "clan_card_clan_tag_id"
f1_local4:addElement( self.clanTag )
f1_local3 = CoD.CreateState( 0, 0, 0, CoD.TextSettings.ExtraBigFont.Height, CoD.AnchorTypes.TopLeftRight )
f1_local3.font = CoD.TextSettings.ExtraBigFont.Font
f1_local3.alignment = LUI.Alignment.Left
CoD.ColorizeState( Colors.white, f1_local3 )
self.clanName = LUI.UIMarqueeText.new( f1_local3 )
self.clanName.id = "clan_card_clan_name_id"
f1_local4:addElement( self.clanName )
local f1_local5 = LUI.UIHorizontalList.new( CoD.CreateState( 0, 0, 0, CoD.TextSettings.BigFont.Height, CoD.AnchorTypes.TopLeftRight ) )
f1_local4:addElement( f1_local5 )
local f1_local6, f1_local7, f1_local8, f1_local9 = GetTextDimensions( Engine.Localize( "@LUA_MENU_CLAN_LEVEL" ), CoD.TextSettings.BigFont.Font, CoD.TextSettings.BigFont.Height )
f1_local3 = CoD.CreateState( 0, 0, f1_local8 + 10, CoD.TextSettings.BigFont.Height, CoD.AnchorTypes.TopLeft )
f1_local3.font = CoD.TextSettings.BigFont.Font
f1_local3.alignment = LUI.Alignment.Left
CoD.ColorizeState( Colors.primary_text_color, f1_local3 )
local f1_local10 = LUI.UIText.new( f1_local3 )
f1_local10.id = "clan_card_clan_level_label_id"
f1_local10:setText( Engine.Localize( "@LUA_MENU_CLAN_LEVEL" ) )
f1_local10:setTextStyle( CoD.TextStyle.Shadowed )
f1_local5:addElement( f1_local10 )
f1_local3 = CoD.CreateState( 0, -20, 40, 20, CoD.AnchorTypes.Left )
f1_local3.material = RegisterMaterial( "icon_clan_level_bg" )
local f1_local11 = LUI.UIImage.new( f1_local3 )
f1_local5:addElement( f1_local11 )
f1_local3 = CoD.CreateState( 0, CoD.TextSettings.NormalFont.Height * -0.55, 0, CoD.TextSettings.NormalFont.Height * 0.45, CoD.AnchorTypes.None )
f1_local3.font = CoD.TextSettings.NormalFont.Font
f1_local3.alignment = LUI.Alignment.Center
CoD.ColorizeState( Colors.black, f1_local3 )
self.clanLevelText = LUI.UIText.new( f1_local3 )
self.clanLevelText.id = "clan_card_clan_level_text_id"
f1_local11:addElement( self.clanLevelText )
f1_local4:addElement( LUI.UIElement.new( CoD.CreateState( 0, 0, 0, 5, CoD.AnchorTypes.TopLeftRight ) ) )
LUI.ClanCard.AddLevelProgressBar( f1_local4, self )
f1_local3 = CoD.CreateState( 0, -CoD.TextSettings.NormalFont.Height - 11, 0, -CoD.TextSettings.NormalFont.Height - 10, CoD.AnchorTypes.BottomLeftRight )
f1_local3.material = RegisterMaterial( "white" )
f1_local3.alpha = 0.15
local f1_local12 = LUI.UIImage.new( f1_local3 )
f1_local12.id = "clan_card_motto_horizontal_line_id"
f1_local2:addElement( f1_local12 )
f1_local3 = CoD.CreateState( 10, -CoD.TextSettings.NormalFont.Height - 5, 0, -5, CoD.AnchorTypes.BottomLeftRight )
f1_local3.font = CoD.TextSettings.NormalFont.Font
f1_local3.alignment = LUI.Alignment.Left
CoD.ColorizeState( Colors.primary_text_color, f1_local3 )
self.clanMotto = LUI.UIText.new( f1_local3 )
self.clanMotto.id = "clan_card_clan_motto_id"
f1_local2:addElement( self.clanMotto )
local f1_local13 = LUI.UIElement.new( CoD.CreateState( 0, 190, 0, 0, CoD.AnchorTypes.All ) )
f1_local13.id = "clan_card_stats_group_id"
self:addElement( f1_local13 )
local f1_local14 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
f1_local14.spacing = 4
local f1_local15 = LUI.UIVerticalList.new( f1_local14 )
f1_local15.id = "clan_card_stats_id"
f1_local13:addElement( f1_local15 )
self.kdRatio = LUI.ClanCard.AddClanStat( f1_local15, "clan_kd_id", Engine.Localize( "@LUA_MENU_CLAN_KD_RATIO" ), "Placeholder Value", 260, 160 )
self.winPercent = LUI.ClanCard.AddClanStat( f1_local15, "clan_win_id", Engine.Localize( "@LUA_MENU_CLAN_WIN_PERCENTAGE" ), "Placeholder Value", 260, 160 )
self.memberCount = LUI.ClanCard.AddClanStat( f1_local15, "clan_member_count_id", Engine.Localize( "@LUA_MENU_CLAN_MEMBERS" ), "Placeholder Value", 260, 160 )
self.rewardsEarned = LUI.ClanCard.AddClanStat( f1_local15, "clan_hours_played_id", Engine.Localize( "@LUA_MENU_CLAN_REWARDS" ), "Placeholder Value", 260, 160 )
self:registerEventHandler( "update_clan_card", LUI.ClanCard.FeedContent )
LUI.ClanCard.FeedContent( self, f1_arg1 )
return self
end
LUI.ClanCard.AddClanStat = function ( f2_arg0, f2_arg1, f2_arg2, f2_arg3, f2_arg4, f2_arg5 )
local self = LUI.UIElement.new( CoD.CreateState( 0, 0, 0, 26, CoD.AnchorTypes.TopLeftRight ) )
self.id = f2_arg1
local f2_local1 = CoD.CreateState( 0, 0, -(f2_arg5 + 26), 0, CoD.AnchorTypes.All )
f2_local1.material = RegisterMaterial( "white" )
f2_local1.alpha = 0.15
CoD.ColorizeState( Colors.black, f2_local1 )
local f2_local2 = LUI.UIImage.new( f2_local1 )
f2_local2.id = "clan_card_stat_base_left_bg_id"
self:addElement( f2_local2 )
f2_local1 = CoD.CreateState( -f2_arg5, 0, 0, 0, CoD.AnchorTypes.TopBottomRight )
f2_local1.material = RegisterMaterial( "white" )
f2_local1.alpha = 0.05
CoD.ColorizeState( Colors.white, f2_local1 )
local f2_local3 = LUI.UIImage.new( f2_local1 )
f2_local3.id = "clan_card_stat_base_right_bg_id"
self:addElement( f2_local3 )
f2_local1 = CoD.CreateState( -(f2_arg5 + 26), 0, -f2_arg5, 0, CoD.AnchorTypes.TopBottomRight )
f2_local1.material = RegisterMaterial( "box_stat_cap" )
f2_local1.alpha = 0.15
f2_local1.zRot = 180
CoD.ColorizeState( Colors.black, f2_local1 )
local f2_local4 = LUI.UIImage.new( f2_local1 )
f2_local4.id = "clan_card_stat_base_left_cap_id"
self:addElement( f2_local4 )
f2_local1 = CoD.CreateState( -(f2_arg5 + 26), 0, -f2_arg5, 0, CoD.AnchorTypes.TopBottomRight )
f2_local1.material = RegisterMaterial( "box_stat_cap" )
f2_local1.alpha = 0.05
CoD.ColorizeState( Colors.white, f2_local1 )
local f2_local5 = LUI.UIImage.new( f2_local1 )
f2_local5.id = "clan_card_stat_base_right_cap_id"
self:addElement( f2_local5 )
f2_local1 = CoD.CreateState( 5, -CoD.TextSettings.NormalFont.Height * 0.5, f2_arg4, CoD.TextSettings.NormalFont.Height * 0.5, CoD.AnchorTypes.Left )
f2_local1.font = CoD.TextSettings.NormalFont.Font
f2_local1.alignment = LUI.Alignment.Left
CoD.ColorizeState( Colors.primary_text_color, f2_local1 )
local f2_local6 = LUI.UIText.new( f2_local1 )
f2_local6.id = "clan_card_stat_label_id"
f2_local6:setText( f2_arg2 )
self:addElement( f2_local6 )
f2_local1 = CoD.CreateState( -f2_arg5, -CoD.TextSettings.NormalFont.Height * 0.5, -5, CoD.TextSettings.NormalFont.Height * 0.5, CoD.AnchorTypes.Right )
f2_local1.font = CoD.TextSettings.NormalFont.Font
f2_local1.alignment = LUI.Alignment.Right
CoD.ColorizeState( Colors.white, f2_local1 )
local f2_local7 = LUI.UIText.new( f2_local1 )
f2_local7.id = "clan_card_stat_value_id"
f2_local7:setText( f2_arg3 )
self:addElement( f2_local7 )
f2_arg0:addElement( self )
return f2_local7
end
LUI.ClanCard.AddLevelProgressBar = function ( f3_arg0, f3_arg1 )
local f3_local0 = 400
local f3_local1 = 10
local self = LUI.UIElement.new( CoD.CreateState( 0, 0, f3_local0, f3_local1 + CoD.TextSettings.SmallFont.Height + 3, CoD.AnchorTypes.TopLeft ) )
self.id = "ClanCard_level_bar_container_id"
local f3_local3 = CoD.CreateState( 0, 0, 0, f3_local1, CoD.AnchorTypes.TopLeftRight )
CoD.ColorizeState( Colors.black, f3_local3 )
local f3_local4 = LUI.UIImage.new( f3_local3 )
f3_local4.id = "ClanCard_level_bar_bg_id"
self:addElement( f3_local4 )
f3_local4:addElement( LUI.MenuGenerics.generic_border( {}, {} ) )
f3_local3 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.TopBottomLeft )
f3_local3.material = RegisterMaterial( "btn_cas_fill_f" )
local f3_local5 = LUI.UIImage.new( {
f3_local3
} )
f3_local5.id = "ClanCard_level_bar_id"
f3_local5.maxWidth = f3_local0 - 1
f3_local4:addElement( f3_local5 )
f3_local3 = CoD.CreateState( 0, -CoD.TextSettings.SmallFont.Height, 0, 0, CoD.AnchorTypes.BottomLeftRight )
f3_local3.font = CoD.TextSettings.SmallFont.Font
f3_local3.alignment = LUI.Alignment.Right
local f3_local6 = LUI.UIText.new( f3_local3 )
f3_local6.id = "clan_card_xp_to_next_id"
self:addElement( f3_local6 )
f3_arg1.XPFillBar = f3_local5
f3_arg1.xpToNextText = f3_local6
f3_arg0:addElement( self )
end
LUI.ClanCard.FeedContent = function ( f4_arg0, f4_arg1 )
if not f4_arg1 then
f4_arg1 = {}
end
if f4_arg1.clan_background then
f4_arg0.cardBG:setImage( RegisterMaterial( f4_arg1.clan_background ) )
end
if f4_arg1.clan_name then
f4_arg0.clanName:setText( f4_arg1.clan_name )
f4_arg0.clanName:setTextStyle( CoD.TextStyle.Shadowed )
end
if f4_arg1.clan_tag then
f4_arg0.clanTag:setText( f4_arg1.clan_tag )
f4_arg0.clanTag:setTextStyle( CoD.TextStyle.Shadowed )
end
if f4_arg1.clan_level and f4_arg1.current_xp and f4_arg1.xp_to_next then
f4_arg0.clanLevelText:setText( f4_arg1.clan_level )
if f4_arg1.xp_to_next > 0 then
f4_arg0.xpToNextText:setText( Engine.Localize( "@CLANS_XP_TO_NEXT", f4_arg1.xp_to_next ) )
else
f4_arg0.xpToNextText:setText( Engine.Localize( "@CLANS_MAX_LEVEL" ) )
end
end
if f4_arg1.next_level_progress then
f4_arg0.XPFillBar:registerAnimationState( "default", {
top = 1,
bottom = -1,
left = 1,
right = f4_arg1.next_level_progress * f4_arg0.XPFillBar.maxWidth,
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
material = RegisterMaterial( "btn_cas_fill_f" )
} )
f4_arg0.XPFillBar:animateToState( "default", 0 )
end
if f4_arg1.clan_motto then
f4_arg0.clanMotto:setText( f4_arg1.clan_motto )
end
if f4_arg1.kd_ratio then
f4_arg0.kdRatio:setText( f4_arg1.kd_ratio )
end
if f4_arg1.win_percent then
f4_arg0.winPercent:setText( f4_arg1.win_percent )
end
if f4_arg1.member_count then
f4_arg0.memberCount:setText( f4_arg1.member_count )
end
if f4_arg1.reward_count then
f4_arg0.rewardsEarned:setText( f4_arg1.reward_count )
end
if f4_arg1.hours_played then
f4_arg0.hoursPlayed:setText( f4_arg1.hours_played )
end
if f4_arg1.session_cxp then
f4_arg0.sessionCXP:setText( f4_arg1.session_cxp )
end
if f4_arg1.cxp_time and f4_arg1.cxp_time > 0 then
local f4_local0 = f4_arg1.cxp_time
local f4_local1 = math.floor( f4_local0 / 3600 )
f4_local0 = f4_local0 % 3600
f4_arg0.cxpText:setText( string.format( "%02d:%02d:%02d", f4_local1, math.floor( f4_local0 / 60 ), f4_local0 % 60 ) )
f4_arg0.cxpIcon:animateToState( "visible", 0 )
f4_arg0.cxpText:animateToState( "visible", 0 )
end
end
LUI.ClanMembersWindow.new = function ( f5_arg0, f5_arg1, f5_arg2 )
local self = LUI.UIElement.new()
self.id = "ClanMembersWindow"
if not f5_arg1 then
f5_arg1 = {}
end
local f5_local1 = f5_arg1.char_window_dims
if not f5_local1 then
f5_local1 = {
left = 0,
top = 0,
right = 0,
bottom = 0
}
end
f5_arg1.char_window_dims = f5_local1
f5_local1 = f5_arg1.controller
if not f5_local1 then
DebugPrint( "WARNING: Using ClanMembersWindow without specifying controller. Defaulting to first active controller" )
f5_local1 = Engine.GetFirstActiveController()
end
self.controller = f5_local1
local charWindow = LUI.UICharacterWindow.new()
charWindow.id = "clan_member_char_window_id"
charWindow:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = f5_arg1.char_window_dims.top,
bottom = f5_arg1.char_window_dims.bottom,
left = f5_arg1.char_window_dims.left,
right = f5_arg1.char_window_dims.right
} )
charWindow:animateToState( "default" )
charWindow:registerEventHandler( "make_scene", LUI.ClanMembersWindow.InitCharacterWindow )
charWindow:registerEventHandler( "animLooped", function ( element, event )
LUI.ClanMembersWindow.DoAnimChange( element, event )
end )
charWindow:registerEventHandler( "animEnded", function ( element, event )
LUI.ClanMembersWindow.DoAnimChange( element, event )
end )
local f5_local3 = LUI.UITimer.new( 50, "make_scene" )
f5_local3.id = "createSceneTimer"
charWindow:addElement( f5_local3 )
self:addElement( charWindow )
self.charWindow = charWindow
LUI.ClanMembersWindow.AddLoadingWidget( charWindow, f5_arg1.loadingOffset )
self.close = function ()
LUI.ClanMembersWindow.Shutdown( self, event )
LUI.UIElement.close( self )
end
self.closeTree = function ()
LUI.ClanMembersWindow.Shutdown( self, event )
LUI.UIElement.closeTree( self )
end
self.characterHandles = {}
return self
end
LUI.ClanMembersWindow.InitCharacterWindow = function ( f10_arg0, f10_arg1 )
if not CharacterScene.IsReady() then
return
end
local f10_local0 = f10_arg0:getParent()
if not f10_local0 or not f10_local0.modelData then
return
end
f10_arg0:closeChildren()
local f10_local1 = f10_local0.properties
CharacterScene.SetVisionSet( "mp_character_room" )
CharacterScene.SetFOV( 43 )
CharacterScene.SetAmbient( 0, 0, 0 )
f10_arg0.anim_states = {}
for f10_local2 = 1, 3, 1 do
local f10_local5 = f10_local0.modelData[f10_local2]
if f10_local5 and f10_local5.hasPlatformInfo then
local f10_local6 = f10_local5.bodyModel
if not f10_local6 then
f10_local6 = Cac.GetDefaultBodyModel( f10_local0.controller )
end
f10_local6 = string.sub( f10_local6, 0, -6 ) .. "elite"
local f10_local7 = f10_local5.headModel
if not f10_local7 then
f10_local7 = Cac.GetDefaultHeadModel( f10_local0.controller )
end
if Engine.TableLookup( "mp/cac/helmets.csv", 0, f10_local7, 4 ) == "1" and string.find( f10_local7, "alt", -4 ) ~= nil then
f10_local7 = string.sub( f10_local7, 0, -4 ) .. "alt_f"
end
local f10_local8 = "iw6_kriss_mp"
if f10_local5.weaponName and f10_local5.weaponName ~= "" then
local f10_local9 = 0
if f10_local5.camoName then
f10_local9 = tonumber( Cac.GetCamoWeaponIndex( f10_local5.camoName ) )
end
f10_local8 = Cac.BuildWeaponName( f10_local5.weaponName, f10_local5.attachName1, f10_local5.attachName2, f10_local9, 0, f10_local5.attachName3 )
end
local f10_local9 = CharacterScene.CreateCharacter( "clan_model_" .. f10_local2, f10_local6, f10_local7, f10_local8 )
CharacterScene.SetSpin( f10_local9, 0, 0, 0 )
CharacterScene.SetBlendedRotation( f10_local9, 0, 0, 0, 0 )
if f10_local1 and f10_local1.character_pos then
CharacterScene.SetCharacterUVs( f10_local9, 0, 0, 1, 1 )
CharacterScene.PositionRelativeToCamera( f10_local9, f10_local1.character_pos[f10_local2][1], f10_local1.character_pos[f10_local2][2], f10_local1.character_pos[f10_local2][3] )
end
f10_local0.characterHandles[f10_local2] = f10_local9
f10_arg0.anim_states[f10_local2] = {
anim_name = Cac.GetRandomIdleAnim( f10_local8 ),
weapon_name = f10_local8
}
LUI.ClanMembersWindow.SetAnimation( f10_arg0:getParent(), f10_local0.characterHandles[f10_local2], f10_arg0.anim_states[f10_local2].anim_name, 0.2 )
else
local f10_local7 = CharacterScene.CreateCharacter( "clan_model_" .. f10_local2, "prop_dogtags_friend_iw6" )
CharacterScene.SetSpin( f10_local7, 0, 5, 0 )
if f10_local1 and f10_local1.character_pos then
CharacterScene.SetCharacterUVs( f10_local7, 0, 0, 1, 1 )
CharacterScene.PositionRelativeToCamera( f10_local7, f10_local1.character_pos[f10_local2][1], f10_local1.character_pos[f10_local2][2], f10_local1.character_pos[f10_local2][3] )
end
f10_local0.characterHandles[f10_local2] = f10_local7
end
f10_arg0:setCharacterHandle( f10_local0.characterHandles[f10_local2] )
end
end
LUI.ClanMembersWindow.Shutdown = function ( f11_arg0, f11_arg1 )
for f11_local0 = 1, #f11_arg0.characterHandles, 1 do
CharacterScene.FreeCharacter( f11_arg0.characterHandles[f11_local0] )
end
f11_arg0.characterHandles = {}
f11_arg0.modelData = nil
end
LUI.ClanMembersWindow.SetAnimation = function ( f12_arg0, f12_arg1, f12_arg2, f12_arg3 )
if not CharacterScene.IsReady() then
return
elseif f12_arg1 then
CharacterScene.PlayAnim( f12_arg1, f12_arg2, f12_arg3 )
end
end
LUI.ClanMembersWindow.AddLoadingWidget = function ( f13_arg0, f13_arg1 )
f13_arg0:addElement( LUI.MenuBuilder.buildItems( {
type = "generic_loading_widget",
id = "loading_widget_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = f13_arg1 or 0,
right = f13_arg1 or 0
}
},
properties = {
message = Engine.Localize( "@MENU_LOADING_DOTS" )
}
}, {}, f13_arg0 ) )
end
LUI.ClanMembersWindow.DoAnimChange = function ( f14_arg0, f14_arg1 )
local f14_local0 = f14_arg0:getParent()
local f14_local1 = nil
for f14_local2 = 1, 3, 1 do
if f14_local0.characterHandles[f14_local2] == f14_arg1.objectHandle then
f14_local1 = f14_local2
break
end
end
if f14_local1 and f14_arg0.anim_states[f14_local1] then
local f14_local2 = f14_arg0.anim_states[f14_local1]
f14_local2.anim_name = Cac.GetRandomIdleAnim( f14_local2.weapon_name, f14_local2.anim_name )
LUI.ClanMembersWindow.SetAnimation( f14_local0, f14_arg1.objectHandle, f14_local2.anim_name, 0.2 )
end
end
function clan_not_in_clan_popup()
return {
type = "generic_selectionList_popup",
properties = {
popup_title = Engine.Localize( "@CLANS_NOT_IN_CLAN_HEADER_CAPS" ),
popup_childfeeder = function ()
return {
{
type = "UIElement",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
height = 10
}
}
},
{
type = "UIText",
id = "clan_popup_desc_text_id",
properties = {
text = Engine.Localize( "@CLANS_NOT_IN_CLAN_TEXT" )
},
states = {
default = {
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = CoD.TextSettings.NormalFont.Height,
red = 1,
green = 1,
blue = 1
}
}
},
{
type = "UIElement",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
height = 10
}
}
},
{
type = "UIGenericButton",
id = "create_clan_button_id",
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
text = Engine.Localize( "@CLANS_CREATE_CLAN" ),
button_action_func = function ( f17_arg0, f17_arg1 )
if CoDAnywhere.ShouldShowLinkCreatePopup( f17_arg1.controller, true ) == true then
LUI.FlowManager.RequestPopupMenu( f17_arg0, "cod_anywhere_popup_menu", true, f17_arg1.controller )
elseif CoDAnywhere.ShouldShowLinkUCDPopup( f17_arg1.controller, true ) == true then
LUI.FlowManager.RequestPopupMenu( f17_arg0, "cod_anywhere_link_ucd_popup_menu", true, f17_arg1.controller )
else
Clan.Create( f17_arg1.controller )
end
LUI.FlowManager.RequestLeaveMenu( f17_arg0 )
end
}
},
{
type = "UIGenericButton",
id = "cancel_button_id",
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
text = Engine.Localize( "@LUA_MENU_CANCEL" ),
button_action_func = function ( f18_arg0, f18_arg1 )
LUI.FlowManager.RequestLeaveMenu( f18_arg0 )
end
}
}
}
end
}
}
end
LUI.MenuBuilder.registerDef( "clan_not_in_clan_popup", clan_not_in_clan_popup )
LUI.MenuBuilder.registerType( "ClanCard", LUI.ClanCard.new )
LUI.MenuBuilder.registerType( "ClanMembersWindow", LUI.ClanMembersWindow.new )

View File

@@ -0,0 +1,620 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
ClanInvites = {
leftPadding = 28
}
function OnCreate( f1_arg0, f1_arg1 )
local f1_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f1_arg0 )
f1_local0.inviteCount = Clan.GetNumProposals( f1_arg1.controller )
f1_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function AcceptClanInvite( f2_arg0, f2_arg1 )
Clan.AcceptClanProposal( f2_arg1.controller, f2_arg0.properties.index )
LUI.FlowManager.RequestLeaveMenu( f2_arg0 )
f2_arg0:dispatchEventToRoot( {
name = "leave_clan_invites",
immediate = true
} )
end
function DeclineClanInvite( f3_arg0, f3_arg1 )
local f3_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "clan_invites" )
Clan.DeclineClanProposal( f3_arg1.controller, f3_arg0.properties.index )
LUI.FlowManager.RequestLeaveMenu( f3_arg0 )
f3_local0.inviteCount = f3_local0.inviteCount - 1
if f3_local0.inviteCount == 0 then
f3_arg0:dispatchEventToRoot( {
name = "leave_clan_invites",
immediate = true
} )
end
end
function ClanInviteDecisionFeeder( f4_arg0, f4_arg1 )
local f4_local0 = {
[#f4_local0 + 1] = {
type = "UIGenericButton",
id = "invite",
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
button_text = Engine.Localize( "@LUA_MENU_CLAN_ACCEPT_INVITATION" ),
index = f4_arg0.index,
button_action_func = AcceptClanInvite
}
},
[#f4_local0 + 1] = {
type = "UIGenericButton",
id = "join",
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
button_text = Engine.Localize( "@LUA_MENU_CLAN_DECLINE_INVITATION" ),
index = f4_arg0.index,
button_action_func = DeclineClanInvite
}
}
}
return f4_local0
end
function popup_invite_decision()
return {
type = "generic_selectionList_popup",
id = "popup_invite_decision",
properties = {
popup_title = Engine.Localize( "@LUA_MENU_CLAN_INVITE_CAPS" ),
popup_childfeeder = ClanInviteDecisionFeeder
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
}
}
end
function InviteDecision( f6_arg0, f6_arg1 )
LUI.FlowManager.RequestPopupMenu( f6_arg0, "popup_invite_decision", true, f6_arg1.controller, false, {
index = f6_arg0.properties.index
} )
end
function ClanInviteFeeder( f7_arg0 )
local f7_local0 = {}
local f7_local1 = Clan.GetNumProposals( f7_arg0.exclusiveController )
for f7_local2 = 0, f7_local1 - 1, 1 do
local f7_local5 = {
type = "UIGenericButton",
id = "clan_invite_button_" .. f7_local2
}
local f7_local6 = {
button_text = Engine.Localize( "PATCH_MENU_INVITE_NUMBER", f7_local2 + 1 ),
index = f7_local2,
button_action_func = InviteDecision
}
local f7_local7 = MBh.DoMultiple
local f7_local8 = {}
local f7_local9 = MBh.EmitEventToRoot( {
name = "update_clan_name",
newName = Clan.GetProposalClanName( f7_arg0.exclusiveController, f7_local2 ),
immediate = true
} )
local f7_local10 = MBh.EmitEventToRoot( {
name = "update_clan_level",
newLevel = Clan.GetProposalClanLevel( f7_arg0.exclusiveController, f7_local2 ),
immediate = true
} )
local f7_local11 = MBh.EmitEventToRoot( {
name = "update_clan_leader",
newLeader = Clan.GetProposalClanLeaderName( f7_arg0.exclusiveController, f7_local2 ),
immediate = true
} )
local f7_local12 = MBh.EmitEventToRoot( {
name = "update_clan_kd",
newKD = Clan.GetProposalClanKD( f7_arg0.exclusiveController, f7_local2 ),
immediate = true
} )
local f7_local13 = MBh.EmitEventToRoot( {
name = "update_clan_member_count",
newMemberCount = Clan.GetProposalClanMemberCount( f7_arg0.exclusiveController, f7_local2 ),
immediate = true
} )
local f7_local14 = MBh.EmitEventToRoot( {
name = "update_clan_message",
newMessage = Clan.GetProposalMessage( f7_arg0.exclusiveController, f7_local2 ),
immediate = true
} )
f7_local6.button_over_func = f7_local7( f7_local9 )
f7_local5.properties = f7_local6
f7_local0[#f7_local0 + 1] = f7_local5
end
return f7_local0
end
function clan_invite_vlist()
return {
type = "UIVerticalList",
focusable = true,
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
handlers = {
close_actions = function ( f9_arg0, f9_arg1 )
f9_arg0:closeChildren()
f9_arg0:dispatchEventToRoot( {
name = "menu_refresh",
immediate = true
} )
f9_arg0:processEvent( {
name = "gain_focus"
} )
end
}
}
end
function LeaveClanInviteMenu( f10_arg0, f10_arg1 )
LUI.FlowManager.RequestLeaveMenu( f10_arg0 )
end
function UpdateClanName( f11_arg0, f11_arg1 )
assert( f11_arg1.newName )
f11_arg0:setText( f11_arg1.newName )
end
function UpdateClanLevel( f12_arg0, f12_arg1 )
assert( f12_arg1.newLevel )
f12_arg0:setText( f12_arg1.newLevel )
end
function UpdateClanLeader( f13_arg0, f13_arg1 )
assert( f13_arg1.newLeader )
f13_arg0:setText( f13_arg1.newLeader )
end
function UpdateClanKD( f14_arg0, f14_arg1 )
assert( f14_arg1.newKD )
f14_arg0:processEvent( {
name = "update_stat_text",
newStatText = f14_arg1.newKD
} )
end
function UpdateClanMemberCount( f15_arg0, f15_arg1 )
assert( f15_arg1.newMemberCount )
f15_arg0:processEvent( {
name = "update_stat_text",
newStatText = f15_arg1.newMemberCount
} )
end
function UpdateClanMessage( f16_arg0, f16_arg1 )
assert( f16_arg1.newMessage )
f16_arg0:setText( f16_arg1.newMessage )
end
function ClanInvitesInfoFeeder( f17_arg0 )
local f17_local0 = {
[#f17_local0 + 1] = {
type = "UIMarqueeText",
id = "clan_name",
properties = {
text = "",
defaultAnimationState = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = ClanInvites.leftPadding,
top = 0,
right = -28,
height = CoD.TextSettings.ExtraBigFont.Height,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Left
}
},
handlers = {
update_clan_name = UpdateClanName
}
},
[#f17_local0 + 1] = {
type = "UIElement",
id = "clan_level_container",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
top = 0,
right = 0,
bottom = CoD.TextSettings.NormalFont.Height
}
},
children = {
{
type = "UIText",
id = "clan_level_text",
states = {
default = CoD.ColorizeState( Colors.grey_5, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = ClanInvites.leftPadding,
top = 0,
right = 0,
height = CoD.TextSettings.BoldFont.Height,
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.Left
} )
},
properties = {
text = Engine.Localize( "PATCH_MENU_CLAN_LEVEL_COLON_CAPS" )
}
},
{
type = "UIElement",
id = "clan_level_icon_container",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = ClanInvites.leftPadding + 110,
top = 0,
right = ClanInvites.leftPadding + 154,
bottom = 0
}
},
children = {
{
type = "UIImage",
id = "clan_level_icon",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
top = -10,
right = 0,
height = 44,
material = RegisterMaterial( "icon_clan_level_bg" )
}
}
},
{
type = "UIText",
id = "clan_level_number",
states = {
default = CoD.ColorizeState( Colors.black, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
top = 0,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center
} )
},
properties = {
text = ""
},
handlers = {
update_clan_level = UpdateClanLevel
}
}
}
}
}
},
[#f17_local0 + 1] = {
type = "UIElement",
id = "clan_leader_container",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
top = 0,
right = 0,
bottom = CoD.TextSettings.NormalFont.Height
}
},
children = {
{
type = "UIMarqueeText",
id = "clan_leader_text",
states = {
default = CoD.ColorizeState( Colors.grey_5, {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = ClanInvites.leftPadding,
top = 0,
right = 170,
height = CoD.TextSettings.BoldFont.Height,
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.Left
} )
},
properties = {
text = Engine.Localize( "PATCH_MENU_CLAN_LEADER_COLON_CAPS" )
}
},
{
type = "UIMarqueeText",
id = "clan_leader_name",
states = {
default = CoD.ColorizeState( Colors.frontend_hilite, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = ClanInvites.leftPadding + 142,
top = 0,
right = -28,
bottom = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left
} )
},
properties = {
text = ""
},
handlers = {
update_clan_leader = UpdateClanLeader
}
}
}
},
[#f17_local0 + 1] = {
type = "UIElement",
id = "clan_stats_container",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = ClanInvites.leftPadding - 10,
top = 0,
right = -28,
bottom = 50
}
},
children = {
{
type = "aar_stats_widget",
id = "kd_stats_widget",
properties = {
label_text = Engine.Localize( "@LUA_MENU_CLAN_KD_RATIO" ),
stat_text = "",
stat_text_r = Colors.white.r,
stat_text_g = Colors.white.g,
stat_text_b = Colors.white.b,
label_text_r = Colors.white.r,
label_text_g = Colors.white.g,
label_text_b = Colors.white.b,
stat_text_indent = 235
},
handlers = {
update_clan_kd = UpdateClanKD
}
},
{
type = "aar_stats_widget",
id = "members_stats_widget",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 26,
bottom = 50
}
},
properties = {
label_text = Engine.Localize( "@PATCH_MENU_MEMBERS" ),
stat_text = "",
stat_text_r = Colors.white.r,
stat_text_g = Colors.white.g,
stat_text_b = Colors.white.b,
label_text_r = Colors.white.r,
label_text_g = Colors.white.g,
label_text_b = Colors.white.b,
stat_text_indent = 235
},
handlers = {
update_clan_member_count = UpdateClanMemberCount
}
}
}
},
[#f17_local0 + 1] = {
type = "UIStencil",
id = "clan_message_stencil",
states = {
default = CoD.ColorizeState( Colors.white, {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = ClanInvites.leftPadding,
top = 0,
right = 412,
height = CoD.TextSettings.NormalFont.Height * 8
} )
},
children = {
{
type = "UIMarqueeText",
id = "clan_message",
states = {
default = CoD.ColorizeState( Colors.white, {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
top = 0,
right = 0,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left
} )
},
properties = {
text = ""
},
handlers = {
update_clan_message = UpdateClanMessage
}
}
}
}
}
return f17_local0
end
function clan_invites()
return {
type = "UIElement",
id = "clan_invites",
handlers = {
menu_create = OnCreate,
leave_clan_invites = MBh.LeaveMenu()
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "generic_menu_title",
id = "clan_invites_title_id",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_CLAN_CLAN_INVITES_CAPS" )
}
},
{
type = "UIElement",
id = "clan_invites_info_container",
states = {
default = {
left = -100,
top = -250,
width = 440,
height = 536
}
},
children = {
{
type = "generic_menu_titlebar",
id = "clan_invites_title",
properties = {
font = CoD.TextSettings.BoldFont,
title_bar_text = Engine.Localize( "CLANS_CLAN_DETAILS_CAPS" ),
title_bar_text_indent = GenericTitleBarDims.TitleBarLCapWidth,
title_bar_alignment = LUI.Alignment.Left
}
},
{
type = "generic_menu_background_withfade",
id = "clan_invites_background",
properties = {
shadow_alpha = 0.6,
fill_alpha = 0.8
}
},
{
type = "UIVerticalList",
id = "clan_invites_content",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = GenericTitleBarDims.TitleBarHeight + 5,
bottom = 0,
left = 1,
right = -1,
spacing = 20
}
},
childrenFeeder = ClanInvitesInfoFeeder
}
}
},
{
type = "clan_invite_vlist",
id = "clan_invite_list",
childrenFeeder = ClanInviteFeeder
},
{
type = "button_helper_text_main",
id = "clans_button_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
},
{
type = "UIBindButton",
id = "squad_results_back_id",
handlers = {
button_secondary = LeaveClanInviteMenu
}
}
}
}
end
LUI.MenuBuilder.registerDef( "clan_invites", clan_invites )
LUI.MenuBuilder.registerDef( "clan_invite_vlist", clan_invite_vlist )
LUI.MenuBuilder.registerDef( "popup_invite_decision", popup_invite_decision )
LockTable( _M )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,923 @@
LUI.UISquadMemberWindow = InheritFrom( LUI.UIElement )
LUI.UISquadMemberWindow.build = function ( f1_arg0, f1_arg1 )
return LUI.UISquadMemberWindow.new( f1_arg1 )
end
LUI.UISquadMemberWindow.new = function ( f2_arg0 )
local self = LUI.UIElement.new()
self.id = "UISquadMemberWindow"
self.setDisplayName = LUI.UISquadMemberWindow.SetDisplayName
self.setPrestigeIcon = LUI.UISquadMemberWindow.SetPrestigeIcon
self.moveTo = LUI.UISquadMemberWindow.MoveTo
self.setCharacterAnim = LUI.UISquadMemberWindow.SetAnimation
self.setBackground = LUI.UISquadMemberWindow.SetBackground
self.updateSquadMember = LUI.UISquadMemberWindow.UpdateSavedCharacterWindow
self.updateCharacter = LUI.UISquadMemberWindow.UpdateCharacterWindow
assert( f2_arg0, "UISquadMemberWindow requires a properties table. At the very least, you must specify char_window_dims, uv_values, and character_pos" )
if not f2_arg0 then
f2_arg0 = {
char_window_dims = {
top = 0,
bottom = 0,
left = 0,
right = 0
}
}
end
self.squadMemberIndex = f2_arg0.squad_member_index
self.loadoutSlot = f2_arg0.loadout_slot
local f2_local1 = f2_arg0.squad_location
if not f2_local1 then
DebugPrint( "WARNING: Using UISquadMemberWindow without specifying squad_location. Defaulting to privateMatchSquadMembers" )
f2_local1 = "privateMatchSquadMembers"
end
self.squadLocation = f2_local1
local f2_local2 = f2_arg0.controller
if not f2_local2 then
DebugPrint( "WARNING: Using UISquadMemberWindow without specifying controller. Defaulting to first active controller" )
f2_local2 = Engine.GetFirstActiveController()
end
self.controller = f2_local2
if f2_arg0.use_background then
local charWindow = f2_arg0.mask_pos_data
if not charWindow then
charWindow = {
left = 0,
top = 0,
right = 0,
bottom = 0
}
end
local f2_local4 = f2_arg0.mask_dims_data
if not f2_local4 then
f2_local4 = {
width = 512,
height = 512
}
end
self.background_mask = LUI.UIImage.new( {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = charWindow.top,
left = charWindow.left,
width = f2_local4.width,
height = f2_local4.height,
material = RegisterMaterial( "img_bg_alpha_stencil" ),
alpha = 1
} )
self.background_mask:setUseStencil( true )
self.background_mask.id = "member_window_background_mask_id"
self:addElement( self.background_mask )
local f2_local5 = f2_arg0.bg_anchor_data
if not f2_local5 then
f2_local5 = {
left = true,
top = true,
right = true,
bottom = true
}
end
local f2_local6 = f2_arg0.bg_pos_data
if not f2_local6 then
f2_local6 = {
left = 1,
top = 1,
right = -1,
bottom = -1
}
end
self.background = LUI.UIImage.new( {
left = f2_local6.left,
top = f2_local6.top,
right = f2_local6.right,
bottom = f2_local6.bottom,
leftAnchor = f2_local5.left,
topAnchor = f2_local5.top,
rightAnchor = f2_local5.right,
bottomAnchor = f2_local5.bottom,
alpha = 1
} )
self.background.id = "member_window_background_id"
self.background:registerAnimationState( "hidden", {
alpha = 0
} )
self.background:animateToState( "hidden", 0 )
self.background:registerEventHandler( "update_character_bg", function ( element, event )
if event.material then
element:setImage( event.material )
element:animateToState( "default", 0 )
end
end )
self.background_mask:addElement( self.background )
end
if f2_arg0.use_border then
local f2_local4 = LUI.MenuBuilder.buildItems( {
type = "generic_border",
id = "member_window_bg_border_id",
properties = {
thickness = 1,
border_red = 1,
border_green = 1,
border_blue = 1,
border_alpha = 0.5
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.2
}
}
}, f2_arg0, self )
f2_local4:registerAnimationState( "focused", {
alpha = 0.4
} )
f2_local4:registerAnimationState( "hidden", {
alpha = 0
} )
f2_local4:registerEventHandler( "set_border_state", function ( element, event )
element:animateToState( event.border_state )
end )
self:addElement( f2_local4 )
end
if f2_arg0.use_3d_model and f2_arg0.use_2d_character_image then
DebugPrint( "ERROR: Both use_3d_model and use_2d_character_image are set to true! Defaulting to using the 2d model." )
f2_arg0.use_3d_model = false
end
if f2_arg0.use_3d_model ~= false then
local charWindow = LUI.UICharacterWindow.new()
charWindow.id = "member_window_character_id"
charWindow:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = f2_arg0.char_window_dims.top,
bottom = f2_arg0.char_window_dims.bottom,
left = f2_arg0.char_window_dims.left,
right = f2_arg0.char_window_dims.right,
red = 1,
green = 1,
blue = 1,
alpha = 1
} )
charWindow:registerAnimationState( "silhouette", {
red = 0,
green = 0,
blue = 0,
alpha = 1
} )
charWindow:registerAnimationState( "hidden", {
red = 0,
green = 0,
blue = 0,
alpha = 0
} )
charWindow:animateToState( "default" )
charWindow:registerEventHandler( "make_scene", LUI.UISquadMemberWindow.InitCharacterWindow )
charWindow:registerEventHandler( "set_silhouette", function ( element, event )
element:animateToState( "silhouette", event.anim_length or 0 )
end )
charWindow:registerEventHandler( "set_normal", function ( element, event )
element:animateToState( "default", event.anim_length or 0 )
end )
charWindow:registerEventHandler( "hide_character", function ( element, event )
element:animateToState( "hidden", event.anim_length or 0 )
end )
charWindow:registerEventHandler( "animLooped", LUI.UISquadMemberWindow.ChangeAnimOnLoopedEnd )
charWindow:registerEventHandler( "animEnded", LUI.UISquadMemberWindow.ChangeAnimOnEnd )
charWindow:registerEventHandler( "weapon_changed", LUI.UISquadMemberWindow.WeaponChangeAnim )
charWindow:registerEventHandler( "weapon_changed_stowed", LUI.UISquadMemberWindow.WeaponChangeStowed )
charWindow:registerEventHandler( "idle_changed", LUI.UISquadMemberWindow.IdleChangeAnim )
charWindow:registerEventHandler( "gamepad_sticks", LUI.UISquadMemberWindow.RightStickSpin )
charWindow:registerEventHandler( "leftmousedown", function ( element, event )
end )
charWindow:registerEventHandler( "leftmouseup", function ( element, event )
local f9_local0 = element:getParent()
CharacterScene.SetSpin( f9_local0.handle, 0, 0, 0 )
end )
charWindow:registerEventHandler( "mousemove", LUI.UISquadMemberWindow.PCSpin )
charWindow:setHandleMouseButton( true )
local f2_local4 = LUI.UITimer.new( 50, "make_scene" )
f2_local4.id = "createSceneTimer"
charWindow:addElement( f2_local4 )
self:addElement( charWindow )
self.charWindow = charWindow
LUI.UISquadMemberWindow.AddLoadingWidget( self, f2_arg0 )
end
if f2_arg0.use_2d_character_image == true then
local charWindow = LUI.UIImage.new()
charWindow.id = "member_window_character_id"
charWindow:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = f2_arg0.char_window_dims.top,
bottom = f2_arg0.char_window_dims.bottom,
left = f2_arg0.char_window_dims.left,
right = f2_arg0.char_window_dims.right,
material = RegisterMaterial( "img_char_cas" ),
red = 0.6,
green = 0.6,
blue = 0.6,
alpha = 0.25
} )
charWindow:registerAnimationState( "hidden", {
alpha = 0
} )
charWindow:animateToState( "default" )
charWindow:registerEventHandler( "set_normal", function ( element, event )
element:animateToState( "default", event.anim_length or 0 )
end )
charWindow:registerEventHandler( "set_silhouette", function ( element, event )
element:animateToState( "default", event.anim_length or 0 )
end )
charWindow:registerEventHandler( "hide_character", function ( element, event )
element:animateToState( "hidden", event.anim_length or 0 )
end )
self:addElement( charWindow )
self.charImage = charWindow
end
if f2_arg0.use_member_name then
LUI.UISquadMemberWindow.AddMemberName( self )
end
if f2_arg0.use_prestige_icon then
self.prestigeIcon = LUI.UIImage.new()
self.prestigeIcon.id = "member_window_prestige_icon_id"
self.prestigeIcon:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 30,
top = 100,
right = 94,
bottom = 164,
material = RegisterMaterial( "white" ),
alpha = 1
} )
self.prestigeIcon:registerAnimationState( "shown", {
alpha = 1
} )
self.prestigeIcon:registerAnimationState( "hidden", {
alpha = 0
} )
self.prestigeIcon:animateToState( "default" )
self.prestigeIcon:registerEventHandler( "show_prestige_icon", function ( element, event )
element:animateToState( "shown", event.anim_length or 0 )
end )
self.prestigeIcon:registerEventHandler( "hide_prestige_icon", function ( element, event )
element:animateToState( "hidden", event.anim_length or 0 )
end )
self:addElement( self.prestigeIcon )
end
if f2_arg0.use_playercard then
local charWindow = LUI.Playercard.new( nil, f2_arg0.card_props or {}, childNum )
charWindow.id = "playercard_id"
local f2_local4 = f2_arg0.card_dims
if not f2_local4 then
f2_local4 = {
top = -15,
bottom = 35,
left = -50,
right = 6
}
end
charWindow:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = f2_local4.top,
bottom = f2_local4.bottom,
left = f2_local4.left,
right = f2_local4.right,
scale = f2_arg0.card_scale or 0,
alpha = 1
} )
charWindow:animateToState( "default" )
self:addElement( charWindow )
end
self.close = function ()
LUI.UISquadMemberWindow.Shutdown( self, event )
LUI.UIElement.close( self )
end
self.closeTree = function ()
LUI.UISquadMemberWindow.Shutdown( self, event )
LUI.UIElement.closeTree( self )
end
if self.squadMemberIndex and (f2_arg0.use_playercard or f2_arg0.use_3d_model) then
self:updateSquadMember( self.controller, self.squadMemberIndex )
end
return self
end
LUI.UISquadMemberWindow.InitCharacterWindow = function ( f17_arg0, f17_arg1 )
if not CharacterScene.IsReady() then
return
end
local f17_local0 = f17_arg0:getParent()
f17_local0:processEvent( {
name = "close_loading_character_scene"
} )
f17_arg0:closeChildren()
if f17_arg0.handle then
CharacterScene.FreeCharacter( f17_arg0.handle )
end
f17_local0 = f17_arg0:getParent()
if not f17_local0 then
return
end
local f17_local1 = "iw6_kriss_mp"
local f17_local2 = "iw6_pp19_mp"
local f17_local3 = Cac.GetDefaultBodyModel( f17_local0.controller )
local f17_local4 = Cac.GetDefaultHeadModel( f17_local0.controller )
local f17_local5 = f17_arg0.storedCharacterData or {}
if f17_local0.squadMemberIndex then
f17_local5 = GetCharDataForSquadMember( f17_local0, f17_local0.controller, f17_local0.squadMemberIndex )
end
f17_local1 = f17_local5.primaryWeaponName or f17_local1
f17_local2 = f17_local5.secondaryWeaponName or f17_local2
f17_local3 = f17_local5.bodyModel or f17_local3
f17_local4 = f17_local5.headModel or f17_local4
local f17_local6 = f17_local0.properties
local f17_local7 = f17_local6.charHandle
if not f17_local7 then
f17_local7 = f17_local0.id .. "_character_render"
end
local f17_local8 = CharacterScene.CreateCharacter( f17_local7, f17_local3, f17_local4, f17_local1 )
CharacterScene.SetVisionSet( "mp_character_room" )
CharacterScene.SetFOV( 43 )
CharacterScene.SetAmbient( 0, 0, 0 )
CharacterScene.SetSpin( f17_local8, 0, 0, 0 )
if f17_local6 then
CharacterScene.SetCharacterUVs( f17_local8, f17_local6.uv_values[1], f17_local6.uv_values[2], f17_local6.uv_values[3], f17_local6.uv_values[4] )
CharacterScene.PositionRelativeToCamera( f17_local8, f17_local6.character_pos[1], f17_local6.character_pos[2], f17_local6.character_pos[3] )
if f17_local6.character_rot then
CharacterScene.SetBlendedRotation( f17_local8, f17_local6.character_rot[1], f17_local6.character_rot[2], f17_local6.character_rot[3], 0 )
end
end
f17_local0.handle = f17_local8
f17_local0.current_weapon = f17_local1
f17_arg0:setCharacterHandle( f17_local8 )
if f17_local0.storedCharacterData then
f17_local0:updateCharacter( f17_local0.storedCharacterData )
elseif f17_local0.squadMemberIndex then
f17_local0:updateSquadMember( f17_local0.controller, f17_local0.squadMemberIndex )
end
local self = LUI.UIElement.new()
self.id = "anim_handling_elem"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 1,
left = 0,
right = 1,
red = 1,
green = 1,
blue = 1,
alpha = 0
} )
self:registerAnimationState( "weapon_change_start", {
alpha = 1
} )
self:animateToState( "default" )
self:registerEventHandler( "weapon_change_start", LUI.UISquadMemberWindow.WeaponChangeStart )
self:registerEventHandler( "transition_complete_weapon_change_start", function ( element, event )
if not event.interrupted then
local f18_local0 = element:getParent()
f18_local0:processEvent( {
name = "weapon_changed",
new_weapon = element.new_weapon,
prev_weapon = element.prev_weapon,
offline_weapon = element.offline_weapon
} )
end
end )
f17_arg0:addElement( self )
f17_arg0.anim_states = {}
f17_arg0.anim_states[1] = {
anim_state = "idle",
anim_name = Cac.GetRandomIdleAnim( f17_local0.current_weapon ),
weapon_name = f17_local0.current_weapon
}
LUI.UISquadMemberWindow.SetAnimation( f17_arg0:getParent(), f17_arg0.anim_states[1].anim_name, 0.2 )
f17_local0:processEvent( {
name = "character_init_complete"
} )
end
LUI.UISquadMemberWindow.MoveTo = function ( f19_arg0, f19_arg1, f19_arg2 )
if not CharacterScene.IsReady() then
return
elseif f19_arg0.handle then
CharacterScene.SetMovement( f19_arg0.handle, f19_arg1.Position[1], f19_arg1.Position[2], f19_arg1.Position[3], f19_arg2 or 0 )
CharacterScene.SetBlendedRotation( f19_arg0.handle, f19_arg1.Rotation[1], f19_arg1.Rotation[2], f19_arg1.Rotation[3], f19_arg2 or 0 )
end
end
function GetCharDataForSquadMember( f20_arg0, f20_arg1, f20_arg2 )
local f20_local0 = {
bodyModel = Cac.Customization.Fields[Cac.Customization.FieldIndexes.Body].GetSavedModel( f20_arg1, f20_arg0.squadLocation, f20_arg2 ),
headModel = Cac.Customization.Fields[Cac.Customization.FieldIndexes.Head].GetSavedModel( f20_arg1, f20_arg0.squadLocation, f20_arg2 )
}
if not Engine.IsAliensMode() then
f20_local0.primaryWeaponName = Cac.BuildPrimaryWeaponName( f20_arg1, f20_arg0.squadLocation, f20_arg2, "loadouts", f20_arg0.loadoutSlot or 0 )
f20_local0.secondaryWeaponName = Cac.BuildSecondaryWeaponName( f20_arg1, f20_arg0.squadLocation, f20_arg2, "loadouts", f20_arg0.loadoutSlot or 0 )
f20_local0.experience = Engine.GetPlayerDataEx( f20_arg1, CoD.GetStatsGroupForGameMode(), f20_arg0.squadLocation, f20_arg2, "squadMemXP" )
f20_local0.rank = Lobby.GetRankForXP( f20_local0.experience )
f20_local0.prestige = Cac.GetPrestigeLevel( f20_arg1, f20_arg0.squadLocation )
else
f20_local0.primaryWeaponName = "iw6_" .. string.sub( LUI.mp_menus.Aliens.GetAlienPerk( f20_arg1, 1 ), string.len( "perk_pistol_" ) + 1 ) .. "_mp"
f20_local0.experience = LUI.mp_menus.Aliens.getAliensExperience( f20_arg1 )
f20_local0.rank = Lobby.GetAlienRankForXP( f20_local0.experience )
f20_local0.prestige = LUI.mp_menus.Aliens.getAliensPrestigeLevel( f20_arg1 )
end
f20_local0.background = Cac.Customization.Fields[Cac.Customization.FieldIndexes.Background].GetSavedRef( f20_arg1, f20_arg0.squadLocation, f20_arg2 )
f20_local0.patch = Cac.Customization.Fields[Cac.Customization.FieldIndexes.Patch].GetSavedRef( f20_arg1, f20_arg0.squadLocation, f20_arg2 )
f20_local0.clanTag = Cac.Customization.Fields[Cac.Customization.FieldIndexes.ClanTag].GetSavedRef( f20_arg1 )
return f20_local0
end
LUI.UISquadMemberWindow.UpdateSavedCharacterWindow = function ( f21_arg0, f21_arg1, f21_arg2 )
f21_arg0.squadMemberIndex = f21_arg2
f21_arg0:updateCharacter( GetCharDataForSquadMember( f21_arg0, f21_arg1, f21_arg2 ) )
end
LUI.UISquadMemberWindow.UpdateCharacterWindow = function ( f22_arg0, f22_arg1 )
if f22_arg1.background then
Cac.Customization.Fields[Cac.Customization.FieldIndexes.Background].PreviewFunction( controller, f22_arg0, nil, f22_arg1.background )
end
if f22_arg1.patch then
Cac.Customization.Fields[Cac.Customization.FieldIndexes.Patch].InitFunction( controller, f22_arg0, nil, f22_arg1.patch )
end
if f22_arg1.clanTag then
Cac.Customization.Fields[Cac.Customization.FieldIndexes.ClanTag].PreviewFunction( controller, f22_arg0, nil, f22_arg1.clanTag )
end
f22_arg0:processEvent( {
name = "update_playercard",
experience = f22_arg1.experience,
rank = f22_arg1.rank,
prestige = f22_arg1.prestige
} )
if not f22_arg0.handle then
f22_arg0.storedCharacterData = f22_arg1
return
elseif f22_arg1.bodyModel then
if f22_arg1.patch then
CharacterScene.ChangeBody( f22_arg0.handle, f22_arg1.bodyModel, f22_arg1.patch )
else
CharacterScene.ChangeBody( f22_arg0.handle, f22_arg1.bodyModel )
end
end
if f22_arg1.headModel then
CharacterScene.ChangeHead( f22_arg0.handle, f22_arg1.headModel )
end
if f22_arg1.primaryWeaponName then
CharacterScene.ChangeWeapon( f22_arg0.handle, f22_arg1.primaryWeaponName and "iw6_knifeonlymenu_mp" or f22_arg1.primaryWeaponName )
LUI.UISquadMemberWindow.IdleChangeAnim( f22_arg0.charWindow, {
name = "idle_changed",
new_weapon = f22_arg1.primaryWeaponName
} )
f22_arg0.current_weapon = f22_arg1.primaryWeaponName
end
if f22_arg1.secondaryWeaponName then
CharacterScene.ChangeStowedWeapon( f22_arg0.handle, f22_arg1.secondaryWeaponName )
end
end
LUI.UISquadMemberWindow.Shutdown = function ( f23_arg0, f23_arg1 )
if f23_arg0.handle then
CharacterScene.FreeCharacter( f23_arg0.handle )
f23_arg0.handle = nil
end
end
LUI.UISquadMemberWindow.SetDisplayName = function ( f24_arg0, f24_arg1 )
if f24_arg0.displayName then
f24_arg0.displayName:setText( f24_arg1 )
end
end
LUI.UISquadMemberWindow.SetPrestigeIcon = function ( f25_arg0, f25_arg1 )
if f25_arg0.prestigeIcon then
f25_arg0.prestigeIcon:setImage( f25_arg1 )
end
end
LUI.UISquadMemberWindow.SetAnimation = function ( f26_arg0, f26_arg1, f26_arg2 )
if not CharacterScene.IsReady() then
return
elseif f26_arg0.handle then
f26_arg0.playing_anim = f26_arg1
if not f26_arg2 then
CharacterScene.PlayAnim( f26_arg0.handle, f26_arg1 )
else
CharacterScene.PlayAnim( f26_arg0.handle, f26_arg1, f26_arg2 )
end
end
end
LUI.UISquadMemberWindow.SetBackground = function ( f27_arg0, f27_arg1 )
if f27_arg0.background then
if f27_arg1 == nil or f27_arg1 == "" then
f27_arg0.background:animateToState( "hidden", 0 )
else
f27_arg0.background:setImage( RegisterMaterial( f27_arg1 ) )
f27_arg0.background:animateToState( "default", 0 )
end
end
end
LUI.UISquadMemberWindow.AddMemberName = function ( f28_arg0 )
local f28_local0 = -15
local self = LUI.UIElement.new( {
top = -60,
bottom = 0,
left = 1,
right = -1,
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true
} )
self.id = "member_window_name_container_id"
local f28_local2 = LUI.UIImage.new( {
top = 0,
bottom = 0,
left = 0,
right = 0,
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
red = Colors.black.r,
green = Colors.black.g,
blue = Colors.black.g,
alpha = 0.5,
material = RegisterMaterial( "gradient_bottom" )
} )
f28_local2.id = "member_window_text_bg_id"
self:addElement( f28_local2 )
f28_arg0.displayName = LUI.UIMarqueeText.new()
f28_arg0.displayName.id = "member_window_name_id"
f28_arg0.displayName:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
left = 0,
top = -CoD.TextSettings.ExtraBigFont.Height + f28_local0,
right = 0,
bottom = f28_local0,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Center,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b
} )
f28_arg0.displayName:animateToState( "default" )
self:addElement( f28_arg0.displayName )
local f28_local3 = nil
f28_local3 = LUI.UIHorizontalList.new()
f28_local3.id = "member_window_unlock_text"
f28_local3:registerAnimationState( "default", {
leftAnchor = false,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
top = 0,
right = 0,
bottom = 0,
alpha = 1,
alignment = LUI.Alignment.Center,
spacing = 2
} )
f28_local3:registerAnimationState( "hidden", {
alpha = 0
} )
f28_local3:animateToState( "default" )
f28_local3:registerEventHandler( "show_unlock_text", function ( element, event )
element:animateToState( "default" )
end )
f28_local3:registerEventHandler( "hide_unlock_text", function ( element, event )
element:animateToState( "hidden" )
end )
local f28_local4 = LUI.UIImage.new( {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
height = 32,
left = 0,
right = 32,
material = RegisterMaterial( "icon_unlock_token_32" )
} )
local f28_local5 = Engine.Localize( "@LUA_MENU_SQUAD_MEMBER_UNLOCK_COST", Cac.MemberCost[1] )
local f28_local6, f28_local7, f28_local8, f28_local9 = GetTextDimensions( f28_local5, CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
local f28_local10 = LUI.UIText.new( {
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = false,
left = 0,
height = CoD.TextSettings.NormalFont.Height,
right = f28_local8 + 1,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b
} )
f28_local10:setText( f28_local5 )
f28_local3:addElement( f28_local4 )
f28_local3:addElement( f28_local10 )
self:addElement( f28_local3 )
f28_arg0:addElement( self )
end
LUI.UISquadMemberWindow.AddLoadingWidget = function ( f31_arg0, f31_arg1 )
local f31_local0 = f31_arg1.mask_pos_data
if not f31_local0 then
f31_local0 = {
left = 0,
top = 0,
right = 0,
bottom = 0
}
end
local f31_local1 = f31_arg1.mask_dims_data
if not f31_local1 then
f31_local1 = {
width = 512,
height = 512
}
end
local self = LUI.UIElement.new( {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = f31_local0.top,
left = f31_local0.left,
width = f31_local1.width,
height = f31_local1.height
} )
self:registerEventHandler( "close_loading_character_scene", function ( element, event )
element:close()
end )
f31_arg0:addElement( self )
local f31_local3 = LUI.MenuBuilder.buildItems( {
type = "live_dialog_text_box",
id = "loading_widget_id",
properties = {
message = Engine.Localize( "@MENU_LOADING_DOTS" ),
overlay_alpha = 0
}
}, {}, f31_arg0 )
f31_local3:processEvent( {
name = "hide_popup_background"
} )
self:addElement( f31_local3 )
end
LUI.UISquadMemberWindow.RightStickSpin = function ( f33_arg0, f33_arg1 )
if Engine.IsGamepadEnabled() ~= 1 then
return
end
local f33_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f33_arg0 )
if f33_local0 and f33_local0.exclusiveController and f33_arg1.controller and f33_local0.exclusiveController ~= f33_arg1.controller then
return
end
local f33_local1 = f33_arg1.rightStickDirection
local f33_local2 = f33_arg1.rightStickMagnitude
local f33_local3 = f33_arg0:getParent()
f33_local3 = f33_local3.handle
if f33_local2 > 0.1 then
if f33_local1 < 35 and f33_local1 > -35 then
CharacterScene.SetSpin( f33_local3, 0, f33_local2 * 3, 0 )
elseif not (f33_local1 >= -145 or f33_local1 < -180) or f33_local1 <= 180 and f33_local1 > 145 then
CharacterScene.SetSpin( f33_local3, 0, -f33_local2 * 3, 0 )
else
CharacterScene.SetSpin( f33_local3, 0, 0, 0 )
end
else
CharacterScene.SetSpin( f33_local3, 0, 0, 0 )
end
end
LUI.UISquadMemberWindow.PCSpin = function ( f34_arg0, f34_arg1 )
if Engine.IsGamepadEnabled() == 1 then
return
end
local f34_local0 = f34_arg0:getParent()
f34_local0 = f34_local0.handle
if not f34_arg0.m_leftMouseDown or not f34_arg1.x then
CharacterScene.SetSpin( f34_local0, 0, 0, 0 )
return
end
local f34_local1 = LUI.clamp( ((f34_arg0.mouse_last_x or 0) - f34_arg1.x) * -100, -10, 10 )
if f34_local1 ~= 0 then
CharacterScene.SetSpin( f34_local0, 0, f34_local1, 0 )
else
CharacterScene.SetSpin( f34_local0, 0, 0, 0 )
end
f34_arg0.mouse_last_x = f34_arg1.x
end
LUI.UISquadMemberWindow.ChangeAnimOnLoopedEnd = function ( f35_arg0, f35_arg1 )
LUI.UISquadMemberWindow.DoAnimChange( f35_arg0, f35_arg1 )
end
LUI.UISquadMemberWindow.ChangeAnimOnEnd = function ( f36_arg0, f36_arg1 )
LUI.UISquadMemberWindow.DoAnimChange( f36_arg0, f36_arg1 )
end
LUI.UISquadMemberWindow.WeaponChangeStowed = function ( f37_arg0, f37_arg1 )
local f37_local0 = f37_arg0:getParent()
if f37_local0.handle then
f37_local0 = f37_arg1.weapon
if not f37_local0 then
f37_local0 = Cac.BuildWeaponName( f37_arg1.weapon )
end
local f37_local1 = CharacterScene.ChangeStowedWeapon
local f37_local2 = f37_arg0:getParent()
f37_local1( f37_local2.handle, f37_local0 )
end
end
LUI.UISquadMemberWindow.WeaponChangeStart = function ( f38_arg0, f38_arg1 )
f38_arg0.new_weapon = f38_arg1.new_weapon
f38_arg0.prev_weapon = f38_arg1.prev_weapon
f38_arg0.offline_weapon = f38_arg1.offline_weapon
f38_arg0:cancelAnimateToState()
f38_arg0:animateToState( "weapon_change_start", 400 )
end
LUI.UISquadMemberWindow.IdleChangeAnim = function ( f39_arg0, f39_arg1 )
local f39_local0 = f39_arg0:getParent()
local f39_local1 = f39_local0.handle
local f39_local2 = string.find( f39_arg1.new_weapon, "riotshield" )
local f39_local3 = string.find( f39_arg1.new_weapon, "knifeonly" )
local f39_local4 = Cac.Customization.Animations.idles.normal[math.random( 1, #Cac.Customization.Animations.idles.normal )]
if f39_local2 then
f39_local4 = Cac.Customization.Animations.idles.riotshield[math.random( 1, #Cac.Customization.Animations.idles.riotshield )]
elseif f39_local3 then
f39_local4 = Cac.Customization.Animations.idles.knifeonly[math.random( 1, #Cac.Customization.Animations.idles.knifeonly )]
end
if not f39_local0.current_weapon then
LUI.UISquadMemberWindow.SetAnimation( f39_local0, f39_local4, 0 )
else
local f39_local5 = string.find( f39_local0.current_weapon, "riotshield" )
local f39_local6 = string.find( f39_local0.current_weapon, "knifeonly" )
if not (not f39_local2 or f39_local5) or f39_local3 and not f39_local6 then
LUI.UISquadMemberWindow.SetAnimation( f39_local0, f39_local4, 0 )
elseif not (f39_local2 or not f39_local5) or not f39_local3 and f39_local6 then
LUI.UISquadMemberWindow.SetAnimation( f39_local0, f39_local4, 0 )
end
end
f39_local0.current_weapon = f39_arg1.new_weapon
if not f39_arg0.anim_states then
f39_arg0.anim_states = {}
end
f39_arg0.anim_states[1] = {
anim_state = "idle",
anim_name = f39_local4,
weapon_name = f39_local0.current_weapon
}
end
LUI.UISquadMemberWindow.AnimateToFirst = function ( f40_arg0, f40_arg1 )
local f40_local0 = f40_arg0:getParent()
local f40_local1 = f40_arg0.anim_states[1]
if f40_local1.anim_state == "grab" then
CharacterScene.ChangeWeapon( f40_local0.handle, f40_local1.weapon_name and "iw6_knifeonlymenu_mp" or f40_local1.weapon_name )
f40_local0.current_weapon = f40_local1.weapon_name
local f40_local2 = LUI.FlowManager.GetMenuScopedDataFromElement( f40_local0 )
if f40_local2.slot then
local f40_local3 = Cac.BuildPrimaryWeaponName( f40_local2.controller or f40_local2.exclusiveController, f40_local2.squadLocation, f40_local2.squadMemberIndex, f40_local2.classLocation, f40_local2.slot )
if f40_local3 ~= f40_local1.weapon_name then
f40_arg0:processEvent( {
name = "weapon_change_start",
new_weapon = f40_local3,
prev_weapon = f40_local1.weapon_name
} )
end
end
end
LUI.UISquadMemberWindow.SetAnimation( f40_local0, f40_local1.anim_name, 0.2 )
end
LUI.UISquadMemberWindow.DoAnimChange = function ( f41_arg0, f41_arg1 )
local f41_local0 = f41_arg0:getParent()
if f41_arg0.anim_states[1].anim_state == "idle" then
local f41_local1 = f41_arg0.anim_states[1]
f41_local1.anim_name = Cac.GetRandomIdleAnim( f41_local1.weapon_name, f41_local1.anim_name )
LUI.UISquadMemberWindow.SetAnimation( f41_local0, f41_local1.anim_name, 0.2 )
else
local f41_local1 = f41_local0.handle
if #f41_arg0.anim_states > 1 then
for f41_local2 = 1, #f41_arg0.anim_states, 1 do
f41_arg0.anim_states[f41_local2] = f41_arg0.anim_states[f41_local2 + 1]
end
end
LUI.UISquadMemberWindow.AnimateToFirst( f41_arg0, f41_arg1 )
end
end
LUI.UISquadMemberWindow.WeaponChangeAnim = function ( f42_arg0, f42_arg1 )
local f42_local0 = f42_arg0:getParent()
local f42_local1 = f42_local0.current_weapon
local f42_local2 = nil
if f42_arg1.offline_weapon then
f42_local2 = f42_arg1.offline_weapon
else
f42_local2 = f42_arg1.new_weapon
end
if f42_local1 == f42_local2 then
return
end
local f42_local3, f42_local4 = nil
if f42_local1 and string.find( f42_local1, "riotshield" ) then
f42_local3 = Cac.Customization.Animations.weapon_grabs.riotshield[1]
elseif f42_local1 and string.find( f42_local1, "knifeonly" ) then
f42_local3 = Cac.Customization.Animations.weapon_grabs.knifeonly[1]
elseif math.random( 1, 2 ) == 1 then
f42_local3 = Cac.Customization.Animations.weapon_grabs.normal_1[1]
else
f42_local3 = Cac.Customization.Animations.weapon_grabs.normal_2[1]
end
if string.find( f42_local2, "riotshield" ) then
f42_local4 = Cac.Customization.Animations.weapon_grabs.riotshield[2]
elseif string.find( f42_local2, "knifeonly" ) then
f42_local4 = Cac.Customization.Animations.weapon_grabs.knifeonly[2]
elseif math.random( 1, 2 ) == 1 then
f42_local4 = Cac.Customization.Animations.weapon_grabs.normal_1[2]
else
f42_local4 = Cac.Customization.Animations.weapon_grabs.normal_2[2]
end
if f42_arg0.anim_states[1].anim_state == "idle" then
f42_arg0.anim_states[1] = {
anim_state = "toss",
anim_name = f42_local3,
weapon_name = f42_local1
}
f42_arg0.anim_states[2] = {
anim_state = "grab",
anim_name = f42_local4,
weapon_name = f42_local2
}
f42_arg0.anim_states[3] = {
anim_state = "idle",
anim_name = Cac.GetRandomIdleAnim( f42_local2 ),
weapon_name = f42_local2
}
LUI.UISquadMemberWindow.AnimateToFirst( f42_arg0, f42_arg1 )
elseif f42_arg0.anim_states[1].anim_state == "toss" then
f42_arg0.anim_states[2] = {
anim_state = "grab",
anim_name = f42_local4,
weapon_name = f42_local2
}
f42_arg0.anim_states[3] = {
anim_state = "idle",
anim_name = Cac.GetRandomIdleAnim( f42_local2 ),
weapon_name = f42_local2
}
elseif f42_arg0.anim_states[1].anim_state == "grab" then
f42_arg0.anim_states[2] = {
anim_state = "toss",
anim_name = f42_local3,
weapon_name = f42_local1
}
f42_arg0.anim_states[3] = {
anim_state = "grab",
anim_name = f42_local4,
weapon_name = f42_local2
}
f42_arg0.anim_states[4] = {
anim_state = "idle",
anim_name = Cac.GetRandomIdleAnim( f42_local2 ),
weapon_name = f42_local2
}
end
end
LUI.MenuBuilder.registerType( "UISquadMemberWindow", LUI.UISquadMemberWindow.build )

217
lui/mp_menus/main.dec.lua Normal file
View File

@@ -0,0 +1,217 @@
DebugPrint( "Running main.lua" )
require( "LUI.CoD" )
require( "LUI.mp_menus.MenuData" )
require( "LUI.MenuGenerics" )
require( "LUI.MenuGenericButtons" )
require( "LUI.common_menus.CommonPopups" )
require( "LUI.ButtonHelperText" )
if Engine.HasSpeechFeature() then
require( "LUI.MenuAutoNav" )
require( "LUI.Speech" )
require( "LUI.common_menus.KinectControlMenu" )
require( "LUI.common_menus.KinectUtils" )
require( "LUI.common_menus.WhatCanISay" )
end
if Engine.InFrontend() then
require( "LUI.mp_menus.CacCustomize" )
end
require( "LUI.common_menus.RankUtils" )
require( "LUI.common_menus.CacUtils" )
require( "LUI.common_menus.CacCustomizeUtils" )
require( "LUI.mp_menus.CacLoadoutUtils" )
require( "LUI.mp_menus.PlayerDataInit" )
if Engine.InFrontend() or Engine.IsAliensMode() then
require( "LUI.mp_menus.Aliens" )
require( "LUI.mp_menus.AliensPurchasables" )
end
require( "LUI.common_menus.OptionsLayout" )
require( "LUI.common_menus.Options" )
require( "LUI.mp_menus.CacRecap" )
require( "LUI.common_menus.FriendsWidget" )
require( "LUI.common_menus.FriendsList" )
require( "LUI.common_menus.FriendsListUtils" )
require( "LUI.mp_menus.MPLobbyUtils" )
if Engine.InFrontend() then
require( "LUI.PersistentBackground" )
require( "LUI.mp_menus.MLGUtils" )
require( "LUI.mp_menus.SvSUtils" )
require( "LUI.mp_menus.AliensIntel" )
require( "LUI.mp_menus.AliensLoadout" )
require( "LUI.ButtonDescText" )
require( "LUI.common_menus.GameManual" )
require( "LUI.common_menus.ProfilePopup" )
require( "LUI.common_menus.PlayerCard" )
require( "LUI.common_menus.VirtualKeyboard" )
require( "LUI.mp_menus.AARUtils" )
require( "LUI.mp_menus.AARUnlockScreen" )
require( "LUI.mp_menus.AARCommon" )
require( "LUI.mp_menus.AARSummary" )
require( "LUI.mp_menus.AARMain" )
require( "LUI.mp_menus.AARMini" )
require( "LUI.mp_menus.CacMain" )
require( "LUI.mp_menus.CacEdit" )
require( "LUI.mp_menus.CacEditSelectionInfo" )
require( "LUI.mp_menus.CacEditPopup" )
require( "LUI.mp_menus.CacEditChooseImagePopup" )
require( "LUI.mp_menus.CacEditWeaponAttachChoose" )
require( "LUI.mp_menus.CacEditWeaponStatsInfoPane" )
require( "LUI.mp_menus.CacEditWeaponPerformanceInfoPane" )
require( "LUI.mp_menus.CacInfoPanes" )
require( "LUI.mp_menus.CacAbilitiesAlt" )
require( "LUI.mp_menus.CacMemberSelect" )
require( "LUI.mp_menus.CacPrestigeDetails" )
require( "LUI.mp_menus.MPPlaylist" )
require( "LUI.mp_menus.MPPopups" )
require( "LUI.mp_menus.MPLobbySearchWidget" )
require( "LUI.mp_menus.mpLobbyWidgets" )
require( "LUI.mp_menus.MPLobbyNavigation" )
require( "LUI.mp_menus.MPLobbyCharacterView" )
require( "LUI.mp_menus.MPLobbyPlayerStats" )
require( "LUI.mp_menus.MPMainMenu" )
require( "LUI.mp_menus.MPXboxLiveMenu" )
require( "LUI.mp_menus.SystemLinkMenu" )
require( "LUI.mp_menus.SystemLinkJoinMenu" )
require( "LUI.mp_menus.SystemLinkGameSetupMenu" )
require( "LUI.mp_menus.SplitScreenGameSetupMenu" )
require( "LUI.mp_menus.MPPlayerPopups" )
require( "LUI.mp_menus.MPLivePrivateLobby" )
require( "LUI.mp_menus.MPLivePublicLobby" )
require( "LUI.mp_menus.SplitScreenSignIn" )
require( "LUI.mp_menus.MPBarracks" )
require( "LUI.mp_menus.MPCoDAnywhere" )
require( "LUI.mp_menus.MPCustomClassRestrictions" )
require( "LUI.mp_menus.MPMemberList" )
require( "LUI.mp_menus.MPGameModeSelectMenu" )
require( "LUI.mp_menus.MPGameSetupMenu" )
require( "LUI.mp_menus.MPGameSetupModeMenu" )
require( "LUI.mp_menus.MPGameSetupOptionsMenu" )
require( "LUI.mp_menus.MPLeaderboard" )
require( "LUI.mp_menus.MPLeaderboardPopups" )
require( "LUI.mp_menus.MPPrestigeReset" )
require( "LUI.mp_menus.MPStatsReset" )
require( "LUI.mp_menus.AARScoreboard" )
require( "LUI.mp_menus.AAROperationProgress" )
require( "LUI.mp_menus.KillstreakSelections" )
require( "LUI.mp_menus.SquadPrePartyLobby" )
require( "LUI.mp_menus.Leaderboards" )
require( "LUI.mp_menus.LeaderboardUtils" )
require( "LUI.mp_menus.MPMapSetupMenu" )
require( "LUI.mp_menus.MPSavedModeSelectMenu" )
require( "LUI.mp_menus.LUISquadMemberWindow" )
require( "LUI.mp_menus.Operations" )
require( "LUI.mp_menus.OperationsUtils" )
require( "LUI.mp_menus.ClanElements" )
require( "LUI.mp_menus.ClanInvites" )
require( "LUI.mp_menus.ClanDetails" )
require( "LUI.BootScreenMargins" )
require( "LUI.mp_menus.ChooseCoDAnywherePlatform" )
require( "LUI.mp_menus.SnsUtils" )
require( "LUI.mp_menus.SnsElements" )
require( "LUI.mp_menus.Store" )
require( "LUI.mp_menus.SquadReports" )
require( "LUI.mp_menus.SquadReportDetail" )
require( "LUI.mp_menus.ArchetypeSelect" )
require( "LUI.mp_menus.AARSquadSummary" )
require( "LUI.mp_menus.SquadsModeSelect" )
require( "LUI.mp_menus.MOTDWidgets" )
require( "LUI.mp_menus.MOTDUtils" )
require( "LUI.mp_menus.SocialFeed" )
require( "LUI.mp_menus.LoadoutBuilder" )
if not Engine.IsConsoleGame() then
require( "LUI.PCOptions" )
require( "LUI.AdvancedVideo" )
require( "LUI.MovementControls" )
require( "LUI.ActionsControls" )
require( "LUI.ChatControls" )
require( "LUI.GamepadControls" )
require( "LUI.LookControls" )
end
require( "LUI.luitest" )
end
if not Engine.InFrontend() then
local f0_local0 = Engine.GetDvarString( "ui_gametype" )
local f0_local1 = Engine.GetDvarString( "ui_mapname" )
require( "LUI.mp_hud.MLGHud" )
require( "LUI.mp_hud.OptionsMenu" )
require( "LUI.mp_hud.endGameMenu" )
require( "LUI.mp_hud.DamageFeedbackHud" )
require( "LUI.mp_hud.GameMessageHud" )
require( "LUI.mp_hud.ScreenEffectsHud" )
require( "LUI.mp_hud.Hints" )
require( "LUI.mp_hud.PredatorMissileOverlayHud" )
require( "LUI.mp_hud.MatchStartHud" )
require( "LUI.mp_hud.MutePlayers" )
require( "LUI.mp_hud.HostMigration" )
require( "LUI.mp_hud.VanguardOverlayHud" )
require( "LUI.mp_hud.WeaponAttachment" )
require( "LUI.mp_hud.TalkerHud" )
if Engine.IsPS4() then
require( "LUI.common_menus.VitaHud" )
end
if Engine.IsAliensMode() then
require( "LUI.mp_hud.AlienHud" )
require( "LUI.mp_hud.AlienHudTechTree" )
require( "LUI.mp_hud.AlienScoreboards" )
require( "LUI.mp_hud.AlienCapturingHud" )
require( "LUI.mp_hud.AlienChaos" )
require( "LUI.mp_hud.AlienVanguardOverlayHud" )
else
require( "LUI.mp_hud.hudUtils" )
require( "LUI.mp_hud.hud" )
if CoD.IsFireTeamMode() then
require( "LUI.mp_hud.FireTeamMenu" )
end
require( "LUI.mp_hud.PlayerCardHud" )
require( "LUI.mp_hud.PointsPopupHud" )
require( "LUI.mp_hud.TimersHud" )
require( "LUI.mp_hud.ScorelistHud" )
require( "LUI.mp_hud.Scoreboard" )
require( "LUI.mp_hud.WeaponInfoHud" )
require( "LUI.mp_hud.PlayerInfoHud" )
require( "LUI.mp_hud.MinimapHud" )
require( "LUI.mp_hud.jammerEffectHud" )
require( "LUI.mp_hud.TeamScoresHud" )
require( "LUI.mp_hud.KillstreakHud" )
require( "LUI.mp_hud.SplashesHud" )
require( "LUI.mp_hud.CapturingHud" )
if f0_local0 == "horde" then
require( "LUI.mp_hud.HordeHud" )
require( "LUI.mp_hud.HordePerksHud" )
end
require( "LUI.mp_hud.IntelChallenges" )
require( "LUI.mp_hud.KillCamHud" )
require( "LUI.mp_hud.OverlayHud" )
require( "LUI.mp_hud.CharSelectMenu" )
require( "LUI.mp_hud.TeamSelect" )
require( "LUI.mp_hud.ObituaryHud" )
require( "LUI.mp_hud.SpectatorHud" )
require( "LUI.mp_hud.OptionsMenuScoreboard" )
require( "LUI.mp_hud.HelicopterPilotOverlayHud" )
require( "LUI.mp_hud.OdinOverlayHud" )
require( "LUI.mp_hud.JuggernautOverlayHud" )
require( "LUI.mp_hud.A10OverlayHud" )
require( "LUI.mp_hud.PerksOnSpawnHud" )
require( "LUI.mp_hud.RoundEndHud" )
if f0_local1 == "mp_battery3" then
require( "LUI.mp_hud.PredatorOverlayHud2" )
end
if f0_local1 == "mp_favela_iw6" then
require( "LUI.mp_hud.AC130OverlayHud" )
end
if f0_local1 == "mp_dig" then
require( "LUI.mp_hud.DigHud" )
end
end
if not Engine.IsConsoleGame() then
require( "LUI.mp_hud.inGamePCOptions" )
require( "LUI.mp_hud.inGameAdvancedVideo" )
require( "LUI.mp_hud.inGameMovementControls" )
require( "LUI.mp_hud.inGameActionsControls" )
require( "LUI.mp_hud.inGameChatControls" )
require( "LUI.mp_hud.inGameGamepadControls" )
require( "LUI.mp_hud.inGameLookControls" )
else
require( "LUI.mp_hud.inGameControls" )
end
end
DisableGlobals()

View File

@@ -0,0 +1,19 @@
DebugPrint( "Running MenuData.lua" )
MPConfig = {
default_dvars = "exec dvar_defaults.cfg",
default_xboxlive = "exec default_xboxlive.cfg",
default_splitscreen = "exec default_splitscreen.cfg",
default_systemlink = "exec default_systemlink.cfg",
default_aliens = "exec default_aliens.cfg"
}
function ConfigureResolution()
if Engine.GetDvarBool( "hidef" ) then
Engine.Exec( "exec default_720p.cfg" )
else
Engine.Exec( "exec default_480p.cfg" )
end
end
FireTeam = {
tactic_name = "@MPUI_FT_TACTIC_NONE"
}

View File

@@ -0,0 +1,140 @@
MLG = MLG or {}
MLG.GetRulesVersionNumber = function ()
return Engine.MarkLocalized( MatchRules.GetData( "mlgVersion" ) or "0.0.0" )
end
MLG.IsFeatureAvailable = function ()
local f2_local0 = Engine.GetDvarBool( "systemlink" )
if not f2_local0 then
f2_local0 = IsPrivateMatch and IsPrivateMatch()
end
if f2_local0 then
f2_local0 = not Engine.IsAliensMode()
end
if f2_local0 then
f2_local0 = Engine.GetDvarBool( "using_mlg" )
end
return f2_local0
end
MLG.CanIAdjustMLGSettings = function ()
if not MLG.IsFeatureAvailable() then
return false
end
local f3_local0 = Engine.GetDvarBool( "systemlink" )
if not f3_local0 then
f3_local0 = Lobby.IsGameHost()
end
return f3_local0
end
MLG.AreMLGRulesEnabled = function ()
if not MLG.IsFeatureAvailable() then
return false
end
local f4_local0 = Engine.GetDvarBool( "systemlink" )
if Engine.GetDvarBool( "xblive_competitionmatch" ) == nil then
Engine.Exec( "set xblive_competitionmatch 0" )
end
local f4_local1
if not f4_local0 then
f4_local1 = Lobby.IsUsingMLGRules()
if not f4_local1 then
else
return f4_local1
end
end
f4_local1 = f4_local0 and Engine.GetDvarBool( "xblive_competitionmatch" )
end
MLG.SetUsingMLGRules = function ( f5_arg0 )
Engine.SetDvarBool( "xblive_competitionmatch", f5_arg0 )
if not Engine.GetDvarBool( "systemlink" ) then
Lobby.SetUsingMLGRules( f5_arg0 )
end
if (Engine.SplitscreenPlayerCount() > 1) or CoD.IsUsingAspectRatio( 1.33 ) then
for f5_local0 = 0, Engine.GetMaxControllerCount() - 1, 1 do
LobbyMember.SelectedMember_SetLocalMemberMLGSpectator( false, f5_local0 )
end
end
end
MLG.ToggleMLGRules = function ( f6_arg0 )
if MLG.CanIAdjustMLGSettings() then
if not MLG.AreMLGRulesEnabled() then
if Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, Engine.GetDvarString( "ui_gametype" ), GameTypesTable.Cols.MLG ) == "1" and MatchRules.HasMLGRecipeAvailable() then
MLG.SetUsingMLGRules( true )
MatchRules.LoadMLGRecipe()
elseif not Engine.UserCanPlayOnline( f6_arg0 ) then
LUI.FlowManager.RequestPopupMenu( self, "mlg_error_no_rules_available_offline", false, f6_arg0, false )
else
LUI.FlowManager.RequestPopupMenu( self, "mlg_error_no_rules_available", false, f6_arg0, false )
end
else
MLG.SetUsingMLGRules( false )
MatchRules.LoadMatchRulesDataDefault()
end
end
end
MLG.Refresh = function ( f7_arg0 )
local f7_local0 = MLG.AreMLGRulesEnabled()
f7_arg0.properties = f7_arg0.properties or {}
if f7_arg0.properties.cacheMLGenabled ~= f7_local0 then
local f7_local1 = "mlg_"
local f7_local2
if f7_local0 then
f7_local2 = "enabled"
if not f7_local2 then
else
f7_arg0:dispatchEventToRoot( {
name = f7_local1 .. f7_local2,
immediate = true
} )
MLG.SetButtonHelper( f7_arg0, f7_local0 )
f7_arg0.properties.cacheMLGenabled = f7_local0
end
end
f7_local2 = "disabled"
end
end
MLG.SetButtonHelper = function ( f8_arg0, f8_arg1 )
local f8_local0 = ""
if MLG.CanIAdjustMLGSettings() then
if f8_arg1 then
f8_local0 = Engine.Localize( "PATCH_MENU_DISABLE_MLG_RULES" )
else
f8_local0 = Engine.Localize( "PATCH_MENU_ENABLE_MLG_RULES" )
end
end
f8_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_start",
helper_text = f8_local0,
side = "left",
clickable = true
} )
end
MLG.Toggle = function ( f9_arg0, f9_arg1 )
if MLG.CanIAdjustMLGSettings() then
MLG.ToggleMLGRules( f9_arg1.controller )
end
MLG.Refresh( f9_arg0 )
end
MLG.Hide = function ( f10_arg0 )
f10_arg0:processEvent( {
name = "mlg_disabled"
} )
f10_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_start",
helper_text = "",
side = "left"
} )
end

View File

@@ -0,0 +1,318 @@
function TryForceOpenMOTD()
if Lobby.IsInPrivateParty() and not Lobby.IsPrivatePartyHost() then
return
end
local f1_local0 = Engine.GetFirstActiveController()
if not Engine.IsProfileSignedIn( f1_local0 ) then
return false
elseif not CanReadReserveData( f1_local0 ) then
return false
end
local f1_local1 = {}
local f1_local2 = 2
if HasSeenMOTDToday( f1_local0 ) and Engine.GetDvarString( "alwaysShowMOTD" ) ~= "1" then
return false
elseif Engine.HasSpeechFeature() and LUI.MenuAutoNav.IsRunning() then
return false
end
SetHasSeenMOTDToday( f1_local0 )
local f1_local3 = GetWelcomeScreenType( f1_local0 )
if f1_local3 then
table.insert( f1_local1, f1_local3 )
end
if #f1_local1 < f1_local2 and ShouldShowCodAnywherePrompt( f1_local0 ) then
table.insert( f1_local1, "codAnywhereUpsell" )
end
if Engine.GetDvarString( "motd" ) ~= "" then
table.insert( f1_local1, "motd" )
end
local f1_local4 = GetVotingLayout( f1_local0 )
if f1_local4 then
StartVoteImageDownload( f1_local0 )
table.insert( f1_local1, f1_local4 )
end
if #f1_local1 < f1_local2 and ShouldShowFestivePackUpsell( f1_local0 ) then
table.insert( f1_local1, "festiveUpsell" )
end
if #f1_local1 < f1_local2 and ShouldShowWolfPackUpsell( f1_local0 ) then
table.insert( f1_local1, "wolfpackUpsell" )
end
if #f1_local1 < f1_local2 and ShouldShowSeasonPassUpsell( f1_local0 ) then
table.insert( f1_local1, "seasonPassUpsell" )
end
if #f1_local1 < f1_local2 and ShouldShowDownloadReminder( f1_local0 ) then
table.insert( f1_local1, "downloadReminder" )
end
if #f1_local1 > 0 then
LUI.FlowManager.RequestPopupMenu( self, "motd_main", false, f1_local0, false, {
layoutQueue = f1_local1
}, nil, nil, false )
return true
end
return false
end
function CanReadReserveData( f2_arg0 )
if Engine.GetPlayerDataReservedInt( f2_arg0, CoD.StatsGroup.Common, "welcome_screen_count" ) then
return true
else
return false
end
end
function ResetMOTDCounters( f3_arg0 )
Engine.SetPlayerDataReservedInt( f3_arg0, CoD.StatsGroup.Common, "welcome_screen_count", 0 )
Engine.SetPlayerDataReservedInt( f3_arg0, CoD.StatsGroup.Common, "cod_anywhere_screen_count", 0 )
Engine.SetPlayerDataReservedInt( f3_arg0, CoD.StatsGroup.Common, "season_pass_upsell_count", 0 )
Engine.SetPlayerDataReservedInt( f3_arg0, CoD.StatsGroup.Common, "motd_today_day", 0 )
Engine.SetPlayerDataReservedInt( f3_arg0, CoD.StatsGroup.Common, "motd_today_month", 0 )
end
function HasSeenWelcomeScreen( f4_arg0 )
return Engine.GetPlayerDataReservedInt( f4_arg0, CoD.StatsGroup.Common, "welcome_screen_count" ) >= 1
end
function SetHasSeenWelcomeScreen( f5_arg0 )
Engine.SetPlayerDataReservedInt( f5_arg0, CoD.StatsGroup.Common, "welcome_screen_count", 1 )
end
function HasPlayedBlops2( f6_arg0 )
return Engine.GetPlayerDataEx( f6_arg0, CoD.StatsGroup.Common, "pastTitleData", "playedblackops2" )
end
function Blops2Prestige( f7_arg0 )
return Engine.GetPlayerDataEx( f7_arg0, CoD.StatsGroup.Common, "pastTitleData", "blackops2prestige" )
end
function HasPlayedMW3( f8_arg0 )
return Engine.GetPlayerDataEx( f8_arg0, CoD.StatsGroup.Common, "pastTitleData", "playedmw3" )
end
function MW3Prestige( f9_arg0 )
return Engine.GetPlayerDataEx( f9_arg0, CoD.StatsGroup.Common, "pastTitleData", "mw3prestige" )
end
function GetWelcomeScreenType( f10_arg0 )
if not HasSeenWelcomeScreen( f10_arg0 ) then
local f10_local0 = false
local f10_local1 = HasPlayedMW3( f10_arg0 )
if not f10_local1 then
f10_local1 = HasPlayedBlops2( f10_arg0 )
end
SetHasSeenWelcomeScreen( f10_arg0 )
if f10_local0 then
return "welcomeFounder"
elseif f10_local1 then
return "welcomeSoldier"
else
return "welcomeNoob"
end
else
return nil
end
end
function HasSeenMOTDToday( f11_arg0 )
local f11_local0 = Engine.GetRawMonthDayYear()
if f11_local0 then
if f11_local0.day ~= Engine.GetPlayerDataReservedInt( f11_arg0, CoD.StatsGroup.Common, "motd_today_day" ) then
return false
elseif f11_local0.month ~= Engine.GetPlayerDataReservedInt( f11_arg0, CoD.StatsGroup.Common, "motd_today_month" ) then
return false
end
end
return true
end
function SetHasSeenMOTDToday( f12_arg0 )
local f12_local0 = Engine.GetRawMonthDayYear()
if f12_local0 and f12_local0.day and f12_local0.month then
Engine.SetPlayerDataReservedInt( f12_arg0, CoD.StatsGroup.Common, "motd_today_day", f12_local0.day )
Engine.SetPlayerDataReservedInt( f12_arg0, CoD.StatsGroup.Common, "motd_today_month", f12_local0.month )
end
end
function GetNumTimesSeenSeasonPassUpsell( f13_arg0 )
return Engine.GetPlayerDataReservedInt( f13_arg0, CoD.StatsGroup.Common, "season_pass_upsell_count" )
end
function GetNumTimesPlayerShouldSeeSeasonPassUpsell()
return 6
end
function IncNumTimesPlayerHasSeenSeasonPassUpsell( f15_arg0 )
Engine.SetPlayerDataReservedInt( f15_arg0, CoD.StatsGroup.Common, "season_pass_upsell_count", Engine.GetPlayerDataReservedInt( f15_arg0, CoD.StatsGroup.Common, "season_pass_upsell_count" ) + 1 )
end
function ShouldShowSeasonPassUpsell( f16_arg0 )
if not Engine.AnyoneHasSeasonPass() and GetNumTimesSeenSeasonPassUpsell( f16_arg0 ) < GetNumTimesPlayerShouldSeeSeasonPassUpsell() then
IncNumTimesPlayerHasSeenSeasonPassUpsell( f16_arg0 )
return true
else
return false
end
end
function GetNumTimesSeenCodAnywherePrompt( f17_arg0 )
return Engine.GetPlayerDataReservedInt( f17_arg0, CoD.StatsGroup.Common, "cod_anywhere_screen_count" )
end
function GetNumTimesPlayerShouldSeeCodAnywherePrompt()
return 3
end
function IncNumTimesPlayerHasSeenCodAnywherePrompt( f19_arg0 )
Engine.SetPlayerDataReservedInt( f19_arg0, CoD.StatsGroup.Common, "cod_anywhere_screen_count", Engine.GetPlayerDataReservedInt( f19_arg0, CoD.StatsGroup.Common, "cod_anywhere_screen_count" ) + 1 )
end
function ShouldShowCodAnywherePrompt( f20_arg0 )
local f20_local0 = true
if CoDAnywhere.ShouldShowLinkCreatePopup( f20_arg0, true ) == true then
f20_local0 = false
end
if not f20_local0 and GetNumTimesSeenCodAnywherePrompt( f20_arg0 ) < GetNumTimesPlayerShouldSeeCodAnywherePrompt() then
IncNumTimesPlayerHasSeenCodAnywherePrompt( f20_arg0 )
return true
else
return false
end
end
function GetNumTimesSeenFestivePackUpsell( f21_arg0 )
return Engine.GetPlayerDataReservedInt( f21_arg0, CoD.StatsGroup.Common, "mp_upsell_holiday_count" )
end
function GetNumTimesPlayerShouldSeeFestivePackUpsell()
return 4
end
function IncNumTimesPlayerHasSeenFestivePackUpsell( f23_arg0 )
Engine.SetPlayerDataReservedInt( f23_arg0, CoD.StatsGroup.Common, "mp_upsell_holiday_count", Engine.GetPlayerDataReservedInt( f23_arg0, CoD.StatsGroup.Common, "mp_upsell_holiday_count" ) + 1 )
end
function ShouldShowFestivePackUpsell( f24_arg0 )
if not Cac.IsCustomizationItemUnlocked( f24_arg0, Cac.Customization.Fields[Cac.Customization.FieldIndexes.Patch], 574 ) and GetNumTimesSeenFestivePackUpsell( f24_arg0 ) < GetNumTimesPlayerShouldSeeFestivePackUpsell() then
IncNumTimesPlayerHasSeenFestivePackUpsell( f24_arg0 )
return true
else
return false
end
end
function GetNumTimesSeenWolfPackUpsell( f25_arg0 )
return Engine.GetPlayerDataReservedInt( f25_arg0, CoD.StatsGroup.Common, "mp_upsell_wolfpack_count" )
end
function GetNumTimesPlayerShouldSeeWolfPackUpsell()
return 4
end
function IncNumTimesPlayerHasSeenWolfPackUpsell( f27_arg0 )
Engine.SetPlayerDataReservedInt( f27_arg0, CoD.StatsGroup.Common, "mp_upsell_wolfpack_count", Engine.GetPlayerDataReservedInt( f27_arg0, CoD.StatsGroup.Common, "mp_upsell_wolfpack_count" ) + 1 )
end
function ShouldShowWolfPackUpsell( f28_arg0 )
if not (1 == Engine.GetDvarInt( "igs_swp" )) then
return false
elseif not Lobby.IsItemOfTypeUnlocked( f28_arg0, "wolf", "DLC" ) and GetNumTimesSeenWolfPackUpsell( f28_arg0 ) < GetNumTimesPlayerShouldSeeWolfPackUpsell() then
IncNumTimesPlayerHasSeenWolfPackUpsell( f28_arg0 )
return true
else
return false
end
end
function GetVotingLayout( f29_arg0 )
if ShouldDisplayVoteScreen( f29_arg0 ) then
return "voting"
else
return nil
end
end
function GetVotingImageFileID( f30_arg0 )
local f30_local0 = 0
if f30_arg0 == 0 then
f30_local0 = 347
else
f30_local0 = 348
end
return f30_local0
end
function GetVotingPageHeader()
return Engine.MarkLocalized( Engine.GetVotingHeader( GetActiveVoteIndex() ) )
end
function GetVotingItemHeader( f32_arg0 )
local f32_local0 = ""
if Engine.GetActiveVotes() == 1 then
f32_local0 = Engine.GetVoteItemText( 0, f32_arg0 )
end
return Engine.MarkLocalized( f32_local0 )
end
function GetNumberOfImagesForVote()
local f33_local0 = 0
if Engine.GetActiveVotes() == 1 then
f33_local0 = Engine.GetNumberOfImagesForVote( 0 )
end
return f33_local0
end
function CastVoteForItem( f34_arg0, f34_arg1 )
if Engine.GetActiveVotes() == 1 then
Engine.VoteForDLCItem( f34_arg0, GetActiveVoteIndex(), f34_arg1 )
Engine.SetPlayerDataReservedShort( f34_arg0, CoD.StatsGroup.Common, "common_last_vote_base_counter", Engine.GetVotingID( GetActiveVoteIndex() ) )
end
end
function ShouldDisplayVoteScreen( f35_arg0 )
if Engine.GetActiveVotes() > 0 then
local f35_local0 = Engine.GetPlayerDataReservedShort( f35_arg0, CoD.StatsGroup.Common, "common_last_vote_base_counter" )
local f35_local1 = Engine.GetVotingID( GetActiveVoteIndex() )
if f35_local1 > -1 and f35_local1 ~= f35_local0 then
return true
end
end
return false
end
function StartVoteImageDownload( f36_arg0 )
Engine.StartVoteImageDownload( f36_arg0 )
end
function IsVoteImageDownloaded( f37_arg0 )
return Engine.IsVoteImageDownloaded( f37_arg0 )
end
function GetActiveVoteIndex()
return 0
end
function ShouldShowDownloadReminder( f39_arg0 )
return #GetMapPacksUserCanDownloadViaSeasonPass() > 0
end
function GetMapPacksUserCanDownloadViaSeasonPass()
local f40_local0 = {}
if not Engine.AnyoneHasSeasonPass() then
return f40_local0
end
local f40_local1 = Engine.GetDvarInt( "num_available_map_packs" )
for f40_local2 = 1, f40_local1, 1 do
if not Engine.AnyoneHasSpecificDLCPack( "dlc" .. 2 + f40_local2 ) then
table.insert( f40_local0, f40_local2 )
end
end
return f40_local0
end
function GetDownloadReminderMessage()
local f41_local0 = Engine.Localize( "LUA_MENU_MP_MOTD_DOWNLOAD_PURCHASED_DLC" )
for f41_local4, f41_local5 in ipairs( GetMapPacksUserCanDownloadViaSeasonPass() ) do
f41_local0 = f41_local0 .. "\n - " .. Engine.Localize( "DLC_MAP_PACK_" .. f41_local5 )
end
return f41_local0
end

View File

@@ -0,0 +1,891 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
MOTD_WIDTH = 892
MOTD_HEIGHT = 590
MOTD_ANIM_DELTA = 600
MOTD_ANIM_TIME_MS = 100
MOTD_IMAGE_TOP_INDENT = 90
MOTD_IMAGE_LEFT_INDENT = 58
MOTD_IMAGE_SIZE = 340
MOTD_TEXT_TOP_INDENT = MOTD_IMAGE_TOP_INDENT
MOTD_TEXT_LEFT_INTENT = 490
MOTD_TEXT_WIDTH = 367
MOTD_UPSELL_MENU_CONTINUE_EVENT = 0
MOTD_UPSELL_OPEN_STORE_EVENT = 1
MOTD_UPSELL_MAX_EVENT_RECORDED = 2
MOTDLayoutType = {
DEFAULT = 0,
VOTING = 1
}
function UpsellAction( f1_arg0, f1_arg1 )
f1_arg0:dispatchEventToParent( {
name = "motd_continue",
exitMotd = true,
controller = f1_arg1.controller,
upsellEvent = MOTD_UPSELL_OPEN_STORE_EVENT
} )
Sns.OpenStoreMenu( f1_arg1.controller, "upsell_menu", true )
end
function RecordUpsellMenuAction( f2_arg0, f2_arg1 )
local f2_local0 = (Engine.GetPlayerDataReservedInt( f2_arg0, CoD.StatsGroup.Common, "sp_upsell_recent_updated_record" ) + 1) % MOTD_UPSELL_MAX_EVENT_RECORDED
Engine.SetUpsellMenuCloseTimestamp()
local f2_local1 = Engine.GetUpsellMenuViewTime()
if f2_local0 == 0 then
Engine.SetPlayerDataReservedInt( f2_arg0, CoD.StatsGroup.Common, "sp_upsell_view_time_0", f2_local1 )
Engine.SetPlayerDataReservedInt( f2_arg0, CoD.StatsGroup.Common, "sp_upsell_action_0", f2_arg1 )
Engine.SetPlayerDataReservedInt( f2_arg0, CoD.StatsGroup.Common, "sp_upsell_open_timestamp_0", Engine.GetUpsellMenuOpenTimestamp() )
else
Engine.SetPlayerDataReservedInt( f2_arg0, CoD.StatsGroup.Common, "sp_upsell_view_time_1", f2_local1 )
Engine.SetPlayerDataReservedInt( f2_arg0, CoD.StatsGroup.Common, "sp_upsell_action_1", f2_arg1 )
Engine.SetPlayerDataReservedInt( f2_arg0, CoD.StatsGroup.Common, "sp_upsell_open_timestamp_1", Engine.GetUpsellMenuOpenTimestamp() )
end
Engine.SetPlayerDataReservedInt( f2_arg0, CoD.StatsGroup.Common, "sp_upsell_recent_updated_record", f2_local0 )
end
function CodAnywhereAction( f3_arg0, f3_arg1 )
f3_arg0:dispatchEventToParent( {
name = "motd_continue",
exitMotd = true,
controller = f3_arg1.controller
} )
OpenCoDAnywhere( f3_arg1.controller )
end
function OpenStoreAction( f4_arg0, f4_arg1 )
LUI.FlowManager.RequestLeaveMenu( f4_arg0 )
Sns.OpenStoreMenu( f4_arg1.controller, "motd" )
end
motdLayouts = {
welcomeFounder = {
title = Engine.Localize( "@LUA_MENU_WELCOME_FOUNDER_TITLE" ),
message = Engine.Localize( "@LUA_MENU_WELCOME_FOUNDER_MESSAGE" ),
image = "image_motd_founder"
},
welcomeSoldier = {
title = Engine.Localize( "@LUA_MENU_WELCOME_SOLDIER_TITLE" ),
message = Engine.Localize( "@LUA_MENU_WELCOME_SOLDIER_MESSAGE" ),
image = "image_motd_soldier"
},
welcomeNoob = {
title = Engine.Localize( "@LUA_MENU_WELCOME_NOOB_TITLE" ),
message = Engine.Localize( "@LUA_MENU_WELCOME_NOOB_MESSAGE" ),
image = "image_motd_new_guy"
},
seasonPassUpsell = {
title = Engine.Localize( "@LUA_MENU_SEASON_PASS_TITLE" ),
message = Engine.Localize( "@LUA_MENU_SEASON_PASS_MESSAGE" ),
image = "image_motd_season_pass",
additional_buttons = {
{
helperTextRef = "button_alt1",
eventAction = "button_alt1",
label = Engine.Localize( "@LUA_MENU_PURCHASE_NOW" ),
handler = UpsellAction,
enabled = function ()
return true
end
}
}
},
festiveUpsell = {
title = Engine.Localize( "@LUA_MENU_FESTIVE_UPSELL_TITLE" ),
message = Engine.Localize( "@LUA_MENU_FESTIVE_UPSELL_MSG" ),
image = "image_motd_holiday",
additional_buttons = {
{
helperTextRef = "button_alt1",
eventAction = "button_alt1",
label = Engine.Localize( "@LUA_MENU_FREE" ),
handler = UpsellAction,
enabled = function ()
return true
end
}
}
},
wolfpackUpsell = {
title = Engine.Localize( "@LUA_MENU_WOLF_UPSELL_TITLE" ),
message = Engine.Localize( "@LUA_MENU_WOLF_UPSELL_MSG" ),
image = "image_motd_wolfskin",
additional_buttons = {
{
helperTextRef = "button_alt1",
eventAction = "button_alt1",
label = Engine.Localize( "@LUA_MENU_PURCHASE_NOW" ),
handler = UpsellAction,
enabled = function ()
return true
end
}
}
},
codAnywhereUpsell = {
title = Engine.Localize( "@LUA_MENU_MOTD_CODA_PLEASE_REGISTER_TITLE" ),
message = Engine.Localize( "@LUA_MENU_MOTD_CODA_PLEASE_REGISTER_MESSAGE" ),
image = "image_motd_cod_account_generic",
additional_buttons = {
{
helperTextRef = "button_alt1",
eventAction = "button_alt1",
label = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_CREATE_ACCOUNT" ),
handler = CodAnywhereAction,
enabled = function ()
return true
end
}
}
},
downloadReminder = {
title = Engine.Localize( "@LUA_MENU_MP_MOTD_DOWNLOAD_PURCHASED_DLC_CAPS" ),
message = function ()
return GetDownloadReminderMessage()
end,
image = "image_motd_season_pass"
},
motd = {
title = Engine.Localize( "@LUA_MENU_MOTD_CAPS" ),
message = function ()
return Engine.GetDvarString( "motd" )
end,
image = "iotd_image",
additional_buttons = {
{
helperTextRef = "button_alt1",
eventAction = "button_alt1",
label = Engine.Localize( "@MPUI_OPEN_STORE" ),
handler = OpenStoreAction,
enabled = function ()
return Engine.GetDvarInt( "motd_store_link" ) == 1
end
}
}
},
voting = {
type = MOTDLayoutType.VOTING,
title = Engine.Localize( "@LUA_MENU_MP_MOTD_VOTING_TITLE" ),
message = function ()
return GetVotingPageHeader()
end,
button_action_text = Engine.Localize( "@LUA_MENU_MP_MOTD_VOTING_SKIP" ),
additional_buttons = {
{
helperTextRef = "button_dpad_left",
eventAction = "button_left",
label = Engine.Localize( "@LUA_MENU_MP_MOTD_VOTING_ITEM_HELPER", 1 ),
handler = function ( f13_arg0, f13_arg1 )
CastVoteForItem( f13_arg1.controller, 0 )
f13_arg0:dispatchEventToParent( {
name = "motd_continue",
controller = f13_arg1.controller,
upsellEvent = MOTD_UPSELL_MENU_CONTINUE_EVENT
} )
end,
enabled = function ()
return true
end
},
{
helperTextRef = "button_dpad_up",
eventAction = "button_up",
label = Engine.Localize( "@LUA_MENU_MP_MOTD_VOTING_ITEM_HELPER", 2 ),
handler = function ( f15_arg0, f15_arg1 )
CastVoteForItem( f15_arg1.controller, 1 )
f15_arg0:dispatchEventToParent( {
name = "motd_continue",
controller = f15_arg1.controller,
upsellEvent = MOTD_UPSELL_MENU_CONTINUE_EVENT
} )
end,
enabled = function ()
return true
end
},
{
helperTextRef = "button_dpad_right",
eventAction = "button_right",
label = Engine.Localize( "@LUA_MENU_MP_MOTD_VOTING_ITEM_HELPER", 3 ),
handler = function ( f17_arg0, f17_arg1 )
CastVoteForItem( f17_arg1.controller, 2 )
f17_arg0:dispatchEventToParent( {
name = "motd_continue",
controller = f17_arg1.controller,
upsellEvent = MOTD_UPSELL_MENU_CONTINUE_EVENT
} )
end,
enabled = function ()
return true
end
},
{
helperTextRef = "button_dpad_down",
eventAction = "button_down",
label = Engine.Localize( "@LUA_MENU_MP_MOTD_VOTING_ITEM_HELPER", 4 ),
handler = function ( f19_arg0, f19_arg1 )
CastVoteForItem( f19_arg1.controller, 3 )
f19_arg0:dispatchEventToParent( {
name = "motd_continue",
controller = f19_arg1.controller,
upsellEvent = MOTD_UPSELL_MENU_CONTINUE_EVENT
} )
end,
enabled = function ()
return true
end
}
}
}
}
function UpdateActionText( f21_arg0, f21_arg1 )
f21_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = Engine.IsConsoleGame() and "button_action" or "button_secondary",
helper_text = f21_arg1,
side = "left",
clickable = true
} )
end
function UpdateAdditionalButtons( f22_arg0, f22_arg1 )
if not f22_arg1 then
return
end
for f22_local0 = 1, #f22_arg1, 1 do
if f22_arg1[f22_local0].enabled() then
f22_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = f22_arg1[f22_local0].helperTextRef,
helper_text = f22_arg1[f22_local0].label,
side = "left",
clickable = true
} )
f22_arg0:dispatchEventToRoot( {
name = "update_button_handler",
eventAction = f22_arg1[f22_local0].eventAction,
newHandler = f22_arg1[f22_local0].handler,
immediate = true
} )
end
end
end
function motdContinueFunc( f23_arg0, f23_arg1 )
local f23_local0 = f23_arg0.properties
local f23_local1 = ""
if f23_local0.layout then
f23_local1 = f23_local0.layout
end
if f23_local1 == "seasonPassUpsell" and f23_arg1.upsellEvent then
RecordUpsellMenuAction( f23_arg1.controller, f23_arg1.upsellEvent )
end
local f23_local2 = nil
if f23_local0 and f23_local0.layoutQueue and #f23_local0.layoutQueue >= 1 and not f23_arg1.exitMotd then
f23_local2 = table.remove( f23_local0.layoutQueue, 1 )
f23_local0.layout = f23_local2
local f23_local3 = MOTDLayoutType.DEFAULT
if motdLayouts[f23_local2] and motdLayouts[f23_local2].type then
f23_local3 = motdLayouts[f23_local2].type
end
f23_arg0:processEvent( {
name = "update_layout_type",
layout_type = f23_local3
} )
if f23_local2 == "seasonPassUpsell" then
Engine.SetUpsellMenuOpenTimestamp()
end
if motdLayouts[f23_local2] and motdLayouts[f23_local2].title then
f23_arg0:processEvent( {
name = "update_title",
title_text = motdLayouts[f23_local2].title
} )
end
if motdLayouts[f23_local2] and motdLayouts[f23_local2].message then
local f23_local4 = motdLayouts[f23_local2].message
if type( f23_local4 ) == "function" then
f23_local4 = motdLayouts[f23_local2].message()
end
f23_arg0:processEvent( {
name = "motd_update_message",
message = f23_local4
} )
end
if motdLayouts[f23_local2] and motdLayouts[f23_local2].image then
if motdLayouts[f23_local2].image == "iotd_image" then
f23_arg0:processEvent( {
name = "show_iotd_image"
} )
else
f23_arg0:processEvent( {
name = "show_custom_image",
image = motdLayouts[f23_local2].image
} )
end
end
f23_arg0:processEvent( {
name = "clear_button_helper_text",
side = "left"
} )
local f23_local4 = Engine.Localize( "@MENU_CONTINUE" )
if motdLayouts[f23_local2] and motdLayouts[f23_local2].button_action_text then
f23_local4 = motdLayouts[f23_local2].button_action_text
end
UpdateActionText( f23_arg0, f23_local4 )
if motdLayouts[f23_local2] and motdLayouts[f23_local2].additional_buttons then
UpdateAdditionalButtons( f23_arg0, motdLayouts[f23_local2].additional_buttons )
end
else
f23_arg0:processEvent( {
name = "exit_transition"
} )
if f23_arg1.controller then
Engine.ExecNow( "uploadstats", f23_arg1.controller )
end
end
end
function motd_main( f24_arg0, f24_arg1, f24_arg2 )
local f24_local0 = f24_arg1 or {}
local f24_local1, f24_local2, f24_local3, f24_local4 = nil
if f24_local0.layoutQueue and #f24_local0.layoutQueue >= 1 then
f24_local1 = table.remove( f24_local0.layoutQueue, 1 )
elseif f24_local0.layout then
f24_local1 = f24_local0.layout
end
local f24_local5
if f24_local1 then
f24_local5 = motdLayouts[f24_local1].title
if not f24_local5 then
f24_local5 = f24_local0.title
if not f24_local5 then
f24_local5 = ""
end
end
else
f24_local5 = f24_local0.title
if not f24_local5 then
f24_local5 = ""
end
end
local f24_local6
if f24_local1 then
f24_local6 = motdLayouts[f24_local1].message
if not f24_local6 then
f24_local6 = f24_local0.message
if not f24_local6 then
f24_local6 = ""
end
end
else
f24_local6 = f24_local0.message
if not f24_local6 then
f24_local6 = ""
end
end
local f24_local7
if f24_local1 then
f24_local7 = motdLayouts[f24_local1].image
if not f24_local7 then
f24_local7 = f24_local0.image
if not f24_local7 then
f24_local7 = "white"
end
end
else
f24_local7 = f24_local0.image
if not f24_local7 then
f24_local7 = "white"
end
end
if type( f24_local6 ) == "function" then
f24_local6 = motdLayouts[f24_local1].message()
end
local self = LUI.UIElement.new()
self.id = "the_root_id"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
} )
self:animateToState( "default" )
local f24_local9 = LUI.UIImage.new()
f24_local9.id = "dimOverlay_id"
f24_local9:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "white" ),
red = 0.1,
green = 0.14,
blue = 0.16,
alpha = 0
} )
f24_local9:registerAnimationState( "visible", {
alpha = 0.85
} )
f24_local9:animateToState( "default" )
f24_local9:animateToState( "visible", MOTD_ANIM_TIME_MS )
self:addElement( f24_local9 )
local f24_local10 = LUI.UIElement.new()
f24_local10.id = "motd_root"
f24_local10.properties = {
layoutQueue = f24_local0.layoutQueue,
layout = f24_local1
}
f24_local10:registerAnimationState( "default0", {
leftAnchor = false,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = -MOTD_WIDTH / 2,
right = MOTD_WIDTH / 2,
top = -MOTD_HEIGHT / 2,
bottom = MOTD_HEIGHT / 2,
alpha = 0
} )
f24_local10:registerAnimationState( "visible", {
leftAnchor = false,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = -MOTD_WIDTH / 2,
right = MOTD_WIDTH / 2,
top = -MOTD_HEIGHT / 2,
bottom = MOTD_HEIGHT / 2,
alpha = 1
} )
f24_local10:registerAnimationState( "exit", {
alpha = 0
} )
f24_local10:registerEventHandler( "motd_continue", motdContinueFunc )
f24_local10:registerEventHandler( "menu_create", MBh.AnimateToState( "visible", MOTD_ANIM_TIME_MS ) )
f24_local10:registerEventHandler( "exit_transition", MBh.AnimateToStateWithEvent( "exit", MOTD_ANIM_TIME_MS ) )
f24_local10:registerEventHandler( "transition_complete_exit", MBh.LeaveMenu() )
f24_local10:animateToState( "default0" )
self:addElement( f24_local10 )
local f24_local11 = LUI.MenuGenerics.generic_drop_shadow( nil, {
offset_shadow = 0,
alpha = 0.35
} )
f24_local11.id = "motd_root_ds"
f24_local10:addElement( f24_local11 )
local f24_local12 = LUI.MenuGenerics.generic_menu_titlebar( nil, {
title_bar_text = f24_local5,
fill_alpha = 1
} )
f24_local12.id = "motd_title_bar"
f24_local10:addElement( f24_local12 )
local f24_local13 = LUI.MenuGenerics.generic_menu_background( nil, {
fill_alpha = 1
} )
f24_local13.id = "bkg1_id"
f24_local10:addElement( f24_local13 )
local f24_local14 = motd_default_view_element( f24_local6, f24_local7 )
f24_local14.id = "motd_default_view_id"
f24_local10:addElement( f24_local14 )
local f24_local15 = motd_vote_view_element( f24_local6 )
f24_local15.id = "motd_vote_view_id"
f24_local10:addElement( f24_local15 )
if Engine.IsConsoleGame() then
local f24_local16 = LUI.UIButton.new()
f24_local16.id = "continuebutton_id"
f24_local16:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
} )
f24_local16:registerEventHandler( "button_action", function ( element, event )
element:dispatchEventToParent( {
name = "motd_continue",
controller = event.controller,
upsellEvent = MOTD_UPSELL_MENU_CONTINUE_EVENT
} )
end )
f24_local16:animateToState( "default" )
f24_local10:addElement( f24_local16 )
end
LUI.MenuBuilder.BuildAddChild( f24_local10, {
type = "UIElement",
id = "help_padding",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 1,
right = -1,
top = 0,
bottom = -1
}
},
children = {
{
type = "button_helper_text_main",
id = "help_texts",
properties = {
left_inset = 10,
top_margin = GenericFooterDims.TopMargin_WithoutBackground,
background_alpha = 0,
hideAlienBar = true
},
handlers = {
menu_create = function ( f26_arg0, f26_arg1 )
local f26_local0 = Engine.Localize( "@MENU_CONTINUE" )
if motdLayouts[f24_local1] and motdLayouts[f24_local1].button_action_text then
f26_local0 = motdLayouts[f24_local1].button_action_text
end
UpdateActionText( f26_arg0, f26_local0 )
if motdLayouts[f24_local1] and motdLayouts[f24_local1].additional_buttons then
UpdateAdditionalButtons( f26_arg0, motdLayouts[f24_local1].additional_buttons )
end
end
}
}
}
} )
local f24_local16 = LUI.UIImage.new()
f24_local16.id = "horizontal_line_id"
f24_local16:registerAnimationState( "default", {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 1,
right = -1,
top = MOTD_HEIGHT - 43,
bottom = MOTD_HEIGHT - 42,
red = Colors.generic_button_border_color.r,
green = Colors.generic_button_border_color.g,
blue = Colors.generic_button_border_color.b,
alpha = 1
} )
f24_local16:animateToState( "default" )
f24_local10:addElement( f24_local16 )
local f24_local17 = LUI.UIBindButton.new()
f24_local17.id = "back"
f24_local17:registerEventHandler( "update_button_handler", function ( element, event )
if event.eventAction and event.newHandler then
f24_local17:registerEventHandler( event.eventAction, event.newHandler )
end
end )
if not Engine.IsConsoleGame() then
f24_local17:registerEventHandler( "button_secondary", function ( element, event )
element:dispatchEventToParent( {
name = "motd_continue",
controller = event.controller
} )
end )
end
f24_local10:addElement( f24_local17 )
return self
end
function motd_default_view_element( menu, controller )
local self = LUI.UIElement.new()
self.id = "motd_default_view_root_id"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 1
} )
self:registerAnimationState( "hidden", {
alpha = 0
} )
self:animateToState( "default" )
self:registerEventHandler( "update_layout_type", function ( element, event )
local f30_local0 = element
local f30_local1 = element.animateToState
local f30_local2 = event.layout_type
local f30_local3 = MOTDLayoutType.DEFAULT
f30_local1( f30_local0, REG6 and "default" or "hidden", 0 )
end )
local f29_local1 = LUI.UIText.new()
f29_local1.id = "motdMessageText_id"
f29_local1:registerAnimationState( "default", {
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.NormalFont.Font,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = MOTD_TEXT_LEFT_INTENT,
right = MOTD_TEXT_LEFT_INTENT + MOTD_TEXT_WIDTH,
top = MOTD_TEXT_TOP_INDENT,
bottom = MOTD_TEXT_TOP_INDENT + CoD.TextSettings.NormalFont.Height
} )
f29_local1:registerEventHandler( "motd_update_message", function ( element, event )
if event.message then
element:setText( event.message )
end
end )
f29_local1:setText( menu )
f29_local1:animateToState( "default" )
self:addElement( f29_local1 )
local f29_local2 = LUI.UIElement.new()
f29_local2.id = "image_layout_container_id"
f29_local2:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = MOTD_IMAGE_LEFT_INDENT,
top = MOTD_IMAGE_TOP_INDENT,
height = MOTD_IMAGE_SIZE + 2,
width = MOTD_IMAGE_SIZE + 2
} )
f29_local2:animateToState( "default" )
self:addElement( f29_local2 )
local f29_local3 = LUI.MenuGenerics.generic_drop_shadow( nil, {
offset_shadow = -3
} )
f29_local2.id = "motd_image_ds"
f29_local2:addElement( f29_local3 )
local f29_local4 = LUI.UIImage.new()
f29_local4.id = "motd_image_border"
f29_local4:registerAnimationState( "default", CoD.ColorizeState( Colors.generic_button_border_color, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "white" )
} ) )
f29_local4:animateToState( "default" )
f29_local2:addElement( f29_local4 )
local f29_local5 = LUI.UIImage.new()
f29_local5.id = "custom_image_id"
f29_local5:registerAnimationState( "default", {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 1,
right = -1,
top = 1,
bottom = -1,
alpha = 1
} )
f29_local5:registerAnimationState( "hidden", {
alpha = 0
} )
f29_local5:registerEventHandler( "show_custom_image", function ( element, event )
element:animateToState( "default" )
if event.image then
element:setImage( RegisterMaterial( event.image ) )
end
end )
f29_local5:registerEventHandler( "show_iotd_image", function ( element, event )
element:animateToState( "hidden" )
end )
if controller == "iotd_image" then
f29_local5:animateToState( "hidden" )
else
f29_local5:animateToState( "default" )
f29_local5:setImage( RegisterMaterial( controller ) )
end
f29_local2:addElement( f29_local5 )
local f29_local6 = LUI.MenuBuilder.BuildAddChild( f29_local4, {
type = "UIOwnerdraw",
id = "motd_iotd_id",
properties = {
ownerDraw = CoD.Ownerdraw.UIIOTD
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 1,
right = -1,
top = 1,
bottom = -1,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
show_iotd_image = MBh.AnimateToState( "default" ),
show_custom_image = MBh.AnimateToState( "hidden" )
}
} )
if controller ~= "iotd_image" then
f29_local6:animateToState( "hidden" )
end
local f29_local7 = LUI.UIImage.new()
f29_local7.id = "vertLine_line_id"
f29_local7:registerAnimationState( "default", {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 446,
right = 447,
top = 90,
bottom = -160,
red = Colors.generic_button_border_color.r,
green = Colors.generic_button_border_color.g,
blue = Colors.generic_button_border_color.b,
alpha = 1
} )
f29_local7:animateToState( "default" )
self:addElement( f29_local7 )
return self
end
function motd_vote_view_element( f34_arg0 )
local f34_local0 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.All )
f34_local0.alpha = 0
local self = LUI.UIElement.new( f34_local0 )
self.id = "motd_vote_view_root_id"
f34_local0.alpha = 1
self:registerAnimationState( "visible", f34_local0 )
self:registerEventHandler( "update_layout_type", function ( element, event )
local f35_local0 = element
local f35_local1 = element.animateToState
local f35_local2 = event.layout_type
local f35_local3 = MOTDLayoutType.VOTING
f35_local1( f35_local0, REG6 and "visible" or "default", 0 )
end )
f34_local0 = CoD.CreateState( 10, 40, -10, 40 + CoD.TextSettings.NormalFont.Height, CoD.AnchorTypes.TopLeftRight )
CoD.ColorizeState( Colors.primary_text_color, f34_local0 )
f34_local0.alignment = LUI.Alignment.Center
f34_local0.font = CoD.TextSettings.NormalFont.Font
local f34_local2 = LUI.UIText.new( f34_local0 )
f34_local2.id = "motd_vote_view_header_text_id"
f34_local2:setText( f34_arg0 )
f34_local2:registerEventHandler( "motd_update_message", function ( element, event )
if event.message then
element:setText( event.message )
end
end )
self:addElement( f34_local2 )
self:addElement( VotingItemFactory( 0, "motd_vote_item_1", 82, 226 ) )
self:addElement( VotingItemFactory( 1, "motd_vote_item_2", 326, 75 ) )
self:addElement( VotingItemFactory( 2, "motd_vote_item_3", 570, 226 ) )
self:addElement( VotingItemFactory( 3, "motd_vote_item_4", 326, 375 ) )
local f34_local3 = 32
local f34_local4 = f34_local3 / 2
f34_local0 = CoD.CreateState( 414, 273, 478, 337, CoD.AnchorTypes.TopLeft )
f34_local0.material = RegisterMaterial( "alien_cash_dpad" )
local f34_local5 = LUI.UIImage.new( f34_local0 )
f34_local5.id = "motd_vote_view_dpad_id"
self:addElement( f34_local5 )
f34_local0 = CoD.CreateState( -f34_local3, -f34_local4, 0, f34_local4, CoD.AnchorTypes.Left )
f34_local0.material = RegisterMaterial( "cont_arrow_lt" )
local f34_local6 = LUI.UIImage.new( f34_local0 )
f34_local6.id = "motd_vote_view_left_arrow_id"
f34_local5:addElement( f34_local6 )
f34_local0 = CoD.CreateState( 0, -f34_local4, f34_local3, f34_local4, CoD.AnchorTypes.Right )
f34_local0.material = RegisterMaterial( "cont_arrow_rt" )
local f34_local7 = LUI.UIImage.new( f34_local0 )
f34_local7.id = "motd_vote_view_right_arrow_id"
f34_local5:addElement( f34_local7 )
f34_local0 = CoD.CreateState( -f34_local4, -f34_local3, f34_local4, 0, CoD.AnchorTypes.Top )
f34_local0.material = RegisterMaterial( "cont_arrow_up" )
local f34_local8 = LUI.UIImage.new( f34_local0 )
f34_local8.id = "motd_vote_view_up_arrow_id"
f34_local5:addElement( f34_local8 )
f34_local0 = CoD.CreateState( -f34_local4, 0, f34_local4, f34_local3, CoD.AnchorTypes.Bottom )
f34_local0.material = RegisterMaterial( "cont_arrow_down" )
local f34_local9 = LUI.UIImage.new( f34_local0 )
f34_local9.id = "motd_vote_view_down_arrow_id"
f34_local5:addElement( f34_local9 )
return self
end
function VotingItemFactory( f37_arg0, f37_arg1, f37_arg2, f37_arg3 )
local f37_local0 = 220
local f37_local1 = 124
local f37_local2 = 10
local f37_local3 = 8
local self = LUI.UIElement.new( CoD.CreateState( f37_arg2, f37_arg3, f37_arg2 + f37_local0 + f37_local2 * 2, f37_arg3 + 160, CoD.AnchorTypes.TopLeft ) )
self.id = f37_arg1
self:registerEventHandler( "check_vote_image_download_status", function ( element, event )
local f38_local0 = Engine.GetVoteItemFileID( GetActiveVoteIndex(), f37_arg0 )
if IsVoteImageDownloaded( f38_local0 ) then
if element.loadingWidget then
element.loadingWidget:close()
end
element.loadingWidget = nil
if element.timerElem then
element.timerElem:close()
end
element.timerElem = nil
if element.image then
element.image:setImage( Engine.GetVoteImageHandle( f38_local0 ) )
element.image:animateToState( "visible", 0 )
end
end
end )
local f37_local5 = CoD.CreateState( 0, f37_local3, 0, f37_local3 + CoD.TextSettings.BoldFont.Height, CoD.AnchorTypes.TopLeftRight )
f37_local5.alignment = LUI.Alignment.Center
f37_local5.font = CoD.TextSettings.BoldFont.Font
local f37_local6 = LUI.UIText.new( f37_local5 )
f37_local6.id = "voting_item_header_id"
f37_local6:setText( GetVotingItemHeader( f37_arg0 ) )
self:addElement( f37_local6 )
f37_local5 = CoD.CreateState( -f37_local0 / 2, -f37_local1 - f37_local3, f37_local0 / 2, -f37_local3, CoD.AnchorTypes.Bottom )
f37_local5.alpha = 0
self.image = LUI.UIImage.new( f37_local5 )
self.image:registerAnimationState( "visible", {
alpha = 1
} )
self.image.id = "voting_item_image_id"
self:addElement( self.image )
self.loadingWidget = LUI.MenuBuilder.buildItems( {
type = "generic_loading_widget",
id = "voting_item_loading_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
}
}, {}, image )
self:addElement( self.loadingWidget )
self.timerElem = LUI.UITimer.new( 500, "check_vote_image_download_status", "voting_image_timer", false, self )
self.timerElem.id = "voting_item_timer_id"
self:addElement( self.timerElem )
return self
end
LUI.MenuBuilder.registerType( "motd_main", motd_main )
LockTable( _M )

View File

@@ -0,0 +1,456 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function BarrackLeaderboardsAction( f1_arg0, f1_arg1 )
if Engine.IsWaitingForOnlineServices( f1_arg1.controller ) then
Engine.Exec( "xopenonlineservicesdialog", f1_arg1.controller )
else
LUI.FlowManager.RequestAddMenu( f1_arg0, "leaderboards", true, f1_arg1.controller )
end
end
function BarrackOperationsAction( f2_arg0, f2_arg1 )
LUI.FlowManager.RequestAddMenu( f2_arg0, "operations_main_menu", true, f2_arg1.controller )
end
function BarrackCreateClanAction( f3_arg0, f3_arg1 )
if CoDAnywhere.ShouldShowLinkCreatePopup( f3_arg1.controller, true ) == true then
LUI.FlowManager.RequestPopupMenu( f3_arg0, "cod_anywhere_popup_menu", true, f3_arg1.controller )
elseif CoDAnywhere.ShouldShowLinkUCDPopup( f3_arg1.controller, true ) == true and Engine.GetDvarInt( "ca_intra_only" ) == 0 then
LUI.FlowManager.RequestPopupMenu( f3_arg0, "cod_anywhere_link_ucd_popup_menu", true, f3_arg1.controller )
else
Clan.Create( f3_arg1.controller )
end
end
function BarrackClanDetailsAction( f4_arg0, f4_arg1 )
if Clan.AlreadyMember( f4_arg1.controller ) then
LUI.FlowManager.RequestAddMenu( f4_arg0, "clan_details_main", true, f4_arg1.controller )
end
end
function BarrackClanInviteAction( f5_arg0, f5_arg1 )
if Clan.CanAcceptInvites( f5_arg1.controller ) == false then
LUI.FlowManager.RequestPopupMenu( f5_arg0, "user_generated_content_restriction_popup", true, f5_arg1.controller )
else
LUI.FlowManager.RequestAddMenu( f5_arg0, "clan_invites", true, f5_arg1.controller )
end
end
function BarrackCoDAnywhereAction( f6_arg0, f6_arg1 )
if CoDAnywhere.ServiceAvailable( f6_arg1.controller ) then
OpenCoDAnywhere( f6_arg1.controller )
else
LUI.FlowManager.RequestPopupMenu( f6_arg0, "generic_confirmation_popup", true, f6_arg1.controller, false, {
popup_title = Engine.Localize( "MENU_ERROR" ),
message_text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_ERROR_SERVICE" )
} )
end
end
function BarrackPrestigeResetStatsAction( f7_arg0, f7_arg1 )
LUI.FlowManager.RequestAddMenu( f7_arg0, "prestige_reset", true, f7_arg1.controller )
end
function BarracksOptionsFeeder( f8_arg0 )
local f8_local0 = Engine.IsAliensMode()
local f8_local1 = not f8_arg0.is_offline_barracks
local f8_local2 = Engine.InLobby()
local f8_local3 = f8_arg0.exclusiveController
if not f8_local3 then
DebugPrint( "[WARNING] Barracks: using controller index 0, this is only ok if you are editing a menu" )
f8_local3 = Engine.GetFirstActiveController()
end
local f8_local4 = {}
if f8_local1 then
f8_local4[#f8_local4 + 1] = {
type = "UIGenericButton",
id = "leaderboard_button_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_LEADERBOARDS_CAPS" ),
button_action_func = BarrackLeaderboardsAction,
desc_text = Engine.Localize( "@LUA_MENU_DESC_LEADERBOARDS" )
}
}
end
if not f8_local0 and IsPublicMatch() then
if Clan.IsEnabled() then
local f8_local5 = #f8_local4 + 1
local f8_local6 = {
type = "UIGenericButton",
id = "create_clan_button_id"
}
local f8_local7 = Engine.IsUserAGuest( f8_local3 )
if not f8_local7 then
f8_local7 = Clan.AlreadyMember( f8_local3 )
if not f8_local7 then
f8_local7 = not CoDAnywhere.ServiceAvailable( f8_local3 )
end
end
f8_local6.disabled = f8_local7
f8_local6.properties = {
button_text = Engine.Localize( "@LUA_MENU_CREATE_CLAN_CAPS" ),
button_action_func = BarrackCreateClanAction,
desc_text = Engine.Localize( "@LUA_MENU_DESC_CREATE_CLAN" )
}
f8_local6.handlers = {
element_refresh = function ( f9_arg0, f9_arg1 )
local f9_local0 = Engine.IsUserAGuest( f8_local3 )
if not f9_local0 then
f9_local0 = Clan.AlreadyMember( f8_local3 )
if not f9_local0 then
f9_local0 = not CoDAnywhere.ServiceAvailable( f8_local3 )
end
end
local f9_local1 = f9_arg0
local f9_local2 = f9_arg0.processEvent
local f9_local3 = {}
local f9_local4
if f9_local0 then
f9_local4 = "disable"
if not f9_local4 then
else
f9_local3.name = f9_local4
f9_local2( f9_local1, f9_local3 )
end
end
f9_local4 = "enable"
end
}
f8_local4[f8_local5] = f8_local6
f8_local5 = #f8_local4 + 1
f8_local6 = {
type = "UIGenericButton",
id = "clan_details_button_id"
}
f8_local7 = Engine.IsUserAGuest( f8_local3 )
if not f8_local7 then
if Clan.AlreadyMember( f8_local3 ) then
f8_local7 = Clan.IsDownloadingData( f8_local3 )
else
f8_local7 = true
end
end
f8_local6.disabled = f8_local7
f8_local6.properties = {
button_text = Engine.Localize( "@CLANS_CLAN_DETAILS_CAPS" ),
button_action_func = BarrackClanDetailsAction,
desc_text = Engine.Localize( "@CLANS_CLAN_DETAILS_DESC_TEXT" )
}
f8_local6.handlers = {
element_refresh = function ( f10_arg0, f10_arg1 )
local f10_local0 = Engine.IsUserAGuest( f8_local3 )
if not f10_local0 then
if Clan.AlreadyMember( f8_local3 ) then
f10_local0 = Clan.IsDownloadingData( f8_local3 )
else
f10_local0 = true
end
end
local f10_local1 = f10_arg0
local f10_local2 = f10_arg0.processEvent
local f10_local3 = {}
local f10_local4
if f10_local0 then
f10_local4 = "disable"
if not f10_local4 then
else
f10_local3.name = f10_local4
f10_local2( f10_local1, f10_local3 )
end
end
f10_local4 = "enable"
end
}
f8_local4[f8_local5] = f8_local6
f8_local5 = #f8_local4 + 1
f8_local6 = {
type = "UIGenericButton",
id = "clan_invite_button_id"
}
f8_local7 = Engine.IsUserAGuest( f8_local3 )
if not f8_local7 then
f8_local7 = Clan.GetNumProposals( f8_local3 ) == 0
end
f8_local6.disabled = f8_local7
f8_local6.properties = {
button_text = Engine.Localize( "@LUA_MENU_CLAN_CLAN_INVITES_CAPS" ),
button_action_func = BarrackClanInviteAction,
desc_text = Engine.Localize( "@LUA_MENU_CLAN_CLAN_INVITES_DESC" )
}
f8_local6.handlers = {
element_refresh = function ( f11_arg0, f11_arg1 )
local f11_local0 = Engine.IsUserAGuest( f8_local3 )
if not f11_local0 then
f11_local0 = Clan.GetNumProposals( f8_local3 ) == 0
end
local f11_local1 = f11_arg0
local f11_local2 = f11_arg0.processEvent
local f11_local3 = {}
local f11_local4
if f11_local0 then
f11_local4 = "disable"
if not f11_local4 then
else
f11_local3.name = f11_local4
f11_local2( f11_local1, f11_local3 )
end
end
f11_local4 = "enable"
end
}
f8_local4[f8_local5] = f8_local6
end
if Engine.GetDvarInt( "allow_cod_anywhere" ) == 1 then
f8_local4[#f8_local4 + 1] = {
type = "UIGenericButton",
id = "cod_anywhere_button_id",
disabled = Engine.IsUserAGuest( f8_local3 ),
properties = {
button_text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_CAPS" ),
button_action_func = BarrackCoDAnywhereAction,
desc_text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_DESC" )
}
}
end
if not f8_local2 then
local f8_local5 = #f8_local4 + 1
local f8_local6 = {
type = "UIGenericButton",
id = "reset_stats_button_id"
}
local f8_local7
if Cac.GetPrestigeLevel( f8_local3, Cac.GetSquadLoc() ) == 10 then
f8_local7 = Engine.IsUserAGuest( f8_local3 )
else
f8_local7 = true
end
f8_local6.disabled = f8_local7
f8_local6.properties = {
button_text = Engine.Localize( "@LUA_MENU_MP_RESET_STATS_CAPS" ),
button_action_func = BarrackPrestigeResetStatsAction,
desc_text = Engine.Localize( "@LUA_MENU_MP_RESET_STATS_DESC" )
}
f8_local6.handlers = {
element_refresh = function ( f12_arg0, f12_arg1 )
local f12_local0
if Cac.GetPrestigeLevel( f8_local3, Cac.GetSquadLoc() ) == 10 then
f12_local0 = Engine.IsUserAGuest( f8_local3 )
else
f12_local0 = true
end
local f12_local1 = f12_arg0
local f12_local2 = f12_arg0.processEvent
local f12_local3 = {}
local f12_local4
if f12_local0 then
f12_local4 = "disable"
if not f12_local4 then
else
f12_local3.name = f12_local4
f12_local2( f12_local1, f12_local3 )
end
end
f12_local4 = "enable"
end
}
f8_local4[f8_local5] = f8_local6
end
end
f8_local4[#f8_local4 + 1] = {
type = "button_desc_text",
id = "barracks_button_description_id"
}
return f8_local4
end
function BarracksButtonHelper( f13_arg0, f13_arg1 )
Engine.ExecNow( "eliteclan_refresh", f13_arg0.properties.exclusiveController )
f13_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function menu_barracks()
return {
type = "UIElement",
id = "menu_barracks_root",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
properties = {
is_offline_barracks = false
},
handlers = {
menu_create = BarracksButtonHelper,
refresh_clan_data = function ( f15_arg0, f15_arg1 )
Engine.ExecNow( "eliteclan_refresh", f15_arg0.properties.exclusiveController )
end
},
children = {
{
type = "generic_menu_title",
id = "barracks_title_text_id",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_BARRACKS_CAPS" )
}
},
{
type = "UIText",
id = "clan_details_downloading",
properties = {
text = Engine.Localize( "LUA_MENU_DOWNLOADING_CLAN" )
},
states = {
default = CoD.ColorizeState( Colors.white, {
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
right = -140,
top = 59,
width = 300,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alpha = 0
} ),
visible = CoD.ColorizeState( Colors.white, {
alpha = 1
} ),
dark = CoD.ColorizeState( Colors.secondary_text_color, {
alpha = 1
} )
},
handlers = {
update_downloading_text = function ( f16_arg0, f16_arg1 )
if Clan.IsDownloadingData( f16_arg0.properties.exclusiveController ) then
if not f16_arg0.properties.animating then
local f16_local0 = MBh.AnimateLoop( {
{
"visible",
400
},
{
"dark",
400
}
} )
f16_local0( f16_arg0 )
f16_arg0.properties.animating = true
end
else
f16_arg0.properties.animating = false
f16_arg0:animateToState( "default" )
end
end
,
menu_create = MBh.EmitEvent( {
name = "update_downloading_text"
} )
},
children = {
{
type = "UITimer",
id = "downloading_text_timer",
properties = {
event = "update_downloading_text",
interval = 100,
disposable = false,
broadcastToRoot = false
}
}
}
},
{
type = "UIVerticalList",
id = "barracks_options_vlist_id",
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
childrenFeeder = BarracksOptionsFeeder
},
{
type = "button_helper_text_main",
id = "barracks_button_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
},
{
type = "UIBindButton",
id = "barracks_bind_buttons_id",
handlers = {
button_secondary = MBh.LeaveMenu()
}
},
{
type = "UITimer",
id = "button_refresh_timer",
properties = {
event = {
name = "element_refresh"
},
interval = 1000
}
},
{
type = "UITimer",
id = "clan_refresh_timer",
properties = {
event = {
name = "refresh_clan_data"
},
interval = 60000
}
}
}
}
end
function barracks_options_vlist()
return {
type = "UIVerticalList",
focusable = true,
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
}
}
end
LUI.MenuBuilder.registerDef( "menu_barracks", menu_barracks )
LUI.MenuBuilder.registerDef( "barracks_options_vlist", barracks_options_vlist )
LockTable( _M )

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,607 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = function ()
return 0
end
f0_local1 = function ()
return 200
end
f0_local2 = function ()
return 0
end
local f0_local3 = function ()
return 0
end
function ToggleRestrictionsStates( f5_arg0, f5_arg1 )
local f5_local0 = f5_arg0:getParent()
local f5_local1 = f5_local0:getFirstDescendentById( "cac_edit_type_" .. f5_arg1 )
if f5_local1 then
f5_local1:processEvent( {
name = f5_local1.restricted and "allow" or "restrict"
} )
end
return f5_local1
end
function RestrictionsChanged( f6_arg0, f6_arg1, f6_arg2, f6_arg3 )
local f6_local0 = f6_arg0:getRootParent()
local f6_local1 = f6_local0:getFirstDescendentById( "menu_custom_class_restrictions_root" )
if f6_arg2 then
f6_local1:dispatchEventToRoot( {
name = "menu_refresh",
controller = f6_arg1.controller,
dispatchChildren = true,
immediate = true
} )
end
if f6_arg3 then
f6_local1:dispatchEventToRoot( {
name = "content_refresh",
type = f6_arg1.contentRefreshType,
controller = f6_arg1.controller,
dispatchChildren = true,
immediate = true
} )
end
end
function ToggleTypeRestricted( f7_arg0, f7_arg1 )
if not MLG.AreMLGRulesEnabled() then
local f7_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f7_arg0 )
local f7_local1 = f7_arg0.properties.itemType
if Cac.PerformMatchRuleToggle( "commonOption", f7_local0.restrictedMatchRule, f7_local1 ) and ToggleRestrictionsStates( f7_arg0, f7_local1 ) then
f7_arg1.contentRefreshType = f7_local0.contentRefreshType
RestrictionsChanged( f7_arg0, f7_arg1, false, true )
if f7_local0.extraContentRefreshType then
f7_arg1.contentRefreshType = f7_local0.extraContentRefreshType
RestrictionsChanged( f7_arg0, f7_arg1, false, true )
end
end
end
end
function CustomClassDisableCheck( f8_arg0 )
local f8_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f8_arg0 )
local f8_local1, f8_local2, f8_local3 = Cac.SafeGetMatchRule( "commonOption", f8_local0.restrictedMatchRule, f8_arg0.properties.itemType )
local f8_local4 = f8_local1 and f8_local2
f8_arg0:processEvent( {
name = "set_checked",
checkBox = f8_local4
} )
local f8_local5 = f8_arg0
local f8_local6 = f8_arg0.processEvent
local f8_local7 = {}
local f8_local8
if f8_local4 then
f8_local8 = "restrict"
if not f8_local8 then
else
f8_local7.name = f8_local8
f8_local6( f8_local5, f8_local7 )
if f8_local3 then
f8_arg0.properties.button_text = f8_arg0.properties.button_text .. f8_local3
end
end
end
f8_local8 = "allow"
end
function ToggleClassRestricted( f9_arg0, f9_arg1 )
if not MLG.AreMLGRulesEnabled() then
local f9_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f9_arg0 )
local f9_local1 = f9_arg1.itemType
local f9_local2, f9_local3, f9_local4 = Cac.SafeGetMatchRule( "commonOption", f9_local0.restrictedMatchRule, f9_local1 )
if f9_local2 then
local f9_local5 = f9_arg0:getParent()
local f9_local6 = f9_local5:getFirstDescendentById( "cac_edit_type_" .. f9_local1 )
if f9_local6 then
MatchRules.SetData( "commonOption", f9_local0.restrictedMatchRule, f9_local1, not f9_local6.restricted )
f9_local6:processEvent( {
name = "set_checked",
checkBox = not f9_local6.restricted
} )
f9_local6:processEvent( {
name = f9_local6.restricted and "allow" or "restrict"
} )
f9_arg1.contentRefreshType = f9_local0.contentRefreshType
RestrictionsChanged( f9_arg0, f9_arg1, false, true )
if f9_local0.extraContentRefreshType then
f9_arg1.contentRefreshType = f9_local0.extraContentRefreshType
RestrictionsChanged( f9_arg0, f9_arg1, false, true )
end
end
end
else
Engine.PlaySound( CoD.SFX.DenySelect )
end
end
function GetWeaponClassData( f10_arg0 )
local f10_local0 = {
overrideAltButtonPressed = ToggleClassRestricted,
itemIndex = f10_arg0,
restrictedMatchRule = "weaponClassRestricted",
checkRestriction = Cac.CheckWeaponTypeRestrictions,
contentRefreshType = "weapon_restrictions_changed",
customTop = f0_local0(),
customLeft = f0_local1(),
customRight = f0_local2(),
customBottom = f0_local3()
}
local f10_local1
if f10_arg0 == Cac.Indices.Weapons.Primary then
f10_local1 = Engine.Localize( "@MPUI_PRIMARY_WEAPON_CAPS" )
if not f10_local1 then
else
f10_local0.titleBarText = f10_local1
f10_local0.buttonFeeder = Cac.EditPopupButtonsFactory( Cac.GetWeaponCategoryName, ClassRestrictionsChooseWeaponTypeAction, Cac.GetWeaponTypes( f10_arg0 == Cac.Indices.Weapons.Primary ), nil, Cac.GetItemClassDescriptions, CustomClassDisableCheck, nil, nil, nil, "menu_custom_class_restrictions" )
return f10_local0
end
end
f10_local1 = Engine.Localize( "@MPUI_SECONDARY_WEAPON_CAPS" )
end
function ClassRestrictionsChooseWeaponTypeAction( f11_arg0, f11_arg1 )
local f11_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f11_arg0 )
local f11_local1 = GetWeaponClassData( f11_local0.itemIndex )
f11_local1.menu = "cac_edit_popup_main"
local f11_local2 = LUI.FlowManager.GetMenuScopedDataByMenuName( "menu_custom_class_restrictions" )
if f11_local2.defaultFocus and type( f11_local2.defaultFocus ) == "table" then
f11_local2.defaultFocus[#f11_local2.defaultFocus + 1] = f11_arg0.properties.itemType
end
LUI.FlowManager.RequestPopupMenu( f11_arg0, "cac_edit_popup_main_second", true, f11_arg1.controller, true, {
itemIndex = f11_local0.itemIndex,
restrictedMatchRule = "weaponRestricted",
contentRefreshType = "weapon_restrictions_changed",
customTop = f0_local0(),
customLeft = f0_local1(),
customRight = f0_local2(),
customBottom = f0_local3(),
titleBarText = Cac.GetWeaponCategoryNameCaps( f11_arg0.properties.itemType ),
buttonFeeder = Cac.EditPopupButtonsFactory( Cac.GetWeaponName, ToggleTypeRestricted, Cac.GetWeaponListReleased( f11_arg0.properties.itemType ), nil, Cac.GetWeaponDesc, CustomClassDisableCheck, nil, nil, nil, "menu_custom_class_restrictions", MLG.AreMLGRulesEnabled ),
editPopupOpenMenuOnClose = f11_local1
} )
end
function PrimaryButtonAction( f12_arg0, f12_arg1 )
LUI.FlowManager.RequestPopupMenu( f12_arg0, "cac_edit_popup_main", true, f12_arg1.controller, false, GetWeaponClassData( 0 ) )
end
function SecondaryButtonAction( f13_arg0, f13_arg1 )
LUI.FlowManager.RequestPopupMenu( f13_arg0, "cac_edit_popup_main", true, f13_arg1.controller, false, GetWeaponClassData( 1 ) )
end
function GetAttachmentClassData()
return {
overrideAltButtonPressed = ToggleClassRestricted,
restrictedMatchRule = "attachmentClassRestricted",
checkRestriction = Cac.CheckAttachmentTypeRestrictions,
contentRefreshType = "attachment_restrictions_changed",
customTop = f0_local0(),
customLeft = f0_local1(),
customRight = f0_local2(),
customBottom = f0_local3(),
titleBarText = Engine.Localize( "@MENU_ATTACHMENTS_CAPS" ),
buttonFeeder = Cac.EditPopupButtonsFactory( Cac.GetAttachmentTypeName, ChooseAttachmentsClassButtonAction, Cac.AttachmentTypes.Types, nil, Cac.GetAttachmentTypeDesc, CustomClassDisableCheck, nil, nil, nil, "menu_custom_class_restrictions" )
}
end
function ChooseAttachmentsClassButtonAction( f15_arg0, f15_arg1 )
local f15_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f15_arg0 )
local f15_local1 = GetAttachmentClassData()
f15_local1.menu = "cac_edit_popup_main"
local f15_local2 = LUI.FlowManager.GetMenuScopedDataByMenuName( "menu_custom_class_restrictions" )
if f15_local2.defaultFocus and type( f15_local2.defaultFocus ) == "table" then
f15_local2.defaultFocus[#f15_local2.defaultFocus + 1] = f15_arg0.properties.itemType
end
LUI.FlowManager.RequestPopupMenu( f15_arg0, "cac_edit_popup_main_second", true, f15_arg1.controller, true, {
ChooseAttachAction = ToggleAttachmentRestricted,
AttachDisableCheck = AttachmentDisableCheck,
restrictedMatchRule = "attachmentRestricted",
contentRefreshType = "attachment_restrictions_changed",
customTop = f0_local0(),
customLeft = f0_local1(),
customRight = f0_local2(),
customBottom = f0_local3(),
titleBarText = Cac.GetAttachmentTypeNameCaps( f15_arg0.properties.itemType ),
buttonFeeder = Cac.EditPopupButtonsFactory( Cac.GetAttachmentName, ToggleTypeRestricted, Cac.GetSimpleAttachmentList( f15_arg0.properties.itemType ), nil, Cac.GetAttachmentDesc, CustomClassDisableCheck, nil, nil, nil, "menu_custom_class_restrictions", MLG.AreMLGRulesEnabled ),
editPopupOpenMenuOnClose = f15_local1
} )
end
function AttachmentsButtonAction( f16_arg0, f16_arg1 )
LUI.FlowManager.RequestPopupMenu( f16_arg0, "cac_edit_popup_main", true, f16_arg1.controller, false, GetAttachmentClassData() )
end
function LethalButtonAction( f17_arg0, f17_arg1 )
LUI.FlowManager.RequestPopupMenu( f17_arg0, "cac_edit_popup_main", true, f17_arg1.controller, false, {
itemIndex = 0,
restrictedMatchRule = "perkRestricted",
contentRefreshType = "grenade_restrictions_changed",
customTop = f0_local0(),
customLeft = f0_local1(),
customRight = f0_local2(),
customBottom = f0_local3(),
titleBarText = Engine.Localize( "@MENU_LETHAL_CAPS" ),
buttonFeeder = Cac.EditPopupButtonsFactory( Cac.GetPerkName, ToggleTypeRestricted, Cac.GetGrenadeListNoNone( 0 ), nil, Cac.GetGrenadeDesc, CustomClassDisableCheck, nil, nil, nil, "menu_custom_class_restrictions", MLG.AreMLGRulesEnabled )
} )
end
function TacticalButtonAction( f18_arg0, f18_arg1 )
LUI.FlowManager.RequestPopupMenu( f18_arg0, "cac_edit_popup_main", true, f18_arg1.controller, false, {
itemIndex = 1,
restrictedMatchRule = "perkRestricted",
contentRefreshType = "grenade_restrictions_changed",
customTop = f0_local0(),
customLeft = f0_local1(),
customRight = f0_local2(),
customBottom = f0_local3(),
titleBarText = Engine.Localize( "@LUA_MENU_TACTICAL_CAPS" ),
buttonFeeder = Cac.EditPopupButtonsFactory( Cac.GetPerkName, ToggleTypeRestricted, Cac.GetGrenadeListNoNone( 1 ), nil, Cac.GetGrenadeDesc, CustomClassDisableCheck, nil, nil, nil, "menu_custom_class_restrictions", MLG.AreMLGRulesEnabled )
} )
end
function GetStrikePackageClassData()
return {
overrideAltButtonPressed = ToggleClassRestricted,
restrictedMatchRule = "killstreakClassRestricted",
checkRestriction = Cac.CheckKillstreakTypeRestrictions,
contentRefreshType = "killstreak_restrictions_changed",
customTop = f0_local0(),
customLeft = f0_local1(),
customRight = f0_local2(),
customBottom = f0_local3(),
titleBarText = Engine.Localize( "@LUA_MENU_STREAK_TYPE_CAPS" ),
buttonFeeder = Cac.EditPopupButtonsFactory( Cac.GetPerkName, ClassRestrictionsChooseStrikePackageTypeAction, Cac.StreakTypes, nil, Cac.GetItemClassDescriptions, CustomClassDisableCheck, nil, nil, nil, "menu_custom_class_restrictions" )
}
end
function ClassRestrictionsChooseStrikePackageTypeAction( f20_arg0, f20_arg1 )
local f20_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "menu_custom_class_restrictions" )
if f20_local0.defaultFocus and type( f20_local0.defaultFocus ) == "table" then
f20_local0.defaultFocus[#f20_local0.defaultFocus + 1] = f20_arg0.properties.itemType
end
if f20_arg0.properties.itemType == "streaktype_specialist" then
f20_arg1.specialist = true
PerkButtonAction( f20_arg0, f20_arg1 )
else
local f20_local1 = GetStrikePackageClassData()
f20_local1.menu = "cac_edit_popup_main"
LUI.FlowManager.RequestPopupMenu( f20_arg0, "cac_edit_popup_main_second", true, f20_arg1.controller, true, {
restrictedMatchRule = "killstreakRestricted",
contentRefreshType = "killstreak_restrictions_changed",
customTop = f0_local0(),
customLeft = f0_local1(),
customRight = f0_local2(),
customBottom = f0_local3(),
titleBarText = Cac.GetStreakTypeCaps( f20_arg0.properties.itemType ),
buttonFeeder = Cac.EditPopupButtonsFactory( Cac.GetStreakName, ToggleTypeRestricted, Cac.GetStreakList( f20_arg0.properties.itemType ), nil, Cac.GetKillstreakDesc, CustomClassDisableCheck, nil, nil, nil, "menu_custom_class_restrictions", MLG.AreMLGRulesEnabled ),
editPopupOpenMenuOnClose = f20_local1
} )
end
end
function StrikePackageButtonAction( f21_arg0, f21_arg1 )
LUI.FlowManager.RequestPopupMenu( f21_arg0, "cac_edit_popup_main", true, f21_arg1.controller, false, GetStrikePackageClassData() )
end
function GetPerkClassData( f22_arg0 )
local f22_local0 = GetStrikePackageClassData()
f22_local0.menu = "cac_edit_popup_main"
return {
overrideAltButtonPressed = ToggleClassRestricted,
restrictedMatchRule = "perkClassRestricted",
checkRestriction = Cac.CheckPerkTypeRestrictions,
contentRefreshType = "perk_restrictions_changed",
extraContentRefreshType = "killstreak_restrictions_changed",
customTop = f0_local0(),
customLeft = f0_local1(),
customRight = f0_local2(),
customBottom = f0_local3(),
specialist = f22_arg0,
titleBarText = Engine.Localize( "@MENU_ABILITIES_CAPS" ),
buttonFeeder = Cac.EditPopupButtonsFactory( Cac.GetPerkTypeNames, ChoosePerkGroupAction, Cac.PerkTypes.Refs, nil, Cac.GetPerkTypeDescription, CustomClassDisableCheck, nil, nil, nil, "menu_custom_class_restrictions" ),
editPopupOpenMenuOnClose = f22_arg0 and f22_local0
}
end
function ChoosePerkGroupAction( f23_arg0, f23_arg1 )
local f23_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f23_arg0 )
local f23_local1 = GetPerkClassData( f23_local0.specialist )
f23_local1.menu = "cac_edit_popup_main_second"
local f23_local2 = LUI.FlowManager.GetMenuScopedDataByMenuName( "menu_custom_class_restrictions" )
if f23_local2.defaultFocus and type( f23_local2.defaultFocus ) == "table" then
f23_local2.defaultFocus[#f23_local2.defaultFocus + 1] = f23_arg0.properties.itemType
end
LUI.FlowManager.RequestPopupMenu( f23_arg0, "cac_edit_popup_main", true, f23_arg1.controller, true, {
restrictedMatchRule = "perkRestricted",
contentRefreshType = "perk_restrictions_changed",
extraContentRefreshType = "killstreak_restrictions_changed",
customTop = f0_local0(),
customLeft = f0_local1(),
customRight = f0_local2(),
customBottom = f0_local3(),
titleBarText = Cac.GetAbilityName( f23_arg0.properties.itemType ),
buttonFeeder = Cac.EditPopupButtonsFactory( Cac.GetPerkName, ToggleTypeRestricted, Cac.GetPerkList( f23_arg0.properties.itemType ), nil, Cac.GetPerkDesc, CustomClassDisableCheck, nil, nil, nil, "menu_custom_class_restrictions", MLG.AreMLGRulesEnabled ),
editPopupOpenMenuOnClose = f23_local1
} )
end
function PerkButtonAction( f24_arg0, f24_arg1 )
LUI.FlowManager.RequestPopupMenu( f24_arg0, "cac_edit_popup_main_second", true, f24_arg1.controller, f24_arg1.specialist, GetPerkClassData( f24_arg1.specialist ) )
end
function GetCheckRestrictionResultString( f25_arg0 )
if f25_arg0 == nil then
return nil
elseif f25_arg0 then
return Engine.Localize( "@MENU_CUSTOM" )
else
return Engine.Localize( "@MENU_ALL" )
end
end
function CheckPrimaryRestrictions( f26_arg0, f26_arg1 )
local f26_local0 = nil
if f26_arg1 and (f26_arg1.name == "menu_create" or f26_arg1.type == "weapon_restrictions_changed") then
f26_local0 = Cac.CheckWeaponRestrictions( "Primary", f26_arg1.controller )
end
return GetCheckRestrictionResultString( f26_local0 )
end
function CheckSecondaryRestrictions( f27_arg0, f27_arg1 )
local f27_local0 = nil
if f27_arg1 and (f27_arg1.name == "menu_create" or f27_arg1.type == "weapon_restrictions_changed") then
f27_local0 = Cac.CheckWeaponRestrictions( "Secondary", f27_arg1.controller )
end
return GetCheckRestrictionResultString( f27_local0 )
end
function CheckAttachmentRestrictions( f28_arg0, f28_arg1 )
local f28_local0 = nil
if f28_arg1 and (f28_arg1.name == "menu_create" or f28_arg1.type == "attachment_restrictions_changed") then
f28_local0 = Cac.CheckAttachmentRestrictionsHelper()
end
return GetCheckRestrictionResultString( f28_local0 )
end
function CheckLethalRestrictions( f29_arg0, f29_arg1 )
local f29_local0 = nil
if f29_arg1 and (f29_arg1.name == "menu_create" or f29_arg1.type == "grenade_restrictions_changed") then
f29_local0 = Cac.CheckGrenadeRestrictions( 0 )
end
return GetCheckRestrictionResultString( f29_local0 )
end
function CheckTacticalRestrictions( f30_arg0, f30_arg1 )
local f30_local0 = nil
if f30_arg1 and (f30_arg1.name == "menu_create" or f30_arg1.type == "grenade_restrictions_changed") then
f30_local0 = Cac.CheckGrenadeRestrictions( 1 )
end
return GetCheckRestrictionResultString( f30_local0 )
end
function CheckStrikePackageRestrictions( f31_arg0, f31_arg1 )
local f31_local0 = nil
if f31_arg1 and (f31_arg1.name == "menu_create" or f31_arg1.type == "killstreak_restrictions_changed") then
f31_local0 = Cac.CheckKillstreakRestrictions()
end
return GetCheckRestrictionResultString( f31_local0 )
end
function CheckPerkRestrictions( f32_arg0, f32_arg1 )
local f32_local0 = nil
if f32_arg1 and (f32_arg1.name == "menu_create" or f32_arg1.type == "perk_restrictions_changed") then
f32_local0 = Cac.CheckPerkRestrictions()
end
return GetCheckRestrictionResultString( f32_local0 )
end
function MenuCustomClassRestrictionsFeeder( f33_arg0 )
local f33_local0 = nil
return {
{
type = "UIGenericButton",
id = "restrictions_primary_id",
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "@MENU_PRIMARY_CAPS" ),
button_display_func = CheckPrimaryRestrictions,
button_action_func = PrimaryButtonAction,
button_text_alignment = LUI.Alignment.Right,
desc_text = nil,
button_over_func = nil,
button_over_disable_func = nil
}
},
{
type = "UIGenericButton",
id = "restrictions_secondary_id",
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "@MENU_SECONDARY_CAPS" ),
button_display_func = CheckSecondaryRestrictions,
button_action_func = SecondaryButtonAction,
button_text_alignment = LUI.Alignment.Right,
desc_text = nil,
button_over_func = nil,
button_over_disable_func = nil
}
},
{
type = "UIGenericButton",
id = "restrictions_attachments_id",
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "@MENU_ATTACHMENTS_CAPS" ),
button_display_func = CheckAttachmentRestrictions,
button_action_func = AttachmentsButtonAction,
button_text_alignment = LUI.Alignment.Right,
desc_text = nil,
button_over_func = nil,
button_over_disable_func = nil
}
},
{
type = "UIGenericButton",
id = "restrictions_lethal_id",
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "@MENU_EQUIPMENT_CAPS" ),
button_display_func = CheckLethalRestrictions,
button_action_func = LethalButtonAction,
button_text_alignment = LUI.Alignment.Right,
desc_text = nil,
button_over_func = nil,
button_over_disable_func = nil
}
},
{
type = "UIGenericButton",
id = "restrictions_tactical_id",
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "@MENU_SPECIAL_EQUIPMENT_CAPS" ),
button_display_func = CheckTacticalRestrictions,
button_action_func = TacticalButtonAction,
button_text_alignment = LUI.Alignment.Right,
desc_text = nil,
button_over_func = nil,
button_over_disable_func = nil
}
},
{
type = "UIGenericButton",
id = "restrictions_strikepackage_id",
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "@MENU_STREAK_TYPE_CAPS" ),
button_display_func = CheckStrikePackageRestrictions,
button_action_func = StrikePackageButtonAction,
button_text_alignment = LUI.Alignment.Right,
desc_text = nil,
button_over_func = nil,
button_over_disable_func = nil
}
},
{
type = "UIGenericButton",
id = "restrictions_abilities_id",
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "@MENU_ABILITIES_CAPS" ),
button_display_func = CheckPerkRestrictions,
button_action_func = PerkButtonAction,
button_text_alignment = LUI.Alignment.Right
}
}
}
end
local f0_local4 = function ( f34_arg0, f34_arg1 )
f34_arg0:dispatchEventToRoot( {
name = "add_button_helper_text",
button_ref = "button_secondary",
helper_text = Engine.Localize( "@LUA_MENU_BACK" ),
side = "left",
clickable = true
} )
end
function menu_custom_class_restrictions()
return {
type = "UIElement",
id = "menu_custom_class_restrictions_root",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
properties = {
additional_handlers = {
primary_button_refresh = PrimaryButtonRefresh
}
},
handlers = {
menu_create = f0_local4
},
children = {
{
type = "UIImage",
id = "menu_custom_class_background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "bkgd_cas" ),
alpha = 0.8
}
}
},
{
type = "generic_menu_title",
id = "menu_custom_class_restrictions_title_text_id",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_RULES_CLASS_RESTRICT_SHORT" )
}
},
{
type = "menu_custom_class_restrictions_options_vlist",
id = "menu_custom_class_restrictions_options_id",
childrenFeeder = MenuCustomClassRestrictionsFeeder
},
{
type = "generic_back_button"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
}
}
}
end
function menu_custom_class_restrictions_options_vlist()
return {
type = "UIVerticalList",
focusable = true,
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right_wide,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
}
}
end
LUI.MenuBuilder.registerDef( "menu_custom_class_restrictions", menu_custom_class_restrictions )
LUI.MenuBuilder.registerDef( "menu_custom_class_restrictions_options_vlist", menu_custom_class_restrictions_options_vlist )
LockTable( _M )

View File

@@ -0,0 +1,571 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function GameModeChooseAction( f1_arg0, f1_arg1 )
local f1_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f1_arg0 )
if f1_local0.squadBaseSelect then
Engine.SetPlayerDataEx( f1_local0.exclusiveControllerIndex, CoD.StatsGroup.Ranked, "squadHQ", "squad_mode", f1_arg0.properties.gameType )
else
local f1_local1 = MatchRules.GetData( "gametype" )
if f1_local1 then
FixTeamLimitsAndDifficultiesIfNecessary( f1_local1, f1_arg0.properties.gameType )
end
MatchRules.SetData( "gametype", f1_arg0.properties.gameType )
if MLG.AreMLGRulesEnabled() then
MLG.LoadMatchRulesData()
else
MatchRules.LoadMatchRulesDataDefault()
end
if Engine.GetDvarBool( "splitscreen" ) == 1 then
Engine.ExecNow( MPConfig.default_splitscreen, f1_arg1.controller )
end
if Engine.GetDvarBool( "systemlink" ) == 1 then
Engine.ExecNow( MPConfig.default_systemlink, f1_arg1.controller )
end
if Engine.GetDvarBool( "xblive_privatematch" ) == 1 then
Engine.ExecNow( MPConfig.default_xboxlive, f1_arg1.controller )
end
if Engine.GetDvarBool( "xblive_privatematch" ) == true and not Engine.IsAliensMode() then
local f1_local2 = Engine.GetDvarInt( "party_maxPrivatePartyPlayers" )
if f1_arg0.properties.gameType == "horde" then
f1_local2 = CoD.MaxSafeguardPlayers
end
if f1_local2 ~= Engine.GetDvarInt( "party_maxplayers" ) then
Engine.SetDvarInt( "party_maxplayers", f1_local2 )
Engine.Exec( "xtogprivateslots; xtogprivateslots; xsessionupdate;" )
end
end
end
GameModeSelectMenuClose( f1_arg0, f1_arg1 )
if f1_local0.squadBaseSelect then
LUI.FlowManager.RequestLeaveMenu( f1_arg0 )
else
LUI.FlowManager.RequestRestoreMenu( f1_arg0, "gamesetup_menu_main", true, f1_arg1.controller, true )
end
if SvS.IsSvS() then
MatchRules.SetData( "commonOption", "allowCustomClasses", false )
end
end
function ShouldHordeBeDisabled()
if Engine.GetDvarBool( "xblive_privatematch" ) == true then
local f2_local0 = Lobby.GetMemberCount( Lobby.MemberListStates.Lobby )
assert( f2_local0 > 0 )
return f2_local0 > CoD.MaxSafeguardPlayers
else
end
end
function UpdateHordeButtonDisabled( f3_arg0, f3_arg1 )
local f3_local0 = ShouldHordeBeDisabled()
if f3_local0 ~= f3_arg0.disabled then
local f3_local1 = f3_arg0
local f3_local2 = f3_arg0.processEvent
local f3_local3 = {}
local f3_local4
if f3_local0 then
f3_local4 = "disable"
if not f3_local4 then
else
f3_local3.name = f3_local4
f3_local2( f3_local1, f3_local3 )
end
end
f3_local4 = "enable"
end
end
function HordeButtonFeeder( f4_arg0 )
local f4_local0 = {
[#f4_local0 + 1] = {
type = "UITimer",
id = "horde_button_refresh_timer",
properties = {
event = "mode_button_disabled",
interval = 100,
disposable = false,
broadcastToRoot = false
}
}
}
return f4_local0
end
function EmitGameModeSelectionUpdate( f5_arg0, f5_arg1 )
f5_arg0:dispatchEventToRoot( {
name = "gamemode_selection_update",
gameType = f5_arg0.properties.gameType,
dispatchChildren = true,
immediate = true,
disabled = f5_arg0.disabled
} )
end
function GameModeSelectFeeder( f6_arg0 )
local f6_local0 = Cac.GetGameModeList( f6_arg0.requestedGameMode )
local f6_local1 = LUI.FlowManager.GetMenuScopedDataByMenuName( "settings_recipe_choosetype" )
local f6_local2 = {}
for f6_local11, f6_local12 in ipairs( f6_local0 ) do
local f6_local6 = false
local f6_local7 = true
local f6_local8, f6_local9, f6_local10 = nil
if f6_local1.squadBaseSelect then
f6_local6 = f6_local12 == Engine.GetPlayerDataEx( f6_local1.exclusiveControllerIndex, CoD.StatsGroup.Ranked, "squadHQ", "squad_mode" )
f6_local7 = Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f6_local12, GameTypesTable.Cols.Squads ) == "1"
else
if f6_local1.teamsOnly then
f6_local7 = Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f6_local12, GameTypesTable.Cols.TeamChoice ) == "1"
end
if f6_local12 == Engine.GetDvarString( "ui_gametype" ) then
f6_local6 = true
end
if f6_local12 == "horde" and Engine.GetDvarBool( "xblive_privatematch" ) == true then
f6_local8 = HordeButtonFeeder
f6_local9 = UpdateHordeButtonDisabled
f6_local10 = ShouldHordeBeDisabled
end
end
if f6_local7 then
f6_local2[#f6_local2 + 1] = {
type = "UIGenericButton",
id = "gameMode_" .. f6_local12,
listDefaultFocus = f6_local6,
disabled = f6_local10 and f6_local10(),
properties = {
button_text = Engine.Localize( Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f6_local12, GameTypesTable.Cols.Name ) .. "_CAPS" ),
gameType = f6_local12,
button_over_func = EmitGameModeSelectionUpdate,
button_over_disable_func = EmitGameModeSelectionUpdate,
additional_handlers = {
button_action = GameModeChooseAction
}
},
handlers = {
mode_button_disabled = f6_local9
},
childrenFeeder = f6_local8
}
end
end
return f6_local2
end
function GameModeSelectMenuCreate( f7_arg0, f7_arg1 )
f7_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function GameModeSelectMenuClose( f8_arg0, f8_arg1 )
local f8_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f8_arg0 )
if not f8_local0.squadBaseSelect then
Engine.ExecNow( "xupdatepartystate" )
end
end
function UpdateGamemodeIcon( f9_arg0, f9_arg1 )
f9_arg0:setImage( RegisterMaterial( Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f9_arg1.gameType, GameTypesTable.Cols.Image ) or "" ) )
end
function UpdateGamemodeTitle( f10_arg0, f10_arg1 )
f10_arg0:setText( Engine.Localize( Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f10_arg1.gameType, GameTypesTable.Cols.Name ) or "" ) )
end
function UpdateGamemodeDesc( f11_arg0, f11_arg1 )
f11_arg0:setText( Engine.Localize( Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f11_arg1.gameType, GameTypesTable.Cols.Desc ) or "" ) )
end
function UpdateDisabledDesc( f12_arg0, f12_arg1 )
if f12_arg1.disabled then
f12_arg0:animateToState( "default" )
else
f12_arg0:animateToState( "hidden" )
end
end
function gamemode_desc_pane()
return {
type = "UIElement",
id = "gamemode_desc_pane_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "generic_menu_titlebar",
id = "gamemode_header_id",
properties = {
title_bar_text_indent = GenericTitleBarDims.TitleBarLCapWidth,
title_bar_alignment = LUI.Alignment.Left,
title_bar_text = Engine.Localize( "@LUA_MENU_MODE_DETAILS_CAPS" ),
font = CoD.TextSettings.BoldFont
}
},
{
type = "generic_menu_background_withfade",
id = "gamemode_bg_fade_id",
children = {
{
type = "UIImage",
id = "gamemode_image_id",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 16,
bottom = 272,
left = -128,
right = 128,
material = RegisterMaterial( "icon_playlist_generic" )
}
},
handlers = {
gamemode_selection_update = UpdateGamemodeIcon
}
},
{
type = "UIText",
id = "gamemode_name_id",
properties = {
text = ""
},
states = {
default = {
left = -144,
top = 32,
width = 240,
height = CoD.TextSettings.BoldFont.Height,
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.Left
}
},
handlers = {
gamemode_selection_update = UpdateGamemodeTitle
}
},
{
type = "UIText",
id = "gamemode_desc_id",
properties = {
text = ""
},
states = {
default = {
left = -144,
top = 52,
width = 296,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b
}
},
handlers = {
gamemode_selection_update = UpdateGamemodeDesc
}
},
{
type = "UIImage",
id = "gamemode_disabled_icon_id",
states = {
default = {
material = RegisterMaterial( "icon_new" ),
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
left = 10,
top = -82,
right = 42,
bottom = -50,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
gamemode_selection_update = UpdateDisabledDesc
}
},
{
type = "UIText",
id = "gamemode_disabled_desc_id",
properties = {
text = Engine.Localize( "LUA_MENU_DESC_TOO_MANY_PLAYERS_HORDE" )
},
states = {
default = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
left = 48,
top = -65 - CoD.TextSettings.NormalFont.Height,
right = -10,
bottom = -65,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
gamemode_selection_update = UpdateDisabledDesc
}
}
}
}
}
}
end
function settings_recipe_choosetype()
return {
type = "UIElement",
id = "settings_recipe_choosetype_root",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
properties = {
requestedGameMode = "Standard",
menu_title = Cac.GetGameModeTypeString( "Standard" )
},
handlers = {
menu_close = GameModeSelectMenuClose,
menu_create = GameModeSelectMenuCreate
},
children = {
{
type = "generic_menu_title",
id = "settings_recipe_choosetype_title_text_id",
properties = {
menu_title = MBh.Property( "menu_title" )
}
},
{
type = "UIStencil",
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
children = {
{
type = "settings_recipe_choosetype_options_vlist",
id = "settings_recipe_choosetype_options_vlist_id",
childrenFeeder = GameModeSelectFeeder,
properties = {
requestedGameMode = MBh.Property( "requestedGameMode" )
}
}
}
},
{
type = "gamemode_desc_pane",
states = {
default = {
leftAnchor = false,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = -64,
right = 288,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
}
},
{
type = "generic_back_button"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
}
}
}
end
function settings_recipe_choosetype_options_vlist()
return {
type = "UIVerticalList",
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = -45,
top = 0,
bottom = 0
}
}
}
end
function SquadsTypeChildrenFeeder( f16_arg0 )
local f16_local0 = {
[#f16_local0 + 1] = {
type = "UIGenericButton",
id = "settings_squads_type_safeguard_button",
properties = {
button_text = Engine.Localize( "LUA_MENU_HORDE" ),
gameType = "horde",
additional_handlers = {
button_action = GameModeChooseAction
}
}
},
[#f16_local0 + 1] = {
type = "UIGenericButton",
id = "settings_squads_type_wargames_button",
properties = {
button_text = Engine.Localize( "LUA_MENU_WARGAME" ),
additional_handlers = {
button_action = function ( f17_arg0, f17_arg1 )
LUI.FlowManager.RequestAddMenu( f17_arg0, "settings_recipe_choosetype", true, f17_arg1.controller, false, {
requestedGameMode = "Standard",
menu_title = Cac.GetGameModeTypeString( "Standard" ),
teamsOnly = true
} )
end
}
}
},
[#f16_local0 + 1] = {
type = "UIGenericButton",
id = "recent_modes_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_RECENT_MODES" ),
button_action_func = function ( f18_arg0, f18_arg1 )
MatchRules.OpenSelectionMenu( f18_arg1.controller, {
savedMode = "history",
menu_title = Engine.Localize( "@LUA_MENU_RECENT_MODES" ),
teamsOnly = SvS.IsSvS()
} )
end
}
},
[#f16_local0 + 1] = {
type = "UIGenericButton",
id = "my_modes_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_MY_MODES" ),
button_action_func = LUI.mp_menus.MPGameSetupModeMenu.ChooseMyModeMenu
}
}
}
return f16_local0
end
function settings_recipe_choosetype_squads()
return {
type = "UIElement",
id = "settings_recipe_choosetype_squads_root",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_close = GameModeSelectMenuClose,
menu_create = function ( f20_arg0, f20_arg1 )
f20_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
},
children = {
{
type = "generic_menu_title",
id = "settings_recipe_choosetype_title_text_id",
properties = {
menu_title = Engine.Localize( "LUA_MENU_MODE_CAPS" )
}
},
{
type = "UIVerticalList",
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
childrenFeeder = SquadsTypeChildrenFeeder
},
{
type = "generic_back_button"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
}
}
}
end
LUI.MenuBuilder.registerDef( "gamemode_desc_pane", gamemode_desc_pane )
LUI.MenuBuilder.registerDef( "settings_recipe_choosetype", settings_recipe_choosetype )
LUI.MenuBuilder.registerDef( "settings_recipe_choosetype_options_vlist", settings_recipe_choosetype_options_vlist )
LUI.MenuBuilder.registerDef( "settings_recipe_choosetype_squads", settings_recipe_choosetype_squads )
LockTable( _M )

View File

@@ -0,0 +1,516 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function PrivatePartyHostSetupMapAction( f1_arg0, f1_arg1 )
LUI.FlowManager.RequestAddMenu( f1_arg0, "mapsetup_menu_main", true, f1_arg1.controller, false, {
rotationAllowed = not Engine.IsAliensMode()
} )
end
function SetupMapAction( f2_arg0, f2_arg1 )
local f2_local0 = {
rotationAllowed = false
}
LUI.FlowManager.RequestAddMenu( f2_arg0, "mapsetup_menu_main", true, f2_arg1.controller, false )
end
function SetupModeAction( f3_arg0, f3_arg1 )
if SvS.IsSvS() then
LUI.FlowManager.RequestAddMenu( f3_arg0, "settings_recipe_choosetype_squads", true, f3_arg1.controller )
else
LUI.FlowManager.RequestAddMenu( f3_arg0, "popup_recipesetup_modes", true, f3_arg1.controller )
end
end
function SetupOptionsAction( f4_arg0, f4_arg1 )
LUI.FlowManager.RequestAddMenu( f4_arg0, "settings_recipe_rules_base", true, f4_arg1.controller, false )
end
function GameSetupMenuCreate( f5_arg0, f5_arg1 )
MatchRules.SetUsingMatchRulesData( 1 )
if Lobby.IsInPrivateParty() and Lobby.IsPrivatePartyHost() then
Lobby.StopIntermissionTimer()
end
local f5_local0 = Engine.GetFirstActiveController()
if f5_arg0.properties.exclusiveController then
f5_local0 = f5_arg0.properties.exclusiveController
end
Engine.SetOldLocalVarBool( f5_local0, "lui_gamesetup_menu", false )
f5_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_secondary",
helper_text = Engine.Localize( "@LUA_MENU_BACK" ),
side = "left",
clickable = true
} )
if not Engine.IsAliensMode() then
f5_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_alt1",
helper_text = Engine.Localize( "@LUA_MENU_RECIPE_SAVE_CUSTOM" ) or "",
side = "left",
clickable = true
} )
end
MLG.Refresh( f5_arg0 )
end
function JIPButtonDisplayText()
if Engine.GetDvarInt( "sv_privateClients" ) == Engine.GetDvarInt( "party_maxPlayers" ) then
return Engine.Localize( "@LUA_MENU_NOTALLOWED" )
else
return Engine.Localize( "@LUA_MENU_ALLOWED" )
end
end
function JIPHandleOptionToggle()
Engine.Exec( "xtogprivateslots; xsessionupdate;" )
end
function IntermissionButtonDisplayText()
if Lobby.IsUsingIntermissionTimer() then
return Engine.Localize( "@LUA_MENU_ENABLED" )
else
return Engine.Localize( "@LUA_MENU_DISABLED" )
end
end
function IntermissionHandleOptionToggle()
if Lobby.IsUsingIntermissionTimer() then
Lobby.UseIntermissionTimer( false )
else
Lobby.UseIntermissionTimer( true )
end
end
function SaveRecipeToMyModes( f10_arg0, f10_arg1 )
if not Engine.IsAliensMode() then
MatchRules.OpenSelectionMenu( f10_arg1.controller, {
savedMode = "save",
menuAction = "save",
menu_title = Engine.Localize( "@LUA_MENU_MY_MODES" ),
return_menu = "gamesetup_menu_main"
} )
end
end
function SaveToVaultAction( f11_arg0, f11_arg1 )
Engine.ExecNow( "incnosplitscreencontrol popup_recipesetup", f11_arg1.controller )
LUI.FlowManager.RequestOldMenu( f11_arg0, "popup_recipesetup", true )
end
function LoadFromHistoryAction( f12_arg0, f12_arg1 )
MatchRules.LoadDataFromHistory( 0 )
f12_arg0:dispatchEventToRoot( {
name = "content_refresh",
dispatchChildren = true
} )
end
function SaveToHistoryAction( f13_arg0, f13_arg1 )
MatchRules.SaveDataToHistory()
end
function SaveToPlayer0Action( f14_arg0, f14_arg1 )
MatchRules.SaveDataToPlayer( 0 )
end
function LoadFromPlayer0Action( f15_arg0, f15_arg1 )
MatchRules.LoadDataFromPlayer( 0 )
f15_arg0:dispatchEventToRoot( {
name = "content_refresh",
dispatchChildren = true
} )
end
function SaveToPlayer2Action( f16_arg0, f16_arg1 )
MatchRules.SaveDataToPlayer( 2 )
end
function LoadFromPlayer2Action( f17_arg0, f17_arg1 )
MatchRules.LoadDataFromPlayer( 2 )
f17_arg0:dispatchEventToRoot( {
name = "content_refresh",
dispatchChildren = true
} )
end
function SaveDefaultsAction( f18_arg0, f18_arg1 )
for f18_local0 = 0, 5, 1 do
MatchRules.SetData( "defaultClasses", "axis", f18_local0, "class", "inUse", false )
MatchRules.SetData( "defaultClasses", "allies", f18_local0, "class", "inUse", false )
MatchRules.SetData( "defaultClasses", "axis", f18_local0, "class", "name", "" )
MatchRules.SetData( "defaultClasses", "allies", f18_local0, "class", "name", "" )
end
MatchRules.SaveMatchRulesDataDefault()
end
function SaveForPlaylistAction( f19_arg0, f19_arg1 )
MatchRules.SaveMatchRulesDataDefault()
end
function ModeButtonDisplayFunc()
if SvS.IsSvS() then
local f20_local0 = MatchRules.GetData( "gametype" )
if f20_local0 == "horde" then
return Lobby.GameTypeNameAbbreviated()
else
return Engine.Localize( Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f20_local0, GameTypesTable.Cols.WargameName ) )
end
else
return Lobby.GameTypeNameAbbreviated()
end
end
function GameSetupMenuOptionsFeeder( f21_arg0 )
local f21_local0 = Engine.Localize( "@LUA_MENU_MAP_CAPS" )
local f21_local1 = SetupMapAction
if Lobby.IsInPrivateParty() and Lobby.IsPrivatePartyHost() then
f21_local0 = Engine.Localize( "@LUA_MENU_MAPS_CAPS" )
f21_local1 = PrivatePartyHostSetupMapAction
end
local f21_local2 = "None"
if Lobby.IsInPrivateParty() and MatchRules.IsUsingCustomMapRotation() then
f21_local2 = Engine.Localize( "@LUA_MENU_ROTATION" )
else
f21_local2 = Lobby.GetMapName()
end
local f21_local3 = {}
if not Engine.IsAliensMode() then
f21_local3[#f21_local3 + 1] = {
type = "UIGenericButton",
id = "maps_button_id",
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = f21_local0,
button_display_func = function ()
return f21_local2
end,
button_action_func = f21_local1
}
}
f21_local3[#f21_local3 + 1] = {
type = "UIGenericButton",
id = "mode_button_id",
disabled = MLG.AreMLGRulesEnabled(),
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "@LUA_MENU_MODE_CAPS" ),
button_display_func = ModeButtonDisplayFunc,
button_action_func = SetupModeAction
},
handlers = {
mlg_enabled = MBh.EmitEvent( {
name = "disable"
} ),
mlg_disabled = MBh.EmitEvent( {
name = "enable"
} )
}
}
end
if not Engine.IsAliensMode() or Engine.IsDevelopmentBuild() and Engine.GetDvarString( "showAliensOptions" ) == "1" then
f21_local3[#f21_local3 + 1] = {
type = "UIGenericButton",
id = "options_button_id",
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "@LUA_MENU_OPTIONS_CAPS" ),
button_display_func = function ()
local f23_local0 = "PATCH_MENU_MATCHRULES_CUSTOM"
if MLG.AreMLGRulesEnabled() then
f23_local0 = "PATCH_MENU_MATCHRULES_MLG"
elseif MatchRules.AreMatchRulesDefaultFromFF() then
f23_local0 = "PATCH_MENU_MATCHRULES_DEFAULT"
end
return Engine.Localize( f23_local0 )
end,
button_action_func = SetupOptionsAction
},
handlers = {
mlg_enabled = MBh.EmitEvent( {
name = "content_refresh"
} ),
mlg_disabled = MBh.EmitEvent( {
name = "content_refresh"
} )
}
}
end
if Lobby.IsInPrivateParty() and Lobby.IsPrivatePartyHost() and not Engine.IsAliensMode() and Lobby.GetPartyPrivacy() >= 0 then
f21_local3[#f21_local3 + 1] = {
type = "UIGenericButton",
id = "privacy_button_id",
properties = {
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( "@PATCH_MENU_PARTY_PRIVACY_CAPS" ),
button_display_func = function ( f24_arg0, f24_arg1 )
return Engine.Localize( Lobby.PrivacySettings.Texts[Lobby.GetPartyPrivacy()] )
end,
button_left_func = function ( f25_arg0, f25_arg1 )
local f25_local0 = Lobby.GetPartyPrivacy() - 1
if f25_local0 < Lobby.PrivacySettings.Min then
f25_local0 = Lobby.PrivacySettings.Max
end
Lobby.SetPartyPrivacy( f25_local0 )
end,
button_right_func = function ( f26_arg0, f26_arg1 )
local f26_local0 = Lobby.GetPartyPrivacy() + 1
if Lobby.PrivacySettings.Max < f26_local0 then
f26_local0 = Lobby.PrivacySettings.Min
end
Lobby.SetPartyPrivacy( f26_local0 )
end
}
}
end
if Lobby.IsInPrivateParty() and Lobby.IsPrivatePartyHost() and not Engine.IsAliensMode() and Lobby.GetPlayerLimit() >= 0 then
local f21_local4 = 2
local f21_local5 = 18
f21_local3[#f21_local3 + 1] = {
type = "UIGenericButton",
id = "limit_button_id",
properties = {
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( "@PATCH_MENU_PLAYER_LIMIT_CAPS" ),
button_display_func = function ( f27_arg0, f27_arg1 )
return Lobby.GetPlayerLimit()
end,
button_left_func = function ( f28_arg0, f28_arg1 )
local f28_local0 = Lobby.GetPlayerLimit() - 1
if f28_local0 < f21_local4 then
f28_local0 = f21_local5
end
Lobby.SetPlayerLimit( f28_local0 )
end,
button_right_func = function ( f29_arg0, f29_arg1 )
local f29_local0 = Lobby.GetPlayerLimit() + 1
if f21_local5 < f29_local0 then
f29_local0 = f21_local4
end
Lobby.SetPlayerLimit( f29_local0 )
end
}
}
end
if not Engine.GetDvarBool( "systemlink" ) and Engine.GetDvarBool( "onlinegame" ) and not f21_arg0.isSoloMode then
if Engine.IsConsoleGame() then
f21_local3[#f21_local3 + 1] = {
type = "UIGenericButton",
id = "jip_button_id",
properties = {
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( "@LUA_MENU_JIP_CAPS" ),
button_display_func = JIPButtonDisplayText,
button_left_func = JIPHandleOptionToggle,
button_right_func = JIPHandleOptionToggle
},
handlers = {
refresh_jip_button_text = function ( f30_arg0, f30_arg1 )
local f30_local0 = JIPButtonDisplayText()
local f30_local1 = f30_arg0:getFirstDescendentById( "content_text_label" )
f30_local1:setText( f30_local0 )
end
},
children = {
{
type = "UITimer",
id = "jip_button_refresh_timer_id",
properties = {
event = "refresh_jip_button_text",
interval = 100,
disposable = false,
broadcastToRoot = false
}
}
}
}
elseif Engine.GetDvarBool( "xblive_privatematch" ) then
f21_local3[#f21_local3 + 1] = {
type = "UIGenericButton",
id = "password_button_id",
disabled = not AreWePrivatePartyHost(),
properties = {
variant = GenericButtonSettings.Variants.Info,
button_text = Engine.Localize( "PATCH_MENU_CHANGE_PASSWORD_CAPS" ),
button_display_func = function ()
local f31_local0 = Engine.GetDvarString( "privateMatch_serverPassword" )
if f31_local0 then
f31_local0 = Engine.GetDvarString( "privateMatch_serverPassword" ) ~= ""
end
local f31_local1
if f31_local0 then
f31_local1 = Engine.Localize( "PATCH_MENU_PASSWORD_SET" )
if not f31_local1 then
else
return f31_local1
end
end
f31_local1 = Engine.Localize( "MENU_NONE" )
end,
button_action_func = function ( f32_arg0, f32_arg1 )
Engine.ExecNow( "setfromdvar ui_password privateMatch_serverPassword" )
Engine.OpenScreenKeyboard( f32_arg1.controller, Engine.Localize( "MENU_PASSWORD" ), Engine.GetDvarString( "ui_password" ) or "", Lobby.PasswordLength, false, false, CoD.KeyboardInputTypes.Password )
end
},
handlers = {
text_input_complete = function ( f33_arg0, f33_arg1 )
if f33_arg1.text then
Engine.SetDvarString( "privateMatch_serverPassword", f33_arg1.text )
f33_arg0:processEvent( {
name = "content_refresh"
} )
end
end
}
}
end
end
if Lobby.IsInPrivateParty() and Lobby.IsPrivatePartyHost() and not Engine.IsAliensMode() then
f21_local3[#f21_local3 + 1] = {
type = "UIGenericButton",
id = "intermission_button_id",
properties = {
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( "@LUA_MENU_INTERMISSION_CAPS" ),
button_display_func = IntermissionButtonDisplayText,
button_left_func = IntermissionHandleOptionToggle,
button_right_func = IntermissionHandleOptionToggle
}
}
end
if Engine.IsDevelopmentBuild() then
f21_local3[#f21_local3 + 1] = {
type = "UIGenericButton",
id = "save_defaults_button_id",
properties = {
button_text = "Save for Default to devkit",
button_action_func = SaveDefaultsAction,
height = 28
}
}
f21_local3[#f21_local3 + 1] = {
type = "UIGenericButton",
id = "save_for_playlist_button_id",
properties = {
button_text = "Save for Playlist/MLG to devkit",
button_action_func = SaveForPlaylistAction,
height = 28
}
}
end
return f21_local3
end
function gamesetup_menu_main()
return {
type = "UIElement",
id = "gamesetup_menu_main_root",
properties = {
isSoloMode = false
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = GameSetupMenuCreate,
update_timer = MLG.Refresh
},
children = {
{
type = "UITimer",
id = "update_timer",
properties = {
event = "update_timer",
disposable = false,
interval = 200
}
},
{
type = "generic_menu_title",
id = "system_link_menu_title",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_GAME_SETUP_CAPS" )
}
},
{
type = "gamesetup_menu_options",
id = "gamesetup_menu_options_id",
properties = {
isSoloMode = MBh.Property( "isSoloMode" )
},
childrenFeeder = GameSetupMenuOptionsFeeder,
handlers = {
mode_changed = function ( f35_arg0, f35_arg1 )
f35_arg0:processEvent( {
name = "content_refresh",
dispatchChildren = true
} )
end
}
},
{
type = "UIBindButton",
id = "gamesetup_bind_buttons_id",
handlers = {
button_secondary = MBh.LeaveMenu(),
button_start = function ( f36_arg0, f36_arg1 )
MLG.Toggle( f36_arg0:getParent(), f36_arg1 )
end
}
},
{
type = "button_helper_text_main",
id = "gamesetup_button_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
},
{
type = "UIBindButton",
id = "save_recipe_bind",
handlers = {
button_alt1 = SaveRecipeToMyModes
}
}
}
}
end
function gamesetup_menu_options()
return {
type = "UIVerticalList",
focusable = true,
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right_wide,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
}
}
end
LUI.MenuBuilder.registerDef( "gamesetup_menu_main", gamesetup_menu_main )
LUI.MenuBuilder.registerDef( "gamesetup_menu_options", gamesetup_menu_options )
LockTable( _M )

View File

@@ -0,0 +1,174 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function ChooseStandardGameModeMenu( f1_arg0, f1_arg1 )
LUI.FlowManager.RequestAddMenu( f1_arg0, "settings_recipe_choosetype", true, f1_arg1.controller, false, {
requestedGameMode = "Standard",
menu_title = Cac.GetGameModeTypeString( "Standard" ),
teamsOnly = SvS.IsSvS()
} )
end
function ChooseAlternateGameModeMenu( f2_arg0, f2_arg1 )
LUI.FlowManager.RequestAddMenu( f2_arg0, "settings_recipe_choosetype", true, f2_arg1.controller, false, {
requestedGameMode = "Alternate",
menu_title = Cac.GetGameModeTypeString( "Alternate" ),
teamsOnly = SvS.IsSvS()
} )
end
function ChooseRecentModeMenu( f3_arg0, f3_arg1 )
MatchRules.OpenSelectionMenu( f3_arg1.controller, {
savedMode = "history",
menu_title = Engine.Localize( "@LUA_MENU_RECENT_MODES" ),
teamsOnly = SvS.IsSvS()
} )
end
function ChooseMyModeMenu( f4_arg0, f4_arg1 )
MatchRules.OpenSelectionMenu( f4_arg1.controller, {
savedMode = "save",
menuAction = "load",
menu_title = Engine.Localize( "@LUA_MENU_MY_MODES" ),
teamsOnly = SvS.IsSvS()
} )
end
function CountModesForCategory( f5_arg0, f5_arg1 )
local f5_local0 = Cac.GetGameModeList( f5_arg0 )
local f5_local1 = 0
for f5_local6, f5_local7 in ipairs( f5_local0 ) do
local f5_local5 = true
if f5_arg1 then
f5_local5 = Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f5_local7, GameTypesTable.Cols.TeamChoice ) == "1"
end
if f5_local5 then
f5_local1 = f5_local1 + 1
end
end
return f5_local1
end
function GameModeFeeder( f6_arg0 )
local f6_local0 = nil
local f6_local1 = LUI.Alignment.Right
f6_local0 = {}
local f6_local2 = SvS.IsSvS()
if CountModesForCategory( "Standard", f6_local2 ) > 0 then
f6_local0[#f6_local0 + 1] = {
type = "UIGenericButton",
id = "standard_modes_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_STANDARD_MODES" ),
button_action_func = ChooseStandardGameModeMenu
}
}
end
if CountModesForCategory( "Alternate", f6_local2 ) > 0 then
f6_local0[#f6_local0 + 1] = {
type = "UIGenericButton",
id = "alternate_modes_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_ALTERNATE_MODES" ),
button_action_func = ChooseAlternateGameModeMenu
}
}
end
if not SvS.IsSvS() then
f6_local0[#f6_local0 + 1] = {
type = "UIGenericButton",
id = "recent_modes_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_RECENT_MODES" ),
button_action_func = ChooseRecentModeMenu
}
}
end
if not SvS.IsSvS() then
f6_local0[#f6_local0 + 1] = {
type = "UIGenericButton",
id = "my_modes_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_MY_MODES" ),
button_action_func = ChooseMyModeMenu
}
}
end
return f6_local0
end
function OnMenuCreate( f7_arg0, f7_arg1 )
f7_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
end
function popup_recipesetup_modes()
return {
type = "UIElement",
id = "popup_recipesetup_modes_root",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = OnMenuCreate
},
properties = {},
children = {
{
type = "generic_menu_title",
id = "popup_recipesetup_modes_title_text_id",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_MODE_CAPS" )
}
},
{
type = "xboxlive_options_vlist",
id = "popup_recipesetup_modes_vlist_id",
childrenFeeder = GameModeFeeder
},
{
type = "generic_back_button"
},
{
type = "button_helper_text_main",
id = "button_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
}
}
}
end
function popup_recipesetup_modes_vlist()
return {
type = "UIVerticalList",
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
}
}
end
LUI.MenuBuilder.registerDef( "popup_recipesetup_modes", popup_recipesetup_modes )
LUI.MenuBuilder.registerDef( "popup_recipesetup_modes_vlist", popup_recipesetup_modes_vlist )
LockTable( _M )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,421 @@
function FiltersPopupClose( f1_arg0, f1_arg1 )
local f1_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f1_arg0 )
local f1_local1 = LUI.FlowManager.GetMenuScopedDataByMenuName( "mp_leaderboard_main" )
local f1_local2 = f1_local1.leaderboardType
if f1_local2 and f1_local2 ~= "" then
Leaderboards.OpenLeaderboard( f1_arg0, f1_local2, f1_local0.filterKey, f1_local1.filterDurationKey, f1_local1.isHardcore )
end
end
function LeaderboardFilterGetGroupKeys( f2_arg0 )
local f2_local0 = {
[#f2_local0 + 1] = "None",
[#f2_local0 + 1] = "Friends"
}
local f2_local1 = f2_arg0.properties.exclusiveController
if not f2_local1 then
f2_local1 = Engine.GetFirstActiveController()
end
if f2_local1 then
if Friends.IsEliteClanAllowed( f2_local1 ) and Friends.EliteClanIsMember( f2_local1 ) then
f2_local0[#f2_local0 + 1] = "Clan"
end
if Engine.GetDvarInt( "party_matchedPlayerCount" ) <= Engine.GetDvarInt( "party_partyPlayerCountNum" ) then
f2_local0[#f2_local0 + 1] = "LobbyMembers"
end
end
return f2_local0
end
function LeaderboardActionsFeeder( f3_arg0 )
local f3_local0 = {}
local f3_local1 = Engine.IsXbox360()
if not f3_local1 then
f3_local1 = Engine.IsXB3()
end
if f3_local1 then
f3_local0[#f3_local0 + 1] = {
type = "UIGenericButton",
id = "profile",
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
button_text = Engine.Localize( "@XBOXLIVE_VIEW_PROFILE" ),
button_action_func = function ( f4_arg0, f4_arg1 )
Leaderboards.ShowGamercard( f4_arg1.controller )
end
}
}
end
if not Engine.IsPS4() and not Engine.IsPS3() then
local f3_local2 = #f3_local0 + 1
local f3_local3 = {
type = "UIGenericButton",
id = "friendrequest"
}
local f3_local4 = Leaderboards.IsPlayerMe( f3_arg0.exclusiveController )
if not f3_local4 then
f3_local4 = Leaderboards.IsPlayerAFriend( f3_arg0.exclusiveController )
end
f3_local3.disabled = f3_local4
f3_local3.properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
button_text = Engine.Localize( "@MENU_FRIEND_REQUEST" ),
button_action_func = function ( f5_arg0, f5_arg1 )
Leaderboards.SendFriendRequest( f5_arg1.controller )
end
}
f3_local0[f3_local2] = f3_local3
end
return f3_local0
end
function PushLeaderboardFilter()
local f6_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "mp_leaderboard_filters_popup" )
f6_local0.filterKey = "None"
for f6_local4, f6_local5 in pairs( Leaderboards.Filters ) do
if f6_local5.Value == Engine.GetDvarString( "lb_filter" ) then
f6_local0.filterKey = f6_local4
break
end
end
end
function LeaderboardFiltersPopupItems( f7_arg0 )
local f7_local0 = {
[#f7_local0 + 1] = {
type = "UIGenericButton",
id = "leaderboard_filters_1",
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.SubMenu,
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( "@LUA_MENU_GROUP_CAPS" ),
button_display_func = function ( f8_arg0, f8_arg1 )
local f8_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f8_arg0 )
return Engine.Localize( Leaderboards.GetLeaderboardFilterOptionText( f8_local0.filterKey ) )
end,
button_left_func = function ( f9_arg0, f9_arg1 )
local f9_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f9_arg0 )
local f9_local1 = LeaderboardFilterGetGroupKeys( f9_arg0 )
local f9_local2 = 1
for f9_local3 = 1, #f9_local1, 1 do
if f9_local1[f9_local3] == f9_local0.filterKey then
f9_local2 = f9_local3
break
end
end
f9_local2 = f9_local2 - 1
if f9_local2 < 1 then
f9_local0.filterKey = f9_local1[#f9_local1]
else
f9_local0.filterKey = f9_local1[f9_local2]
end
end,
button_right_func = function ( f10_arg0, f10_arg1 )
local f10_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f10_arg0 )
local f10_local1 = LeaderboardFilterGetGroupKeys( f10_arg0 )
local f10_local2 = 1
for f10_local3 = 1, #f10_local1, 1 do
if f10_local1[f10_local3] == f10_local0.filterKey then
f10_local2 = f10_local3
break
end
end
f10_local2 = f10_local2 + 1
if #f10_local1 < f10_local2 then
f10_local0.filterKey = f10_local1[1]
else
f10_local0.filterKey = f10_local1[f10_local2]
end
end
}
},
[#f7_local0 + 1] = {
type = "UIGenericButton",
id = "leaderboard_filters_2",
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.SubMenu,
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( "@LUA_MENU_DURATION_CAPS" ),
button_display_func = function ( f11_arg0, f11_arg1 )
local f11_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f11_arg0 )
local f11_local1 = LUI.FlowManager.GetMenuScopedDataByMenuName( "mp_leaderboard_main" )
local f11_local2 = f11_local1.leaderboardType
if f11_local2 == nil or f11_local2 == "" then
return Engine.Localize( Leaderboards.DurationDefs.Alltime.OptionText )
else
local f11_local3 = Leaderboards.GetLeaderboardDurationDef( f11_local2, f11_local1.filterDurationKey )
if f11_local3 then
return Engine.Localize( f11_local3.OptionText )
else
assert( false, "Leaderboard Filter Duration not found" )
return Engine.Localize( "@LUA_MENU_DURATION_CAPS" )
end
end
end,
button_left_func = function ( f12_arg0, f12_arg1 )
local f12_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f12_arg0 )
local f12_local1 = LUI.FlowManager.GetMenuScopedDataByMenuName( "mp_leaderboard_main" )
local f12_local2 = f12_local1.leaderboardType
if f12_local2 and f12_local2 ~= "" then
local f12_local3 = Leaderboards.LeaderboardFilterGetDurationKeys( f12_local2 )
local f12_local4 = 1
for f12_local5 = 1, #f12_local3, 1 do
if f12_local3[f12_local5] == f12_local1.filterDurationKey then
f12_local4 = f12_local5
break
end
end
f12_local4 = f12_local4 - 1
if f12_local4 < 1 then
f12_local1.filterDurationKey = f12_local3[#f12_local3]
end
f12_local1.filterDurationKey = f12_local3[f12_local4]
end
end,
button_right_func = function ( f13_arg0, f13_arg1 )
local f13_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f13_arg0 )
local f13_local1 = LUI.FlowManager.GetMenuScopedDataByMenuName( "mp_leaderboard_main" )
local f13_local2 = f13_local1.leaderboardType
if f13_local2 and f13_local2 ~= "" then
local f13_local3 = Leaderboards.LeaderboardFilterGetDurationKeys( f13_local2 )
local f13_local4 = 1
for f13_local5 = 1, #f13_local3, 1 do
if f13_local3[f13_local5] == f13_local1.filterDurationKey then
f13_local4 = f13_local5
break
end
end
f13_local4 = f13_local4 + 1
if #f13_local3 < f13_local4 then
f13_local1.filterDurationKey = f13_local3[1]
end
f13_local1.filterDurationKey = f13_local3[f13_local4]
end
end
}
}
}
if Engine.GetDvarBool( "extinction_hardcore_enabled" ) and not SvS.IsSvS() then
local f7_local1 = LUI.FlowManager.GetMenuScopedDataByMenuName( "mp_leaderboard_main" )
if Leaderboards.GetLeaderboardHasHardcoreMode( f7_local1.leaderboardType ) then
f7_local0[#f7_local0 + 1] = {
type = "UIGenericButton",
id = "leaderboard_filters_3",
properties = {
style = GenericButtonSettings.Styles.GlassButton,
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( "@LUA_MENU_HARDCORE_CAPS" ),
button_display_func = function ( f14_arg0, f14_arg1 )
local f14_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "mp_leaderboard_main" )
return f14_local0.isHardcore and Engine.Localize( "@MENU_ON" ) or Engine.Localize( "@MENU_OFF" )
end,
button_left_func = function ( f15_arg0, f15_arg1 )
local f15_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "mp_leaderboard_main" )
f15_local0.isHardcore = not f15_local0.isHardcore
end,
button_right_func = function ( f16_arg0, f16_arg1 )
local f16_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "mp_leaderboard_main" )
f16_local0.isHardcore = not f16_local0.isHardcore
end
}
}
end
end
return f7_local0
end
function mp_leaderboard_actions_popup()
local f17_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "mp_leaderboard_main" )
local f17_local1 = f17_local0.selectedRowIndex or 0
local f17_local2 = f17_local0.exclusiveControllerIndex
if not f17_local2 then
f17_local2 = Engine.GetFirstActiveController()
end
return {
type = "generic_selectionList_popup",
id = "mp_leaderboard_actions_popup_id",
handlers = {
close_actions = MBh.LeaveMenu()
},
properties = {
popup_title = Leaderboards.GetValue( f17_local2, f17_local1, 3 ),
popup_childfeeder = LeaderboardActionsFeeder
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
}
}
end
function mp_leaderboard_filters_popup_page()
return {
type = "UIElement",
id = "mp_leaderboard_filters_popup_page_id",
properties = {},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = AAR.Layout.TitleBarHeight + 1,
bottom = -1,
left = 1,
right = -1
}
},
children = {
{
type = "UIText",
id = "leaderboard_filters_instruction",
properties = {
text = Engine.Localize( "@LUA_MENU_FILTER_POPUP_INSTR" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 10,
bottom = 10 + CoD.TextSettings.NormalFont.Height,
left = 75,
right = -75,
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.NormalFont.Font,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b
}
}
},
{
type = "UIVerticalList",
id = "leaderboard_filters_popup_vlist",
properties = {},
states = {
default = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = -90,
bottom = 0,
left = 2,
right = -2,
spacing = 2
}
},
childrenFeeder = LeaderboardFiltersPopupItems
}
}
}
end
function mp_leaderboard_filters_popup()
return {
type = "UIElement",
id = "mp_leaderboard_filters_popup_container_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
children = {
{
type = "UIImage",
id = "darken_bg",
states = {
default = CoD.ColorizeState( Swatches.Overlay.Color, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
material = RegisterMaterial( "white" ),
alpha = Swatches.Overlay.AlphaMore
} )
}
},
{
type = "UIElement",
id = "mp_leaderboard_filters_popup_id",
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -1 * Leaderboards.Layout.FilterHeight * 0.6,
width = Leaderboards.Layout.FilterWidth,
height = Leaderboards.Layout.FilterHeight
}
},
children = {
{
type = "generic_drop_shadow",
properties = {
offset_shadow = 0
}
},
{
type = "generic_menu_titlebar",
id = "leaderboard_filters_popup_title_bar_id",
properties = {
title_bar_text = Engine.Localize( "@LUA_MENU_FILTER_CAPS" ),
fill_alpha = 1
}
},
{
type = "generic_menu_background",
id = "leaderboard_filters_popup_background",
properties = {
fill_alpha = 1
}
},
{
type = "mp_leaderboard_filters_popup_page"
},
{
type = "UIBindButton",
id = "filters_popup_back_button",
handlers = {
button_secondary = MBh.DoMultiple( {
MBh.LeaveMenu(),
FiltersPopupClose
} )
}
}
}
}
}
}
end
LUI.MenuBuilder.registerDef( "mp_leaderboard_actions_popup", mp_leaderboard_actions_popup )
LUI.MenuBuilder.registerDef( "mp_leaderboard_filters_popup", mp_leaderboard_filters_popup )
LUI.MenuBuilder.registerDef( "mp_leaderboard_filters_popup_page", mp_leaderboard_filters_popup_page )
LUI.FlowManager.RegisterStackPushBehaviour( "mp_leaderboard_filters_popup", PushLeaderboardFilter )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,324 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function UpdateMemberWindowProperties( f1_arg0, f1_arg1 )
f1_arg0.properties.memberListState = f1_arg1.memberListState
f1_arg0.properties.memberSlot = f1_arg1.memberSlot
f1_arg0.properties.team = f1_arg1.team
f1_arg0:processEvent( {
name = "refresh_member_window"
} )
end
function RefreshMemberWindow( f2_arg0, f2_arg1 )
local f2_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f2_arg0 )
local f2_local1 = f2_arg0.properties
local f2_local2 = f2_local1.memberListState
local f2_local3 = f2_local1.memberSlot
local f2_local4 = f2_local1.team
if f2_local2 == Lobby.MemberListStates.None then
return
elseif f2_local0.selectedMemberUniqueId ~= GetLobbyMemberUniqueId( f2_local2, f2_local3, f2_local4 ) then
return
end
local f2_local5 = Engine.TableLookup( BackgroundsTable.File, BackgroundsTable.Cols.Ref, Lobby.GetMemberBackground and Lobby.GetMemberBackground( f2_local2, f2_local3, f2_local4 ) or 0, BackgroundsTable.Cols.Image )
if f2_local5 ~= nil then
f2_arg0:setBackground( f2_local5 )
end
local f2_local6 = {}
local f2_local7 = Lobby.GetMemberPartModelName( f2_local2, f2_local3, f2_local4, Lobby.CustomizationTypes.Head )
if f2_local7 and f2_local7 ~= "" then
if Engine.TableLookup( "mp/cac/helmets.csv", 0, f2_local7, 4 ) == "1" and string.find( f2_local7, "alt", -4 ) ~= nil then
f2_local7 = string.sub( f2_local7, 0, -4 ) .. "alt_f"
end
f2_local6.headModel = f2_local7
end
local f2_local8 = Lobby.GetMemberPartModelName( f2_local2, f2_local3, f2_local4, Lobby.CustomizationTypes.Body )
if f2_local8 and f2_local8 ~= "" then
f2_local6.bodyModel = string.sub( f2_local8, 0, -6 ) .. "elite"
end
local f2_local9 = Lobby.GetMemberPatch( f2_local2, f2_local3, f2_local4 )
if f2_local9 then
f2_local6.patch = f2_local9
end
if Engine.IsAliensMode() then
local f2_local10 = Lobby.GetMemberPerk( f2_local3, 1 )
if f2_local10 then
f2_local6.primaryWeaponName = "iw6_" .. string.sub( f2_local10, string.len( "perk_pistol_" ) + 1 ) .. "_mp"
end
else
local f2_local10 = Lobby.GetMemberWeaponSetup( f2_local2, f2_local3, f2_local4 )
local f2_local11 = 0
if f2_local10.camoName then
f2_local11 = tonumber( Cac.GetCamoWeaponIndex( f2_local10.camoName ) )
end
local f2_local12 = Cac.BuildWeaponName( f2_local10.weaponName, f2_local10.attachName1, f2_local10.attachName2, f2_local11, 0, f2_local10.attachName3 )
if f2_local12 then
f2_local6.primaryWeaponName = f2_local12
end
end
f2_arg0:updateCharacter( f2_local6 )
end
function LobbyCharacterViewUpdateSquadBotInfo( f3_arg0, f3_arg1 )
if Lobby.IsMemberAISquadMember and Lobby.IsMemberAISquadMember( f3_arg1.memberListState, f3_arg1.memberSlot, f3_arg1.team ) then
f3_arg0:animateToState( "default" )
else
f3_arg0:animateToState( "hidden" )
end
end
function LobbyCharacterViewSetSquadBotWeaponClassText( f4_arg0, f4_arg1 )
local f4_local0 = Lobby.IsMemberAISquadMember
if f4_local0 then
f4_local0 = Lobby.IsMemberAISquadMember( f4_arg1.memberListState, f4_arg1.memberSlot, f4_arg1.team )
end
if not f4_local0 or not Lobby.IsActiveMemberSlot( f4_arg1.memberIndex - 1 ) or not Lobby.GetSquadMemberWeaponName then
return
end
local f4_local1 = Lobby.GetSquadMemberWeaponName( f4_arg1.memberListState, f4_arg1.memberSlot, f4_arg1.team, f4_arg1.controller )
local f4_local2 = ""
if f4_local1 == "iw6_knifeonly" then
f4_local2 = Cac.GetWeaponName( f4_local1 )
else
f4_local2 = Cac.GetWeaponCategoryNameSingle( Cac.GetWeaponClass( f4_local1 ) )
end
if f4_local2 then
f4_arg0:setText( f4_local2 )
end
f4_arg0:animateToState( "default" )
end
function LobbyCharacterViewSetSquadBotWeaponText( f5_arg0, f5_arg1 )
local f5_local0 = Lobby.IsMemberAISquadMember
if f5_local0 then
f5_local0 = Lobby.IsMemberAISquadMember( f5_arg1.memberListState, f5_arg1.memberSlot, f5_arg1.team )
end
if not f5_local0 or not Lobby.IsActiveMemberSlot( f5_arg1.memberIndex - 1 ) or not Lobby.GetSquadMemberWeaponName then
return
end
local f5_local1 = Lobby.GetSquadMemberWeaponName( f5_arg1.memberListState, f5_arg1.memberSlot, f5_arg1.team, f5_arg1.controller )
if f5_local1 == "iw6_knifeonly" then
f5_arg0:setText( "" )
else
f5_arg0:setText( Cac.GetWeaponName( f5_local1 ) )
end
f5_arg0:animateToState( "default" )
end
function CharacterViewChildFeeder( f6_arg0 )
local f6_local0 = {
{
type = "UISquadMemberWindow",
id = "CharacterViewSquadMemberWindow",
properties = {
use_member_name = false,
use_prestige_icon = false,
use_playercard = false,
use_background = true,
default_anim = Cac.Customization.Animations.default,
uv_values = {
0,
0,
1,
1
},
character_pos = CharacterCameraPresets.Lobby.Position,
char_window_dims = {
top = 0,
bottom = 610,
left = -175,
right = 435
},
card_scale = -0.15,
squad_location = MBh.Property( "squad_location" ),
mask_pos_data = {
top = 17,
bottom = 0,
left = 0,
right = 0
},
memberListState = Lobby.MemberListStates.None,
memberSlot = 0,
team = Teams.free
},
states = {
default = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = true,
top = 70,
left = 0 + Cac.Layout.CacEditPanel.shift_delta,
bottom = 670,
right = 746 + Cac.Layout.CacEditPanel.shift_delta
}
},
handlers = {
menu_create = function ( f7_arg0, f7_arg1 )
f7_arg0:processEvent( {
name = "set_border_state",
border_state = "hidden"
} )
end,
lobby_detail_update = UpdateMemberWindowProperties,
refresh_member_window = RefreshMemberWindow,
menu_close = function ( f8_arg0, f8_arg1 )
LUI.UISquadMemberWindow.Shutdown( f8_arg0 )
end
}
},
{
type = "UITimer",
id = "member_window_refresh_timer",
properties = {
event = "refresh_member_window",
interval = 300,
disposable = false
}
}
}
if SvS.IsSvS() then
f6_local0[#f6_local0 + 1] = {
type = "UIVerticalList",
id = "lobby_character_view_squad_weapon_container",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = false,
bottomAnchor = true,
left = 20,
right = 500,
top = -200,
bottom = -250,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
lobby_detail_update = LobbyCharacterViewUpdateSquadBotInfo
},
children = {
{
type = "UIText",
id = "lobby_character_view_squad_weapon_cat",
properties = {
text = ""
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = CoD.TextSettings.BigFont.Height,
font = CoD.TextSettings.BigFont.Font,
textStyle = CoD.TextStyle.ShadowedMore,
alignment = LUI.Alignment.Right,
alpha = 1,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b
},
hidden = {
alpha = 0
}
},
handlers = {
lobby_detail_update = LobbyCharacterViewSetSquadBotWeaponClassText
}
},
{
type = "UIText",
id = "lobby_character_view_squad_weapon_name",
properties = {
text = ""
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = CoD.TextSettings.BigFont.Height,
font = CoD.TextSettings.BigFont.Font,
textStyle = CoD.TextStyle.ShadowedMore,
alignment = LUI.Alignment.Right,
alpha = 1,
red = Colors.grey_4.r,
green = Colors.grey_4.g,
blue = Colors.grey_4.b
},
hidden = {
alpha = 0
}
},
handlers = {
lobby_detail_update = LobbyCharacterViewSetSquadBotWeaponText
}
}
}
}
end
return f6_local0
end
function lobby_character_view()
return {
type = "UIElement",
id = "lobby_character_view_id",
focusable = true,
properties = {
squad_location = "privateMatchSquadMembers"
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0
}
},
handlers = {
lobby_detail_update = function ( f10_arg0, f10_arg1 )
local f10_local0 = false
if SvS.IsSvS() and (not Lobby.IsMemberAISquadMember or Lobby.IsMemberAISquadMember( f10_arg1.memberListState, f10_arg1.memberSlot, f10_arg1.team )) then
f10_local0 = true
end
if not Lobby.ShowMemberInfo( f10_arg1.memberListState, f10_arg1.memberSlot, f10_arg1.team ) then
f10_local0 = true
end
if f10_local0 then
f10_arg0:dispatchEventToParent( {
name = "page_disable",
immediate = true
} )
else
f10_arg0:dispatchEventToParent( {
name = "page_enable",
immediate = true
} )
end
end
},
childrenFeeder = CharacterViewChildFeeder
}
end
LUI.MenuBuilder.registerDef( "lobby_character_view", lobby_character_view )
LockTable( _M )

View File

@@ -0,0 +1,725 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function DefaultLobbyTitleUpdateStub( f1_arg0, f1_arg1 )
end
function DefaultShouldDisableSlideRightFunc( f2_arg0, f2_arg1 )
return false
end
function LobbyNavigationFeeder( f3_arg0 )
local f3_local0 = {}
local f3_local1 = f3_arg0:lobbyNavigationPages()
local f3_local2 = #f3_local1
for f3_local3 = 1, f3_local2, 1 do
local f3_local6 = f3_local1[f3_local3].title or ""
local f3_local7 = f3_local1[f3_local3].title_update_func or DefaultLobbyTitleUpdateStub
assert( f3_local1[f3_local3].element )
assert( f3_local1[f3_local3].element.id )
f3_local0[#f3_local0 + 1] = {
type = "UIElement",
id = "lobby_navigation_slide_button_" .. f3_local3,
properties = {
pageIndex = f3_local3,
pageCount = f3_local2,
aliensSoloMode = f3_arg0.aliensSoloMode,
isDisabled = false,
elementId = f3_local1[f3_local3].element.id,
should_disable_slide_right_func = function ( f4_arg0, f4_arg1 )
local f4_local0 = f4_arg0:getChildById( f4_arg0.properties.elementId )
if f4_local0.properties and f4_local0.properties.should_disable_slide_right_func then
return f4_local0.properties:should_disable_slide_right_func( f4_arg1 )
else
return false
end
end
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
right = 640
}
},
handlers = {
page_disable = function ( f5_arg0, f5_arg1 )
f5_arg0.properties.isDisabled = true
f5_arg0:dispatchEventToParent( {
name = "refresh_arrows",
immediate = true
} )
end,
page_enable = function ( f6_arg0, f6_arg1 )
f6_arg0.properties.isDisabled = false
f6_arg0:dispatchEventToParent( {
name = "refresh_arrows",
immediate = true
} )
end
},
children = {
{
type = "generic_menu_title",
id = "mp_lobby_title_text_id",
properties = {
menu_title = f3_local1[f3_local3].title,
disableLobbyStatus = true,
additional_handlers = {
lobby_page_left = function ( f7_arg0, f7_arg1 )
local f7_local0 = f7_arg1.animTime or 0
f7_arg0:processEvent( {
name = "menu_title_show",
preAnimTime = f7_local0 * 0.5,
animTime = f7_local0 * 0.5
} )
end,
lobby_page_right = function ( f8_arg0, f8_arg1 )
f8_arg0:processEvent( {
name = "menu_title_hide",
preAnimTime = (f8_arg1.animTime or 0) * 0.5,
animTime = 0
} )
end,
lobby_page_leave = function ( f9_arg0, f9_arg1 )
local f9_local0 = f9_arg1.animTime or 0
f9_arg0:processEvent( {
name = "menu_title_hide",
preAnimTime = f9_local0 * 0.5,
animTime = f9_local0 * 0.5
} )
end
}
},
handlers = {
lobby_update_title = f3_local7,
lobby_transition_to_game = MBh.AnimateToState( "hidden", Lobby.TransitionTime ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
}
},
f3_local1[f3_local3].element
}
}
end
return f3_local0
end
function HandleLobbyNavigationPagesCreate( f10_arg0, f10_arg1 )
local f10_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f10_arg0 )
if not f10_local0.focusedPage then
f10_local0.focusedPage = 1
elseif f10_local0.focusedPage > 2 then
f10_local0.focusedPage = 2
f10_arg0:processEvent( {
name = "refocus_member_list",
inFocus = true
} )
end
local f10_local1 = f10_arg0.properties:lobbyNavigationPages()
for f10_local2 = 1, #f10_local1, 1 do
local f10_local5 = -1 * (f10_local2 - 1) * 640
f10_arg0:registerAnimationState( "slide_" .. f10_local2, {
leftAnchor = true,
rightAnchor = false,
left = f10_local5,
right = f10_local5 + 1280
} )
f10_arg0:registerEventHandler( "transition_complete_slide_" .. f10_local2, HandleLobbyNavigationTransitionComplete )
end
f10_arg0:animateToState( "slide_" .. f10_local0.focusedPage, 0, true )
local f10_local2 = f10_arg0:getFirstChild()
while f10_local2 do
if f10_local2.properties.pageIndex == f10_local0.focusedPage then
f10_local2:processEvent( {
name = "lobby_page_left",
dispatchChildren = true
} )
f10_local2:processEvent( {
name = "lobby_page_enter",
dispatchChildren = true
} )
elseif f10_local2.properties.pageIndex == f10_local0.focusedPage + 1 then
f10_local2:processEvent( {
name = "lobby_page_right",
dispatchChildren = true
} )
f10_local2:processEvent( {
name = "lobby_page_enter",
dispatchChildren = true
} )
else
f10_local2:processEvent( {
name = "lobby_page_leave",
dispatchChildren = true
} )
end
f10_local2 = f10_local2:getNextSibling()
end
end
function HandleLobbyNavigationRefreshArrows( f11_arg0, f11_arg1 )
local f11_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f11_arg0 )
local f11_local1 = f11_arg0.properties:lobbyNavigationPages()
local f11_local2 = f11_arg0:getParent()
if f11_local0.focusedPage <= 1 then
f11_local2:processEvent( {
name = "lobby_arrow_lt_hide"
} )
else
f11_local2:processEvent( {
name = "lobby_arrow_lt_show"
} )
end
local f11_local3 = false
local f11_local4 = f11_arg0:getFirstChild()
while f11_local4 do
if f11_local4.properties.pageIndex == f11_local0.focusedPage + 1 then
if f11_local4.properties.isDisabled or f11_local4.properties.should_disable_slide_right_func and f11_local4.properties:should_disable_slide_right_func( f11_arg1.controller ) then
f11_local3 = true
break
end
f11_local3 = false
end
f11_local4 = f11_local4:getNextSibling()
end
if not f11_local3 then
if #f11_local1 - 1 <= f11_local0.focusedPage then
f11_local3 = true
else
f11_local3 = false
end
end
if f11_local3 then
f11_local2:processEvent( {
name = "lobby_arrow_rt_hide"
} )
else
f11_local2:processEvent( {
name = "lobby_arrow_rt_show"
} )
end
end
function HandleLobbyNavigationSlideLeft( f12_arg0, f12_arg1 )
local f12_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f12_arg0 )
if f12_local0.animating then
return
elseif f12_arg0.properties.slideDisabled then
return
elseif not isNavMenuOnTop() then
return
end
local f12_local1 = f12_arg0.properties:lobbyNavigationPages()
if f12_local0.focusedPage > 1 then
local f12_local2 = false
local f12_local3 = f12_arg0:getFirstChild()
while f12_local3 do
if f12_local3.properties.pageIndex == f12_local0.focusedPage - 1 then
f12_local2 = f12_local3.properties.isDisabled
end
end
if not f12_local2 then
f12_local0.animating = true
f12_arg0:animateToState( "slide_" .. f12_local0.focusedPage - 1, 200, true )
local f12_local4 = f12_arg0:getFirstChild()
while f12_local4 do
if f12_local4.properties.pageIndex == f12_local0.focusedPage then
f12_local4:processEvent( {
name = "lobby_page_right",
animTime = 200,
dispatchChildren = true
} )
f12_local4:processEvent( {
name = "lose_focus"
} )
elseif f12_local4.properties.pageIndex == f12_local0.focusedPage - 1 then
f12_local4:processEvent( {
name = "lobby_page_enter",
animTime = 200,
controller = f12_arg1.controller,
dispatchChildren = true
} )
f12_local4:processEvent( {
name = "lobby_page_left",
animTime = 200,
dispatchChildren = true
} )
elseif f12_local4.properties.pageIndex == f12_local0.focusedPage + 1 then
f12_local4:processEvent( {
name = "lobby_page_leave",
animTime = 200,
controller = f12_arg1.controller,
dispatchChildren = true
} )
end
f12_local4 = f12_local4:getNextSibling()
end
f12_local0.focusedPage = f12_local0.focusedPage - 1
local f12_local5 = f12_arg0:getFirstChild()
while f12_local5 do
if f12_local5.properties.pageIndex == f12_local0.focusedPage then
f12_local5:processEvent( {
name = "gain_focus"
} )
end
f12_local5 = f12_local5:getNextSibling()
end
f12_arg0:processEvent( {
name = "refresh_arrows"
} )
else
end
f12_local3 = f12_local3:getNextSibling()
elseif not Engine.IsConsoleGame() then
local f12_local2 = f12_arg0:getFirstChild()
if not f12_local2:isInFocus() then
f12_local2 = f12_arg0:getFirstChild()
while f12_local2 do
if f12_local2.properties.pageIndex == f12_local0.focusedPage + 1 then
f12_local2:processEvent( {
name = "lose_focus"
} )
end
f12_local2 = f12_local2:getNextSibling()
end
f12_local2 = f12_arg0:getFirstChild()
while f12_local2 do
if f12_local2.properties.pageIndex == f12_local0.focusedPage then
f12_local2:processEvent( {
name = "gain_focus"
} )
end
f12_local2 = f12_local2:getNextSibling()
end
end
end
end
function HandleLobbyNavigationSlideRight( f13_arg0, f13_arg1 )
local f13_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f13_arg0 )
if f13_local0.animating then
return
elseif f13_arg0.properties.slideDisabled then
return
elseif not isNavMenuOnTop() then
return
elseif f13_local0.focusedPage < #f13_arg0.properties:lobbyNavigationPages() - 1 then
local f13_local1 = false
local f13_local2 = f13_arg0:getFirstChild()
while f13_local2 do
if f13_local2.properties.pageIndex == f13_local0.focusedPage + 1 then
f13_local1 = f13_local2.properties.should_disable_slide_right_func and (f13_local2.properties.isDisabled or f13_local2.properties:should_disable_slide_right_func( f13_arg1.controller ))
end
end
if not f13_local1 then
f13_local0.animating = true
f13_arg0:animateToState( "slide_" .. f13_local0.focusedPage + 1, 200, true )
local f13_local3 = f13_arg0:getFirstChild()
while f13_local3 do
if f13_local3.properties.pageIndex == f13_local0.focusedPage + 1 then
f13_local3:processEvent( {
name = "lobby_page_left",
animTime = 200,
dispatchChildren = true
} )
elseif f13_local3.properties.pageIndex == f13_local0.focusedPage + 2 then
f13_local3:processEvent( {
name = "lobby_page_enter",
animTime = 200,
controller = f13_arg1.controller,
dispatchChildren = true
} )
f13_local3:processEvent( {
name = "lobby_page_right",
animTime = 200,
dispatchChildren = true
} )
elseif f13_local3.properties.pageIndex == f13_local0.focusedPage then
f13_local3:processEvent( {
name = "lobby_page_leave",
animTime = 200,
controller = f13_arg1.controller,
dispatchChildren = true
} )
f13_local3:processEvent( {
name = "lose_focus"
} )
end
f13_local3 = f13_local3:getNextSibling()
end
f13_local0.focusedPage = f13_local0.focusedPage + 1
local f13_local4 = f13_arg0:getFirstChild()
while f13_local4 do
if f13_local4.properties.pageIndex == f13_local0.focusedPage then
f13_local4:processEvent( {
name = "gain_focus"
} )
end
f13_local4 = f13_local4:getNextSibling()
end
f13_arg0:processEvent( {
name = "refresh_arrows",
controller = f13_arg1.controller
} )
else
end
f13_local2 = f13_local2:getNextSibling()
end
end
function HandleLobbyNavigationSlideEnable( f14_arg0, f14_arg1 )
f14_arg0.properties.slideDisabled = false
end
function HandleLobbyNavigationSlideDisable( f15_arg0, f15_arg1 )
f15_arg0.properties.slideDisabled = true
end
function HandleLobbyNavigationGamepadButton( f16_arg0, f16_arg1 )
if f16_arg0.properties.slideDisabled then
f16_arg0:dispatchEventToChildren( f16_arg1 )
return false
end
local f16_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f16_arg0 )
if f16_arg1.down == true then
if f16_arg1.button == "left" then
if f16_local0.animating then
return true
end
f16_arg0:processEvent( {
name = "lobby_slide_left",
controller = f16_arg1.controller,
dispatchChildren = true
} )
elseif f16_arg1.button == "right" then
if f16_local0.animating then
return true
end
f16_arg0:processEvent( {
name = "lobby_slide_right",
controller = f16_arg1.controller,
dispatchChildren = true
} )
end
end
return LUI.UIElement.GamepadButton( f16_arg0, f16_arg1 )
end
function HandleLobbyNavigationTransitionComplete( f17_arg0, f17_arg1 )
local f17_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f17_arg0 )
f17_local0.animating = false
if f17_local0.force_press_lobby_navigation_arrow_right_btn == true then
f17_local0.force_press_lobby_navigation_arrow_right_btn = false
Kinect.PressMenuButton( "lobby_navigation_arrow_right_btn" )
end
end
function HandleLobbyArrowLeft( f18_arg0, f18_arg1 )
local f18_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f18_arg0:getParent() )
local f18_local1 = f18_arg0.properties:lobbyNavigationPages()
if f18_local0.focusedPage > 1 then
f18_arg0:dispatchEventToRoot( {
name = "lobby_slide_left",
focusedPage = f18_local0.focusedPage,
dispatchChildren = true
} )
end
end
function HandleLobbyArrowRight( f19_arg0, f19_arg1 )
local f19_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f19_arg0:getParent() )
if f19_local0.focusedPage < #f19_arg0.properties:lobbyNavigationPages() - 1 then
f19_arg0:dispatchEventToRoot( {
name = "lobby_slide_right",
focusedPage = f19_local0.focusedPage,
dispatchChildren = true
} )
end
end
function HandleLobbyNavigationCreate( f20_arg0, f20_arg1 )
local f20_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f20_arg0 )
f20_local0.animating = false
f20_arg0:processEvent( {
name = "refresh_arrows"
} )
end
function HandleLobbyNavigationListGainFocus( f21_arg0, f21_arg1 )
local f21_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f21_arg0 )
local f21_local1 = f21_arg0:getFirstChild()
while f21_local1 do
if f21_local1.properties.pageIndex == f21_local0.focusedPage then
f21_local1:processEvent( {
name = "gain_focus"
} )
break
end
f21_local1 = f21_local1:getNextSibling()
end
end
function HandleLobbyNavigationListLoseFocus( f22_arg0, f22_arg1 )
local f22_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f22_arg0 )
local f22_local1 = f22_arg0:getFirstChild()
while f22_local1 do
if f22_local1.properties.pageIndex == f22_local0.focusedPage then
f22_local1:processEvent( {
name = "lose_focus"
} )
end
if not Engine.IsConsoleGame() and f22_local1.properties.pageIndex == f22_local0.focusedPage + 1 then
f22_local1:processEvent( {
name = "lose_focus"
} )
end
f22_local1 = f22_local1:getNextSibling()
end
end
function HandleArrowOnOver( f23_arg0, f23_arg1 )
if isNavMenuOnTop() and f23_arg1.focusType == FocusType.MouseOver then
f23_arg0:dispatchEventToRoot( {
name = "lobby_slide_enable",
dispatchChildren = true
} )
end
end
function lobby_navigation()
return {
type = "UIElement",
id = "lobby_navigation_id",
properties = {
lobbyNavigationPages = function ( f25_arg0 )
return {}
end
,
aliensSoloMode = false
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
handlers = {
menu_create = HandleLobbyNavigationCreate
},
children = {
{
type = "UIHorizontalList",
id = "lobby_navigation_list_id",
properties = {
lobbyNavigationPages = MBh.Property( "lobbyNavigationPages" ),
aliensSoloMode = MBh.Property( "aliensSoloMode" ),
noWrap = true,
slideDisabled = false
},
states = {
default = {
alignment = LUI.Alignment.Left,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
menu_create = HandleLobbyNavigationPagesCreate,
gamepad_button = HandleLobbyNavigationGamepadButton,
lobby_slide_left = HandleLobbyNavigationSlideLeft,
lobby_slide_right = HandleLobbyNavigationSlideRight,
lobby_slide_enable = HandleLobbyNavigationSlideEnable,
lobby_slide_disable = HandleLobbyNavigationSlideDisable,
refresh_arrows = HandleLobbyNavigationRefreshArrows,
gain_focus = HandleLobbyNavigationListGainFocus,
lose_focus = HandleLobbyNavigationListLoseFocus,
lobby_transition_to_game = MBh.AnimateToState( "hidden", Lobby.TransitionTime ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
},
childrenFeeder = LobbyNavigationFeeder
},
{
type = "UIButton",
id = "lobby_navigation_arrow_left_btn",
properties = {
lobbyNavigationPages = MBh.Property( "lobbyNavigationPages" )
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 75,
right = 91,
top = 57,
bottom = 73
},
pan = MBh.BaseState( "default", {
left = 70,
right = 86
} )
},
handlers = {
menu_create = MBh.AnimateLoop( {
{
"pan",
500,
true,
true
},
{
"default",
500,
true,
true
}
} ),
button_action = HandleLobbyArrowLeft,
button_over = HandleArrowOnOver,
lobby_arrow_lt_show = MBh.EmitEvent( "enable" ),
lobby_arrow_lt_hide = MBh.EmitEvent( "disable" )
},
children = {
{
type = "UIImage",
id = "lobby_navigation_arrow_left",
states = {
default = {
material = RegisterMaterial( "widg_lobby_arrow" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 16,
right = 0,
top = 0,
bottom = 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" ),
lobby_transition_to_game = MBh.AnimateToState( "hidden", Lobby.TransitionTime ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
}
}
}
},
{
type = "UIButton",
id = "lobby_navigation_arrow_right_btn",
properties = {
lobbyNavigationPages = MBh.Property( "lobbyNavigationPages" )
},
states = {
default = {
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = -91,
right = -75,
top = 57,
bottom = 73
},
pan = MBh.BaseState( "default", {
left = -86,
right = -70
} )
},
handlers = {
menu_create = MBh.AnimateLoop( {
{
"pan",
500,
true,
true
},
{
"default",
500,
true,
true
}
} ),
button_action = HandleLobbyArrowRight,
button_over = HandleArrowOnOver,
lobby_arrow_rt_show = MBh.EmitEvent( "enable" ),
lobby_arrow_rt_hide = MBh.EmitEvent( "disable" )
},
children = {
{
type = "UIImage",
id = "lobby_navigation_arrow_right",
states = {
default = {
material = RegisterMaterial( "widg_lobby_arrow" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 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" ),
lobby_transition_to_game = MBh.AnimateToState( "hidden", Lobby.TransitionTime ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
}
}
}
}
}
}
end
LUI.MenuBuilder.registerDef( "lobby_navigation", lobby_navigation )
LockTable( _M )

View File

@@ -0,0 +1,828 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function ShowHistory()
local f1_local0
if not Engine.IsAliensMode() then
f1_local0 = not SvS.IsSvS()
else
f1_local0 = false
end
return f1_local0
end
function LobbyPlayerStatsGetPlayerInfo( f2_arg0, f2_arg1, f2_arg2, f2_arg3, f2_arg4 )
local f2_local0 = {}
local f2_local1 = f2_arg2
local f2_local2 = f2_arg3
if f2_arg0 then
assert( f2_arg4 )
if f2_arg1 == Lobby.MemberListStates.Teams and Lobby.GetLocalPlayerTeam then
f2_local2 = Lobby.GetLocalPlayerTeam( f2_arg1, f2_arg4 )
end
local f2_local3 = Lobby.GetMemberCount( f2_arg1, f2_local2 )
for f2_local4 = 1, f2_local3, 1 do
if Lobby.GetMemberControllerIndex( f2_arg1, f2_local4 - 1, f2_local2 ) == f2_arg4 then
f2_local1 = f2_local4 - 1
break
end
end
end
f2_local0.gamertag = Lobby.GetMemberName( f2_arg1, f2_local1, f2_local2 )
if Engine.IsAliensMode() then
f2_local0.memberPrestige = Lobby.GetMemberAlienPrestigeLevel( f2_arg1, f2_local1, f2_local2 )
f2_local0.memberRank = Lobby.GetMemberAlienRank( f2_arg1, f2_local1, f2_local2 )
else
f2_local0.memberPrestige = Lobby.GetMemberPrestigeLevel( f2_arg1, f2_local1, f2_local2 )
f2_local0.memberRank = Lobby.GetMemberRank( f2_arg1, f2_local1, f2_local2 )
end
f2_local0.clantag = ""
if Lobby.HasMemberClanTag( f2_arg1, f2_local1, f2_local2 ) then
f2_local0.clantag = Lobby.GetMemberClanTag( f2_arg1, f2_local1, f2_local2 )
end
f2_local0.patch = Lobby.GetMemberPatch and Lobby.GetMemberPatch( f2_arg1, f2_local1, f2_local2 ) or 0
f2_local0.patchBG = Lobby.GetMemberPatchbacking and Lobby.GetMemberPatchbacking( f2_arg1, f2_local1, f2_local2 ) or 0
f2_local0.background = Lobby.GetMemberBackground and Lobby.GetMemberBackground( f2_arg1, f2_local1, f2_local2 ) or 0
f2_local0.memberSlot = f2_local1
f2_local0.memberTeam = f2_local2
return f2_local0
end
function LobbyPlayerHistoryGetPoints( f3_arg0, f3_arg1, f3_arg2, f3_arg3 )
local f3_local0 = Lobby.GetMemberKDHistory( f3_arg1.memberListState, f3_arg0.memberSlot, f3_arg0.memberTeam, f3_arg1.controller )
if f3_local0 == nil then
f3_local0 = {
0,
0,
0,
0,
0
}
end
local f3_local1 = 5
for f3_local2 = 1, #f3_local0, 1 do
if f3_local1 < f3_local0[f3_local2] then
f3_local1 = f3_local0[f3_local2]
end
end
local f3_local2 = function ( f4_arg0 )
local f4_local0 = f3_arg3 * 1 / (#f3_local0 - 1) * (f4_arg0 - 1)
local f4_local1 = nil
if 1 < f3_local0[f4_arg0] then
f4_local1 = f3_arg2 * 0.5 * (1 - f3_local0[f4_arg0] / f3_local1)
else
f4_local1 = f3_arg2 * 0.5 + f3_arg2 * 0.5 * (1 - f3_local0[f4_arg0])
end
return {
x = f4_local0,
y = f4_local1
}
end
local f3_local3 = {}
for f3_local4 = 1, #f3_local0, 1 do
f3_local3[#f3_local3 + 1] = f3_local2( f3_local4 )
end
return f3_local3
end
function LobbyPlayerHistoryFactory( f5_arg0, f5_arg1, f5_arg2 )
local f5_local0 = f5_arg2.bottom - f5_arg2.top - f5_arg2.header - f5_arg2.footer
local f5_local1 = f5_arg2.width - f5_arg2.left + f5_arg2.right
local f5_local2, f5_local3, f5_local4 = Lobby.GetMemberKDHistory( f5_arg1.memberListState, f5_arg0.memberSlot, f5_arg0.memberTeam, f5_arg1.controller )
if f5_local2 == nil or #f5_local2 <= 1 then
return
end
local f5_local5 = 1 / (#f5_local2 - 1)
local f5_local6 = LobbyPlayerHistoryGetPoints( f5_arg0, f5_arg1, f5_local0, f5_local1 )
local f5_local7 = {
type = "UIElement",
id = "lobby_player_history_graph",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = f5_local1,
top = f5_arg2.header,
bottom = -1 * f5_arg2.footer
}
},
children = {
{
type = "UIImage",
id = "lobby_player_history_zero_line",
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = f5_local0 * 0.5 - 1,
bottom = f5_local0 * 0.5 + 1,
red = 0,
green = 0,
blue = 0
}
}
},
{
type = "UIImage",
id = "lobby_player_history_bg",
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = 1,
green = 1,
blue = 1,
alpha = 0.1
}
}
}
}
}
local f5_local8 = {
type = "UIElement",
id = "lobby_player_history",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = f5_arg2.left,
right = f5_arg2.right,
top = f5_arg2.top,
bottom = f5_arg2.bottom
}
},
children = {
f5_local7,
{
type = "UIText",
id = "lobby_player_history_title",
properties = {
text = Engine.Localize( "LUA_MENU_MP_KILL_DEATH_RATIO", #f5_local2 )
},
states = {
default = {
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.SmallFont.Font,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = CoD.TextSettings.SmallFont.Height,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b
}
}
}
}
}
for f5_local9 = 2, #f5_local2 - 1, 1 do
f5_local7.children[#f5_local7.children + 1] = {
type = "UIImage",
id = "lobby_player_history_" .. f5_local9 .. "_line",
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = f5_local1 * f5_local5 * (f5_local9 - 1) - 1,
right = f5_local1 * f5_local5 * (f5_local9 - 1) + 1,
top = 0,
bottom = 0,
red = 0,
green = 0,
blue = 0
}
}
}
end
for f5_local9 = 2, #f5_local2, 1 do
local f5_local12 = f5_local6[f5_local9].x - f5_local6[f5_local9 - 1].x
local f5_local13 = f5_local6[f5_local9].y - f5_local6[f5_local9 - 1].y
local f5_local14 = math.sqrt( f5_local12 * f5_local12 + f5_local13 * f5_local13 )
local f5_local15 = f5_local6[f5_local9 - 1].x + f5_local12 * 0.5
local f5_local16 = f5_local6[f5_local9 - 1].y + f5_local13 * 0.5
f5_local7.children[#f5_local7.children + 1] = {
type = "UIImage",
id = "lobby_player_history_connect_" .. f5_local9,
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = f5_local6[f5_local9 - 1].x - (f5_local14 - f5_local12) / 2,
right = f5_local6[f5_local9 - 1].x + f5_local14 - (f5_local14 - f5_local12) / 2,
top = f5_local6[f5_local9 - 1].y + f5_local13 / 2 - 1,
bottom = f5_local6[f5_local9 - 1].y + f5_local13 / 2 + 1,
zRot = -1 * math.deg( math.atan( f5_local13 / f5_local12 ) ),
red = 1,
green = 1,
blue = 1,
alpha = 0.5
}
}
}
end
for f5_local9 = 1, #f5_local2, 1 do
local f5_local12 = {
red = 0,
green = 0,
blue = 0
}
if f5_local2[f5_local9] >= 1 then
f5_local12.green = 0.75
else
f5_local12.red = 0.75
end
f5_local7.children[#f5_local7.children + 1] = {
type = "UIImage",
id = "lobby_player_history_point_" .. f5_local9,
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = f5_local6[f5_local9].x - 3,
right = f5_local6[f5_local9].x + 3,
top = f5_local6[f5_local9].y - 3,
bottom = f5_local6[f5_local9].y + 3,
red = f5_local12.red,
green = f5_local12.green,
blue = f5_local12.blue,
alpha = 1
}
}
}
end
for f5_local9 = 1, #f5_local2, 1 do
f5_local7.children[#f5_local7.children + 1] = {
type = "UIText",
id = "lobby_player_history_value_" .. f5_local9,
properties = {
text = string.format( "%.2f", f5_local2[f5_local9] )
},
states = {
default = {
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.SmallFont.Font,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = f5_local6[f5_local9].x,
right = f5_local6[f5_local9].x,
top = f5_local0,
bottom = f5_local0 + CoD.TextSettings.SmallFont.Height,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b
}
}
}
end
return f5_local8
end
function LobbyPlayerStatsFeeder( f6_arg0 )
local f6_local0 = {}
local f6_local1 = LobbyPlayerStatsGetPlayerInfo( f6_arg0.isComparison, f6_arg0.memberListState, f6_arg0.memberSlot, f6_arg0.team, f6_arg0.controller )
local f6_local2 = 0
f6_local0[#f6_local0 + 1] = {
type = "playercard",
id = "lobby_basic_playercard_id",
properties = {
gamertag = f6_local1.gamertag,
clantag = f6_local1.clantag,
rank = f6_local1.memberRank,
prestige = f6_local1.memberPrestige,
background = f6_local1.background,
patchShape = f6_local1.patchBG,
patchEmblem = f6_local1.patch
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 55,
right = -55,
top = 130,
bottom = 200
}
}
}
if not Engine.IsAliensMode() or Engine.GetDvarBool( "extinction_cac_enabled" ) then
if ShowHistory() then
f6_local2 = 85 + CoD.TextSettings.SmallFont.Height + CoD.TextSettings.SmallFont.Height
end
local f6_local3 = {}
local f6_local4 = 25
local f6_local5 = {
material = RegisterMaterial( "white" ),
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = -150,
right = 0,
top = 0,
bottom = 0,
red = 1,
green = 1,
blue = 1,
alpha = 0.1
}
local f6_local6 = {
material = RegisterMaterial( "box_angle_rtcap" ),
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = -150,
right = -182,
top = 0,
bottom = 0,
red = 1,
green = 1,
blue = 1,
alpha = 0.1
}
local f6_local7 = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 6,
right = -150,
top = 2,
bottom = 2 + CoD.TextSettings.SmallFont.Height,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b,
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.SmallFont.Font
}
local f6_local8 = {
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = -150,
right = -6,
top = 2,
bottom = 2 + CoD.TextSettings.SmallFont.Height,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.SmallFont.Font
}
if f6_arg0.isComparison then
f6_local5 = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 150,
top = 0,
bottom = 0,
red = 1,
green = 1,
blue = 1,
alpha = 0.1
}
f6_local6 = {
material = RegisterMaterial( "box_angle_ltcap" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 182,
right = 150,
top = 0,
bottom = 0,
red = 1,
green = 1,
blue = 1,
alpha = 0.1
}
f6_local7 = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 150,
right = -6,
top = 2,
bottom = 2 + CoD.TextSettings.SmallFont.Height,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b,
alignment = LUI.Alignment.Right,
font = CoD.TextSettings.SmallFont.Font
}
f6_local8 = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 6,
right = 150,
top = 2,
bottom = 2 + CoD.TextSettings.SmallFont.Height,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alignment = LUI.Alignment.Right,
font = CoD.TextSettings.SmallFont.Font
}
end
local f6_local9 = nil
if SvS.IsSvS() then
f6_local9 = Lobby.SquadsPlayerStatsCategories
elseif Engine.IsAliensMode() then
f6_local9 = Lobby.AliensPlayerStatsCategories
else
f6_local9 = Lobby.PlayerStatsCategories
end
for f6_local10 = 1, #f6_local9, 1 do
if f6_local9[f6_local10].Visible == nil or f6_local9[f6_local10].Visible( f6_arg0.memberListState, f6_local1.memberSlot, f6_local1.memberTeam ) then
local f6_local13 = "---"
if Lobby.GetMemberStat then
local f6_local14 = tonumber( Lobby.GetMemberStat( f6_arg0.memberListState, f6_local1.memberSlot, f6_local1.memberTeam, Lobby.MemberStatTypes.GamesPlayed ) )
if f6_local9[f6_local10].Getter then
f6_local13 = f6_local9[f6_local10].Getter( f6_arg0.memberListState, f6_local1.memberSlot, f6_local1.memberTeam )
elseif f6_local9[f6_local10].Type and (not (f6_local14 == nil or f6_local14 <= 0) or SvS.IsSvS() or Engine.IsAliensMode()) then
f6_local13 = Lobby.GetMemberStat( f6_arg0.memberListState, f6_local1.memberSlot, f6_local1.memberTeam, f6_local9[f6_local10].Type ) or ""
end
end
f6_local3[#f6_local3 + 1] = {
type = "UIElement",
id = "lobby_player_stat_" .. f6_local10 .. "_id",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = f6_local4
}
},
children = {
{
type = "UIImage",
id = "lobby_player_stat_bg_title",
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = Colors.very_dark_cyan.r,
green = Colors.very_dark_cyan.g,
blue = Colors.very_dark_cyan.b,
alpha = 0.5
}
}
},
{
type = "UIImage",
id = "lobby_player_stat_bg_value",
states = {
default = f6_local5
}
},
{
type = "UIImage",
id = "lobby_player_stat_bg_cap",
states = {
default = f6_local6
}
},
{
type = "UIText",
id = "lobby_player_stat_text_title",
properties = {
text = Engine.Localize( f6_local9[f6_local10].Title )
},
states = {
default = f6_local7
}
},
{
type = "UIMarqueeText",
id = "lobby_player_stat_text_value",
properties = {
text = f6_local13
},
states = {
default = f6_local8
}
}
}
}
end
end
f6_local0[#f6_local0 + 1] = {
type = "UIVerticalList",
id = "lobby_player_stats_list_id",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 40,
right = -40,
top = 250 + f6_local2 + 10,
bottom = 250 + f6_local2 + 20 + #Lobby.PlayerStatsCategories * (f6_local4 + 2),
spacing = 3
}
},
children = f6_local3
}
if f6_arg0.isComparison then
f6_local0[#f6_local0 + 1] = {
type = "UIText",
id = "lobby_player_stat_text_value",
properties = {
text = Engine.Localize( "@LUA_MENU_VERSUS" )
},
states = {
default = {
alignment = LUI.Alignment.Center,
font = CoD.TextSettings.ExtraBigFont.Font,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = -20,
right = 20,
top = 205,
bottom = 205 + CoD.TextSettings.ExtraBigFont.Height,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b
},
shown = {
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
lobby_page_enter = function ( f7_arg0, f7_arg1 )
f7_arg0:animateToState( "shown", f7_arg1.animTime or 0, true )
end,
lobby_page_leave = function ( f8_arg0, f8_arg1 )
f8_arg0:animateToState( "hidden", f8_arg1.animTime or 0, true )
end
}
}
end
if ShouldShowEliteIcon( f6_arg0.memberListState, f6_local1.memberSlot, f6_local1.memberTeam ) then
local f6_local10 = 300 + #f6_local9 * (f6_local4 + 2) + f6_local4 + 2
f6_local0[#f6_local0 + 1] = {
type = "UIHorizontalList",
id = "lobby_player_mobile_app_info_id",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 64,
right = -54,
top = f6_local10,
bottom = f6_local10 + f6_local4 + 2,
spacing = 8
}
},
children = {
{
type = "UIImage",
id = "lobby_player_mobile_app_icon_id",
states = {
default = {
material = RegisterMaterial( "widg_arrow_dn" ),
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
top = 7,
bottom = 19,
left = 3,
right = 29,
red = 0.33,
green = 0.71,
blue = 0.23
}
}
},
{
type = "UIText",
id = "lobby_player_mobile_app_text_id",
properties = {
text = Engine.Localize( "@LUA_MENU_MOBILE_APP_RUNNING" )
},
states = {
default = {
alignment = LUI.Alignment.Left,
font = CoD.TextSettings.SmallFont.Font,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 20,
right = -14,
top = 2,
bottom = f6_local4,
red = Colors.secondary_text_color.r,
green = Colors.secondary_text_color.g,
blue = Colors.secondary_text_color.b
}
}
}
}
}
end
end
return f6_local0
end
function LobbyPlayerStatsUpdateProps( f9_arg0, f9_arg1 )
assert( f9_arg1.memberListState )
assert( f9_arg1.memberSlot )
assert( f9_arg1.team )
local f9_local0 = f9_arg0.properties
local f9_local1 = f9_arg1.memberListState
if not f9_local1 then
f9_local1 = Lobby.MemberListStates.None
end
f9_local0.memberListState = f9_local1
f9_arg0.properties.memberSlot = f9_arg1.memberSlot or 0
f9_arg0.properties.team = f9_arg1.team or 1
end
function LobbyPlayerStatsEnter( f10_arg0, f10_arg1 )
local f10_local0 = f10_arg0.properties
local f10_local1 = f10_arg0.properties
local f10_local2 = f10_arg1.controller
if not f10_local2 then
f10_local2 = Engine.GetFirstActiveController()
end
f10_local1.controller = f10_local2
if f10_local0.isComparison then
f10_arg0:processEvent( {
name = "menu_refresh"
} )
end
f10_local1 = LobbyPlayerStatsGetPlayerInfo( f10_local0.isComparison, f10_local0.memberListState, f10_local0.memberSlot, f10_local0.team, f10_arg0.properties.controller )
f10_arg0:processEvent( {
name = "update_playercard",
gamertag = f10_local1.gamertag,
clantag = f10_local1.clantag,
rank = f10_local1.memberRank,
prestige = f10_local1.memberPrestige,
background = f10_local1.background,
patchShape = f10_local1.patchBG,
patchEmblem = f10_local1.patch
} )
end
function sendPlayerCardUpdate( f11_arg0, f11_arg1 )
if Engine.IsAliensMode() then
local f11_local0 = LobbyPlayerStatsGetPlayerInfo( false, f11_arg1.memberListState, f11_arg1.memberSlot, f11_arg1.team, f11_arg1.controller )
f11_arg0:processEvent( {
name = "update_playercard",
gamertag = f11_local0.gamertag,
clantag = f11_local0.clantag,
rank = f11_local0.memberRank,
prestige = f11_local0.memberPrestige,
background = f11_local0.background,
patchShape = f11_local0.patchBG,
patchEmblem = f11_local0.patch
} )
end
end
function LobbyPlayerStatsBuildHistory( f12_arg0, f12_arg1 )
if ShowHistory() then
local f12_local0 = f12_arg0:getFirstDescendentById( "lobby_player_history" )
local f12_local1 = f12_arg0.properties
if f12_local0 then
f12_local0:close()
end
local f12_local2 = LobbyPlayerHistoryFactory( LobbyPlayerStatsGetPlayerInfo( f12_local1.isComparison, f12_local1.memberListState, f12_local1.memberSlot, f12_local1.team, f12_arg0.properties.controller ), f12_local1, {
left = 40,
right = -40,
top = 250,
width = 550,
bottom = 250 + 85 + CoD.TextSettings.SmallFont.Height + CoD.TextSettings.SmallFont.Height,
footer = CoD.TextSettings.SmallFont.Height,
header = CoD.TextSettings.SmallFont.Height
} )
if f12_local2 ~= nil then
LUI.MenuBuilder.BuildAddChild( f12_arg0, f12_local2 )
end
end
end
function lobby_player_stats()
return {
type = "UIElement",
id = "lobby_player_stats_id",
focusable = true,
properties = {
memberListState = Lobby.MemberListStates.Lobby,
memberSlot = 0,
team = Teams.free,
isComparison = false,
controller = Engine.GetFirstActiveController(),
should_disable_slide_right_func = function ( f14_arg0, f14_arg1 )
local f14_local0 = f14_arg0.properties
if not f14_local0.isComparison then
if (Lobby.GetMemberControllerIndex and Lobby.GetMemberControllerIndex( f14_local0.memberListState, f14_local0.memberSlot, f14_local0.team ) or 0) == f14_arg1 then
return true
elseif not Engine.IsConsoleGame() and Lobby.IsMemberALocalPlayer( f14_local0.memberListState, f14_local0.memberSlot, f14_local0.team ) then
return true
end
end
return false
end
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
handlers = {
lobby_detail_update = function ( f15_arg0, f15_arg1 )
LobbyPlayerStatsUpdateProps( f15_arg0, f15_arg1 )
sendPlayerCardUpdate( f15_arg0, f15_arg1 )
f15_arg0:processEvent( {
name = "menu_refresh"
} )
LobbyPlayerStatsBuildHistory( f15_arg0, f15_arg1 )
end
,
lobby_page_enter = function ( f16_arg0, f16_arg1 )
LobbyPlayerStatsEnter( f16_arg0, f16_arg1 )
LobbyPlayerStatsBuildHistory( f16_arg0, f16_arg1 )
end
},
childrenFeeder = LobbyPlayerStatsFeeder
}
end
LUI.MenuBuilder.registerDef( "lobby_player_stats", lobby_player_stats )
LockTable( _M )

View File

@@ -0,0 +1,644 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
SearchWidgetStatus = {
INACTIVE = 0,
FOUND_NO_GAMES = 1,
SEARCHING = 2,
FOUND_GAMES = 3,
WAITING_FOR_PLAYERS = 4,
WAITING_FOR_HOST = 5,
JOINING = 6,
STARTING = 7
}
function lobby_search_widget()
local f1_local0 = function ( f2_arg0, f2_arg1, f2_arg2 )
if f2_arg0.currentState ~= f2_arg1 then
f2_arg0:animateToState( f2_arg1, f2_arg2 or 200 )
f2_arg0.currentState = f2_arg1
end
end
local f1_local1 = 320
local self = LUI.UIElement.new()
self.id = "search_widget"
self:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
left = 0,
top = f1_local1,
width = 512,
height = 256,
alpha = 1
} )
self:registerAnimationState( "disabled", {
alpha = 0
} )
self:animateToState( "default" )
local f1_local3 = LUI.UITimer.new( 50, "main_update" )
f1_local3.id = "mainTimer"
self:addElement( f1_local3 )
self:registerEventHandler( "main_update", function ( element, event )
if SvS.IsSvS() then
local f3_local0 = SvS.GetCurrentSquadModeInfo()
if f3_local0 == SvS.SquadModes.SquadAssault then
if Squad.FoundMatch() then
element:animateToState( "disabled" )
event.timer:close()
end
elseif f3_local0 == SvS.SquadModes.SquadVsSquad then
local f3_local1 = Lobby.GetSearchWidgetStatus() >= SearchWidgetStatus.WAITING_FOR_PLAYERS
if f3_local1 and not element.disableForSquadVsSquad then
element:animateToState( "disabled" )
element.disableForSquadVsSquad = true
elseif not f3_local1 and element.disableForSquadVsSquad then
element:animateToState( "default" )
element.disableForSquadVsSquad = false
end
end
end
if Lobby.GetSearchWidgetStatus then
local f3_local0 = element.status or -1
local f3_local1 = Lobby.GetSearchWidgetStatus()
if f3_local1 ~= element.status then
element.status = f3_local1
DebugPrint( "Search widget status is now " .. f3_local1 )
element:processEvent( {
name = "update_search_status",
oldStatus = f3_local0,
status = element.status,
dispatchChildren = true
} )
end
end
end )
local f1_local4 = LUI.UIImage.new()
f1_local4.id = "bg"
f1_local4:registerAnimationState( "default", {
material = RegisterMaterial( "widg_grid_fade" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.1
} )
f1_local4:animateToState( "default" )
self:addElement( f1_local4 )
local f1_local5 = {
{
268,
85
},
{
352,
72
},
{
170,
136
},
{
384,
28
},
{
408,
139
},
{
234,
173
},
{
157,
4
},
{
92,
145
},
{
412,
227
},
{
285,
114
},
{
98,
40
},
{
112,
77
},
{
330,
168
},
{
421,
8
},
{
105,
189
},
{
381,
106
},
{
305,
12
},
{
136,
89
},
{
224,
33
}
}
local f1_local6 = LUI.UIElement.new()
f1_local6.id = "techyDigits"
f1_local6:registerAnimationState( "default", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 1
} )
f1_local6:registerAnimationState( "hidden", {
alpha = 0
} )
f1_local6:animateToState( "default" )
f1_local6:registerEventHandler( "update_search_status", function ( element, event )
assert( event.status )
if event.status >= SearchWidgetStatus.FOUND_GAMES then
f1_local0( f1_local6, "hidden" )
else
f1_local0( f1_local6, "default" )
end
end )
self:addElement( f1_local6 )
local f1_local7 = LUI.UITimer.new( 450, "update_digits_bg" )
f1_local7.id = "digitsTimer"
f1_local6:addElement( f1_local7 )
f1_local6.animIndex = 0
f1_local6:registerEventHandler( "update_digits_bg", function ( element, event )
local f5_local0 = element:getFirstChild()
while f5_local0 do
if f5_local0.index == element.animIndex then
local f5_local1 = MBh.AnimateSequence( {
{
"visible",
800,
true,
true
},
{
"visible",
2400,
false,
false
},
{
"default",
1200,
true,
true
}
} )
f5_local1( f5_local0, {} )
end
f5_local0 = f5_local0:getNextSibling()
end
element.animIndex = (element.animIndex + 1) % #f1_local5
end )
for f1_local11, f1_local12 in ipairs( f1_local5 ) do
local f1_local13 = LUI.UITechyDigits.new()
f1_local13.id = "digits_" .. f1_local11
f1_local13.index = f1_local11
f1_local13:registerAnimationState( "default", {
font = CoD.TextSettings.TinyFont.Font,
alignment = LUI.Alignment.Center,
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
left = f1_local12[1],
top = f1_local12[2],
width = 0,
height = CoD.TextSettings.TinyFont.Height,
alpha = 0
} )
f1_local13:registerAnimationState( "visible", {
alpha = 0.3
} )
f1_local13:animateToState( "default", 0 )
local f1_local14 = MBh.AnimateLoop( {
{
"default",
(f1_local11 - 1) * 600,
false,
false
},
{
"visible",
800,
true,
true
},
{
"visible",
2400,
false,
false
},
{
"default",
1200,
true,
true
},
{
"default",
(#f1_local5 - f1_local11) * 400,
false,
false
}
} )
f1_local14( f1_local13, {} )
f1_local6:addElement( f1_local13 )
f1_local14 = LUI.UIImage.new()
f1_local14.id = "blip"
f1_local14:registerAnimationState( "default", {
material = RegisterMaterial( "icon_lobby_map_blip2" ),
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 15,
height = 8,
left = -4,
width = 8,
alpha = 0.6
} )
f1_local14:animateToState( "default" )
f1_local13:addElement( f1_local14 )
end
f1_local8 = LUI.UITechyDigits.new()
f1_local8.id = "middleDigits"
f1_local8:registerAnimationState( "default", {
font = CoD.TextSettings.TinyFont.Font,
alignment = LUI.Alignment.Center,
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
left = -50,
top = -8,
width = 100,
height = CoD.TextSettings.TinyFont.Height,
alpha = 0
} )
f1_local8:registerAnimationState( "visible", {
alpha = 0.5
} )
f1_local8:animateToState( "default", 0 )
f1_local8:registerEventHandler( "update_search_status", function ( element, event )
assert( event.status )
if event.status >= SearchWidgetStatus.FOUND_GAMES and event.status < SearchWidgetStatus.JOINING then
f1_local0( f1_local8, "visible", 400 )
else
f1_local0( f1_local8, "default", 100 )
end
end )
self:addElement( f1_local8 )
f1_local9 = 48
f1_local10 = 8
f1_local11 = LUI.UIElement.new()
f1_local11.id = "spinner"
f1_local11:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -f1_local9,
bottom = f1_local9,
left = -f1_local9,
right = f1_local9
} )
f1_local11:registerEventHandler( "update_search_status", function ( element, event )
local f7_local0
if event.status < SearchWidgetStatus.FOUND_GAMES or event.status >= SearchWidgetStatus.JOINING then
f7_local0 = false
else
f7_local0 = true
end
element.spinningRequested = f7_local0
end )
f1_local11:animateToState( "default" )
self:addElement( f1_local11 )
f1_local12 = LUI.UITimer.new( 80, "update_spinner" )
f1_local12.id = "spinnerTimer"
f1_local11:addElement( f1_local12 )
f1_local11.spinningPossible = false
f1_local11.spinningRequested = false
f1_local11.spinIndex = 0
f1_local11:registerEventHandler( "update_spinner", function ( element, event )
if element.spinningPossible and element.spinningRequested then
local f8_local0 = element:getFirstChild()
while f8_local0 do
if f8_local0.index and f8_local0.index == element.spinIndex then
local f8_local1 = MBh.AnimateSequence( {
{
"positioned",
80
},
{
"faded",
140
}
} )
f8_local1( f8_local0, {} )
end
f8_local0 = f8_local0:getNextSibling()
end
element.spinIndex = (f1_local10 + element.spinIndex - 1) % f1_local10
end
end )
for f1_local13 = 0, f1_local10 - 1, 1 do
local f1_local16 = LUI.UIImage.new()
f1_local16.id = "dot_" .. f1_local13
f1_local16.index = f1_local13
f1_local16:registerAnimationState( "default", {
material = RegisterMaterial( "icon_lobby_map_blip2" ),
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -4,
bottom = 4,
left = -4,
right = 4,
alpha = 0
} )
local f1_local17 = -(f1_local13 / 8) * 2 * math.pi
local f1_local18 = f1_local9 * math.cos( f1_local17 )
local f1_local19 = f1_local9 * math.sin( f1_local17 )
f1_local16:registerAnimationState( "positioned", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = f1_local19 - 4,
bottom = f1_local19 + 4,
left = f1_local18 - 4,
right = f1_local18 + 4,
alpha = 1
} )
f1_local16:registerAnimationState( "faded", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = f1_local19 - 4,
bottom = f1_local19 + 4,
left = f1_local18 - 4,
right = f1_local18 + 4,
alpha = 0.3
} )
f1_local16:registerAnimationState( "final_blink", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = f1_local19 - 4,
bottom = f1_local19 + 4,
left = f1_local18 - 4,
right = f1_local18 + 4,
alpha = 0.3
} )
f1_local16:registerAnimationState( "vanished", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = f1_local19 - 4 + 2 * f1_local18,
bottom = f1_local19 + 4 + 2 * f1_local18,
left = f1_local18 - 4 - 2 * f1_local19,
right = f1_local18 + 4 - 2 * f1_local19,
alpha = 0
} )
f1_local16:animateToState( "default" )
f1_local16:addEventHandler( LUI.FormatAnimStateFinishEvent( "final_blink" ), function ( f9_arg0, f9_arg1 )
f1_local11.spinningPossible = true
end )
f1_local16:registerEventHandler( "update_search_status", function ( element, event )
if event.oldStatus < SearchWidgetStatus.FOUND_GAMES and event.status >= SearchWidgetStatus.FOUND_GAMES and event.status < SearchWidgetStatus.JOINING then
f1_local11.spinningPossible = false
local f10_local0 = MBh.AnimateSequence( {
{
"default",
20
},
{
"positioned",
250
},
{
"faded",
250
},
{
"positioned",
120
},
{
"faded",
250
},
{
"positioned",
120
},
{
"faded",
250
},
{
"positioned",
120
},
{
"final_blink",
250
}
} )
f10_local0( f1_local16, {} )
elseif event.status < SearchWidgetStatus.FOUND_GAMES then
f1_local11.spinningPossible = false
f1_local16:animateToState( "default", 140 )
elseif event.status == SearchWidgetStatus.JOINING then
f1_local16:animateToState( "faded", 100 )
elseif event.status == SearchWidgetStatus.STARTING then
f1_local16:animateToState( "vanished", 300 )
end
end )
f1_local11:addElement( f1_local16 )
end
local f1_local13 = 3
local f1_local14 = LUI.UIElement.new()
f1_local14.id = "gameFound"
f1_local14:registerAnimationState( "default", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
right = 0
} )
f1_local14:animateToState( "default" )
self:addElement( f1_local14 )
f1_local14:registerEventHandler( "update_search_status", function ( element, event )
element.pulseRequested = event.status >= SearchWidgetStatus.JOINING
end )
local f1_local15 = LUI.UITimer.new( 400, "update_game_found" )
f1_local15.id = "gameFoundTimer"
f1_local14:addElement( f1_local15 )
f1_local14.pulseRequested = false
f1_local14.pulsePossible = false
f1_local14.pulseIndex = 0
f1_local14:registerEventHandler( "update_game_found", function ( element, event )
if element.pulsePossible and element.pulseRequested then
local f12_local0 = element:getFirstChild()
while f12_local0 do
if f12_local0.index and f12_local0.index == element.pulseIndex then
local f12_local1 = MBh.AnimateSequence( {
{
"default",
0
},
{
"expanded",
1000,
true,
true
}
} )
f12_local1( f12_local0, {} )
end
f12_local0 = f12_local0:getNextSibling()
end
element.pulseIndex = (element.pulseIndex + 1) % f1_local13
end
end )
local f1_local20 = LUI.UIImage.new()
f1_local20.id = "foundBlip"
local f1_local16 = -(3 / f1_local10) * 2 * math.pi
f1_local20:registerAnimationState( "default", {
material = RegisterMaterial( "icon_lobby_map_blip3" ),
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = f1_local9 * math.sin( f1_local16 ) - 4,
height = 8,
left = f1_local9 * math.cos( f1_local16 ) - 4,
width = 8,
alpha = 0
} )
f1_local20:registerAnimationState( "visible", {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
top = -4,
height = 8,
left = -4,
width = 8,
alpha = 1
} )
f1_local20:registerAnimationState( "invisible", {
alpha = 0
} )
f1_local20:animateToState( "default" )
f1_local14:addElement( f1_local20 )
f1_local20:addEventHandler( LUI.FormatAnimStateFinishEvent( "visible" ), function ( f13_arg0, f13_arg1 )
f1_local14.pulsePossible = true
end )
f1_local20:registerEventHandler( "update_search_status", function ( element, event )
if event.oldStatus < SearchWidgetStatus.JOINING and event.status >= SearchWidgetStatus.JOINING then
f1_local14.pulsePossible = false
local f14_local0 = MBh.AnimateSequence( {
{
"invisible",
20
},
{
"default",
0
},
{
"visible",
250
}
} )
f14_local0( element, {} )
elseif event.status < SearchWidgetStatus.JOINING then
f1_local14.pulsePossible = false
element:animateToState( "invisible", 140 )
end
end )
for f1_local19 = 0, f1_local13 - 1, 1 do
local f1_local23 = LUI.UIImage.new()
f1_local23.id = "pulse_" .. f1_local19
f1_local23.index = f1_local19
f1_local23:registerAnimationState( "default", CoD.ColorizeState( Colors.frontend_hilite, {
material = RegisterMaterial( "widg_circle" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
alpha = 0.5
} ) )
f1_local23:registerAnimationState( "expanded", {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = -32,
bottom = 32,
left = -32,
right = 32,
alpha = 0
} )
f1_local23:animateToState( "default" )
f1_local14:addElement( f1_local23 )
end
return self
end
LUI.MenuBuilder.registerType( "lobby_search_widget", lobby_search_widget )
LockTable( _M )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,702 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function mpMainMenuPushFunc()
Engine.StopMusic( 200 )
if Engine.IsAliensMode() then
Engine.PlayMusic( CoD.Music.MainExtinctMusic )
elseif SvS.IsSvS() then
Engine.PlayMusic( CoD.Music.MainSquadMusic )
else
Engine.PlayMusic( CoD.Music.MainMPMusic )
end
if Engine.SplitscreenPlayerCount() > 0 then
local f1_local0 = Engine.GetFirstActiveController()
if f1_local0 and Engine.IsUserSignedIn( f1_local0 ) then
Engine.PLMRefreshData()
end
end
end
function mpMainMenuCheckRequiredDLC( f2_arg0, f2_arg1 )
if Engine.IsXbox360() then
LUI.mp_menus.MPPopups.UpdateRequiredDLCNotification( f2_arg0, f2_arg1 )
end
end
function mpMainMenuCreateHandler( f3_arg0, f3_arg1 )
Engine.SetDvarString( "ui_version_show", "0" )
Engine.SetDvarBool( "ui_onlineRequired", false )
f3_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_secondary",
helper_text = Engine.Localize( "@MENU_MAIN_MENU" ),
side = "left",
clickable = true
} )
mpMainMenuCheckRequiredDLC( f3_arg0, f3_arg1 )
end
function resolveXboxLiveButtonAction( f4_arg0 )
Engine.ExecNow( "forcenosplitscreencontrol main_XBOXLIVE_1", f4_arg0 )
local f4_local0, f4_local1 = Engine.UserCanPlayOnline( f4_arg0 )
if not f4_local0 and f4_local1 == CoD.PlayOnlineFailure.OPFR_XBOXLIVE_MPNOTALLOWED and Engine.IsXB3() then
f4_local0 = Engine.ShowXB3GoldUpsell( f4_arg0 )
end
if not f4_local0 then
Engine.ExecWithResolve( "xrequirelivesignin", resolveXboxLiveButtonAction, f4_arg0 )
Engine.Exec( "forcenosplitscreencontrol main_XBOXLIVE_2", f4_arg0 )
else
if Engine.IsXbox360() and Engine.AnyContentDamaged and Engine.AnyContentDamaged() then
LUI.FlowManager.RequestPopupMenu( self, "mp_damaged_content_popup", false, f4_arg0 )
return
elseif SvS.IsSvS() then
Engine.Exec( "profile_SetHasEverPlayed_SP", f4_arg0 )
end
Engine.ExecNow( "resetSplitscreenSignIn", f4_arg0 )
Engine.ExecNow( "forcenosplitscreencontrol main_XBOXLIVE_3", f4_arg0 )
Engine.SetDvarBool( "systemlink", false )
Engine.SetDvarBool( "splitscreen", false )
Engine.SetDvarBool( "onlinegame", true )
Engine.SetDvarBool( "xblive_privatematch", false )
Engine.SetDvarBool( "ui_opensummary", false )
Engine.SetDvarBool( "squad_match", false )
if Engine.GetDvarBool( "xblive_competitionmatch" ) then
Engine.SetDvarBool( "xblive_competitionmatch", false )
Engine.Exec( "set remove_mlg_rules 1" )
end
Engine.ExecNow( MPConfig.default_xboxlive, f4_arg0 )
if not SvS.IsSvS() then
Engine.ExecNow( "xstartprivateparty", f4_arg0 )
end
Engine.Exec( "startentitlements", f4_arg0 )
Engine.CacheUserDataForController( f4_arg0 )
if SvS.IsSvS() then
LUI.FlowManager.RequestAddMenu( nil, "squads_mode_select_menu", false, f4_arg0, false )
else
LUI.FlowManager.RequestAddMenu( nil, "menu_xboxlive", false, f4_arg0, false )
end
end
end
function xboxLiveButtonAction( f5_arg0, f5_arg1 )
resolveXboxLiveButtonAction( f5_arg1.controller )
end
function splitScreenButtonAction( f6_arg0, f6_arg1 )
if Engine.IsXbox360() and Engine.AnyContentDamaged and Engine.AnyContentDamaged() then
LUI.FlowManager.RequestPopupMenu( f6_arg0, "mp_damaged_content_popup", false, controller )
return
elseif SvS.IsSvS() then
Engine.Exec( "profile_SetHasEverPlayed_SP", f6_arg1.controller )
end
Engine.Exec( "resetSplitscreenSignIn" )
Engine.Exec( "forcesplitscreencontrol main_SPLITSCREEN" )
Engine.SetDvarBool( "systemlink", false )
Engine.SetDvarBool( "splitscreen", true )
Engine.SetDvarBool( "onlinegame", false )
Engine.SetDvarBool( "xblive_privatematch", false )
Engine.SetDvarBool( "ui_opensummary", false )
Engine.Exec( MPConfig.default_splitscreen )
Engine.CacheUserDataForController( f6_arg1.controller )
if Engine.GetDvarBool( "lui_splitscreensignin_menu" ) then
LUI.FlowManager.RequestAddMenu( f6_arg0, "menu_splitscreensignin", false, f6_arg1.controller, false )
else
assert( not Engine.IsAliensMode(), "Splitscreen sign in UI not supported by .menu." )
LUI.FlowManager.RequestOldMenu( f6_arg0, "menu_splitscreensignin", false )
end
end
function systemLinkButtonResolveAction( f7_arg0 )
Engine.SetDvarBool( "systemlink", true )
Engine.SetDvarBool( "splitscreen", false )
Engine.SetDvarBool( "onlinegame", false )
Engine.SetDvarBool( "xblive_privatematch", false )
Engine.SetDvarBool( "ui_opensummary", false )
Engine.Exec( MPConfig.default_systemlink, f7_arg0 )
Engine.CacheUserDataForController( f7_arg0 )
if Engine.IsUserSignedIn( f7_arg0 ) == true and Engine.IsUserAGuest( f7_arg0 ) == false then
if Engine.IsPS3() then
if Engine.OfflineProfileIsSelected( Engine.GetFirstActiveController() ) then
Engine.Exec( "forcenosplitscreencontrol main_SYSTEMLINK_3", f7_arg0 )
LUI.FlowManager.RequestAddMenu( nil, "menu_systemlink", false, f7_arg0, false )
else
LUI.FlowManager.RequestPopupMenu( nil, "menu_ps3_profile", true, f7_arg0, false )
end
else
if Engine.IsXbox360() and Engine.AnyContentDamaged and Engine.AnyContentDamaged() then
LUI.FlowManager.RequestPopupMenu( self, "mp_damaged_content_popup", false, f7_arg0 )
return
end
Engine.Exec( "forcenosplitscreencontrol main_SYSTEMLINK_3", f7_arg0 )
LUI.FlowManager.RequestAddMenu( nil, "menu_systemlink", false, f7_arg0, false )
end
end
end
function systemLinkButtonAction( f8_arg0, f8_arg1 )
Engine.ExecNow( "forcenosplitscreencontrol main_SYSTEMLINK_1", f8_arg1.controller )
if not Engine.IsUserSignedIn( f8_arg1.controller ) or Engine.IsUserAGuest( f8_arg1.controller ) then
Engine.ExecWithResolve( "xrequiresignin", systemLinkButtonResolveAction, f8_arg1.controller )
Engine.Exec( "forcesplitscreencontrol main_SYSTEMLINK_2", f8_arg1.controller )
else
systemLinkButtonResolveAction( f8_arg1.controller )
end
end
function eliteButtonAction( f9_arg0, f9_arg1 )
if not Engine.IsEliteAppAvailable( f9_arg1.controller ) then
Engine.ExecNow( "incnosplitscreencontrol main_ELITE_1", f9_arg1.controller )
if not Engine.IsUserSignedInForCommerce( f9_arg1.controller ) then
Engine.Exec( "xrequirelivesigninforcommerce", f9_arg1.controller )
Engine.Exec( "decnosplitscreencontrol main_ELITE_2" )
else
Engine.ExecNow( "decnosplitscreencontrol main_ELITE_3" )
LUI.FlowManager.RequestPopupMenu( f9_arg0, "popup_elite_sell", false, f9_arg1.controller )
end
end
end
function resolveStoreButtonAction( f10_arg0 )
if not Engine.UserCanAccessStore( f10_arg0 ) then
Engine.ExecNow( "forcenosplitscreencontrol main_XBOXLIVE_STORE_1", f10_arg0 )
Engine.ExecWithResolve( "xrequirelivesigninforstore", resolveStoreButtonAction, f10_arg0 )
Engine.Exec( "forcesplitscreencontrol main_XBOXLIVE_STORE_2", f10_arg0 )
else
Engine.SetDvarBool( "ui_onlineRequired", true )
if not Sns.OpenStoreMenu( f10_arg0 ) then
Engine.SetDvarBool( "ui_onlineRequired", false )
end
end
end
function storeButtonAction( f11_arg0, f11_arg1 )
Engine.SetDvarBool( "systemlink", false )
resolveStoreButtonAction( f11_arg1.controller )
end
function optionsButtonAction( f12_arg0, f12_arg1 )
if Engine.IsConsoleGame() then
Engine.ExecNow( "forcenosplitscreencontrol main_options_menu", f12_arg1.controller )
LUI.FlowManager.RequestAddMenu( f12_arg0, "controls", true, f12_arg1.controller, false )
else
LUI.FlowManager.RequestAddMenu( f12_arg0, "pc_controls", true, f12_arg1.controller, false )
end
end
function mainMenuButtonAction( f13_arg0, f13_arg1 )
Engine.StartSingleplayer()
end
function updateDescText( f14_arg0, f14_arg1 )
f14_arg0:setText( Engine.Localize( f14_arg1.string ) )
end
function MainMenuChildFeeder( f15_arg0 )
local f15_local0 = SvS.IsSvS()
local f15_local1 = nil
if Engine.IsAliensMode() then
f15_local1 = Engine.Localize( "@LUA_MENU_ALIENS" )
elseif f15_local0 then
f15_local1 = Engine.Localize( "@LUA_MENU_SQUAD_TITLE_CAPS" )
else
f15_local1 = Engine.Localize( "@LUA_MENU_MULTIPLAYER_CAPS" )
end
local f15_local2 = {
[#f15_local2 + 1] = {
type = "generic_menu_title",
id = "mp_main_title_text_id",
properties = {
menu_title = f15_local1
}
},
[#f15_local2 + 1] = {
type = "main_mp_menu_options"
},
[#f15_local2 + 1] = {
type = "button_helper_text_main",
id = "mp_main_button_helper_text_id"
},
[#f15_local2 + 1] = {
type = "UICharacterWindow",
id = "characterwindow",
states = {
default = {
topAnchor = false,
bottomAnchor = true,
leftAnchor = false,
rightAnchor = true,
right = -150,
bottom = -150,
height = 256,
width = 154
}
},
children = {
{
type = "UITimer",
id = "createSceneTimer",
properties = {
event = "make_scene",
interval = 200
}
}
}
},
[#f15_local2 + 1] = {
type = "generic_back_button",
handlers = {
button_secondary = MBh.PopupMenu( "main_choose_exe_popup_menu", false, false )
}
}
}
if Engine.IsXbox360() then
f15_local2[#f15_local2 + 1] = {
type = "UITimer",
id = "checkRequiredDLCTimer",
properties = {
event = "check_required_dlc",
interval = 1000
}
}
end
return f15_local2
end
function mp_main_menu()
return {
type = "UIElement",
id = "mp_main_menu_id",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
handlers = {
menu_create = mpMainMenuCreateHandler,
check_required_dlc = mpMainMenuCheckRequiredDLC
},
childrenFeeder = MainMenuChildFeeder
}
end
function main_menu_options_feeder( f17_arg0 )
local f17_local0 = Engine.IsAliensMode()
local f17_local1 = SvS.IsSvS()
local f17_local2 = false
if Engine.GetDvarInt( "allow_online_squads" ) == 1 or not Engine.IsConsoleGame() then
f17_local2 = true
end
local f17_local3 = Engine.DoWeNeedCompatibilityPacks()
if f17_local1 then
local f17_local4 = f17_local2
end
local f17_local5 = f17_local4 or not f17_local1
local f17_local6 = {}
if Engine.AllowOnline() and f17_local5 then
local f17_local7, f17_local8 = nil
if f17_local1 then
f17_local8 = Engine.Localize( "@PLATFORM_PLAY_ONLINE_SQUADS_CAPS" )
f17_local7 = Engine.Localize( "@LUA_MENU_SQUADS_INTRO" )
elseif f17_local0 then
f17_local8 = Engine.Localize( "@PLATFORM_PLAY_ONLINE_CAPS" )
f17_local7 = Engine.Localize( "@LUA_MENU_PLAY_EXTINCTION_ONLINE_DESC" )
else
f17_local8 = Engine.Localize( "@PLATFORM_PLAY_ONLINE_CAPS" )
f17_local7 = Engine.Localize( "@PLATFORM_PLAY_ONLINE_DESC" )
end
f17_local6[#f17_local6 + 1] = {
type = "UIGenericButton",
id = "btn_MPMain_0",
disabled = f17_local3,
disabledFunc = Engine.DoWeNeedCompatibilityPacks,
properties = {
button_text = f17_local8,
button_action_func = xboxLiveButtonAction,
desc_text = f17_local7,
button_over_func = function ( f18_arg0, f18_arg1 )
PersistentBackground.SetToDefault()
end
}
}
end
if Engine.IsConsoleGame() then
local f17_local7 = "@LUA_MENU_SPLITSCREEN_CAPS"
if f17_local0 then
f17_local7 = "@LUA_MENU_LOCAL_CAPS"
elseif f17_local1 then
f17_local7 = "@LUA_MENU_LOCAL_CAPS"
end
local f17_local8 = #f17_local6 + 1
local f17_local9 = {
type = "UIGenericButton",
id = "btn_MPMain_1",
disabled = f17_local3,
disabledFunc = Engine.DoWeNeedCompatibilityPacks
}
local f17_local10 = {
button_text = Engine.Localize( f17_local7 ),
button_action_func = splitScreenButtonAction
}
local f17_local11
if f17_local1 then
f17_local11 = Engine.Localize( "@LUA_MENU_SQUAD_LOCAL_PLAY_DESC" )
if not f17_local11 then
else
f17_local10.desc_text = f17_local11
f17_local10.button_over_func = function ( f19_arg0, f19_arg1 )
PersistentBackground.SetToDefault()
end
f17_local9.properties = f17_local10
f17_local6[f17_local8] = f17_local9
if not f17_local1 then
f17_local6[#f17_local6 + 1] = {
type = "UIGenericButton",
id = "btn_MPMain_2",
disabled = f17_local3,
disabledFunc = Engine.DoWeNeedCompatibilityPacks,
properties = {
button_text = Engine.Localize( "@PLATFORM_SYSTEM_LINK_CAPS" ),
button_action_func = systemLinkButtonAction,
desc_text = Engine.Localize( "@PLATFORM_SYSTEM_LINK_DESC" ),
button_over_func = function ( f20_arg0, f20_arg1 )
PersistentBackground.SetToDefault()
end
}
}
end
end
end
f17_local11 = Engine.Localize( "@LUA_MENU_SPLITSCREEN_DESC" )
end
if not f17_local1 then
f17_local6[#f17_local6 + 1] = {
type = "UIGenericButton",
id = "btn_MPMain_5",
properties = {
button_text = Engine.Localize( "@LUA_MENU_STORE_CAPS" ),
button_action_func = storeButtonAction,
desc_text = Engine.Localize( "@LUA_MENU_STORE_DESC" ),
button_over_func = function ( f21_arg0, f21_arg1 )
PersistentBackground.SetToDefault()
end
}
}
end
f17_local6[#f17_local6 + 1] = {
type = "UIGenericButton",
id = "btn_MPMain_6",
properties = {
button_text = Engine.Localize( "@LUA_MENU_OPTIONS_CAPS" ),
button_action_func = optionsButtonAction,
desc_text = Engine.Localize( "@LUA_MENU_OPTIONS_DESC" ),
button_over_func = function ( f22_arg0, f22_arg1 )
PersistentBackground.SetToDefault()
end
}
}
f17_local6[#f17_local6 + 1] = {
type = "generic_separator",
id = "main_menu_spacer_id"
}
if not Engine.IsCoreMode() then
f17_local6[#f17_local6 + 1] = {
type = "UIGenericButton",
id = "btn_MPMain_7",
properties = {
text = Engine.Localize( "@LUA_MENU_MULTIPLAYER_CAPS" ),
button_action_func = function ( f23_arg0, f23_arg1 )
Engine.StopMusic( 200 )
Engine.SwitchToCoreMode()
Engine.PlayMusic( CoD.Music.MainMPMusic )
Engine.SetActiveMenu( ActiveMenus.None )
Engine.SetActiveMenu( ActiveMenus.Main )
end,
button_over_func = function ( f24_arg0, f24_arg1 )
PersistentBackground.Set( PersistentBackground.Variants.MPBackground )
end,
desc_text = Engine.Localize( "@PLATFORM_PLAY_ONLINE_DESC" )
}
}
end
if not SvS.IsSvS() then
f17_local6[#f17_local6 + 1] = {
type = "UIGenericButton",
id = "btn_MPMain_8",
properties = {
button_text = Engine.Localize( "@LUA_MENU_SQUAD_MODE_CAP" ),
button_action_func = function ( f25_arg0, f25_arg1 )
Engine.StopMusic( 200 )
Engine.SwitchToSquadVsSquadMode()
Engine.PlayMusic( CoD.Music.MainSquadMusic )
Engine.SetActiveMenu( ActiveMenus.None )
Engine.SetActiveMenu( ActiveMenus.Main )
end,
button_over_func = function ( f26_arg0, f26_arg1 )
PersistentBackground.Set( PersistentBackground.Variants.SvSBackground )
end,
desc_text = Engine.Localize( "@LUA_MENU_SVS_MAIN_MENU_DESC" )
}
}
end
if not Engine.IsAliensMode() and Engine.UnlockedAliens() then
f17_local6[#f17_local6 + 1] = {
type = "UIGenericButton",
id = "btn_MPMain_9",
properties = {
button_text = Engine.Localize( "@LUA_MENU_ALIENS_CAPS" ),
button_action_func = function ( f27_arg0, f27_arg1 )
Engine.StopMusic( 200 )
Engine.SwitchToAliensMode()
Engine.PlayMusic( CoD.Music.MainExtinctMusic )
Engine.SetActiveMenu( ActiveMenus.None )
Engine.SetActiveMenu( ActiveMenus.Main )
end,
button_over_func = function ( f28_arg0, f28_arg1 )
PersistentBackground.Set( PersistentBackground.Variants.AliensBackground )
end,
desc_text = Engine.Localize( "@LUA_MENU_ALIENS_MAIN_MENU_DESC" ),
additional_handlers = {
menu_create = AddExtinctionGlowBackground
}
}
}
end
f17_local6[#f17_local6 + 1] = {
type = "button_desc_text",
id = "mp_menu_button_description_id",
properties = {
lines = SvS.IsSvS() and 8 or nil
}
}
return f17_local6
end
f0_local0 = function ()
return {
type = "UIVerticalList",
id = "mp_main_menu_id",
childrenFeeder = main_menu_options_feeder,
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
alignment = LUI.Alignment.Top
}
},
handlers = {
dlc_mount_complete = function ( f30_arg0, f30_arg1 )
f30_arg0:processEvent( {
name = "menu_refresh"
} )
end
,
dlc_mount_fail = function ( f31_arg0, f31_arg1 )
f31_arg0:processEvent( {
name = "menu_refresh"
} )
end
,
dlc_download_fail = function ( f32_arg0, f32_arg1 )
f32_arg0:processEvent( {
name = "menu_refresh"
} )
end
}
}
end
function SquadsDescTextFeeder( f33_arg0 )
local f33_local0 = {
[#f33_local0 + 1] = {
type = "UIText",
id = "squads_desc_text_main",
properties = {
text = Engine.Localize( "LUA_MENU_SQUADS_INTRO" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = CoD.TextSettings.NormalFont.Height,
left = 0,
right = 0,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left
}
}
}
}
return f33_local0
end
function AddExtinctionGlowBackground( f34_arg0, f34_arg1 )
local f34_local0 = f34_arg0:getFirstDescendentById( "hlist" )
local f34_local1 = f34_local0:getChildById( "bgRightCap" )
if f34_local1 then
if Engine.IsConsoleGame() or Engine.IsGamepadEnabled() == 1 then
f34_local1:registerAnimationState( "focus", {
material = RegisterMaterial( "btn_alien_00a_rtcap_f" )
} )
else
f34_local1:registerAnimationState( "focus", {
material = RegisterMaterial( "btn_alien_00a_rtcap_f_pc" )
} )
end
local self = LUI.UIImage.new( {
material = RegisterMaterial( "btn_alien_overlay" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = -44,
bottom = 16,
left = -208,
right = -48,
alpha = 0
} )
self.id = "blood_splat_glow"
self:registerAnimationState( "glow", {
alpha = 0.12
} )
self:registerAnimationState( "heavyglow", {
alpha = 0.5
} )
self:registerEventHandler( "button_over", MBh.AnimateLoop( {
{
"default",
0
},
{
"heavyglow",
1200
},
{
"default",
1200
}
} ) )
self:registerEventHandler( "button_up", MBh.AnimateLoop( {
{
"default",
0
},
{
"glow",
1200
},
{
"default",
1200
}
} ) )
local f34_local3 = MBh.AnimateLoop( {
{
"default",
1200
},
{
"glow",
1200
}
} )
f34_local3( self )
f34_local1:addElement( self )
f34_local3 = LUI.UIImage.new( {
material = RegisterMaterial( "btn_alien_overlay_02" ),
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = -28,
bottom = 32,
left = -208,
right = -48,
alpha = 0
} )
f34_local3.id = "blood_splat_glow_02"
f34_local3:registerAnimationState( "glow", {
alpha = 0.12
} )
f34_local3:registerAnimationState( "heavyglow", {
alpha = 0.5
} )
f34_local3:registerEventHandler( "button_over", MBh.AnimateLoop( {
{
"default",
0
},
{
"heavyglow",
1800
},
{
"default",
1800
}
} ) )
f34_local3:registerEventHandler( "button_up", MBh.AnimateLoop( {
{
"default",
0
},
{
"glow",
1800
},
{
"default",
1800
}
} ) )
local f34_local4 = MBh.AnimateLoop( {
{
"default",
1800
},
{
"glow",
1800
}
} )
f34_local4( f34_local3 )
f34_local1:addElement( f34_local3 )
end
local self = f34_local0:getChildById( "bgLeftCap" )
if self then
self:registerAnimationState( "focus", {
material = RegisterMaterial( "btn_alien_00a_ltcap_f" )
} )
end
local f34_local3 = f34_local0:getChildById( "bgMid" )
if f34_local3 then
f34_local3:registerAnimationState( "focus", {
material = RegisterMaterial( "btn_alien_00a_mid_f" )
} )
end
end
LUI.MenuBuilder.registerDef( "mp_main_menu", mp_main_menu )
LUI.MenuBuilder.registerDef( "main_mp_menu_options", f0_local0 )
LUI.FlowManager.RegisterStackPushBehaviour( "mp_main_menu", mpMainMenuPushFunc )
LockTable( _M )

View File

@@ -0,0 +1,550 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function MapFeeder( f1_arg0 )
local f1_local0 = {}
local f1_local1 = Lobby.GetMapFeederCount()
local f1_local2 = LUI.FlowManager.GetMenuScopedDataByMenuName( "mapsetup_menu_main" ) or {}
local f1_local3 = nil
if f1_local2.squadBaseSelect then
f1_local3 = Engine.GetPlayerDataEx( f1_local2.exclusiveControllerIndex, CoD.StatsGroup.Ranked, "squadHQ", "squad_base" )
end
for f1_local4 = 0, f1_local1 - 1, 1 do
local f1_local7 = nil
local f1_local8 = Lobby.GetMapLoadNameByIndex( f1_local4 )
local f1_local9 = false
if f1_local2.squadBaseSelect then
f1_local9 = f1_local8 == f1_local3
end
if f1_local8 == "bonus_map" or f1_local8 == "more_maps" then
f1_local7 = {
type = "UIGenericButton",
id = "mapsetup_rotationmap" .. f1_local4,
properties = {
button_text = GetButtonMapName( f1_local4 ),
button_action_func = MBh.EmitEventToRoot( {
name = "select_map",
idx = f1_local4
} ),
button_over_func = MBh.EmitEventToRoot( {
name = "update_map",
idx = f1_local4
} )
}
}
else
f1_local7 = {
type = "UIGenericButton",
id = "mapsetup_rotationmap" .. f1_local4,
listDefaultFocus = f1_local9,
properties = {
variant = GenericButtonSettings.Variants.Checkbox,
button_text = Lobby.GetMapNameByIndex( f1_local4 ),
button_action_func = MBh.EmitEventToRoot( {
name = "select_map",
idx = f1_local4
} ),
button_over_func = MBh.EmitEventToRoot( {
name = "update_map",
idx = f1_local4
} )
}
}
end
if f1_local4 == 0 and Engine.GetDvarBool( "accessToSubscriberContent" ) then
f1_local0[#f1_local0 + 1] = f1_local7
end
if Engine.IsAliensMode() and Lobby.GetMapSupportsAliensByIdx( f1_local4 ) then
f1_local0[#f1_local0 + 1] = f1_local7
end
if not Engine.IsAliensMode() and not Lobby.GetMapSupportsAliensByIdx( f1_local4 ) then
f1_local0[#f1_local0 + 1] = f1_local7
end
end
return f1_local0
end
function MapSetupCreate( f2_arg0, f2_arg1 )
local f2_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f2_arg0 ) or {}
f2_local0.rotationAllowed = f2_arg0.properties.rotationAllowed
f2_arg0:dispatchEventToRoot( {
name = "add_button_helper_text",
button_ref = "button_secondary",
helper_text = Engine.Localize( "@LUA_MENU_BACK" ),
side = "left",
clickable = true,
immediate = true
} )
f2_arg0:dispatchEventToRoot( {
name = "add_button_helper_text",
button_ref = "button_action",
helper_text = Engine.Localize( "@LUA_MENU_SELECT" ),
side = "left",
clickable = true,
immediate = true
} )
f2_arg0:dispatchEventToRoot( {
name = "update_lists",
immediate = true
} )
UpdateMapRotation( f2_arg0, f2_arg1 )
UpdateMap( f2_arg0, {
idx = 0
} )
end
function UpdateMapRotation( f3_arg0, f3_arg1 )
local f3_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f3_arg0 )
if not f3_local0.squadBaseSelect then
local f3_local1 = Lobby.GetMapFeederCount()
for f3_local2 = 0, f3_local1 - 1, 1 do
local f3_local5 = Lobby.GetMapLoadNameByIndex( f3_local2 )
local f3_local6 = f3_arg0:getFirstDescendentById( "mapsetup_rotationmap" .. f3_local2 )
if Lobby.IsMapInRotation( f3_local5 ) then
f3_local6:processEvent( {
name = "set_checked",
dispatchChildren = true
} )
end
end
end
end
function GetButtonMapName( f4_arg0 )
local f4_local0 = Lobby.GetMapNameByIndex( f4_arg0 )
if Engine.MarkLocalized( f4_local0 ) == Engine.Localize( "DLC_MAPSTORE" ) then
f4_local0 = Engine.Localize( "PATCH_MENU_MORE_MAPS" )
end
return f4_local0
end
function UpdateMap( f5_arg0, f5_arg1 )
local f5_local0 = f5_arg0:getFirstDescendentById( "mapsetup_mapname" )
local f5_local1 = f5_arg0:getFirstDescendentById( "mapsetup_mapdesc" )
local f5_local2 = f5_arg0:getFirstDescendentById( "mapsetup_mapimage" )
local f5_local3 = f5_arg1.idx
local f5_local4 = Lobby.GetMapDescByIndex( f5_local3 )
if f5_local0 then
f5_local0:setText( Lobby.GetMapNameByIndex( f5_local3 ) )
end
if f5_local1 then
f5_local1:setText( Engine.Localize( f5_local4 ) )
end
f5_arg0:processEvent( {
name = "adjust_desc_text",
dispatchChildren = true,
descText = f5_local4
} )
if f5_local2 then
local f5_local5 = Lobby.GetMapLoadNameByIndex( f5_local3 )
if f5_local5 == "bonus_map" or f5_local5 == "more_maps" then
f5_local2:setImage( RegisterMaterial( "loadscreen_mp_bonusmaps" ) )
else
f5_local2:setImage( RegisterMaterial( Lobby.GetMapImageByIndex( f5_local3 ) ) )
end
end
end
function SelectMap( f6_arg0, f6_arg1 )
local f6_local0 = Lobby.GetMapLoadNameByIndex( f6_arg1.idx )
if f6_local0 == "bonus_map" then
if Lobby.GetDLCMapCount() > 0 then
Engine.SetDvarBool( "ui_showDLCMaps", true )
f6_arg0:dispatchEventToRoot( {
name = "refresh_maps"
} )
elseif Engine.GetDvarBool( "onlinegame" ) then
LUI.FlowManager.RequestPopupMenu( f6_arg0, "you_dont_have_bonus_maps", true, f6_arg1.controller, nil, nil, nil, nil, false )
else
LUI.FlowManager.RequestPopupMenu( f6_arg0, "you_dont_have_bonus_maps_offline", true, f6_arg1.controller, nil, nil, nil, nil, false )
end
elseif f6_local0 == "more_maps" then
if Engine.GetDvarBool( "onlinegame" ) then
LUI.FlowManager.RequestPopupMenu( f6_arg0, "get_more_maps", true, f6_arg1.controller, nil, nil, nil, nil, false )
else
LUI.FlowManager.RequestPopupMenu( f6_arg0, "get_more_maps_offline", true, f6_arg1.controller, nil, nil, nil, nil, false )
end
elseif f6_arg0.properties.rotationAllowed and MatchRules.IsUsingCustomMapRotation() then
SelectMap_Rotation( f6_arg0, f6_arg1 )
else
SelectMap_Single( f6_arg0, f6_arg1 )
end
end
function SelectMap_Single( f7_arg0, f7_arg1 )
local f7_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f7_arg0 ) or {}
local f7_local1 = f7_arg1.idx
if f7_local1 == nil then
return
end
local f7_local2 = Lobby.GetMapLoadNameByIndex( f7_local1 )
if f7_local0.squadBaseSelect then
Engine.SetPlayerDataEx( f7_local0.exclusiveControllerIndex, CoD.StatsGroup.Ranked, "squadHQ", "squad_base", f7_local2 )
else
Engine.SetDvarString( "ui_mapname", f7_local2 )
end
ExitMenu( f7_arg0, f7_arg1 )
end
function SelectMap_Rotation( f8_arg0, f8_arg1 )
local f8_local0 = Lobby.GetMapLoadNameByIndex( f8_arg1.idx )
if Lobby.IsMapInRotation( f8_local0 ) then
Lobby.IncludeMapInRotation( f8_local0, false )
else
Lobby.IncludeMapInRotation( f8_local0, true )
end
Engine.ExecNow( "xupdatepartystate" )
end
function ToggleMultiMap( f9_arg0, f9_arg1 )
if f9_arg0.properties.rotationAllowed then
Engine.PlaySound( CoD.SFX.MouseClick )
MatchRules.SetUsingCustomMapRotation( MatchRules.IsUsingCustomMapRotation() )
f9_arg0:dispatchEventToRoot( {
name = "update_lists"
} )
end
end
function UpdateLists( f10_arg0, f10_arg1 )
local f10_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f10_arg0 ) or {}
if not f10_local0.squadBaseSelect then
local f10_local1 = f10_local0.rotationAllowed
local f10_local2 = MatchRules.IsUsingCustomMapRotation()
end
local f10_local3 = f10_local1 and f10_local2 or false
f10_arg0:processEvent( {
name = "show_checkbox",
showBox = f10_local3,
dispatchChildren = true
} )
if f10_local3 then
f10_arg0:dispatchEventToRoot( {
name = "add_button_helper_text",
button_ref = "button_alt1",
helper_text = Engine.Localize( "@LUA_MENU_RULES_TOGGLE_ROTATION_OFF" ),
side = "left",
clickable = true,
immediate = true
} )
elseif f10_arg0.properties.rotationAllowed then
f10_arg0:dispatchEventToRoot( {
name = "add_button_helper_text",
button_ref = "button_alt1",
helper_text = Engine.Localize( "@LUA_MENU_RULES_TOGGLE_ROTATION_ON" ),
side = "left",
clickable = true,
immediate = true
} )
end
end
function RefreshMapList( f11_arg0, f11_arg1 )
f11_arg0:processEvent( {
name = "refresh_scroll_list",
dispatchChildren = true
} )
f11_arg0:processEvent( {
name = "update_lists"
} )
f11_arg0:processEvent( {
name = "gain_focus"
} )
UpdateMapRotation( f11_arg0, f11_arg1 )
end
function ExitMenu( f12_arg0, f12_arg1 )
local f12_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f12_arg0 ) or {}
local f12_local1
if not f12_local0.squadBaseSelect then
f12_local1 = f12_local0.rotationAllowed
if f12_local1 then
f12_local1 = MatchRules.IsUsingCustomMapRotation()
end
else
f12_local1 = false
end
if f12_local1 == false then
Engine.ExecNow( "xupdatepartystate" )
end
Engine.SetDvarBool( "ui_showDLCMaps", false )
LUI.FlowManager.RequestLeaveMenu( f12_arg0 )
end
function BackButtonFunc( f13_arg0, f13_arg1 )
if Engine.GetDvarBool( "ui_showDLCMaps" ) then
Engine.SetDvarBool( "ui_showDLCMaps", false )
f13_arg0:dispatchEventToRoot( {
name = "refresh_maps"
} )
else
ExitMenu( f13_arg0, f13_arg1 )
end
end
function mapsetup_map_vlist()
return {
type = "UIVerticalList",
focusable = true,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = -50,
top = 0,
bottom = 0,
alpha = 1
},
hidden = {
alpha = 0
}
}
}
end
function mapsetup_details_window()
return {
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 140,
bottom = 600,
left = 560,
right = 1040
}
},
children = {
{
type = "generic_menu_titlebar",
id = "mapsetup_details_title",
properties = {
font = CoD.TextSettings.BoldFont,
title_bar_text = Engine.Localize( "@LUA_MENU_MAP_DETAILS_CAPS" ),
title_bar_text_indent = GenericTitleBarDims.TitleBarLCapWidth,
title_bar_alignment = LUI.Alignment.Left,
fill_alpha = 1
}
},
{
type = "generic_menu_background_withfade",
id = "mapsetup_details_window_bg",
properties = {
fill_alpha = 1
}
},
{
type = "UIImage",
id = "mapsetup_mapimage",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
material = RegisterMaterial( "" ),
left = 10,
right = -10,
top = GenericTitleBarDims.TitleBarHeight + 10,
height = 240
}
}
},
{
type = "UIText",
id = "mapsetup_mapname",
properties = {
text = ""
},
states = {
default = {
left = -220,
top = 65,
width = 380,
height = CoD.TextSettings.BoldFont.Height,
font = CoD.TextSettings.BoldFont.Font,
alignment = LUI.Alignment.Left
}
}
},
{
type = "UIText",
id = "mapsetup_mapdesc",
states = {
default = {
left = -220,
top = 85,
width = 450,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b
},
adjusted = {
top = 105,
height = CoD.TextSettings.NormalFont.Height
}
},
handlers = {
adjust_desc_text = function ( f16_arg0, f16_arg1 )
if f16_arg1.descText == "@DLC_MAPS_DESC" then
f16_arg0:animateToState( "adjusted" )
else
f16_arg0:animateToState( "default" )
end
end
}
}
}
}
end
function mapsetup_menu_main()
return {
type = "UIElement",
id = "mapsetup_root",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_MAP_SELECT_CAPS" ),
rotationAllowed = false
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = MapSetupCreate,
update_map = UpdateMap,
update_lists = UpdateLists,
select_map = SelectMap,
refresh_maps = RefreshMapList
},
children = {
{
type = "generic_menu_title",
id = "mapsetup_title",
properties = {
menu_title = MBh.Property( "menu_title" )
}
},
{
type = "UIScrollingVerticalList",
id = "mapsetup_rptatopmmaplist",
childrenFeeder = MapFeeder,
properties = {
use_arrows = true,
use_scrollbar = false,
bar_width = 20
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_top + GenericButtonSettings.Styles.GradientButton.height * 11 + 2 + 60
}
}
},
{
type = "mapsetup_details_window",
id = "mapsetup_details_window_id"
},
{
type = "UIBindButton",
id = "mapsetup_bindbuttons",
handlers = {
button_secondary = BackButtonFunc,
button_alt1 = ToggleMultiMap
}
},
{
type = "button_helper_text_main",
id = "mapsetup_button_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
}
}
}
end
function you_dont_have_bonus_maps()
return {
type = "generic_yesno_popup",
properties = {
message_text = Engine.Localize( "@LUA_MENU_NO_BONUS_MAPS" ),
popup_title = Engine.Localize( "@MENU_NOTICE" ),
yes_action = function ( f19_arg0, f19_arg1 )
LUI.FlowManager.RequestLeaveMenu( f19_arg0 )
Sns.OpenStoreMenu( f19_arg1.controller, "map_select_menu" )
end
}
}
end
function get_more_maps()
return {
type = "generic_yesno_popup",
properties = {
message_text = Engine.Localize( "@LUA_MENU_PURCHASE_MAPS" ),
popup_title = Engine.Localize( "@MENU_NOTICE" ),
yes_action = function ( f21_arg0, f21_arg1 )
LUI.FlowManager.RequestLeaveMenu( f21_arg0 )
Sns.OpenStoreMenu( f21_arg1.controller, "map_select_menu" )
end
}
}
end
function you_dont_have_bonus_maps_offline()
return {
type = "generic_confirmation_popup",
properties = {
popup_title = Engine.Localize( "@MENU_NOTICE" ),
message_text = Engine.Localize( "@LUA_MENU_NO_BONUS_MAPS_OFFLINE" )
}
}
end
function get_more_maps_offline()
return {
type = "generic_confirmation_popup",
properties = {
popup_title = Engine.Localize( "@MENU_NOTICE" ),
message_text = Engine.Localize( "@LUA_MENU_PURCHASE_MAPS_OFFLINE" )
}
}
end
LUI.MenuBuilder.registerDef( "mapsetup_menu_main", mapsetup_menu_main )
LUI.MenuBuilder.registerDef( "mapsetup_map_vlist", mapsetup_map_vlist )
LUI.MenuBuilder.registerDef( "mapsetup_details_window", mapsetup_details_window )
LUI.MenuBuilder.registerDef( "you_dont_have_bonus_maps", you_dont_have_bonus_maps )
LUI.MenuBuilder.registerDef( "get_more_maps", get_more_maps )
LUI.MenuBuilder.registerDef( "you_dont_have_bonus_maps_offline", you_dont_have_bonus_maps_offline )
LUI.MenuBuilder.registerDef( "get_more_maps_offline", get_more_maps_offline )
LockTable( _M )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,524 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
if not LobbyMember then
LobbyMember = {}
end
LobbyMember.ReportPlayerButtonAction = function ( f1_arg0, f1_arg1 )
LUI.FlowManager.RequestPopupMenu( f1_arg0, "popup_friend_report", true, f1_arg1.controller, false, {
friendIndex = -1,
reportFunction = LobbyMember.SelectedMember_Report,
confirmationAction = function ( f2_arg0, f2_arg1, f2_arg2 )
LUI.FlowManager.RequestPopupMenu( f2_arg0, "popup_confirm_report", true, controller, false, {
message_text = f2_arg2
} )
end
} )
end
LobbyMember.Options = {
xboxProfile = {
text = "@XBOXLIVE_VIEW_PROFILE",
action = LobbyMember.SelectedMember_ShowGamerCard,
disabled = function ()
return not Engine.GetDvarBool( "party_playervisible" )
end
},
psSendFriendInvite = {
text = "@XBOXLIVE_ADDFRIEND",
action = LobbyMember.SelectedMember_AddFriend,
disabled = function ()
local f4_local0
if Engine.GetDvarBool( "party_playervisible" ) then
f4_local0 = Engine.GetDvarBool( "party_IsLocalClientSelected" )
if not f4_local0 then
f4_local0 = LobbyMember.SelectedMember_IsFriend()
if not f4_local0 then
f4_local0 = LobbyMember.SelectedMember_IsGuest()
end
end
else
f4_local0 = true
end
return f4_local0
end
},
inviteToClan = {
text = "@LUA_MENU_CLAN_INVITE_TO_CLAN",
action = function ( f5_arg0, f5_arg1 )
if Engine.IsChatRestricted() then
LUI.FlowManager.RequestPopupMenu( f5_arg0, "user_generated_content_restriction_popup", true, f5_arg1.controller )
else
LobbyMember.SelectedMember_InviteToClan( f5_arg1.controller )
end
end,
disabled = function ( f6_arg0 )
local f6_local0
if LobbyMember.SelectedMember_CanInviteToClan( f6_arg0 ) and Engine.GetDvarBool( "party_playervisible" ) then
f6_local0 = LobbyMember.SelectedMember_IsGuest()
else
f6_local0 = true
end
return f6_local0
end
},
viewClan = function ( f7_arg0, f7_arg1, f7_arg2 )
local f7_local0 = Lobby.GetMemberName( f7_arg0, f7_arg1, f7_arg2 )
return {
text = "@CLANS_VIEW_CLAN",
action = function ( f8_arg0, f8_arg1 )
if not CoDAnywhere.ServiceAvailable( f8_arg1.controller ) then
LUI.FlowManager.RequestPopupMenu( f8_arg0, "generic_confirmation_popup", true, f8_arg1.controller, false, {
popup_title = Engine.Localize( "MENU_ERROR" ),
message_text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_ERROR_SERVICE" )
} )
elseif not CoDAnywhere.HasUCDAccount( f8_arg1.controller ) then
LUI.FlowManager.RequestPopupMenu( f8_arg0, "generic_confirmation_popup", true, f8_arg1.controller, false, {
popup_title = Engine.Localize( "MENU_NOTICE" ),
message_text = Engine.Localize( "@PATCH_MENU_REQUIRES_COD_ACCOUNT" )
} )
else
LobbyMember.SelectedMember_FetchClan( f8_arg1.controller )
LUI.FlowManager.RequestAddMenu( f8_arg0, "clan_details_main", true, f8_arg1.controller, false, {
remoteView = true,
remotePlayerName = f7_local0
} )
end
end
,
disabled = function ( f9_arg0 )
local f9_local0 = LobbyMember.SelectedMember_IsGuest()
if not f9_local0 then
if Engine.GetDvarBool( "party_playervisible" ) then
f9_local0 = not Lobby.IsInClan( f7_arg0, f7_arg1, f7_arg2, f9_arg0 )
else
f9_local0 = true
end
end
return f9_local0
end
}
end,
toggleMute = {
text = "@XBOXLIVE_PLAYER_MUTE",
action = LobbyMember.SelectedMember_ToggleMute,
disabled = function ()
local f10_local0 = Engine.GetDvarBool( "party_IsLocalClientSelected" )
if not f10_local0 then
if Engine.GetDvarBool( "party_playervisible" ) then
f10_local0 = LobbyMember.SelectedMember_IsAway()
else
f10_local0 = true
end
end
return f10_local0
end
},
showCommonGroups = {
text = "@MENU_SHOW_COMMON_GROUPS",
action = LobbyMember.SelectedMember_ShowCommonGroups,
disabled = function ()
local f11_local0 = Engine.GetDvarBool( "party_IsLocalClientSelected" )
if not f11_local0 then
f11_local0 = not Engine.GetDvarBool( "party_playervisible" )
end
return f11_local0
end,
exclude = function ( f12_arg0 )
return not Engine.UserGroupsAllowed( f12_arg0 )
end
},
tryMigrateHost = {
text = "@MPUI_SETASHOST",
action = LobbyMember.SelectedMember_TryMigrateHost,
disabled = function ()
local f13_local0
if Lobby.IsPrivatePartyHost() and Engine.GetDvarBool( "party_playervisible" ) then
f13_local0 = Engine.GetDvarBool( "party_IsLocalClientSelected" )
if not f13_local0 then
f13_local0 = LobbyMember.SelectedMember_IsAway()
end
else
f13_local0 = true
end
return f13_local0
end
},
reportPlayer = {
text = "@MENU_REPORT_PLAYER",
action = LobbyMember.ReportPlayerButtonAction,
disabled = function ()
local f14_local0 = Engine.GetDvarBool( "party_IsLocalClientSelected" )
if not f14_local0 then
f14_local0 = not Engine.GetDvarBool( "party_playervisible" )
end
return f14_local0
end
},
kickPlayer = {
text = "@XBOXLIVE_KICK",
action = LobbyMember.SelectedMember_TryKick,
disabled = function ()
local f15_local0 = Lobby.IsPrivatePartyHost()
if f15_local0 then
f15_local0 = IsPublicMatch()
end
local f15_local1 = Lobby.IsGameHost()
if f15_local1 then
f15_local1 = IsPrivateMatch()
end
local f15_local2 = f15_local1 or f15_local0
local f15_local3 = Engine.GetDvarBool( "party_playervisible" )
local f15_local4 = Engine.GetDvarBool( "party_IsLocalClientSelected" )
local f15_local5
if f15_local2 and f15_local3 then
f15_local5 = f15_local4
else
f15_local5 = true
end
return f15_local5
end
},
makeMLGSpectator = function ( f16_arg0 )
local f16_local0 = Lobby.IsMemberMLGSpectator( f16_arg0 )
if not f16_local0 or not "PATCH_MENU_UNSET_MLG_SPECTATOR" then
local f16_local1 = "PATCH_MENU_SET_MLG_SPECTATOR"
end
if CoD.IsUsingAspectRatio( 1.33 ) then
local f16_local1 = "LUA_MENU_MLG_SPECTATOR_DISABLED_ASPECT"
end
return {
text = f16_local1,
action = function ( f17_arg0, f17_arg1 )
LobbyMember.SelectedMember_SetLocalMemberMLGSpectator( not f16_local0 )
end
,
disabled = function ()
local f18_local0
if MLG.AreMLGRulesEnabled() and Engine.GetDvarBool( "party_IsLocalClientSelected" ) then
f18_local0 = Engine.GetDvarBool( "splitscreen" )
if not f18_local0 then
f18_local0 = CoD.IsUsingAspectRatio( 1.33 )
end
else
f18_local0 = true
end
return f18_local0
end
}
end
}
f0_local0 = function ( f19_arg0, f19_arg1, f19_arg2, f19_arg3, f19_arg4 )
local f19_local0 = Engine.IsXbox360()
if not f19_local0 then
f19_local0 = Engine.IsXB3()
end
local f19_local1 = {}
if Lobby.IsMemberABot( f19_arg0, f19_arg1, f19_arg2 ) then
return {
{
text = "@LUA_MENU_REMOVE_BOT",
customActionFunc = function ( f20_arg0, f20_arg1 )
Lobby.RemoveMemberBot( f19_arg0, f19_arg1, f19_arg2 )
end
,
disabled = function ()
return not Lobby.IsPrivatePartyHost()
end
},
{
variant = "select",
text = "@LUA_MENU_DIFFICULTY",
display = function ( f22_arg0, f22_arg1 )
local f22_local0 = Lobby.GetMemberBotDifficulty( f19_arg0, f19_arg1, f19_arg2 )
if f22_local0 == Lobby.BotDifficulties.Recruit then
return Engine.Localize( "@LUA_MENU_BOTS_RECRUIT" )
elseif f22_local0 == Lobby.BotDifficulties.Regular then
return Engine.Localize( "@LUA_MENU_BOTS_REGULAR" )
elseif f22_local0 == Lobby.BotDifficulties.Hardened then
return Engine.Localize( "@LUA_MENU_BOTS_HARDENED" )
elseif f22_local0 == Lobby.BotDifficulties.Veteran then
return Engine.Localize( "@LUA_MENU_BOTS_VETERAN" )
else
return "FIXME Missing option"
end
end
,
left = function ( f23_arg0, f23_arg1 )
local f23_local0 = Lobby.GetMemberBotDifficulty( f19_arg0, f19_arg1, f19_arg2 )
local f23_local1 = Lobby.BotDifficulties.Regular
if f23_local0 == Lobby.BotDifficulties.Recruit then
f23_local1 = Lobby.BotDifficulties.Veteran
elseif f23_local0 == Lobby.BotDifficulties.Regular then
f23_local1 = Lobby.BotDifficulties.Recruit
elseif f23_local0 == Lobby.BotDifficulties.Hardened then
f23_local1 = Lobby.BotDifficulties.Regular
elseif f23_local0 == Lobby.BotDifficulties.Veteran then
f23_local1 = Lobby.BotDifficulties.Hardened
else
f23_local1 = Lobby.BotDifficulties.Regular
end
Lobby.SetMemberBotDifficulty( f19_arg0, f19_arg1, f19_arg2, f23_local1 )
end
,
right = function ( f24_arg0, f24_arg1 )
local f24_local0 = Lobby.GetMemberBotDifficulty( f19_arg0, f19_arg1, f19_arg2 )
local f24_local1 = Lobby.BotDifficulties.Regular
if f24_local0 == Lobby.BotDifficulties.Recruit then
f24_local1 = Lobby.BotDifficulties.Regular
elseif f24_local0 == Lobby.BotDifficulties.Regular then
f24_local1 = Lobby.BotDifficulties.Hardened
elseif f24_local0 == Lobby.BotDifficulties.Hardened then
f24_local1 = Lobby.BotDifficulties.Veteran
elseif f24_local0 == Lobby.BotDifficulties.Veteran then
f24_local1 = Lobby.BotDifficulties.Recruit
else
f24_local1 = Lobby.BotDifficulties.Regular
end
Lobby.SetMemberBotDifficulty( f19_arg0, f19_arg1, f19_arg2, f24_local1 )
end
,
disabled = function ()
return not Lobby.IsPrivatePartyHost()
end
},
{
variant = "select",
text = "@LUA_MENU_PERSONALITY",
display = function ( f26_arg0, f26_arg1 )
return tostring( Lobby.GetMemberBotPersonality( f19_arg0, f19_arg1, f19_arg2 ) )
end
,
left = function ( f27_arg0, f27_arg1 )
local f27_local0 = Lobby.GetMemberBotPersonality( f19_arg0, f19_arg1, f19_arg2 ) - 1
if f27_local0 < 1 then
f27_local0 = 5
end
Lobby.SetMemberBotPersonality( f19_arg0, f19_arg1, f19_arg2, f27_local0 )
end
,
right = function ( f28_arg0, f28_arg1 )
local f28_local0 = Lobby.GetMemberBotPersonality( f19_arg0, f19_arg1, f19_arg2 ) + 1
if f28_local0 > 5 then
f28_local0 = 1
end
Lobby.SetMemberBotPersonality( f19_arg0, f19_arg1, f19_arg2, f28_local0 )
end
,
disabled = function ()
return not Lobby.IsPrivatePartyHost()
end
}
}
elseif f19_arg0 == Lobby.MemberListStates.Prelobby then
if Engine.IsConsoleGame() then
local f19_local2 = {}
local f19_local3
if f19_local0 or Engine.IsPS4() then
f19_local3 = LobbyMember.Options.xboxProfile
if not f19_local3 then
else
local f19_local4 = LobbyMember.Options.toggleMute
local f19_local5 = LobbyMember.Options.tryMigrateHost
local f19_local6 = LobbyMember.Options.reportPlayer
local f19_local7 = LobbyMember.Options.kickPlayer
f19_local2[1] = f19_local3
f19_local2[2] = f19_local4
f19_local2[3] = f19_local5
f19_local2[4] = f19_local6
f19_local2[5] = f19_local7
f19_local1 = f19_local2
end
end
f19_local3 = LobbyMember.Options.psSendFriendInvite
else
f19_local1 = {
LobbyMember.Options.toggleMute,
LobbyMember.Options.tryMigrateHost,
LobbyMember.Options.reportPlayer,
LobbyMember.Options.kickPlayer
}
end
elseif f19_arg0 == Lobby.MemberListStates.Lobby or f19_arg0 == Lobby.MemberListStates.Teams then
if f19_arg4 then
f19_local1 = {}
if Engine.IsConsoleGame() then
local f19_local2 = #f19_local1 + 1
local f19_local3
if f19_local0 or Engine.IsPS4() then
f19_local3 = LobbyMember.Options.xboxProfile
if not f19_local3 then
else
f19_local1[f19_local2] = f19_local3
end
end
f19_local3 = LobbyMember.Options.psSendFriendInvite
end
f19_local1[#f19_local1 + 1] = LobbyMember.Options.toggleMute
f19_local1[#f19_local1 + 1] = LobbyMember.Options.kickPlayer
f19_local1[#f19_local1 + 1] = LobbyMember.Options.reportPlayer
if MLG.IsFeatureAvailable() then
f19_local1[#f19_local1 + 1] = LobbyMember.Options.makeMLGSpectator( f19_arg1 )
end
elseif f19_arg3 then
if Engine.IsConsoleGame() then
local f19_local2 = {}
local f19_local3
if f19_local0 or Engine.IsPS4() then
f19_local3 = LobbyMember.Options.xboxProfile
if not f19_local3 then
else
local f19_local4 = LobbyMember.Options.toggleMute
local f19_local5 = LobbyMember.Options.reportPlayer
f19_local2[1] = f19_local3
f19_local2[2] = f19_local4
f19_local2[3] = f19_local5
f19_local1 = f19_local2
end
end
f19_local3 = LobbyMember.Options.psSendFriendInvite
else
f19_local1 = {
LobbyMember.Options.toggleMute,
LobbyMember.Options.reportPlayer
}
end
end
end
if Clan.IsEnabled() then
f19_local1[#f19_local1 + 1] = LobbyMember.Options.inviteToClan
end
if Clan.IsRemoteViewEnabled() and not Engine.IsAliensMode() then
f19_local1[#f19_local1 + 1] = LobbyMember.Options.viewClan( f19_arg0, f19_arg1, f19_arg2 )
end
return f19_local1
end
function playerPopupMenuFeeder( f30_arg0 )
assert( f30_arg0.memberListState )
assert( f30_arg0.memberSlot )
assert( f30_arg0.team )
assert( f30_arg0.exclusiveController )
local f30_local0 = f30_arg0.exclusiveController
local f30_local1 = Lobby.IsMemberAISquadMember( f30_arg0.memberListState, f30_arg0.memberSlot, f30_arg0.team )
if not f30_local1 then
LobbyMember.SelectMember( f30_arg0.exclusiveController, f30_arg0.memberListState, f30_arg0.memberSlot, f30_arg0.team )
end
local f30_local2 = f0_local0( f30_arg0.memberListState, f30_arg0.memberSlot, f30_arg0.team, f30_arg0.isPublicLobby, f30_arg0.isPrivateLobby )
local f30_local3 = {}
for f30_local4 = 1, #f30_local2, 1 do
local f30_local7 = f30_local4
if not f30_local2[f30_local7].exclude or f30_local2[f30_local7].exclude( f30_local0 ) == false then
if f30_local2[f30_local7].variant and f30_local2[f30_local7].variant == "select" then
f30_local3[#f30_local3 + 1] = {
type = "UIGenericButton",
id = "member_option_" .. f30_local7,
disabled = f30_local2[f30_local7].disabled( f30_local0 ) or f30_local1,
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
variant = GenericButtonSettings.Variants.Select,
button_text = Engine.Localize( f30_local2[f30_local7].text ),
button_display_func = f30_local2[f30_local7].display,
button_left_func = f30_local2[f30_local7].left,
button_right_func = f30_local2[f30_local7].right
}
}
else
f30_local3[#f30_local3 + 1] = {
type = "UIGenericButton",
id = "member_option_" .. f30_local7,
disabled = f30_local2[f30_local7].disabled( f30_local0 ) or f30_local1,
properties = {
style = GenericButtonSettings.Styles.GlassButton,
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
text = Engine.Localize( f30_local2[f30_local7].text ),
button_action_func = function ( f31_arg0, f31_arg1 )
LUI.FlowManager.RequestLeaveMenu( f31_arg0 )
if f30_local2[f30_local7].customActionFunc then
f30_local2[f30_local7].customActionFunc( f31_arg0, f31_arg1 )
else
f30_local2[f30_local7].action( f31_arg0, f31_arg1 )
end
end
}
}
end
end
end
return f30_local3
end
function player_popup_party()
return {
type = "generic_selectionList_popup",
id = "player_popup_menu_id",
properties = {
memberSlot = nil,
memberListState = nil,
team = nil,
popup_title = Engine.Localize( "@MPUI_PLAYER_OPTIONS" ),
popup_childfeeder = playerPopupMenuFeeder
}
}
end
function kickwarning()
return {
type = "generic_yesno_popup",
id = "kick_player_question_id",
properties = {
message_text = Engine.GetDvarString( "party_kickplayerquestion" ),
popup_title = Engine.Localize( "@MPUI_KICK_PLAYER" ),
yes_text = Engine.Localize( "@LUA_MENU_YES" ),
no_text = Engine.Localize( "@LUA_MENU_NO" ),
yes_action = LobbyMember.SelectedMember_Kick,
default_focus_index = 2
}
}
end
function hostchangewarning()
return {
type = "generic_yesno_popup",
id = "migrate_host_question_id",
properties = {
message_text = Engine.GetDvarString( "party_makehostquestion" ),
popup_title = Engine.Localize( "@MPUI_CHANGEHOSTTITLE" ),
yes_text = Engine.Localize( "@LUA_MENU_YES" ),
no_text = Engine.Localize( "@LUA_MENU_NO" ),
yes_action = LobbyMember.SelectedMember_MigrateHost,
default_focus_index = 2
}
}
end
function playerUnmutable()
return {
type = "generic_confirmation_popup",
id = "player_unmutable_popup_id",
properties = {
message_text = Engine.Localize( "@XBOXLIVE_EXTERNALMUTE_TITLE" ),
popup_title = Engine.Localize( "@MENU_NOTICE" ),
button_text = Engine.Localize( "@MENU_OK" ),
confirmation_action = nil,
dialog_top = -75,
dialog_bottom = 75
}
}
end
LUI.MenuBuilder.registerDef( "player_popup_party", player_popup_party )
LUI.MenuBuilder.registerDef( "kickwarning", kickwarning )
LUI.MenuBuilder.registerDef( "hostchangewarning", hostchangewarning )
LUI.MenuBuilder.registerDef( "playerUnmutable", playerUnmutable )
LockTable( _M )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,147 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
ItemStatsTable = {
"deaths",
"headShots",
"hits",
"kills",
"shots"
}
PrestigeResetTable = {
File = "mp/PrestigeResetTable.csv",
MaxRows = 1000,
Cols = {
Index = 0,
Purchases = 1,
WeaponStats = 2,
PlayerStats = 3
}
}
function prestigeresetaction( f1_arg0, f1_arg1 )
if Engine.IsAliensMode() then
Lobby.ExecAliensPrestigeReset( f1_arg1.controller, LUI.mp_menus.Aliens.getAliensRank( f1_arg1.controller ) )
else
PlayerStatsReset( f1_arg1 )
SquadMemXPReset( f1_arg1 )
WeaponStatsReset( f1_arg1 )
SquadMemPurchasesReset( f1_arg1 )
SquadMemUnlockReset( f1_arg1 )
ValidateLoadoutsAfterReset( f1_arg1 )
Engine.ExecNow( "uploadstats", f1_arg1.controller )
end
f1_arg0:dispatchEventToRoot( {
name = "prestige_mode_reset",
controller = f1_arg1.controller,
immediate = true
} )
end
function prestigereset3()
return {
type = "generic_yesno_popup",
id = "prestige_reset_popup_3",
properties = {
message_text = Engine.Localize( "@MENU_PRESTIGE_RESET_WARNING3" ),
popup_title = Engine.Localize( "@MENU_PRESTIGE_RESET_TITLE3" ),
yes_action = prestigeresetaction,
yes_text = Engine.Localize( "@LUA_MENU_MP_RESET_STATS" ),
no_text = Engine.Localize( "@LUA_MENU_CANCEL" )
}
}
end
function prestigereset2()
return {
type = "generic_yesno_popup",
id = "prestige_reset_popup_2",
properties = {
message_text = Engine.Localize( "@MENU_RESET_STATS_WARNING2" ),
popup_title = Engine.Localize( "@MENU_PRESTIGE_RESET_TITLE2" ),
yes_action = MBh.PopupMenu( "prestige_reset3", true ),
yes_text = Engine.Localize( "@MENU_PRESTIGE_RESET_TITLE3" ),
no_text = Engine.Localize( "@LUA_MENU_CANCEL" )
}
}
end
function prestigereset()
return {
type = "generic_yesno_popup",
id = "prestige_reset_popup",
properties = {
message_text = Engine.Localize( "@MENU_RESET_STATS_WARNING1" ),
popup_title = Engine.Localize( "@MENU_PRESTIGE_RESET_TITLE1" ),
yes_action = MBh.PopupMenu( "prestige_reset2", true ),
yes_text = Engine.Localize( "@MENU_PRESTIGE_RESET_TITLE2" ),
no_text = Engine.Localize( "@LUA_MENU_CANCEL" )
}
}
end
function PlayerStatsReset( f5_arg0 )
for f5_local0 = 0, PrestigeResetTable.MaxRows, 1 do
local f5_local3 = Engine.TableLookupByRow( PrestigeResetTable.File, f5_local0, PrestigeResetTable.Cols.PlayerStats )
if f5_local3 ~= "" then
Engine.SetPlayerDataEx( f5_arg0.controller, CoD.StatsGroup.Ranked, f5_local3, 0 )
end
end
for f5_local4, f5_local3 in pairs( ItemStatsTable ) do
Engine.SetPlayerDataEx( f5_arg0.controller, CoD.StatsGroup.Ranked, "bestWeapon", f5_local3, 0 )
end
end
function SquadMemXPReset( f6_arg0 )
for f6_local0 = 0, 9, 1 do
Engine.SetPlayerDataEx( f6_arg0.controller, CoD.StatsGroup.Ranked, "squadMembers", f6_local0, "squadMemXP", 0 )
Engine.SetPlayerDataEx( f6_arg0.controller, CoD.StatsGroup.Ranked, "characterXP", f6_local0, 0 )
Engine.SetPlayerDataEx( f6_arg0.controller, CoD.StatsGroup.Ranked, "squadMembers", f6_local0, "experienceToPrestige", 0 )
end
Engine.SetPlayerDataReservedInt( f6_arg0.controller, CoD.StatsGroup.Ranked, "prestigeLevel", 0 )
end
function WeaponStatsReset( f7_arg0 )
for f7_local0 = 0, PrestigeResetTable.MaxRows, 1 do
local f7_local3 = Engine.TableLookupByRow( PrestigeResetTable.File, f7_local0, PrestigeResetTable.Cols.WeaponStats )
if f7_local3 ~= "" then
for f7_local7, f7_local8 in pairs( ItemStatsTable ) do
Engine.SetPlayerDataEx( f7_arg0.controller, CoD.StatsGroup.Ranked, "weaponStats", f7_local3, f7_local8, 0 )
end
end
end
end
function SquadMemPurchasesReset( f8_arg0 )
for f8_local0 = 0, PrestigeResetTable.MaxRows, 1 do
local f8_local3 = Engine.TableLookupByRow( PrestigeResetTable.File, f8_local0, PrestigeResetTable.Cols.Purchases )
if f8_local3 ~= "" then
for f8_local4 = 0, 9, 1 do
Engine.SetPlayerDataEx( f8_arg0.controller, CoD.StatsGroup.Ranked, "squadMembers", f8_local4, "challengeState", f8_local3, 0 )
end
end
end
end
function SquadMemUnlockReset( f9_arg0 )
for f9_local0 = 0, 9, 1 do
Engine.SetPlayerDataEx( f9_arg0.controller, CoD.StatsGroup.Ranked, "squadMembers", f9_local0, "inUse", false )
Engine.SetPlayerDataEx( f9_arg0.controller, CoD.StatsGroup.Ranked, "squadMembers", f9_local0, "defaultSet", false )
end
Engine.SetPlayerDataEx( f9_arg0.controller, CoD.StatsGroup.Ranked, "squadMembers", 0, "inUse", true )
Engine.SetPlayerDataEx( f9_arg0.controller, CoD.StatsGroup.Ranked, "challengeState", "ch_squad_member1_purchase", 2 )
Cac.SetActiveSquadMember( f9_arg0.controller, 0 )
end
function ValidateLoadoutsAfterReset( f10_arg0 )
local f10_local0 = Cac.GetSquadLoc()
local f10_local1 = f10_arg0.controller
for f10_local2 = 0, Cac.MaxSquadMemberCount( f10_local0 ) - 1, 1 do
Cac.ValidateCustomizationItems( f10_local1, f10_local0, f10_local2 )
end
end
LUI.MenuBuilder.registerDef( "prestige_reset", prestigereset )
LUI.MenuBuilder.registerDef( "prestige_reset2", prestigereset2 )
LUI.MenuBuilder.registerDef( "prestige_reset3", prestigereset3 )
LockTable( _M )

View File

@@ -0,0 +1,422 @@
MatchRules.OpenSelectionMenu = function ( f1_arg0, f1_arg1 )
MatchRules.SelectSaveDevice( f1_arg0 )
if Engine.UserIsGuest( f1_arg0 ) then
LUI.FlowManager.RequestPopupMenu( self, "recipe_save_failed_no_guests_popup", false, f1_arg0, false )
elseif not Engine.HasSaveDevice( f1_arg0 ) then
LUI.FlowManager.RequestPopupMenu( self, "recipe_save_failed_no_device_popup", false, f1_arg0, false )
else
Engine.ExecNow( "incnosplitscreencontrol menu_RECIPE_SELECT" )
LUI.FlowManager.RequestAddMenu( self, "savedmode_select_main", true, f1_arg0, false, f1_arg1 )
end
end
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function ModeButtonFeeder( f2_arg0 )
local f2_local0 = {}
local f2_local1 = MatchRules.GetSavedModeMax()
local f2_local2 = Engine.Localize( "@MPUI_EMPTY" )
for f2_local3 = 0, f2_local1 - 1, 1 do
local f2_local6 = MatchRules.GetMetaData( f2_arg0.savedMode, f2_local3, "name" )
local f2_local7
if f2_local6 ~= nil and f2_local6 ~= "" then
f2_local7 = false
else
f2_local7 = true
end
local f2_local8 = MatchRules.GetMetaData( f2_arg0.savedMode, f2_local3, "rawgametype" )
local f2_local9 = false
local f2_local10 = false
if SvS.IsSvS() and f2_local8 and not (Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f2_local8, GameTypesTable.Cols.TeamChoice ) == "1") and f2_local8 ~= "horde" then
f2_local9 = true
end
if f2_local7 then
f2_local6 = f2_local2
end
f2_local10 = f2_local7 or f2_local9
if f2_arg0.savedMode == "save" and f2_arg0.menuAction == "save" then
f2_local10 = false
end
f2_local0[#f2_local0 + 1] = {
type = "UIGenericButton",
id = "savedmode_" .. f2_local3,
disabled = f2_local10,
properties = {
button_text = f2_local6,
button_over_func = MBh.EmitEventToRoot( {
name = "update_selection",
savedMode = f2_arg0.savedMode,
idx = f2_local3,
showVaultText = true
} ),
button_action_func = MBh.EmitEventToRoot( {
name = "select_mode",
savedMode = f2_arg0.savedMode,
idx = f2_local3,
menuAction = f2_arg0.menuAction
} ),
button_over_disable_func = MBh.EmitEventToRoot( {
name = "update_selection",
savedMode = f2_arg0.savedMode,
idx = -1,
showVaultText = false
} )
}
}
end
return f2_local0
end
function ModeDetailFeeder( f3_arg0 )
local f3_local0 = {}
local f3_local1 = MatchRules.GetSavedModeMax()
for f3_local2 = 0, f3_local1 - 1, 1 do
f3_local0[#f3_local0 + 1] = {
type = "savedmode_details_widget",
id = "savedmode_" .. f3_local2 .. "_details",
properties = {
time_text = MatchRules.GetMetaData( f3_arg0.savedMode, f3_local2, "timestamp" ),
type_text = MatchRules.GetMetaData( f3_arg0.savedMode, f3_local2, "gametype" )
}
}
end
return f3_local0
end
function SaveModeItem( f4_arg0, f4_arg1 )
if MatchRules.SaveDataToPlayer( f4_arg0.properties.callback_params.saveToSlot ) then
LUI.FlowManager.RequestLeaveMenuByName( "savedmode_select_main" )
end
end
function savedmode_confirm_overwrite_popup()
return {
type = "generic_yesno_popup",
id = "mode_select_confirm_overwrite_popup_id",
properties = {
popup_title = Engine.Localize( "@MENU_ONLINEVAULT_CONFIRM_OVERWRITE" ),
message_text = Engine.Localize( "@MENU_OVERWRITE_EXISTING_FILE" ),
callback_params = {
saveToSlot = -1
},
yes_action = SaveModeItem
}
}
end
function SelectMode( f6_arg0, f6_arg1 )
local f6_local0 = MatchRules.GetData( "gametype" )
local f6_local1 = f6_arg1.idx
if f6_arg1.savedMode == "save" then
if f6_arg1.menuAction == "save" then
local f6_local2 = MatchRules.GetMetaData( f6_arg1.savedMode, f6_local1, "name" )
local f6_local3
if f6_local2 ~= nil and f6_local2 ~= "" then
f6_local3 = false
else
f6_local3 = true
end
if f6_local3 then
if not MatchRules.SaveDataToPlayer( f6_local1 ) then
return
end
else
LUI.FlowManager.RequestPopupMenu( f6_arg0, "savedmode_confirm_overwrite_popup", true, f6_arg1.controller, false, {
callback_params = {
saveToSlot = f6_local1
}
} )
return
end
elseif f6_arg1.menuAction == "load" then
MatchRules.LoadDataFromPlayer( f6_local1 )
end
elseif f6_arg1.savedMode == "history" then
MatchRules.LoadDataFromHistory( f6_local1 )
end
FixTeamLimitsAndDifficultiesIfNecessary( f6_local0, MatchRules.GetData( "gametype" ) )
if SvS.IsSvS() then
MatchRules.SetData( "commonOption", "allowCustomClasses", false )
end
local f6_local3 = MatchRules.GetData( "mlgVersion" ) ~= ""
if f6_local3 ~= MLG.AreMLGRulesEnabled() then
MLG.SetUsingMLGRules( f6_local3 )
end
LUI.FlowManager.RequestRestoreMenu( f6_arg0, "gamesetup_menu_main", true, f6_arg1.controller, true )
end
function UpdateSelection( f7_arg0, f7_arg1 )
local f7_local0 = f7_arg1.idx
local f7_local1 = LUI.FlowManager.GetMenuScopedDataFromElement( f7_arg0 )
f7_local1.mode = f7_arg1.savedMode
f7_local1.index = f7_local0
f7_arg0:dispatchEventToRoot( {
name = "stop_pulse",
dispatchChildren = true,
immediate = true
} )
if f7_local0 >= 0 then
local f7_local2 = f7_arg0:getFirstDescendentById( "savedmode_" .. f7_local0 .. "_details" )
if f7_local2 then
f7_local2:processEvent( {
name = "play_pulse",
dispatchChildren = true
} )
end
end
end
function SaveToVault( f8_arg0, f8_arg1 )
local f8_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f8_arg0 )
if f8_local0.index and f8_local0.index >= 0 then
if f8_local0.mode == "history" then
MatchRules.LoadDataFromHistory( f8_local0.index )
else
MatchRules.LoadDataFromPlayer( f8_local0.index )
end
LUI.FlowManager.RequestAddMenu( f8_arg0, "online_vault_main", true, f8_arg1.controller, false, {
vaultMode = "save",
vaultCategory = "cgm",
menu_title = Engine.Localize( "@MPUI_ONLINE_VAULT" )
} )
end
end
function SaveToMyModes( f9_arg0, f9_arg1 )
local f9_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f9_arg0 )
if f9_local0.index and f9_local0.index >= 0 and f9_local0.mode == "history" then
local f9_local1 = MatchRules.GetData()
MatchRules.OpenSelectionMenu( f9_arg1.controller, {
vaultMode = "save",
vaultCategory = "cgm",
menu_title = Engine.Localize( "@LUA_MENU_MY_MODES" )
} )
end
end
function OnCreate( f10_arg0, f10_arg1 )
f10_arg0:clearSavedState()
f10_arg0:dispatchEventToRoot( {
name = "add_button_helper_text",
button_ref = "button_secondary",
helper_text = Engine.Localize( "@LUA_MENU_BACK" ),
side = "left",
clickable = true,
immediate = true
} )
end
function savedmode_details_widget()
return {
type = "UIElement",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = GenericButtonDims.button_height + 13.5,
left = 0,
right = 0
}
},
properties = {
time_text = "",
type_text = ""
},
children = {
{
type = "UIText",
id = "mapsetup_timestamp",
properties = {
text = MBh.Property( "time_text" )
},
states = {
default = {
left = 0,
top = 0,
width = 200,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
},
dark = {
red = Colors.secondary_text_color.r,
green = Colors.secondary_text_color.g,
blue = Colors.secondary_text_color.b,
alpha = 1
}
},
handlers = {
play_pulse = MBh.AnimateLoop( {
{
"dark",
400
},
{
"default",
400
}
} ),
stop_pulse = MBh.AnimateToState( "default", 0 )
}
},
{
type = "UIText",
id = "savedmode_gametype",
properties = {
text = MBh.Property( "type_text" )
},
states = {
default = {
left = 220,
top = 0,
width = 480,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
red = Colors.white.r,
green = Colors.white.g,
blue = Colors.white.b,
alpha = 1
},
dark = {
red = Colors.secondary_text_color.r,
green = Colors.secondary_text_color.g,
blue = Colors.secondary_text_color.b,
alpha = 1
}
},
handlers = {
play_pulse = MBh.AnimateLoop( {
{
"dark",
400
},
{
"default",
400
}
} ),
stop_pulse = MBh.AnimateToState( "default", 0 )
}
}
}
}
end
function savedmode_select_main()
return {
type = "UIElement",
id = "savedmode_select_root",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_RECENT_MODES" ),
savedMode = "history",
menuAction = "load"
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = OnCreate,
select_mode = SelectMode,
update_selection = UpdateSelection
},
children = {
{
type = "generic_menu_title",
id = "savedmode_select_title_text_id",
properties = {
menu_title = MBh.Property( "menu_title" )
}
},
{
type = "UIVerticalList",
id = "savedmode_select_modelist_id",
focusable = true,
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
properties = {
savedMode = MBh.Property( "savedMode" ),
menuAction = MBh.Property( "menuAction" )
},
childrenFeeder = ModeButtonFeeder
},
{
type = "UIVerticalList",
id = "savedmode_details_list_id",
focusable = false,
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 520,
right = 0,
top = GenericMenuDims.menu_top - 12,
bottom = GenericMenuDims.menu_bottom
}
},
properties = {
savedMode = MBh.Property( "savedMode" )
},
childrenFeeder = ModeDetailFeeder
},
{
type = "UIBindButton",
id = "savedmode_bind_buttons",
handlers = {
button_secondary = MBh.LeaveMenu()
}
},
{
type = "button_helper_text_main",
id = "savedmode_button_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
}
}
}
end
LUI.MenuBuilder.registerDef( "savedmode_select_main", savedmode_select_main )
LUI.MenuBuilder.registerDef( "savedmode_details_widget", savedmode_details_widget )
LUI.MenuBuilder.registerDef( "savedmode_confirm_overwrite_popup", savedmode_confirm_overwrite_popup )
LUI.FlowManager.RegisterStackPushBehaviour( "savedmode_select_main", function ()
MatchRules.ClearMetaDataCache()
end )
LUI.FlowManager.RegisterStackPopBehaviour( "savedmode_select_main", function ()
Engine.ExecNow( "decnosplitscreencontrol menu_RECIPE_SELECT" )
end )
LockTable( _M )

View File

@@ -0,0 +1,140 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function ExitViewer( f1_arg0, f1_arg1 )
local f1_local0 = OnlineVault.AbortScreenshotDownload
local f1_local1 = f1_arg0.controller
if not f1_local1 then
f1_local1 = Engine.GetFirstActiveController()
end
f1_local0( f1_local1 )
LUI.FlowManager.RequestLeaveMenu( f1_arg0 )
end
function menu_screenshot()
return {
type = "UIElement",
id = "menu_screenshot_root",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
children = {
{
type = "UIImage",
id = "menu_screenshot_background_id",
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = 0,
green = 0,
blue = 0,
alpha = 0.5
}
}
},
{
type = "UIImage",
id = "menu_screenshot_border_id",
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 200,
right = -200,
top = 120,
bottom = -80,
red = Colors.window_border_color.r,
green = Colors.window_border_color.g,
blue = Colors.window_border_color.b
}
},
children = {
{
type = "UIBindText",
id = "menu_screenshot_download_percent_id",
properties = {
dataSource = "DownloadProgress",
textFormat = Engine.Localize( "@LUA_MENU_ONLINEVAULT_DOWNLOADING_PERCENT" )
},
states = {
default = {
width = 400,
height = CoD.TextSettings.ExtraBigFont.Height,
font = CoD.TextSettings.ExtraBigFont.Font,
alignment = LUI.Alignment.Center
}
}
},
{
type = "UIScreenshotViewer",
id = "menu_screenshot_screenshot_id",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 2,
right = -2,
top = 2,
bottom = -40
}
}
},
{
type = "UIText",
id = "menu_screenshot_back_button_id",
properties = {
text = Engine.Localize( ButtonMap.button_secondary.string ) .. " " .. Engine.Localize( "@LUA_MENU_BACK" )
},
states = {
default = {
leftAnchor = false,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
right = -5,
bottom = -5,
width = 80,
height = CoD.TextSettings.NormalFont.Height,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Right
}
}
}
}
},
{
type = "UIBindButton",
id = "menu_screenshot_bind_button_id",
handlers = {
button_secondary = ExitViewer
}
}
}
}
end
LUI.MenuBuilder.registerDef( "menu_screenshot", menu_screenshot )
LockTable( _M )

View File

@@ -0,0 +1,54 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function statsresetaction( f1_arg0, f1_arg1 )
f1_arg0:dispatchEventToRoot( {
name = "prestige_shop_reset_all_stats",
controller = f1_arg1.controller
} )
end
function statsreset3()
return {
type = "generic_yesno_popup",
properties = {
message_text = Engine.Localize( "@MENU_PRESTIGE_RESET_WARNING3" ),
popup_title = Engine.Localize( "@MENU_PRESTIGE_RESET_TITLE3" ),
yes_action = statsresetaction,
yes_text = Engine.Localize( "@MPUI_PRESTIGE_RESET_STATS" ),
no_text = Engine.Localize( "@LUA_MENU_CANCEL" )
}
}
end
function statsreset2()
return {
type = "generic_yesno_popup",
properties = {
message_text = Engine.Localize( "@MENU_RESET_STATS_WARNING2" ),
popup_title = Engine.Localize( "@MENU_PRESTIGE_RESET_TITLE2" ),
yes_action = MBh.PopupMenu( "stats_reset3", true ),
yes_text = Engine.Localize( "@MENU_PRESTIGE_RESET_TITLE3" ),
no_text = Engine.Localize( "@LUA_MENU_CANCEL" )
}
}
end
function statsreset()
return {
type = "generic_yesno_popup",
properties = {
message_text = Engine.Localize( "@MENU_RESET_STATS_WARNING1" ),
popup_title = Engine.Localize( "@MENU_PRESTIGE_RESET_TITLE1" ),
yes_action = MBh.PopupMenu( "stats_reset2", true ),
yes_text = Engine.Localize( "@MENU_PRESTIGE_RESET_TITLE2" ),
no_text = Engine.Localize( "@LUA_MENU_CANCEL" )
}
}
end
LUI.MenuBuilder.registerDef( "stats_reset", statsreset )
LUI.MenuBuilder.registerDef( "stats_reset2", statsreset2 )
LUI.MenuBuilder.registerDef( "stats_reset3", statsreset3 )
LockTable( _M )

View File

@@ -0,0 +1,136 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function OnCreate( f1_arg0, f1_arg1 )
f1_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_secondary",
helper_text = Engine.Localize( "@LUA_MENU_BACK" ),
side = "left",
clickable = true
} )
f1_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_alt2",
helper_text = Engine.Localize( "@MENU_FRIENDS" ),
side = "right",
clickable = true
} )
end
function OnlineVaultAction( f2_arg0, f2_arg1 )
LUI.FlowManager.RequestAddMenu( f2_arg0, "online_vault_main", true, f2_arg1.controller, false, {
vaultMode = "browse",
vaultCategory = "all",
menu_title = Engine.Localize( "@MPUI_ONLINE_VAULT" )
} )
end
function FriendVaultAction( f3_arg0, f3_arg1 )
end
function TheaterAction( f4_arg0, f4_arg1 )
end
function ButtonFeeder( f5_arg0 )
return {
{
type = "UIGenericButton",
id = "vault_button_0",
properties = {
button_text = Engine.Localize( "@MENU_ONLINEVAULT_CAPS" ),
button_action_func = OnlineVaultAction
}
},
{
type = "UIGenericButton",
id = "vault_button_1",
properties = {
button_text = Engine.Localize( "@MENU_FRIENDS_ONLINEVAULT_CAPS" ),
button_action_func = FriendVaultAction
}
},
{
type = "UIGenericButton",
id = "vault_button_2",
properties = {
button_text = Engine.Localize( "@MENU_THEATRE_CAPS" ),
button_action_func = TheaterAction
}
}
}
end
function vault_main()
return {
type = "UIElement",
id = "vault_root",
properties = {
menu_title = Engine.Localize( "@MENU_VAULT_CAPS" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = OnCreate
},
children = {
{
type = "generic_menu_title",
id = "vault_title_id",
properties = {
menu_title = MBh.Property( "menu_title" )
}
},
{
type = "UIVerticalList",
id = "vault_entry_vlist_id",
focusable = true,
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
handlers = {
vault_refresh = DoRefresh
},
childrenFeeder = ButtonFeeder
},
{
type = "online_friends_widget",
id = "vault_friends_widget_id"
},
{
type = "button_helper_text_main",
id = "vault_helper_text_id"
},
{
type = "generic_back_button",
id = "vault_bind_button_id"
}
}
}
end
LUI.MenuBuilder.registerDef( "vault_main", vault_main )
LockTable( _M )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,239 @@
local f0_local0 = function ( f1_arg0, f1_arg1, f1_arg2, f1_arg3 )
if f1_arg0 and Cac.Settings.DataLoc.loadouts.baseClassSlots <= f1_arg0 then
return Engine.TableLookup( "mp/classTable.csv", 0, f1_arg1, 12 )
elseif f1_arg2 == nil or f1_arg2 == "privateMatchSquadMembers" then
return Engine.TableLookup( "mp/classTable.csv", 0, f1_arg1, f1_arg0 % 10 + 1 )
elseif f1_arg3 == 0 then
return Engine.TableLookup( "mp/classTableAssault.csv", 0, f1_arg1, 1 )
elseif f1_arg3 == 1 then
return Engine.TableLookup( "mp/classTableCQB.csv", 0, f1_arg1, 1 )
elseif f1_arg3 == 2 then
return Engine.TableLookup( "mp/classTableAssassin.csv", 0, f1_arg1, 1 )
elseif f1_arg3 == 3 then
return Engine.TableLookup( "mp/classTableHeavyGunner.csv", 0, f1_arg1, 1 )
elseif f1_arg3 == 4 then
return Engine.TableLookup( "mp/classTableSniper.csv", 0, f1_arg1, 1 )
else
return Engine.TableLookup( "mp/classTableAssault.csv", 0, f1_arg1, 1 )
end
end
local f0_local1 = function ( f2_arg0, f2_arg1, f2_arg2 )
local f2_local0 = {}
local f2_local1 = 0
local f2_local2 = Engine.TableLookupByRow( f2_arg0, f2_local1, f2_arg2 )
while f2_local2 ~= "" do
if f2_local2 == f2_arg1 then
f2_local0[#f2_local0 + 1] = f2_local1
end
f2_local1 = f2_local1 + 1
f2_local2 = Engine.TableLookupByRow( f2_arg0, f2_local1, f2_arg2 )
end
return f2_local0
end
local f0_local2 = function ( f3_arg0, f3_arg1, f3_arg2, f3_arg3, f3_arg4, f3_arg5 )
local f3_local0 = f0_local0( f3_arg3, "loadout" .. f3_arg5, f3_arg1, f3_arg2 )
local f3_local1 = f0_local0( f3_arg3, "loadout" .. f3_arg5 .. "Attachment", f3_arg1, f3_arg2 )
local f3_local2 = f0_local0( f3_arg3, "loadout" .. f3_arg5 .. "Attachment2", f3_arg1, f3_arg2 )
local f3_local3 = f0_local0( f3_arg3, "loadout" .. f3_arg5 .. "Attachment3", f3_arg1, f3_arg2 )
local f3_local4 = f0_local0( f3_arg3, "loadout" .. f3_arg5 .. "Camo", f3_arg1, f3_arg2 )
Cac.SetCacConfig( f3_arg0, f3_arg1, f3_arg2, "loadouts", f3_arg3, "weaponSetups", f3_arg4, "weapon", f3_local0 )
Cac.SetCacConfig( f3_arg0, f3_arg1, f3_arg2, "loadouts", f3_arg3, "weaponSetups", f3_arg4, "attachment", 0, f3_local1 )
Cac.SetCacConfig( f3_arg0, f3_arg1, f3_arg2, "loadouts", f3_arg3, "weaponSetups", f3_arg4, "attachment", 1, f3_local2 )
Cac.SetCacConfig( f3_arg0, f3_arg1, f3_arg2, "loadouts", f3_arg3, "weaponSetups", f3_arg4, "attachment", 2, f3_local3 )
Cac.SetCacConfig( f3_arg0, f3_arg1, f3_arg2, "loadouts", f3_arg3, "weaponSetups", f3_arg4, "camo", f3_local4 )
local f3_local5 = {
f3_local1,
f3_local2,
f3_local3
}
local f3_local6 = "none"
for f3_local10, f3_local11 in ipairs( f3_local5 ) do
if f3_local11 and f3_local11 ~= "" and Cac.AttachmentHasReticles( f3_local11 ) then
f3_local6 = Cac.GetReticleDefault( f3_local11 )
break
end
end
Cac.SetCacConfig( f3_arg0, f3_arg1, f3_arg2, "loadouts", f3_arg3, "weaponSetups", f3_arg4, "reticle", f3_local6 )
end
local f0_local3 = function ( f4_arg0, f4_arg1, f4_arg2, f4_arg3, f4_arg4, f4_arg5 )
f0_local2( f4_arg0, f4_arg1, f4_arg2, f4_arg3, 0, "Primary" )
f0_local2( f4_arg0, f4_arg1, f4_arg2, f4_arg3, 1, "Secondary" )
end
local f0_local4 = function ( f5_arg0, f5_arg1, f5_arg2, f5_arg3 )
local f5_local0 = Cac.GetCacConfig( f5_arg0, f5_arg1, f5_arg2, "loadouts", f5_arg3, "perks", Cac.Indices.Grenade.Primary )
local f5_local1 = Cac.GetCacConfig( f5_arg0, f5_arg1, f5_arg2, "loadouts", f5_arg3, "perks", Cac.Indices.Grenade.Secondary )
Cac.SetCacConfig( f5_arg0, f5_arg1, f5_arg2, "loadouts", f5_arg3, "perks", Cac.Indices.Grenade.Primary, f0_local0( f5_arg3, "loadoutEquipment", f5_arg1, f5_arg2 ) )
Cac.SetCacConfig( f5_arg0, f5_arg1, f5_arg2, "loadouts", f5_arg3, "perks", Cac.Indices.Grenade.Secondary, f0_local0( f5_arg3, "loadoutOffhand", f5_arg1, f5_arg2 ) )
end
local f0_local5 = function ( f6_arg0, f6_arg1, f6_arg2, f6_arg3 )
for f6_local0 = 1, 8, 1 do
local f6_local3 = f0_local0( f6_arg3, "loadoutPerk" .. f6_local0, f6_arg1, f6_arg2 )
if f6_local3 then
if f6_local3 == "" then
break
end
local f6_local4 = tonumber( string.sub( f6_local3, 1, 1 ) )
local f6_local5 = tonumber( string.sub( f6_local3, 2, 2 ) )
if f6_local4 then
if not f6_local5 then
break
end
Cac.SetCacConfig( f6_arg0, f6_arg1, f6_arg2, "loadouts", f6_arg3, "abilitiesPicked", f6_local4 - 1, f6_local5 - 1, true )
end
end
end
end
local f0_local6 = function ( f7_arg0, f7_arg1, f7_arg2, f7_arg3 )
for f7_local0 = 0, 5, 1 do
local f7_local3 = f0_local0( f7_arg3, "loadoutStreak" .. f7_local0, f7_arg1, f7_arg2 )
local f7_local4 = "assaultStreaks"
local f7_local5 = f7_local0
if f7_local0 > 2 then
f7_local4 = "supportStreaks"
f7_local5 = f7_local0 - 3
end
Cac.SetCacConfig( f7_arg0, f7_arg1, f7_arg2, "loadouts", f7_arg3, f7_local4, f7_local5, f7_local3 )
end
end
local f0_local7 = function ( f8_arg0, f8_arg1, f8_arg2 )
for f8_local0 = 0, Cac.Settings.DataLoc.loadouts.baseClassSlots - 1, 1 do
Cac.SetCacConfig( f8_arg0, f8_arg1, f8_arg2, "loadouts", f8_local0, "name", Engine.Localize( f0_local0( f8_local0, "loadoutName" ) ) )
f0_local3( f8_arg0, f8_arg1, f8_arg2, f8_local0, 0, "Primary" )
f0_local3( f8_arg0, f8_arg1, f8_arg2, f8_local0, 1, "Secondary" )
f0_local4( f8_arg0, f8_arg1, f8_arg2, f8_local0 )
f0_local5( f8_arg0, f8_arg1, f8_arg2, f8_local0 )
f0_local6( f8_arg0, f8_arg1, f8_arg2, f8_local0 )
if f8_arg1 ~= "privateMatchSquadMembers" then
local f8_local3 = false
if f8_local0 <= 2 then
f8_local3 = true
end
Cac.SetCacConfig( f8_arg0, f8_arg1, f8_arg2, "loadouts", f8_local0, "inUse", f8_local3 )
end
end
end
local f0_local8 = function ( f9_arg0, f9_arg1, f9_arg2, f9_arg3, f9_arg4, f9_arg5 )
local f9_local0 = {
0,
4,
8,
12,
18,
22,
26,
30,
34,
40
}
local f9_local1 = math.random( 1, #f9_local0 )
local f9_local2 = {
0,
4,
9,
13,
27
}
local f9_local3 = math.random( 1, #f9_local2 )
local f9_local4 = Cac.GetGenderFromBodyRef( f9_local0[f9_local1] )
local f9_local5 = 0
if f9_local4 == "m" then
if math.random( 0, 1 ) == 1 then
f9_local5 = 0
else
f9_local5 = 8
end
else
f9_local5 = 20
end
Engine.SetPlayerDataEx( f9_arg0, f9_arg1, f9_arg2, f9_arg3, "name", f9_arg4 )
Engine.SetPlayerDataEx( f9_arg0, f9_arg1, f9_arg2, f9_arg3, "head", f9_local5 )
Engine.SetPlayerDataEx( f9_arg0, f9_arg1, f9_arg2, f9_arg3, "helmet", f9_local2[f9_local3] )
Engine.SetPlayerDataEx( f9_arg0, f9_arg1, f9_arg2, f9_arg3, "body", f9_local0[f9_local1] )
if f9_arg5 then
f0_local7( f9_arg0, f9_arg2, f9_arg3 )
end
end
local f0_local9 = function ( f10_arg0, f10_arg1, f10_arg2, f10_arg3 )
local f10_local0 = Cac.MaxSquadMemberCount( f10_arg2 )
local f10_local1 = f0_local1( "mp/namesTable.csv", "american", 0 )
for f10_local2 = 1, f10_local0, 1 do
local f10_local5 = math.random( f10_local2, #f10_local1 )
f10_local1[f10_local5] = f10_local1[f10_local2]
f10_local1[f10_local2] = f10_local1[f10_local5]
end
for f10_local2 = 1, f10_local0, 1 do
f0_local8( f10_arg0, f10_arg1, f10_arg2, f10_local2 - 1, Engine.TableLookupByRow( "mp/namesTable.csv", f10_local1[f10_local2], 1 ), f10_arg3 )
end
end
local f0_local10 = function ( f11_arg0, f11_arg1 )
local f11_local0 = Engine.GetPlayerDataEx( f11_arg0, f11_arg1, "prestige" )
Engine.SetPlayerDataEx( f11_arg0, f11_arg1, "challengeState", "ch_prestige", f11_local0 + 1 )
Engine.SetPlayerDataEx( f11_arg0, f11_arg1, "challengeProgress", "ch_prestige", f11_local0 + 1 )
if f11_local0 == 10 then
Engine.SetPlayerDataEx( f11_arg0, f11_arg1, "challengeState", "ch_prestige", 2 )
Engine.SetPlayerDataEx( f11_arg0, f11_arg1, "challengeProgress", "ch_prestige", 1 )
end
end
function InitPlayerData( f12_arg0, f12_arg1 )
local f12_local0 = f12_arg1.controller or 0
f0_local9( f12_local0, CoD.StatsGroup.Ranked, "squadMembers", true )
f0_local9( f12_local0, CoD.StatsGroup.Private, "privateMatchSquadMembers", true )
Engine.SetPlayerDataEx( f12_local0, CoD.StatsGroup.Ranked, "squadMembers", 0, "inUse", true )
Engine.SetPlayerDataEx( f12_local0, CoD.StatsGroup.Ranked, "challengeState", "ch_squad_member1_purchase", 2 )
for f12_local1 = 0, Cac.MaxSquadMemberCount( "privateMatchSquadMembers" ) - 1, 1 do
local f12_local4 = f12_local1
Engine.SetPlayerDataEx( f12_local0, CoD.StatsGroup.Private, "privateMatchSquadMembers", 0, "inUse", true )
end
f0_local9( f12_local0, CoD.StatsGroup.Coop, "coopSquadMembers", false )
f0_local10( f12_local0, CoD.StatsGroup.Ranked )
Engine.SetPlayerDataEx( f12_local0, CoD.StatsGroup.Common, "enableBattleBuddy", false )
local f12_local1 = f0_local1( "mp/squadDefaults.csv", "squadname", 0 )
Engine.SetPlayerDataEx( f12_local0, CoD.StatsGroup.Ranked, "squadHQ", "squad_name", Engine.TableLookupByRow( "mp/squadDefaults.csv", f12_local1[math.random( 1, #f12_local1 )], 1 ) )
local f12_local4 = f0_local1( "mp/squadDefaults.csv", "mapname", 0 )
Engine.SetPlayerDataEx( f12_local0, CoD.StatsGroup.Ranked, "squadHQ", "squad_base", Engine.TableLookupByRow( "mp/squadDefaults.csv", f12_local4[math.random( 1, #f12_local4 )], 1 ) )
Engine.SetPlayerDataEx( f12_local0, CoD.StatsGroup.Ranked, "squadHQ", "squad_mode", "war" )
for f12_local5 = 0, 9, 1 do
Engine.SetPlayerDataEx( f12_local0, CoD.StatsGroup.Ranked, "squadHQ", "aiSquadMembers", f12_local5, f12_local5 )
end
InitOperationsData( f12_local0 )
ResetMOTDCounters( f12_local0 )
end
function InitPlayerDataExtended( f13_arg0, f13_arg1 )
local f13_local0 = {
"privateMatchSquadMembers",
"squadMembers"
}
local f13_local1 = f13_arg1.controller
if not f13_local1 then
return
end
for f13_local10, f13_local11 in ipairs( f13_local0 ) do
local f13_local12 = Cac.MaxSquadMemberCount( f13_local11 )
local f13_local13 = Cac.Settings.DataLoc.loadouts.baseClassSlots
local f13_local14 = Cac.Settings.DataLoc.loadouts.maxClassSlots
for f13_local9 = 0, f13_local12 - 1, 1 do
for f13_local5 = 0, f13_local14 - f13_local13 - 1, 1 do
local f13_local8 = f13_local5 + f13_local13
f0_local3( f13_local1, f13_local11, f13_local9, f13_local8, 0, "Primary" )
f0_local3( f13_local1, f13_local11, f13_local9, f13_local8, 1, "Secondary" )
f0_local4( f13_local1, f13_local11, f13_local9, f13_local8 )
f0_local5( f13_local1, f13_local11, f13_local9, f13_local8 )
f0_local6( f13_local1, f13_local11, f13_local9, f13_local8 )
Cac.SetCacConfig( f13_local1, f13_local11, f13_local9, "loadouts", f13_local8, "name", Engine.Localize( "LUA_MENU_EXTRA_LOADOUT", f13_local5 + 1 ) )
end
end
end
end

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,333 @@
NewsType = {
News = 0,
Item = 1
}
FeedCategory = {
MOTD = 0,
News = 1,
Clans = 2,
Squads = 3,
Social = 4
}
FeedSubCategory = {
{
News = 0,
Event = 1,
NewItems = 2,
Sale = 3
},
{
GettingStarted = 0,
Invite = 1,
ClanWarUpdate = 2
},
{
Default = 0
},
{
AverageScore = 0,
GamesPlayed = 1,
TimePlayed = 2,
Wins = 3,
WinStreak = 4,
KDRatio = 5,
Kills = 6,
KillStreak = 7
}
}
StoreCategory = {
SeasonPass = 0,
MapPacks = 1,
Personalization = 2,
Customization = 3,
ExtraSlots = 4,
AnnouncerVoices = 5,
AdditionalItems = 6,
Avatar = 7,
Crossgame = 8
}
Sns = {
Dims = {
Thumbnail = {
width = 160,
height = 80
},
DefaultArticleImage = {
width = 320,
height = 320,
maxWidth = 370,
maxHeight = 340
}
},
MaxVisibleArticles = 4,
MaxPrefetchArticles = 4,
HListOffset = 10,
HListSpacing = 25,
TickerCategory = FeedCategory.News,
TickerIndex = 0,
TickerScrollSpeed = 1000,
TickerUpdateInterval = 12000
}
function CrossGameHackVisual( f1_arg0 )
local f1_local0
if not Engine.IsXbox360() and not Engine.IsXB3() and not Engine.IsPS3() then
f1_local0 = Engine.IsPS4()
if f1_local0 then
else
return f1_local0
end
end
f1_local0 = f1_arg0 == StoreCategory.Crossgame
end
function CrossGameHackData( f2_arg0 )
local f2_local0
if not Engine.IsXbox360() and not Engine.IsXB3() then
f2_local0 = Engine.IsPS4()
if f2_local0 then
else
return f2_local0
end
end
f2_local0 = f2_arg0 == StoreCategory.Crossgame
end
Sns.UpdateScopedArticleInfo = function ( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg1 or LUI.FlowManager.GetMenuScopedDataFromElement( f3_arg0 )
local f3_local1 = CrossGameHackData( f3_local0.category )
local f3_local2, f3_local3 = nil
if f3_local1 then
f3_local2 = {
title = Engine.Localize( "LUA_MENU_STORE_CROSS_GAME" ),
details = Engine.Localize( "LUA_MENU_STORE_CROSS_GAME_DESC" ),
image = "",
thumbName = "",
cost = -1,
sale = 0
}
else
f3_local2 = Store.GetCompleteItemInfoByIndex( f3_local0.category, f3_local0.articleIndex )
f3_local3 = Store.IsItemPurchasedByIndex( f3_local0.category, f3_local0.articleIndex )
DebugPrint( "Proper image info " .. tostring( f3_local2.image ) .. " " .. tostring( f3_local2.thumbName ) )
end
local f3_local4 = {
itemId = f3_local0.articleId
}
local f3_local5 = f3_local2.title
if not f3_local5 then
f3_local5 = "Content " .. itemId .. " has no title"
end
f3_local4.title = f3_local5
f3_local5 = f3_local2.details
if not f3_local5 then
f3_local5 = "Content " .. itemId .. " has no text"
end
f3_local4.details = f3_local5
f3_local4.image = f3_local2.image
f3_local4.thumbName = f3_local2.thumbName
f3_local4.cost = f3_local2.cost
f3_local4.sale = f3_local2.sale
f3_local4.endTime = 0
f3_local4.purchased = f3_local3
f3_local0.articleInfo = f3_local4
f3_local0.articleInfo.details = f3_local0.articleInfo.details .. "\n"
end
Sns.GetScopedArticleInfo = function ( f4_arg0, f4_arg1 )
local f4_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f4_arg0 )
if f4_arg1 and f4_local0.articleInfo then
return f4_local0.articleInfo[f4_arg1]
else
return f4_local0.articleInfo
end
end
Sns.IsRedeemCodeDisabled = function ()
return Engine.GetDvarInt( "ui_disableTokenRedemption" ) == 1
end
Sns.IsStoreDisabled = function ()
return Engine.GetDvarInt( "ui_disableInGameStore" ) == 1
end
Sns.SetContextualMenuLocation = function ( f7_arg0 )
Engine.SetStoreEnterTimestamp()
if f7_arg0 then
Engine.SetDvarString( "ui_contextualMenuLocation", f7_arg0 )
else
Engine.SetDvarString( "ui_contextualMenuLocation", "store" )
end
end
Sns.OpenStoreLinkConfirmPopup = function ( f8_arg0, f8_arg1 )
local f8_local0 = {
callback_params = {
dlcName = f8_arg1
}
}
if Engine.IsXbox360() and Engine.GetCurrentLanguage() ~= 5 and Engine.GetCurrentLanguage() ~= 10 then
Sns.SetContextualMenuLocation( "cac" )
Store.ShowSystemOffer( f8_arg0, f8_arg1 )
else
LUI.FlowManager.RequestPopupMenu( self, "goto_store", true, f8_arg0, false, f8_local0 )
end
end
Sns.OpenStoreMenu = function ( f9_arg0, f9_arg1, f9_arg2, f9_arg3 )
local f9_local0 = assert
local f9_local1 = Engine.GetDvarBool( "onlinegame" )
if not f9_local1 then
f9_local1 = Engine.GetDvarBool( "ui_onlineRequired" )
end
f9_local0( f9_local1 )
if Engine.IsConsoleGame() then
if Sns.IsStoreDisabled() then
LUI.FlowManager.RequestPopupMenu( self, "store_disabled_error", false, f9_arg0, false )
elseif Engine.UserIsGuest( f9_arg0 ) then
LUI.FlowManager.RequestPopupMenu( self, "store_noguests_error", false, f9_arg0, false )
elseif Engine.IsPS3() and f9_arg0 ~= 0 then
LUI.FlowManager.RequestPopupMenu( self, "mp_wrong_controller_popup", false, f9_arg0, false )
else
Store.ClearContentCache( f9_arg0 )
Sns.SetContextualMenuLocation( f9_arg1 )
Engine.ExecNow( "incnosplitscreencontrol menu_STORE" )
f9_local0 = {
initialDlcName = f9_arg3
}
if Engine.GetDvarInt( "igs_sosp" ) == 1 or Engine.IsXbox360() == false then
LUI.FlowManager.RequestAddMenu( self, "store_main", true, f9_arg0, f9_arg2, f9_local0 )
else
LUI.FlowManager.RequestPopupMenu( self, "finding_player_purchases", true, f9_arg0, false, {
storeData = f9_local0
} )
end
return true
end
else
Engine.Exec( "xshowmarketplace" )
end
return false
end
Sns.GetTickerHeader = function ( f10_arg0, f10_arg1 )
if f10_arg0 == FeedCategory.Squads then
local f10_local0 = SvS.GetSquadReportData( Engine.GetControllerForLocalClient( 0 ), f10_arg1 )
return Engine.Localize( "SOCIALFEED_SQUAD_HEADER", Engine.MarkLocalized( f10_local0.enemyName ) )
else
return SocialFeed.GetArticleHeader( f10_arg0, f10_arg1 )
end
end
function RefreshThumbnails( f11_arg0, f11_arg1 )
f11_arg0:closeChildren()
f11_arg0:clearSavedState()
f11_arg0:processEvent( {
name = "menu_refresh"
} )
if LUI.FlowManager.IsMenuTopmost( Engine.GetLuiRoot(), "store_main" ) then
f11_arg0:processEvent( {
name = "gain_focus"
} )
end
f11_arg0:processEvent( {
name = "update_sale_banners"
} )
f11_arg0:processEvent( {
name = "update_purchase_checkboxes"
} )
f11_arg0:processEvent( {
name = "update_hack_banner"
} )
end
Sns.OpenStore = function ( f12_arg0, f12_arg1 )
local f12_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f12_arg0 )
LUI.FlowManager.RequestAddMenu( f12_arg0, "store_main", true, f12_local0.exclusiveController, false, {
reqiestedItem = f12_arg1
} )
end
Sns.OpenSocialFeed = function ( f13_arg0, f13_arg1, f13_arg2 )
if Engine.IsUserAGuest( f13_arg1 ) then
LUI.FlowManager.RequestPopupMenu( f13_arg0, "mp_no_guest_popup", false, f13_arg1, false )
else
Squad.UpdateReportPlayerCardCache( f13_arg1 )
LUI.FlowManager.RequestAddMenu( f13_arg0, "social_feed_main", true, f13_arg1, false, {
fromLobby = f13_arg2 or false
} )
end
end
Sns.SocialFeedEnabled = function ()
local f14_local0 = false
if Engine.GetDvarInt( "social_feed_motd_active" ) == 1 then
f14_local0 = true
elseif Engine.GetDvarInt( "social_feed_news_active" ) == 1 then
f14_local0 = true
elseif Engine.GetDvarInt( "social_feed_clans_active" ) == 1 then
f14_local0 = true
elseif Engine.GetDvarInt( "social_feed_squads_active" ) == 1 then
f14_local0 = true
elseif Engine.GetDvarInt( "social_feed_social_active" ) == 1 then
f14_local0 = true
end
return f14_local0
end
Sns.ChangeTickerStory = function ( f15_arg0, f15_arg1 )
local f15_local0 = Engine.GetControllerForLocalClient( 0 )
local f15_local1 = SocialFeed.GetArticleCount( f15_local0, Sns.TickerCategory )
Sns.TickerIndex = Sns.TickerIndex + 1
if f15_local1 <= Sns.TickerIndex then
local f15_local2 = Sns.TickerCategory
repeat
f15_local2 = f15_local2 + 1
if f15_local2 > FeedCategory.Social then
f15_local2 = FeedCategory.News
end
if SocialFeed.GetArticleCount( f15_local0, f15_local2 ) > 0 then
Sns.TickerCategory = f15_local2
break
else
end
until f15_local2 == Sns.TickerCategory
Sns.TickerIndex = 0
end
if f15_arg0.tickerText and f15_local1 > Sns.TickerIndex then
f15_arg0.nextText:setText( Sns.GetTickerHeader( Sns.TickerCategory, Sns.TickerIndex ) )
f15_arg0.tickerText:animateToState( "transition_to_next", Sns.TickerScrollSpeed )
f15_arg0.nextText:animateToState( "transition_to_next", Sns.TickerScrollSpeed )
end
end
Sns.TickerScrollEnded = function ( f16_arg0, f16_arg1 )
f16_arg0.tickerText:setText( Sns.GetTickerHeader( Sns.TickerCategory, Sns.TickerIndex ) )
f16_arg0.tickerText:animateToState( "default", 0 )
f16_arg0.nextText:animateToState( "default", 0 )
end
Sns.GetArticleImageDims = function ( f17_arg0, f17_arg1 )
local f17_local0 = Sns.Dims.DefaultArticleImage.width
local f17_local1 = Sns.Dims.DefaultArticleImage.height
if f17_arg0 then
f17_local0 = math.min( f17_arg0, Sns.Dims.DefaultArticleImage.maxWidth )
end
if f17_arg1 then
f17_local1 = math.min( f17_arg1, Sns.Dims.DefaultArticleImage.maxHeight )
end
return f17_local0, f17_local1
end
Sns.IsSeasonPassAccessible = function ()
local f18_local0
if Engine.GetCurrentLanguage() == 5 or Engine.GetCurrentLanguage() == 10 then
f18_local0 = false
else
f18_local0 = true
end
return f18_local0
end

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,689 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function PushSplitScreenMenu()
MatchRules.SetUsingMatchRulesData( 1 )
Engine.PLMRefreshData()
end
function SplitScreenStartGame( f2_arg0, f2_arg1 )
if Engine.GetDvarString( "ui_gametype" ) == "horde" then
Lobby.SetBotsConnectType( 0 )
Engine.SetDvarBool( "squad_use_hosts_squad", false )
elseif SvS.IsSvS() then
if Lobby.GetBotsConnectType() == 0 then
Lobby.SetBotsConnectType( 1 )
end
Lobby.SetBotsTeamLimit( Lobby.BotTeams.Friendly, SvS.MaxSquadSize )
Lobby.SetBotsTeamLimit( Lobby.BotTeams.Enemy, SvS.MaxSquadSize )
Engine.SetDvarBool( "squad_use_hosts_squad", true )
elseif Lobby.GetBotsConnectType() == 0 then
Lobby.SetBotsConnectType( 1 )
Engine.SetDvarBool( "squad_use_hosts_squad", false )
end
local f2_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f2_arg0 )
f2_local0.startingController = f2_arg1.controller
CharacterScene.FreeCharacterScene()
local f2_local1 = LUI.mp_menus.Aliens.LobbyGetIntroVideo()
if f2_local1 and f2_local1 ~= "" and not LUI.mp_menus.Aliens.HasSeenVideo( f2_arg1.controller, f2_local1 ) then
LUI.mp_menus.Aliens.SetHasSeenVideo( f2_arg1.controller, f2_local1 )
LUI.mp_menus.Aliens.AliensPlayVideo( f2_arg1.controller, f2_local1, {
name = "start_transition_to_game",
immediate = true
} )
else
f2_arg0:dispatchEventToRoot( {
name = "start_transition_to_game",
immediate = true
} )
end
end
function StartTheGameHandler( f3_arg0, f3_arg1 )
local f3_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f3_arg0 )
Engine.SetDvarBool( "splitscreen_ingame", true )
Lobby.StartServer( f3_local0.startingController )
LUI.UIRoot.BlockButtonInput( Engine.GetLuiRoot(), false, "LobbyTransitionToGame" )
end
function SplitScreenGameSetup( f4_arg0, f4_arg1 )
LUI.FlowManager.RequestAddMenu( f4_arg0, "gamesetup_menu_main", true, f4_arg1.controller, false )
end
function SplitScreenEditSquad( f5_arg0, f5_arg1 )
Cac.SetEditSquadMember( Cac.GetActiveSquadMember( f5_arg1.controller ) )
LUI.FlowManager.RequestAddMenu( f5_arg0, "cac_edit_main", true, f5_arg1.controller, false, {
open_char_list = true,
squadLocation = "privateMatchSquadMembers",
squadMemberIndex = Cac.GetEditSquadMember(),
classLocation = "loadouts",
allowMemberSwap = true
} )
end
function LeaveSplitScreen( f6_arg0, f6_arg1 )
if Lobby.GetBotsConnectType() > 0 then
Lobby.SetBotsConnectType( 0 )
end
LUI.FlowManager.RequestLeaveMenu( f6_arg0 )
end
function GameSetupCreateHandler( f7_arg0, f7_arg1 )
LUI.FlowManager.RequestSetStack( f7_arg0, {
{
name = "mp_main_menu"
},
{
name = "menu_splitscreensignin"
}
} )
local f7_local0 = Engine.GetFirstActiveController()
f7_arg0:dispatchEventToRoot( LUI.ButtonHelperText.CommonEvents.addBackButton )
f7_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addGameSummaryButton )
Engine.SetDvarBool( "splitscreen_ingame", false )
Engine.Exec( MPConfig.default_dvars, f7_local0 )
if Engine.IsAliensMode() then
LUI.mp_menus.Aliens.AliensRunConfig( f7_local0 )
LUI.mp_menus.Aliens.InitGameTypeToAliens()
end
if Engine.IsXbox360() and Engine.AnyContentDamaged and Engine.AnyContentDamaged() then
LUI.FlowManager.RequestPopupMenu( f7_arg0, "mp_damaged_content_popup", false, f7_local0 )
else
TryForceOpenAfterActionReport( f7_arg0, f7_arg1 )
end
if Engine.GetDvarBool( "xblive_competitionmatch" ) and not Engine.IsAliensMode() then
MLG.SetUsingMLGRules( false )
MatchRules.LoadMatchRulesDataDefault()
f7_arg0:processEvent( {
name = "create_class_update_restrictions",
controller = f7_local0
} )
end
Cac.ValidateAllPlayersPrivateSquadMembers()
end
function GameSetupOptionsFeeder( f8_arg0 )
local f8_local0 = Engine.IsAliensMode()
local f8_local1 = {}
if not f8_arg0.slot then
DebugPrint( "[WARNING] CAC: using cac slot index 0, this is only ok if you are editing a menu" )
local f8_local2 = 0
end
local f8_local3 = Cac.GetCustomClassLoc( f8_arg0.classLocation )
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "start_game_btn_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_START_GAME_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_DESC_START_MATCH" ),
button_action_func = SplitScreenStartGame
}
}
if not f8_local0 then
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "game_setup_btn_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_GAME_SETUP_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_DESC_GAME_SETUP" ),
button_action_func = SplitScreenGameSetup
}
}
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "create_squad_btn_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_CREATE_A_CLASS_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_DESC_CREATE_A_CLASS" ),
button_action_func = SplitScreenEditSquad,
button_over_func = TriggerUpdateRestrictionsIcon,
button_up_func = TriggerUpdateRestrictionsIcon
},
handlers = {
create_class_update_restrictions = TriggerUpdateRestrictionsIcon
},
children = {
{
type = "lobby_restriction_icon"
}
}
}
else
f8_local1[#f8_local1 + 1] = LUI.mp_menus.AliensLoadout.GetAliensLoadoutButton()
if LUI.mp_menus.Aliens.ExtinctionHasMapSelection() then
f8_local1[#f8_local1 + 1] = LUI.mp_menus.Aliens.MapSelectionButton()
end
if LUI.mp_menus.Aliens.ExtinctionHasModeSelection() then
f8_local1[#f8_local1 + 1] = LUI.mp_menus.Aliens.ModeSelectionButton()
end
if LUI.mp_menus.Aliens.ExtinctionHasDifficultySelection() then
f8_local1[#f8_local1 + 1] = LUI.mp_menus.Aliens.DifficultySelectionButton()
end
if LUI.mp_menus.Aliens.CanAccessIntelMenu() then
f8_local1[#f8_local1 + 1] = LUI.mp_menus.AliensIntel.GetAliensIntelButton()
end
end
local f8_local4 = MatchRules.GetData( "gametype" )
if not f8_local0 and f8_local4 ~= "horde" then
local f8_local5 = tonumber( Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f8_local4, GameTypesTable.Cols.TeamChoice ) )
if f8_local5 and f8_local5 == 1 then
if not SvS.IsSvS() then
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "friendly_bot_button_id",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = GenericMenuDims.menu_right_more,
top = 0,
bottom = GenericButtonSettings.Styles.GradientButton.height
}
},
properties = {
variant = GenericButtonSettings.Variants.Select,
content_margin = 40,
content_width = 225,
text_padding_with_content = 275,
button_text = Engine.Localize( "@LUA_MENU_FRIENDLY_BOTS_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_FRIENDLY_BOTS_DESC" ),
button_display_func = FriendlyBotButtonDisplayText,
button_left_func = FriendlyBotButtonLeft,
button_right_func = FriendlyBotButtonRight,
button_over_func = MBh.EmitEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true,
immediate = true
} )
}
}
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "friendly_bots_difficulty_button_id",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = GenericMenuDims.menu_right_more,
top = 0,
bottom = GenericButtonSettings.Styles.GradientButton.height
}
},
properties = {
variant = GenericButtonSettings.Variants.Select,
content_margin = 40,
content_width = 225,
text_padding_with_content = 275,
button_text = Engine.Localize( "@LUA_MENU_BOTDIFFICULTY_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_FRIENDLY_BOTDIFFICULTY_DESC" ),
button_display_func = FriendlyBotsDifficultyButtonDisplayText,
button_left_func = FriendlyBotsDifficultyButtonLeft,
button_right_func = FriendlyBotsDifficultyButtonRight,
button_over_func = MBh.EmitEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true,
immediate = true
} )
}
}
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "enemy_bot_button_id",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = GenericMenuDims.menu_right_more,
top = 0,
bottom = GenericButtonSettings.Styles.GradientButton.height
}
},
properties = {
variant = GenericButtonSettings.Variants.Select,
content_margin = 40,
content_width = 225,
text_padding_with_content = 275,
button_text = Engine.Localize( "@LUA_MENU_ENEMY_BOTS_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_ENEMY_BOTS_DESC" ),
button_display_func = EnemyBotButtonDisplayText,
button_left_func = EnemyBotButtonLeft,
button_right_func = EnemyBotButtonRight,
button_over_func = MBh.EmitEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true,
immediate = true
} )
}
}
end
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "enemy_bots_difficulty_button_id",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = GenericMenuDims.menu_right_more,
top = 0,
bottom = GenericButtonSettings.Styles.GradientButton.height
}
},
properties = {
variant = GenericButtonSettings.Variants.Select,
content_margin = 40,
content_width = 225,
text_padding_with_content = 275,
button_text = Engine.Localize( "@LUA_MENU_BOTDIFFICULTY_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_ENEMY_BOTDIFFICULTY_DESC" ),
button_display_func = EnemyBotsDifficultyButtonDisplayText,
button_left_func = EnemyBotsDifficultyButtonLeft,
button_right_func = EnemyBotsDifficultyButtonRight,
button_over_func = MBh.EmitEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true,
immediate = true
} )
}
}
else
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "bot_button_id",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = GenericMenuDims.menu_right_more,
top = 0,
bottom = GenericButtonSettings.Styles.GradientButton.height
}
},
properties = {
variant = GenericButtonSettings.Variants.Select,
content_margin = 40,
content_width = 225,
text_padding_with_content = 275,
button_text = Engine.Localize( "@LUA_MENU_BOTS_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_BOTS_DESC" ),
button_display_func = FFABotButtonDisplayText,
button_left_func = FFABotButtonLeft,
button_right_func = FFABotButtonRight,
button_over_func = MBh.EmitEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true,
immediate = true
} )
}
}
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "bots_difficulty_button_id",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = GenericMenuDims.menu_right_more,
top = 0,
bottom = GenericButtonSettings.Styles.GradientButton.height
}
},
properties = {
variant = GenericButtonSettings.Variants.Select,
content_margin = 40,
content_width = 225,
text_padding_with_content = 275,
button_text = Engine.Localize( "@LUA_MENU_BOTDIFFICULTY_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_BOTDIFFICULTY_DESC" ),
button_display_func = FFABotsDifficultyButtonDisplayText,
button_left_func = FFABotsDifficultyButtonLeft,
button_right_func = FFABotsDifficultyButtonRight,
button_over_func = MBh.EmitEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true,
immediate = true
} )
}
}
end
f8_local1[#f8_local1 + 1] = {
type = "UITimer",
id = "bot_button_timer_id",
properties = {
event = "bot_button_refresh",
interval = 200
}
}
end
f8_local1[#f8_local1 + 1] = {
type = "button_desc_text",
id = "splitscreen_gamesetup_description_id"
}
return f8_local1
end
function menu_gamesetup_splitscreen()
local f9_local0 = Engine.IsAliensMode()
local f9_local1 = {
type = "UIElement",
id = "menu_splitscreen_gamesetup_root",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = GameSetupCreateHandler,
start_transition_to_game = HandleStartTransitionToGame,
open_after_action_report = OpenAfterActionReport,
lobby_transition_complete = StartTheGameHandler
}
}
local f9_local2 = {}
local f9_local3 = {
type = "generic_menu_title",
id = "splitscreen_menu_title"
}
local f9_local4 = {}
local f9_local5
if f9_local0 then
f9_local5 = Engine.Localize( "@LUA_MENU_LOCAL_PLAY_CAPS" )
if not f9_local5 then
else
f9_local4.menu_title = f9_local5
f9_local3.properties = f9_local4
f9_local3.handlers = {
lobby_transition_to_game = MBh.AnimateToState( "hidden", Lobby.TransitionTime ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
}
f9_local4 = {
type = "UIVerticalList",
id = "live_splitscreen_options_id",
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom,
alpha = 1
},
hidden = {
alpha = 0
}
},
childrenFeeder = GameSetupOptionsFeeder,
handlers = {
lobby_transition_to_game = MBh.AnimateToState( "hidden", Lobby.TransitionTime ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime ),
bot_button_refresh = BotButtonRefresh,
menu_create = BotButtonRefresh
}
}
f9_local5 = {
type = "splitscreen_member_list"
}
local f9_local6 = {
type = "lobby_loading_widget"
}
local f9_local7 = {
type = "lobby_game_type_title"
}
local f9_local8 = {
type = "lobby_game_type_icon"
}
local f9_local9 = {
type = "UIBindButton",
id = "lobby_bind_buttons_id",
handlers = {
button_secondary = LeaveSplitScreen,
button_select = OpenAfterActionReport
}
}
local f9_local10 = {
type = "UIElement",
id = "LowerSliderID",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alpha = 1
},
hidden = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 100,
bottom = 100,
alpha = 0
}
},
handlers = {
lobby_transition_to_game = MBh.AnimateToState( "hidden", Lobby.TransitionTime ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
},
children = {
{
type = "map_info_text",
id = "map_info_text_id"
},
{
type = "button_helper_text_main",
id = "cac_button_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
}
}
}
f9_local2[1] = f9_local3
f9_local2[2] = f9_local4
f9_local2[3] = f9_local5
f9_local2[4] = f9_local6
f9_local2[5] = f9_local7
f9_local2[6] = f9_local8
f9_local2[7] = f9_local9
f9_local2[8] = f9_local10
f9_local1.children = f9_local2
return f9_local1
end
end
f9_local5 = Engine.Localize( "@LUA_MENU_SPLITSCREEN_CAPS" )
end
function PlayerCardDummyData( f10_arg0, f10_arg1, f10_arg2 )
f10_arg0:processEvent( {
gamertag = "player" .. f10_arg2 + 1,
clantag = "NVST",
rank = 18,
prestige = 0,
background = "0",
patchEmblem = "0",
patchShape = "0",
name = "update_playercard"
} )
end
function FillPlayerData( f11_arg0, f11_arg1, f11_arg2 )
if not Lobby.GetControllerForSplitScreenSlot then
PlayerCardDummyData( f11_arg0, f11_arg1, f11_arg2 )
return
end
local f11_local0 = Lobby.GetControllerForSplitScreenSlot( f11_arg2 )
if f11_local0 and Engine.HasPlayerData( f11_local0 ) then
local f11_local1 = LUI.mp_menus.Aliens
local f11_local2 = nil
if Engine.IsAliensMode() then
f11_local2 = Lobby.GetAlienRankForXP( f11_local1.getAliensExperience( f11_local0 ) )
else
f11_local2 = Lobby.GetRankForXP( Engine.GetPlayerDataEx( f11_local0, CoD.StatsGroup.Ranked, "experience" ) )
end
local f11_local3 = {
gamertag = Engine.GetUsernameByController( f11_local0 ),
clantag = Engine.GetCustomClanTag( f11_local0 ) or "",
rank = f11_local2
}
if Engine.IsAliensMode() then
f11_local3.prestige = f11_local1.getAliensPrestigeLevel( f11_local0 )
else
f11_local3.prestige = Engine.GetPlayerDataEx( f11_local0, CoD.StatsGroup.Ranked, "prestige" )
end
if Engine.IsAliensMode() then
local f11_local4 = "squadMembers"
local f11_local5 = 0
f11_local3.background = Engine.GetPlayerDataEx( f11_local0, CoD.StatsGroup.Ranked, f11_local4, f11_local5, "background" )
f11_local3.patchEmblem = Engine.GetPlayerDataEx( f11_local0, CoD.StatsGroup.Ranked, f11_local4, f11_local5, "patch" )
f11_local3.patchShape = Engine.GetPlayerDataEx( f11_local0, CoD.StatsGroup.Ranked, f11_local4, f11_local5, "patchbacking" )
else
local f11_local4 = Cac.GetSquadLoc()
local f11_local5 = AAR.GetRoundSquadMember( f11_local0 )
f11_local3.background = Cac.GetBackgroundIndex( f11_local0, f11_local4, f11_local5 )
f11_local3.patchEmblem = Cac.GetPatchIndex( f11_local0, f11_local4, f11_local5 )
f11_local3.patchShape = Cac.GetPatchbackingIndex( f11_local0, f11_local4, f11_local5 )
end
f11_local3.name = "update_playercard"
f11_arg0:processEvent( f11_local3 )
end
end
function splitscreenMemberFeeder( f12_arg0 )
local f12_local0 = {}
local f12_local1 = Engine.SplitscreenPlayerCount()
local f12_local2 = 70
for f12_local3 = 1, f12_local1, 1 do
local f12_local6 = f12_local3
f12_local0[#f12_local0 + 1] = {
type = "playercard",
id = "playercard_id" .. f12_local6,
properties = {
additional_handlers = {
menu_create = function ( f13_arg0, f13_arg1 )
FillPlayerData( f13_arg0, f13_arg1, f12_local6 - 1 )
end,
update_cards = function ( f14_arg0, f14_arg1 )
FillPlayerData( f14_arg0, f14_arg1, f12_local6 - 1 )
end
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = f12_local2
}
}
}
end
f12_local0[#f12_local0 + 1] = {
type = "UITimer",
properties = {
event = "update_player_cards",
interval = 750,
disposable = false
}
}
return f12_local0
end
function HandleUpdatePlayerCards( f15_arg0, f15_arg1 )
if f15_arg0.properties.numPlayers ~= Engine.SplitscreenPlayerCount() then
f15_arg0.properties.numPlayers = Engine.SplitscreenPlayerCount()
f15_arg0:closeChildren()
f15_arg0:processEvent( {
name = "menu_refresh"
} )
end
f15_arg0:processEvent( {
name = "update_cards"
} )
end
function splitscreen_member_list()
return {
type = "UIVerticalList",
id = "splitscreen_memberlist_id",
properties = {
numPlayers = Engine.SplitscreenPlayerCount()
},
childrenFeeder = splitscreenMemberFeeder,
states = {
default = {
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = -500,
right = -50,
top = 150,
bottom = 0,
spacing = 60
},
hidden = {
leftAnchor = false,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 100,
right = 650,
top = 150,
bottom = 0,
spacing = 60
}
},
handlers = {
lobby_transition_to_game = MBh.AnimateToState( "hidden", Lobby.TransitionTime ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime ),
update_player_cards = HandleUpdatePlayerCards
}
}
end
LUI.MenuBuilder.registerDef( "menu_gamesetup_splitscreen", menu_gamesetup_splitscreen )
LUI.MenuBuilder.registerDef( "splitscreen_member_list", splitscreen_member_list )
LUI.FlowManager.RegisterStackPushBehaviour( "menu_gamesetup_splitscreen", PushSplitScreenMenu )
LockTable( _M )

View File

@@ -0,0 +1,622 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = {
ButtonPos1 = 75,
ButtonPos2 = 100,
ButtonPos3 = 125,
ButtonPos4 = 150,
ButtonPos5 = 175,
ButtonPos6 = 200
}
function SplitScreenSignInCreate( f1_arg0, f1_arg1 )
Engine.PlaySound( CoD.SFX.MouseOver )
if not f1_arg1.stackRestore then
Engine.Exec( "startsplitscreensignin", 0 )
end
end
function SplitscreensigninRefresh( f2_arg0, f2_arg1 )
f2_arg0:dispatchEventToRoot( {
name = "refresh_quadrant_options",
immediate = true
} )
f2_arg0:dispatchEventToRoot( {
name = "refresh_quadrant_leds",
immediate = true
} )
end
function GetQuadsLayoutData( f3_arg0 )
local f3_local0 = assert
local f3_local1
if f3_arg0 ~= 2 and f3_arg0 ~= 4 then
f3_local1 = false
else
f3_local1 = true
end
f3_local0( f3_local1, "numQuads must be 2 or 4" )
f3_local0 = 245
f3_local1 = 517
local f3_local2 = {}
if f3_arg0 == 4 then
f3_local2 = {
{
x = 100,
y = 124
},
{
x = 660,
y = 124
},
{
x = 100,
y = 395
},
{
x = 660,
y = 395
}
}
else
f3_local2 = {
{
x = 370,
y = 124
},
{
x = 370,
y = 395
}
}
end
return f3_local0, f3_local1, f3_local2
end
function QuadrantFeeder( f4_arg0 )
local f4_local0 = f4_arg0.numQuads
local f4_local1 = 245
local f4_local2 = 517
local f4_local3 = nil
f4_local1, f4_local2, f4_local3 = GetQuadsLayoutData( f4_local0 )
local f4_local4 = {}
for f4_local5 = 1, #f4_local3, 1 do
f4_local4[#f4_local4 + 1] = {
type = "menu_splitscreensignin_quadrant",
id = "quadrant_" .. f4_local5,
properties = {
qid = f4_local5 - 1,
listen_on_controller = -1
},
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = f4_local3[f4_local5].x,
right = f4_local3[f4_local5].x + f4_local2,
top = f4_local3[f4_local5].y,
bottom = f4_local3[f4_local5].y + f4_local1
}
}
}
end
return f4_local4
end
function menu_splitscreensignin()
return {
type = "UIElement",
id = "menu_splitscreensigninmain",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
properties = {
numQuads = 2
},
handlers = {
menu_create = SplitScreenSignInCreate,
refresh_splitscreensignin_menu = SplitscreensigninRefresh
},
children = {
{
type = "generic_menu_title",
id = "splitscreen_signin_menu_title",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_LOCAL_PLAY_SIGNIN_CAPS" )
}
},
{
type = "UIImage",
id = "horizontal_line_id",
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = false,
left = 0,
right = 0,
top = 21.5,
bottom = 22.5,
red = 1,
green = 1,
blue = 1,
alpha = 0.3
}
}
},
{
type = "UIElement",
id = "quadrants_container_id",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
childrenFeeder = QuadrantFeeder,
handlers = {
refresh_quadrant_leds = RefreshQuadrantLEDs
}
}
}
}
end
function GetOptionsList( f6_arg0 )
local f6_local0 = 200
local f6_local1 = {
{
string = Engine.Localize( "@XBOXLIVE_JOINSPLITSCREENGAME_BUTTON" ) .. " " .. Engine.Localize( "@XBOXLIVE_JOINSPLITSCREENGAME_MW3" ),
visarg = Engine.GetDvarBool( "joingame" .. f6_arg0.listen_on_controller .. "_vis" ),
xpos = f6_local0,
ypos = f0_local0.ButtonPos1
},
{
string = Engine.Localize( "@XBOXLIVE_BACK_BUTTON" ) .. " " .. Engine.Localize( "@XBOXLIVE_BACK_MW3" ),
visarg = Engine.GetDvarBool( "joingame" .. f6_arg0.listen_on_controller .. "_vis" ),
xpos = f6_local0,
ypos = f0_local0.ButtonPos2
},
{
string = Engine.Localize( "@MENU_WAITING_FOR_MORE_PLAYERS1" ),
visarg = Engine.GetDvarBool( "waiting" .. f6_arg0.listen_on_controller .. "_vis" ),
xpos = f6_local0,
ypos = f0_local0.ButtonPos3
},
{
string = Engine.Localize( "@XBOXLIVE_STARTGAME_BUTTON" ) .. " " .. Engine.Localize( "@XBOXLIVE_STARTGAME_MW3" ),
visarg = Engine.GetDvarBool( "startgame" .. f6_arg0.listen_on_controller .. "_vis" ),
xpos = f6_local0,
ypos = f0_local0.ButtonPos3
},
{
string = Engine.Localize( "@XBOXLIVE_LEAVESPLITSCREENGAME_BUTTON" ) .. " " .. Engine.Localize( "@XBOXLIVE_LEAVESPLITSCREENGAME_MW3" ),
visarg = Engine.GetDvarBool( "leavegame" .. f6_arg0.listen_on_controller .. "_vis" ),
xpos = f6_local0,
ypos = f0_local0.ButtonPos4
}
}
if Engine.IsPS3() then
f6_local1[#f6_local1 + 1] = {
string = Engine.Localize( "@XBOXLIVE_CHANGEOFFLINEPROFILE_BUTTON" ) .. " " .. Engine.Localize( "@XBOXLIVE_CHANGEOFFLINEPROFILE_MW3" ),
visarg = Engine.GetDvarBool( "changeusers" .. f6_arg0.listen_on_controller .. "_vis" ),
xpos = f6_local0,
ypos = f0_local0.ButtonPos5
}
elseif not Engine.IsPS4() then
f6_local1[#f6_local1 + 1] = {
string = Engine.Localize( "@XBOXLIVE_SIGNINPROFILE_BUTTON" ) .. " " .. Engine.Localize( "@XBOXLIVE_SIGNINPROFILE_MW3" ),
visarg = Engine.GetDvarBool( "signin" .. f6_arg0.listen_on_controller .. "_vis" ),
xpos = f6_local0,
ypos = f0_local0.ButtonPos5,
xbox_only = true
}
f6_local1[#f6_local1 + 1] = {
string = Engine.Localize( "@XBOXLIVE_CHANGEPROFILE_BUTTON" ) .. " " .. Engine.Localize( "@XBOXLIVE_CHANGEPROFILE_MW3" ),
visarg = Engine.GetDvarBool( "changeusers" .. f6_arg0.listen_on_controller .. "_vis" ),
xpos = f6_local0,
ypos = f0_local0.ButtonPos5,
xbox_only = true
}
if not Engine.IsXB3() then
f6_local1[#f6_local1 + 1] = {
string = Engine.Localize( "@XBOXLIVE_SELECTSAVEDEVICE_BUTTON" ) .. " " .. Engine.Localize( "@XBOXLIVE_SELECTSAVEDEVICE_MW3" ),
visarg = Engine.GetDvarBool( "changeusers" .. f6_arg0.listen_on_controller .. "_vis" ),
xpos = f6_local0,
ypos = f0_local0.ButtonPos6,
xbox_only = true
}
end
end
return f6_local1
end
function QuadrantOptionsListFeeder( f7_arg0 )
local f7_local0 = {}
local f7_local1 = 0.7
local f7_local2 = 0.7
local f7_local3 = 0.7
local f7_local4 = CoD.TextSettings.BigFont.Height
local f7_local5 = GetOptionsList( f7_arg0 )
for f7_local6 = 1, #f7_local5, 1 do
local f7_local9 = 0
if f7_local5[f7_local6].visarg == true then
f7_local9 = 1
end
f7_local0[#f7_local0 + 1] = {
type = "UIText",
id = "option_" .. f7_local6 .. "id_controller" .. f7_arg0.listen_on_controller,
properties = {
text = f7_local5[f7_local6].string
},
states = {
default = {
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = f7_local5[f7_local6].xpos,
right = 0,
top = f7_local5[f7_local6].ypos,
bottom = f7_local5[f7_local6].ypos + f7_local4,
red = f7_local1,
green = f7_local2,
blue = f7_local3,
alpha = f7_local9,
animateOnRefresh = true
}
}
}
end
if Engine.GetDvarBool( "startgame" .. f7_arg0.listen_on_controller .. "_vis" ) then
f7_local0[#f7_local0 + 1] = {
type = "playercard",
id = "basic_playercard_for_controller_" .. f7_arg0.listen_on_controller,
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = false,
top = 20,
left = 40,
height = 128,
width = 512
}
}
}
end
return f7_local0
end
function ToggleQuadrantLED( f8_arg0, f8_arg1, f8_arg2 )
local f8_local0 = assert
local f8_local1
if f8_arg2 ~= "on" and f8_arg2 ~= "off" then
f8_local1 = false
else
f8_local1 = true
end
f8_local0( f8_local1 )
f8_arg0:dispatchEventToRoot( {
name = "quadrant_" .. f8_arg1 .. "_led_" .. f8_arg2,
immediate = true
} )
end
function RefreshQuadrantOptions( f9_arg0, f9_arg1 )
local f9_local0 = f9_arg0.properties
if not f9_local0 then
DebugPrint( "Warning: could not resolve properties for Split screen sign in quadrant" )
return
end
local f9_local1 = "basic_playercard_for_controller_" .. f9_local0.listen_on_controller
local f9_local2 = f9_arg0:getChildById( f9_local1 )
if f9_local2 then
f9_local2:close()
end
f9_arg0:processEvent( {
name = "menu_refresh"
} )
f9_local2 = f9_arg0:getChildById( f9_local1 )
if f9_local2 then
local f9_local3 = nil
if Engine.IsAliensMode() then
f9_local3 = Lobby.GetMemberAlienRank( Lobby.MemberListStates.Prelobby, f9_local0.qid, 0, f9_local0.listen_on_controller )
else
f9_local3 = Lobby.GetMemberRank( Lobby.MemberListStates.Prelobby, f9_local0.qid, 0, f9_local0.listen_on_controller )
end
if not f9_local3 then
f9_local3 = 0
end
local f9_local4 = ""
if Lobby.HasMemberClanTag( Lobby.MemberListStates.Prelobby, f9_local0.qid, 0, f9_local0.listen_on_controller ) then
f9_local4 = Lobby.GetMemberClanTag( Lobby.MemberListStates.Prelobby, f9_local0.qid, 0, f9_local0.listen_on_controller )
end
local f9_local5 = nil
if Engine.IsAliensMode() then
f9_local5 = Lobby.GetMemberAlienPrestigeLevel( Lobby.MemberListStates.Prelobby, f9_local0.qid, 0, f9_local0.listen_on_controller )
else
f9_local5 = Lobby.GetMemberPrestigeLevel( Lobby.MemberListStates.Prelobby, f9_local0.qid, 0, f9_local0.listen_on_controller )
end
f9_local2:processEvent( {
gamertag = Lobby.GetMemberName( Lobby.MemberListStates.Prelobby, f9_local0.qid, 0, f9_local0.listen_on_controller ),
clantag = f9_local4,
prestige = f9_local5,
background = "0",
patchEmblem = "0",
patchShape = "0",
name = "update_playercard"
} )
end
end
function AssignControllerToQuadrant( f10_arg0, f10_arg1 )
if f10_arg0.properties.qid == f10_arg1.qid then
f10_arg0.properties.listen_on_controller = f10_arg1.controller
end
end
function menu_splitscreensignin_quadrant()
return {
type = "UIElement",
properties = {
qid = -1,
listen_on_controller = -1
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
handlers = {
assign_controller_to_quadrant = AssignControllerToQuadrant
},
children = {
{
type = "generic_drop_shadow",
properties = {
offset_shadow = 0
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alpha = 0.5
}
}
},
{
type = "UIImage",
states = {
default = {
material = RegisterMaterial( "white" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
red = Colors.black.r,
green = Colors.black.g,
blue = Colors.black.b,
alpha = 0.75
}
}
},
{
type = "generic_border",
properties = {
border_red = Colors.window_border_color.r,
border_green = Colors.window_border_color.g,
border_blue = Colors.window_border_color.b
}
},
{
type = "UIElement",
id = "quadrant_options_list",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
handlers = {
refresh_quadrant_options = RefreshQuadrantOptions
},
childrenFeeder = QuadrantOptionsListFeeder
}
}
}
end
function RefreshQuadrantLEDs( f12_arg0, f12_arg1 )
for f12_local0 = 1, 4, 1 do
local f12_local3 = false
local f12_local4 = f12_local0 - 1
for f12_local5 = 1, 4, 1 do
local f12_local8 = f12_arg0:getChildById( "quadrant_" .. f12_local5 )
if f12_local8 and f12_local8.properties.listen_on_controller == f12_local4 then
f12_local3 = true
break
end
end
if f12_local3 then
ToggleQuadrantLED( f12_arg0, f12_local4, "on" )
else
ToggleQuadrantLED( f12_arg0, f12_local4, "off" )
end
end
end
function controller_port_indicators()
return {
type = "UIImage",
id = "console_logo_icon_id",
states = {
default = {
material = RegisterMaterial( "cont_port_indicators_bg" ),
leftAnchor = false,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = -20,
right = 20,
top = 2,
bottom = 42,
alpha = 1
}
},
children = {
{
type = "UIImage",
id = "quadrant_1_led",
states = {
default = {
material = RegisterMaterial( "cont_port_0_on" ),
leftAnchor = false,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = -20,
right = 0,
top = -20,
bottom = 0,
alpha = 0
},
on = {
alpha = 1
}
},
handlers = {
quadrant_0_led_on = MBh.AnimateToState( "on", 0 ),
quadrant_0_led_off = MBh.AnimateToState( "default", 0 )
}
},
{
type = "UIImage",
id = "quadrant_2_led",
states = {
default = {
material = RegisterMaterial( "cont_port_1_on" ),
leftAnchor = false,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = 0,
right = 20,
top = -20,
bottom = 0,
alpha = 0
},
on = {
alpha = 1
}
},
handlers = {
quadrant_1_led_on = MBh.AnimateToState( "on", 0 ),
quadrant_1_led_off = MBh.AnimateToState( "default", 0 )
}
},
{
type = "UIImage",
id = "quadrant_3_led",
states = {
default = {
material = RegisterMaterial( "cont_port_2_on" ),
leftAnchor = false,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = -20,
right = 0,
top = 0,
bottom = 20,
alpha = 0
},
on = {
alpha = 1
}
},
handlers = {
quadrant_2_led_on = MBh.AnimateToState( "on", 0 ),
quadrant_2_led_off = MBh.AnimateToState( "default", 0 )
}
},
{
type = "UIImage",
id = "quadrant_4_led",
states = {
default = {
material = RegisterMaterial( "cont_port_3_on" ),
leftAnchor = false,
rightAnchor = false,
topAnchor = false,
bottomAnchor = false,
left = 0,
right = 20,
top = 0,
bottom = 20,
alpha = 0
},
on = {
alpha = 1
}
},
handlers = {
quadrant_3_led_on = MBh.AnimateToState( "on", 0 ),
quadrant_3_led_off = MBh.AnimateToState( "default", 0 )
}
}
}
}
end
LUI.MenuBuilder.registerDef( "controller_port_indicators", controller_port_indicators )
LUI.MenuBuilder.registerDef( "menu_splitscreensignin_quadrant", menu_splitscreensignin_quadrant )
LUI.MenuBuilder.registerDef( "menu_splitscreensignin", menu_splitscreensignin )
LUI.FlowManager.RegisterStackPopBehaviour( "menu_splitscreensignin", SplitScreenSignInExit )
LockTable( _M )

View File

@@ -0,0 +1,77 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function squad_pre_party_lobby()
return {
type = "UIElement",
id = "squad_pre_party_lobby",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = function ( f2_arg0, f2_arg1 )
end
,
menu_close = function ( f3_arg0, f3_arg1 )
end
},
children = {
{
type = "generic_header",
properties = {
text = Engine.Localize( "@LUA_MENU_SQUAD_V_SQUAD" )
}
},
{
type = "UIImage",
id = "results_bg",
states = {
default = {
material = RegisterMaterial( "white" ),
left = -320,
top = -240,
width = 640,
height = 480,
alpha = 0.2
}
}
},
{
type = "UIText",
id = "text1",
states = {
default = {
height = CoD.TextSettings.NormalFont.Height * 1.5,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center,
alpha = 1,
width = 640,
top = -100,
red = 0.9,
green = 0.9,
blue = 0
}
},
properties = {
text = "Host is finding a squad game."
}
}
}
}
end
LUI.MenuBuilder.registerDef( "squad_pre_party_lobby", squad_pre_party_lobby )
LockTable( _M )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

622
lui/mp_menus/store.dec.lua Normal file
View File

@@ -0,0 +1,622 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( "Registering " .. _NAME )
function EndAnnouncerPreviewSound( f1_arg0 )
local f1_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f1_arg0 )
if f1_local0.announcerPreview then
Engine.StopSound( f1_local0.announcerPreview )
f1_local0.announcerPreview = nil
end
end
function OnCreate( f2_arg0, f2_arg1 )
f2_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
local f2_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f2_arg0 )
f2_local0.detailsVisible = false
f2_local0.hList = f2_arg0:getFirstDescendentById( "thumbnail_list_id" )
f2_arg0:processEvent( {
name = "update_tags"
} )
f2_arg0:processEvent( {
name = "update_thumbnail_arrows",
left_visible = showLeft,
right_visible = showRight
} )
end
function ChangeCategory( f3_arg0, f3_arg1 )
local f3_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f3_arg0 )
f3_local0.category = f3_arg0.properties.article_category
f3_local0.articleIndex = nil
EndAnnouncerPreviewSound( f3_arg0 )
f3_arg0:dispatchEventToRoot( {
name = "refresh_thumbnails",
immediate = true
} )
f3_arg0:dispatchEventToRoot( {
name = "update_store_helper_text",
immediate = true
} )
end
function ChangeArticle( f4_arg0, f4_arg1 )
local f4_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f4_arg0 )
f4_local0.articleIndex = f4_arg1.headerIndex
f4_local0.articleId = f4_arg1.itemId
local f4_local1, f4_local2, f4_local3, f4_local4 = f4_local0.hList:GetAnchorData()
local f4_local5 = math.max( f4_local0.articleIndex - Sns.MaxVisibleArticles - 1, 0 )
local f4_local6 = f4_local5 * -(Sns.Dims.Thumbnail.width + Sns.HListSpacing)
f4_local0.minVisibleArticle = f4_local5
f4_local0.hList:registerAnimationState( "default", {
leftAnchor = f4_local1,
rightAnchor = f4_local3,
topAnchor = f4_local2,
bottomAnchor = f4_local4,
left = f4_local6 + Sns.HListOffset,
right = -Sns.HListOffset,
top = Sns.HListOffset,
bottom = -Sns.HListOffset
} )
f4_local0.hList:animateToState( "default", 100 )
f4_arg0:processEvent( {
name = "refresh_article",
itemId = f4_arg1.itemId
} )
local f4_local7 = Store.GetNumItemsInCategory( f4_local0.category )
local f4_local8 = f4_local0.articleIndex >= Sns.MaxVisibleArticles
local f4_local9
if f4_local7 <= Sns.MaxVisibleArticles or f4_local0.articleIndex >= f4_local7 - 1 then
f4_local9 = false
else
f4_local9 = true
end
f4_arg0:processEvent( {
name = "update_thumbnail_arrows",
left_visible = f4_local8,
right_visible = f4_local9
} )
EndAnnouncerPreviewSound( f4_arg0 )
if f4_local0.category == StoreCategory.AnnouncerVoices then
local f4_local10 = Engine.TableLookup( "mp/cac/announcers.csv", 0, tostring( f4_local0.articleIndex + 1 ), 2 )
if f4_local10 ~= "" then
f4_local0.announcerPreview = Engine.PlaySound( f4_local10 )
end
end
end
function RefreshArticle( f5_arg0, f5_arg1 )
local f5_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f5_arg0 )
local f5_local1 = CrossGameHackData( f5_local0.category )
assert( f5_arg1.itemId == f5_local0.articleId )
Sns.UpdateScopedArticleInfo( f5_arg0, f5_local0 )
f5_local0.detailsVisible = false
local f5_local2 = {}
if f5_local0.articleCount > 0 then
f5_local2[1] = {
fileId = Sns.GetScopedArticleInfo( f5_arg0, "image" ),
thumbName = Sns.GetScopedArticleInfo( f5_arg0, "thumbName" )
}
local f5_local3 = f5_local0.minVisibleArticle
local f5_local4 = math.min( f5_local0.articleCount - 1, f5_local3 + Sns.MaxPrefetchArticles - 1 )
for f5_local5 = f5_local3, f5_local4, 1 do
local f5_local8 = nil
if f5_local1 then
f5_local8 = {
dlcName = "s1",
id = -1,
thumb = "s1",
thumbName = "s1"
}
else
f5_local8 = Store.GetItemInfoByCategory( f5_local0.category, f5_local5 )
end
if f5_local8.thumb ~= f5_local2[1] then
f5_local2[#f5_local2 + 1] = {
fileId = f5_local8.thumb,
thumbName = f5_local8.thumbName
}
end
end
end
Store.RequestContentServerImages( unpack( f5_local2 ) )
f5_arg0:dispatchEventToChildren( {
name = "hide_more_details"
} )
f5_arg0:dispatchEventToChildren( {
name = "update_article_details",
end_time = endTime
} )
f5_arg0:dispatchEventToChildren( {
name = "show_article_purchaseinfo",
itemID = itemId,
dispatchChildren = true
} )
f5_arg0:dispatchEventToChildren( {
name = "update_purchase_checkboxes"
} )
f5_arg0:dispatchEventToRoot( {
name = "update_store_helper_text",
immediate = true
} )
end
function UpdateHelperText( f6_arg0, f6_arg1 )
local f6_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f6_arg0 )
local f6_local1 = f6_local0.category
f6_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_action",
helper_text = "",
side = "left"
} )
f6_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_alt1",
helper_text = "",
side = "left"
} )
if f6_local0.articleIndex then
local f6_local2 = nil
if f6_local0.articleInfo then
if f6_local0.articleInfo.purchased then
f6_local2 = Engine.Localize( "@LUA_MENU_DOWNLOAD" )
else
f6_local2 = Engine.Localize( "@LUA_MENU_PURCHASE" )
end
else
f6_local2 = ""
end
f6_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_action",
helper_text = f6_local2,
side = "left",
clickable = true
} )
end
if not Sns.IsRedeemCodeDisabled() then
if not f6_local0.articleIndex and Engine.IsPS3() then
return
end
f6_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_alt1",
helper_text = Engine.Localize( "@LUA_MENU_REDEEM_CODE" ),
side = "left",
clickable = true
} )
end
end
function OnActionPressed( f7_arg0, f7_arg1 )
local f7_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f7_arg0 )
if not f7_local0.articleIndex then
return
end
DebugPrint( "Action pressed. Category: " .. f7_local0.category .. " Index: " .. f7_local0.articleIndex )
DebugPrint( "Attempting to purchase..." )
if Engine.IsXbox360() then
if f7_local0.category == StoreCategory.Crossgame then
Engine.ExecNow( "downloadSelectedOffer 0x0 " .. StoreCategory.Crossgame )
else
Engine.ExecNow( "downloadSelectedOffer " .. f7_local0.articleId .. " " .. f7_local0.category )
end
elseif Engine.IsPS3() or Engine.IsPS4() then
if f7_local0.category == StoreCategory.Crossgame and Engine.IsPS4() then
Engine.ExecNow( "crossGameSelectedOffer " .. f7_local0.articleId )
elseif f7_local0.articleInfo.purchased then
Engine.ExecNow( "downloadSelectedOffer " .. f7_local0.articleId )
else
Engine.ExecNow( "purchaseSelectedOffer " .. f7_local0.articleId )
end
elseif Engine.IsXB3() then
Engine.ExecNow( "purchaseSelectedOffer " .. f7_local0.articleIndex .. " " .. f7_local0.category )
end
end
function OnAltPressed( f8_arg0, f8_arg1 )
if Sns.IsRedeemCodeDisabled() then
return
else
local f8_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f8_arg0 )
if not f8_local0.articleIndex and Engine.IsPS3() then
return
else
Engine.Exec( "showTokenRedemptionUI" )
end
end
end
function CategoryFetchCompleted( f9_arg0, f9_arg1 )
DebugPrint( "CategoryFetchCompleted" )
local f9_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "store_main" )
local f9_local1
if f9_local0 then
f9_local1 = f9_local0.category
if not f9_local1 then
else
if f9_local1 == f9_arg1.category then
f9_arg0:processEvent( {
name = "refresh_thumbnails"
} )
elseif not Store.HasContentForCategory( f9_local1 ) then
f9_arg0:processEvent( {
name = "show_fetching_metadata"
} )
Store.FetchContentForCategory( f9_local1 )
end
end
end
f9_local1 = StoreCategory.SeasonPass
end
function ThumbnailFeeder( f10_arg0 )
local f10_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "store_main" )
local f10_local1 = f10_local0 and f10_local0.category
if not f10_local1 then
if Sns.IsSeasonPassAccessible() then
local f10_local2 = StoreCategory.SeasonPass
end
f10_local1 = f10_local2 or StoreCategory.MapPacks
end
local f10_local3 = {}
local f10_local4 = CrossGameHackData( f10_local1 )
if not f10_local4 and not Store.HasContentForCategory( f10_local1 ) then
DebugPrint( "Fetch content" )
local f10_local5 = Engine.GetLuiRoot()
f10_local5:processEvent( {
name = "show_fetching_metadata",
immediate = true
} )
Store.FetchContentForCategory( f10_local1 )
return f10_local3
end
local f10_local5 = Engine.GetLuiRoot()
f10_local5:processEvent( {
name = "hide_fetching_metadata",
immediate = true
} )
f10_local5 = Store.GetNumItemsInCategory( f10_local1 )
f10_local0.articleCount = f10_local5
for f10_local6 = 0, f10_local5 - 1, 1 do
local f10_local9 = nil
if not f10_local4 then
f10_local9 = Store.GetItemInfoByCategory( f10_local1, f10_local6 )
else
f10_local9 = {
dlcName = "s1",
id = -1,
thumb = "s1",
thumb_name = "s1"
}
end
f10_local3[#f10_local3 + 1] = {
type = "sns_thumbnail",
id = "thumbnail_" .. f10_local6,
listDefaultFocus = f10_local9.dlcName == f10_arg0.initialDlcName,
properties = {
item_id = f10_local9.id,
file_id = f10_local9.thumb,
item_index = f10_local6,
thumbName = f10_local9.thumbName
},
handlers = {
button_over = MBh.EmitEventToRoot( {
name = "change_article",
headerIndex = f10_local6,
itemId = f10_local9.id,
immediate = true
} )
}
}
end
f10_arg0.initialDlcName = ""
return f10_local3
end
function CategoryButtonFactory( f11_arg0, f11_arg1, f11_arg2, f11_arg3 )
if not Store.GetCategoryInfo( f11_arg2 ) then
return nil
else
return {
type = "store_category_button",
id = f11_arg0,
listDefaultFocus = f11_arg2 == f11_arg3,
properties = {
button_text = f11_arg1,
button_over_func = ChangeCategory,
button_action_func = OnActionPressed,
article_category = f11_arg2
}
}
end
end
function CategoryFeeder( f12_arg0 )
local f12_local0 = {}
local f12_local1 = Store.GetCategoryForDLCName( f12_arg0.initialDlcName )
if f12_local1 >= 0 then
local f12_local2 = f12_local1
end
local f12_local3 = f12_local2 or StoreCategory.SeasonPass
if Sns.IsSeasonPassAccessible() then
f12_local0[#f12_local0 + 1] = CategoryButtonFactory( "seasonpass_id", Engine.Localize( "@LUA_MENU_STORE_SEASON_PASS" ), StoreCategory.SeasonPass, f12_local3 )
end
if 1 == Engine.GetDvarInt( "igs_smappacks" ) then
f12_local0[#f12_local0 + 1] = CategoryButtonFactory( "mappacks_id", Engine.Localize( "@LUA_MENU_STORE_MAP_PACKS" ), StoreCategory.MapPacks, f12_local3 )
end
f12_local0[#f12_local0 + 1] = CategoryButtonFactory( "mappacks_id", Engine.Localize( "@LUA_MENU_STORE_MAP_PACKS" ), StoreCategory.MapPacks, f12_local3 )
f12_local0[#f12_local0 + 1] = CategoryButtonFactory( "personalization_id", Engine.Localize( "@LUA_MENU_MP_STORE_PERSONALIZATION_PACKS" ), StoreCategory.Personalization, f12_local3 )
f12_local0[#f12_local0 + 1] = CategoryButtonFactory( "customization_id", Engine.Localize( "@LUA_MENU_STORE_CUSTOMIZATION_PACKS" ), StoreCategory.Customization, f12_local3 )
f12_local0[#f12_local0 + 1] = CategoryButtonFactory( "extraslots_id", Engine.Localize( "@LUA_MENU_MP_STORE_EXTRA_SLOTS" ), StoreCategory.ExtraSlots, f12_local3 )
if 0 ~= Engine.GetDvarInt( "igs_announcer" ) then
f12_local0[#f12_local0 + 1] = CategoryButtonFactory( "voices_id", Engine.Localize( "@LUA_MENU_MP_STORE_ANNOUNCER_VOICES" ), StoreCategory.AnnouncerVoices, f12_local3 )
end
f12_local0[#f12_local0 + 1] = CategoryButtonFactory( "additional_id", Engine.Localize( "@LUA_MENU_MP_STORE_ADDITIONAL_ITEMS" ), StoreCategory.AdditionalItems, f12_local3 )
if Engine.IsXbox360() then
f12_local0[#f12_local0 + 1] = CategoryButtonFactory( "avatar_id", Engine.Localize( "@LUA_MENU_STORE_AVATAR_UNIFORM" ), StoreCategory.Avatar, f12_local3 )
end
if 1 == Engine.GetDvarInt( "igs_crossgame" ) then
f12_local0[#f12_local0 + 1] = CategoryButtonFactory( "crossgame_id", Engine.Localize( "@LUA_MENU_STORE_CROSS_GAME" ), StoreCategory.Crossgame, f12_local3 )
end
return f12_local0
end
function store_category_button()
return {
type = "UIGenericButton",
id = "store_category_button_id",
properties = {
style = GenericButtonSettings.Styles.FlatButton,
substyle = GenericButtonSettings.Styles.FlatButton.SubStyles.SubMenu,
use_locking = false,
article_category = StoreCategory.SeasonPass
},
handlers = {
update_tags = function ( f14_arg0, f14_arg1 )
local f14_local0 = Store.GetCategoryInfo( f14_arg0.properties.article_category )
assert( f14_local0 )
f14_arg0.properties.hasNew = f14_local0.hasNew
f14_arg0.properties.hasSale = f14_local0.hasSale
f14_arg0:dispatchEventToChildren( f14_arg1 )
end
},
children = {
{
type = "UIImage",
id = "store_category_button_new_image_id",
properties = {
article_category = MBh.Property( "article_category" )
},
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
left = -20,
right = 0,
top = -10,
bottom = 10,
red = 0.5,
green = 0.5,
blue = 0.5,
material = RegisterMaterial( "icon_new" ),
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
update_tags = function ( f15_arg0, f15_arg1 )
local f15_local0 = f15_arg0
local f15_local1 = f15_arg0.animateToState
local f15_local2 = f15_arg0:getParent()
f15_local1( f15_local0, f15_local2.properties.hasNew and "default" or "hidden", 0 )
end
}
},
{
type = "UIImage",
id = "store_category_button_sale_image_id",
properties = {
article_category = MBh.Property( "article_category" )
},
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
left = -20,
right = 20,
top = -10,
bottom = 10,
red = 0.5,
green = 0.5,
blue = 0.5,
material = RegisterMaterial( "icon_sale" ),
alpha = 1
},
hidden = {
alpha = 0
}
},
handlers = {
update_tags = function ( f16_arg0, f16_arg1 )
local f16_local0 = f16_arg0
local f16_local1 = f16_arg0.animateToState
local f16_local2 = f16_arg0:getParent()
f16_local1( f16_local0, f16_local2.properties.hasSale and "default" or "hidden", 0 )
end
}
}
}
}
end
function store_main()
return {
type = "UIElement",
id = "store_root",
properties = {
initialDlcName = ""
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = OnCreate,
gain_focus = nil,
update_store_helper_text = UpdateHelperText,
change_article = ChangeArticle,
store_got_metadata = CategoryFetchCompleted,
menu_close = function ( f18_arg0, f18_arg1 )
if Engine.GetDvarString( "ui_contextualMenuLocation" ) == "squad_menu" then
LUI.FlowManager.RequestRestoreMenu( f18_arg0, "menu_xboxlive", false, f18_arg1.controller, false )
end
EndAnnouncerPreviewSound( f18_arg0 )
end
,
purchase_complete = function ( f19_arg0, f19_arg1 )
Sns.UpdateScopedArticleInfo( f19_arg0 )
f19_arg0:dispatchEventToRoot( {
name = "refresh_thumbnails",
immediate = true
} )
end
},
children = {
{
type = "generic_menu_title",
properties = {
menu_title = Engine.Localize( "@LUA_MENU_STORE_CAPS" )
}
},
{
type = "UIImage",
id = "store_playstation_logo_id",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = true,
top = 49,
right = -80,
width = 128,
height = 32,
material = RegisterMaterial( "logo_playstation_store" ),
alpha = 0
},
show = {
alpha = 1
}
},
handlers = {
menu_create = function ( f20_arg0, f20_arg1 )
if Engine.IsPS3() or Engine.IsPS4() then
f20_arg0:animateToState( "show", 0 )
end
end
}
},
{
type = "sns_category_window",
id = "store_category_window_id",
properties = {
feeder = CategoryFeeder,
initialDlcName = MBh.Property( "initialDlcName" )
}
},
{
type = "sns_thumbnail_window",
id = "store_thumbnail_window_id",
properties = {
feeder = ThumbnailFeeder,
initialDlcName = MBh.Property( "initialDlcName" )
}
},
{
type = "sns_article",
id = "sns_article_id",
properties = {
additional_handlers = {
refresh_article = RefreshArticle
}
}
},
{
type = "sns_fetching_category_spinner",
id = "sns_fetching_category_spinner_id"
},
{
type = "button_helper_text_main",
id = "store_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
},
{
type = "UIBindButton",
id = "store_bind_button_id",
handlers = {
button_secondary = MBh.LeaveMenu(),
button_alt1 = OnAltPressed
}
}
}
}
end
function store_noguests_error()
return {
type = "generic_confirmation_popup",
id = "store_noguests_error_popup_id",
properties = {
popup_title = Engine.Localize( "@MENU_NOTICE" ),
message_text = Engine.Localize( "@LUA_MENU_STORE_NOGUESTACCOUNTS" )
}
}
end
function store_disabled_error()
return {
type = "generic_confirmation_popup",
id = "store_disabled_error_popup_id",
properties = {
popup_title = Engine.Localize( "@MENU_NOTICE" ),
message_text = Engine.Localize( "@LUA_MENU_STORE_RESTRICTED" )
}
}
end
LUI.MenuBuilder.registerDef( "store_main", store_main )
LUI.MenuBuilder.registerDef( "store_noguests_error", store_noguests_error )
LUI.MenuBuilder.registerDef( "store_disabled_error", store_disabled_error )
LUI.MenuBuilder.registerDef( "store_category_button", store_category_button )
LUI.FlowManager.RegisterStackPushBehaviour( "store_main", function ()
end )
LUI.FlowManager.RegisterStackPopBehaviour( "store_main", function ()
Engine.ExecNow( "decnosplitscreencontrol menu_STORE" )
end )
LockTable( _M )

View File

@@ -0,0 +1,642 @@
SvS = {
MaxSquadSize = 6,
OrderArraySize = 10,
MaxAILoadoutIndex = 5,
SquadModeDvar = "ui_squad_mode",
SquadPlaylistCategory = 5,
ShowChatRestrict = false,
PlaylistTags = {
Invalid = 0,
SquadAssault = 1,
SquadVsSquad = 2,
Safeguard = 3,
SafeguardExtended = 4,
SafeguardInfinite = 5,
Wargame1 = 6,
Wargame2 = 7,
Wargame3 = 8,
Wargame4 = 9,
Wargame5 = 10,
Wargame6 = 11,
Wargame7 = 12,
Wargame8 = 13,
DLC_Safeguard1 = 14,
DLC_Safeguard2 = 15,
DLC_Safeguard3 = 16,
DLC_Safeguard4 = 17,
DLC_Wargame1 = 18,
DLC_Wargame2 = 19,
DLC_Wargame3 = 20,
DLC_Wargame4 = 21
},
Reports = {
MaxReports = 5,
MatchOutcomeKeys = {
Victory = "Victory",
Defeat = "Defeat",
Draw = "Draw",
Forfeit = "Forfeit"
},
MatchOutcomeArray = {
"Victory",
"Defeat",
"Draw",
"Forfeit"
},
MatchOutcomeStrings = {
Victory = "LUA_MENU_REPORT_VICTORY",
Defeat = "LUA_MENU_REPORT_DEFEAT",
Draw = "LUA_MENU_REPORT_DRAW",
Forfeit = "LUA_MENU_REPORT_REASON_FORFEIT"
},
MatchOutcomeColors = {
Victory = {
textColor = {
r = 0.55,
g = 0.78,
b = 0.24
},
bgColor = {
r = 0,
g = 1,
b = 0
}
},
Defeat = {
textColor = {
r = 0.94,
g = 0.12,
b = 0.12
},
bgColor = Colors.red
},
Draw = {
textColor = Colors.window_title_text_color,
bgColor = Colors.white
},
Forfeit = {
textColor = {
r = 0.55,
g = 0.78,
b = 0.24
},
bgColor = {
r = 0,
g = 1,
b = 0
}
}
}
},
PostMatchDataCache = {
enemyPlayercard = {}
},
SquadModes = {
SquadAssault = {
ModeDvarValue = 0,
PlaylistTagValue = SvS.PlaylistTags.SquadAssault,
RequiresMatchmaking = true,
HasReports = true,
HasCompare = true,
RecordsStats = true,
DynamicMatchmaking = false,
HasLeaderboard = true
},
SquadVsSquad = {
ModeDvarValue = 4,
PlaylistTagValue = SvS.PlaylistTags.SquadVsSquad,
RequiresMatchmaking = true,
HasReports = false,
HasCompare = false,
RecordsStats = true,
DynamicMatchmaking = false,
HasLeaderboard = false
},
Safeguard = {
ModeDvarValue = 1,
PlaylistTagValue = SvS.PlaylistTags.Safeguard,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = true
},
SafeguardExtended = {
ModeDvarValue = 2,
PlaylistTagValue = SvS.PlaylistTags.SafeguardExtended,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = true
},
SafeguardInfinite = {
ModeDvarValue = 3,
PlaylistTagValue = SvS.PlaylistTags.SafeguardInfinite,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = true
},
Wargame1 = {
ModeDvarValue = 5,
PlaylistTagValue = SvS.PlaylistTags.Wargame1,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = false
},
Wargame2 = {
ModeDvarValue = 6,
PlaylistTagValue = SvS.PlaylistTags.Wargame2,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = false
},
Wargame3 = {
ModeDvarValue = 7,
PlaylistTagValue = SvS.PlaylistTags.Wargame3,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = false
},
Wargame4 = {
ModeDvarValue = 8,
PlaylistTagValue = SvS.PlaylistTags.Wargame4,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = false
},
Wargame5 = {
ModeDvarValue = 9,
PlaylistTagValue = SvS.PlaylistTags.Wargame5,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = false
},
Wargame6 = {
ModeDvarValue = 10,
PlaylistTagValue = SvS.PlaylistTags.Wargame6,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = false
},
Wargame7 = {
ModeDvarValue = 11,
PlaylistTagValue = SvS.PlaylistTags.Wargame7,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = false
},
Wargame8 = {
ModeDvarValue = 12,
PlaylistTagValue = SvS.PlaylistTags.Wargame8,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = false
},
DLC_Safeguard1 = {
ModeDvarValue = 13,
PlaylistTagValue = SvS.PlaylistTags.DLC_Safeguard1,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = true
},
DLC_Safeguard2 = {
ModeDvarValue = 14,
PlaylistTagValue = SvS.PlaylistTags.DLC_Safeguard2,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = true
},
DLC_Safeguard3 = {
ModeDvarValue = 15,
PlaylistTagValue = SvS.PlaylistTags.DLC_Safeguard3,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = true
},
DLC_Safeguard4 = {
ModeDvarValue = 16,
PlaylistTagValue = SvS.PlaylistTags.DLC_Safeguard4,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = true
},
DLC_Wargame1 = {
ModeDvarValue = 17,
PlaylistTagValue = SvS.PlaylistTags.DLC_Wargame1,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = false
},
DLC_Wargame2 = {
ModeDvarValue = 18,
PlaylistTagValue = SvS.PlaylistTags.DLC_Wargame2,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = false
},
DLC_Wargame3 = {
ModeDvarValue = 19,
PlaylistTagValue = SvS.PlaylistTags.DLC_Wargame3,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = false
},
DLC_Wargame4 = {
ModeDvarValue = 20,
PlaylistTagValue = SvS.PlaylistTags.DLC_Wargame4,
RequiresMatchmaking = false,
HasReports = false,
HasCompare = false,
RecordsStats = false,
DynamicMatchmaking = true,
HasLeaderboard = false
}
},
SquadCategories = {
{
Devname = "squad_assault",
NameLocRefCaps = "LUA_MENU_SQUAD_ASSAULT_CAPS",
DescLocRef = "LUA_MENU_SQUAD_ASSAULT_DESC",
PlayersDescLocRef = "LUA_MENU_SQUAD_ASSAULT_PLAYER_DESC",
PlayersAltDescLocRef = "",
Image = "img_squadmode_01",
Modes = {
SvS.SquadModes.SquadAssault
}
},
{
Devname = "squad_vs_squad",
NameLocRefCaps = "LUA_MENU_SQUAD_VS_SQUAD_CAPS",
DescLocRef = "LUA_MENU_SQUAD_VS_SQUAD_DESC",
PlayersDescLocRef = "LUA_MENU_SQUAD_VS_SQUAD_PLAYER_DESC",
PlayersAltDescLocRef = "",
Image = "img_squadmode_02",
Modes = {
SvS.SquadModes.SquadVsSquad
}
},
{
Devname = "safeguard",
NameLocRefCaps = "LUA_MENU_HORDE_CAPS",
DescLocRef = "LUA_MENU_SAFEGUARD_DESC",
PlayersDescLocRef = "LUA_MENU_SAFEGUARD_PLAYER_DESC",
PlayersAltDescLocRef = "LUA_MENU_SAFEGUARD_PLAYER_DESC_ALT",
Image = "img_squadmode_03",
Modes = {
SvS.SquadModes.Safeguard,
SvS.SquadModes.SafeguardExtended,
SvS.SquadModes.SafeguardInfinite
}
},
{
Devname = "wargame",
NameLocRefCaps = "LUA_MENU_WARGAME_CAPS",
DescLocRef = "LUA_MENU_WARGAME_DESC",
PlayersDescLocRef = "LUA_MENU_WARGAME_PLAYER_DESC",
PlayersAltDescLocRef = "LUA_MENU_WARGAME_PLAYER_DESC_ALT",
Image = "img_squadmode_04",
Modes = {
SvS.SquadModes.Wargame1,
SvS.SquadModes.Wargame2,
SvS.SquadModes.Wargame3,
SvS.SquadModes.Wargame4,
SvS.SquadModes.Wargame5,
SvS.SquadModes.Wargame6,
SvS.SquadModes.Wargame7,
SvS.SquadModes.Wargame8
}
}
},
SquadDLCCategories = {
{
Devname = "squads_dlc",
NameLocRefCaps = "PATCH_MENU_SQUADS_DLC_CATEGORY_CAPS",
DescLocRef = "PATCH_MENU_SQUADS_DLC_DESC",
PlayersDescLocRef = "",
PlayersAltDescLocRef = "",
Image = "img_squadmode_dlc",
Modes = {
SvS.SquadModes.DLC_Safeguard1,
SvS.SquadModes.DLC_Wargame1
}
},
{
Devname = "squads_dlc",
NameLocRefCaps = "LUA_MENU_MP_SQUADS_DLC_CATEGORY_2_CAPS",
DescLocRef = "LUA_MENU_MP_SQUADS_DLC_DESC_2",
PlayersDescLocRef = "",
PlayersAltDescLocRef = "",
Image = "img_squadmode_dlc",
Modes = {
SvS.SquadModes.DLC_Safeguard2,
SvS.SquadModes.DLC_Wargame2
}
},
{
Devname = "squads_dlc",
NameLocRefCaps = "LUA_MENU_MP_SQUADS_DLC_CATEGORY_3_CAPS",
DescLocRef = "LUA_MENU_MP_SQUADS_DLC_DESC_3",
PlayersDescLocRef = "",
PlayersAltDescLocRef = "",
Image = "img_squadmode_dlc",
Modes = {
SvS.SquadModes.DLC_Safeguard3,
SvS.SquadModes.DLC_Wargame3
}
},
{
Devname = "squads_dlc",
NameLocRefCaps = "LUA_MENU_MP_SQUADS_DLC_CATEGORY_4_CAPS",
DescLocRef = "LUA_MENU_MP_SQUADS_DLC_DESC_4",
PlayersDescLocRef = "",
PlayersAltDescLocRef = "",
Image = "img_squadmode_dlc",
Modes = {
SvS.SquadModes.DLC_Safeguard4,
SvS.SquadModes.DLC_Wargame4
}
}
},
IsSvS = function ()
return Engine.IsSquadVsSquadMode and Engine.IsSquadVsSquadMode()
end,
GetLocalPlayerBaseName = function ( f2_arg0 )
return Engine.GetPlayerDataEx( f2_arg0, CoD.StatsGroup.Ranked, "squadHQ", "squad_base" )
end,
GetBasePreviewImageSmall = function ( f3_arg0 )
return "preview_" .. f3_arg0 .. "_vote"
end,
GetBasePreviewImageLarge = function ( f4_arg0 )
return "preview_" .. f4_arg0
end,
GetSquadReportData = function ( f5_arg0, f5_arg1 )
local f5_local0 = function ( f6_arg0 )
local f6_local0 = Engine.GetPlayerDataEx( f5_arg0, CoD.StatsGroup.Ranked, "squadHQ", "reports", f6_arg0, "time" )
return f6_local0 and f6_local0 ~= 0
end
f5_arg1 = ((Engine.GetPlayerDataEx( f5_arg0, CoD.StatsGroup.Ranked, "squadHQ", "reportIndex" ) - 1) % SvS.Reports.MaxReports - f5_arg1) % SvS.Reports.MaxReports
if not f5_local0( f5_arg1 ) then
return nil
end
local f5_local1 = Engine.GetPlayerDataEx( f5_arg0, CoD.StatsGroup.Ranked, "squadHQ", "reports", f5_arg1, "time" ) or 0
local f5_local2 = Engine.GetPlayerDataEx( f5_arg0, CoD.StatsGroup.Ranked, "squadHQ", "reports", f5_arg1, "squadName" ) or ""
local f5_local3 = Engine.GetPlayerDataEx( f5_arg0, CoD.StatsGroup.Ranked, "squadHQ", "reports", f5_arg1, "enemyName" ) or ""
local f5_local4 = Engine.GetPlayerDataEx( f5_arg0, CoD.StatsGroup.Ranked, "squadHQ", "reports", f5_arg1, "your_score" ) or 0
local f5_local5 = Engine.GetPlayerDataEx( f5_arg0, CoD.StatsGroup.Ranked, "squadHQ", "reports", f5_arg1, "their_score" ) or 0
local f5_local6 = Engine.GetPlayerDataEx( f5_arg0, CoD.StatsGroup.Ranked, "squadHQ", "reports", f5_arg1, "squad_mode" ) or ""
local f5_local7 = Engine.GetPlayerDataEx( f5_arg0, CoD.StatsGroup.Ranked, "squadHQ", "reports", f5_arg1, "squad_base" ) or ""
local f5_local8 = Engine.GetPlayerDataEx( f5_arg0, CoD.StatsGroup.Ranked, "squadHQ", "reports", f5_arg1, "won_match" ) or 0
local f5_local9 = Engine.GetPlayerDataEx( f5_arg0, CoD.StatsGroup.Ranked, "squadHQ", "reports", f5_arg1, "xp" ) or 0
local f5_local10 = {
isReport = true,
reportIndex = f5_arg1
}
if f5_local1 then
local f5_local11 = Engine.GetFormattedDateTimeForEvent
local f5_local12 = Engine.GetFormattedDateTimeForEvent( f5_local1 )
end
f5_local10.timeString = f5_local11 and f5_local12 or ""
f5_local10.gametype = f5_local6
f5_local10.mapName = f5_local7
f5_local10.matchOutcome = SvS.GetReportOutcomeKeyFromPlayerdataValue( f5_local8 )
f5_local10.enemySquadName = f5_local2
f5_local10.enemyName = f5_local3
f5_local10.enemyScore = f5_local5
f5_local10.yourScore = f5_local4
if f5_local9 < 0 then
f5_local10.didEarnXP = false
f5_local10.xpString = Engine.Localize( "LUA_MENU_CHALLENGE_MATCH_CAPS" )
elseif f5_local9 == 0 then
f5_local10.didEarnXP = true
f5_local10.xpString = Engine.Localize( "LUA_MENU_XP_BONUS_CAPPED_OUT" )
else
f5_local10.didEarnXP = true
f5_local10.xpString = Engine.Localize( "LUA_MENU_XP_BONUS_EARNED", Engine.MarkLocalized( Engine.FormatTimeHoursMinutesSeconds( f5_local9 ) ) )
end
f5_local10.enemyPlayercardProps = Squad.GetReportPlayercard( f5_arg0, f5_local10.reportIndex )
if f5_local10.enemyPlayercardProps then
f5_local10.enemyPlayercardProps.gamertag = f5_local3
f5_local10.enemyPlayercardProps.clantag = Squad.GetClanTagForReport( f5_arg0, f5_local10.reportIndex )
else
f5_local10.enemyPlayercardProps = {}
f5_local10.enemyPlayercardProps.valid = false
f5_local10.enemyPlayercardProps.gamertag = f5_local3
f5_local10.enemyPlayercardProps.clantag = Squad.GetClanTagForReport( f5_arg0, f5_local10.reportIndex )
f5_local10.enemyPlayercardProps.rank = 0
f5_local10.enemyPlayercardProps.prestige = nil
f5_local10.enemyPlayercardProps.background = 0
f5_local10.enemyPlayercardProps.patchEmblem = 0
end
return f5_local10
end,
GetReportOutcomeKeyFromWinLoss = function ( f7_arg0, f7_arg1 )
local f7_local0 = nil
if f7_arg0 then
f7_local0 = SvS.Reports.MatchOutcomeKeys.Victory
elseif f7_arg1 then
f7_local0 = SvS.Reports.MatchOutcomeKeys.Defeat
else
f7_local0 = SvS.Reports.MatchOutcomeKeys.Draw
end
return f7_local0
end,
GetReportOutcomeKeyFromPlayerdataValue = function ( f8_arg0 )
local f8_local0 = assert
local f8_local1
if f8_arg0 < 0 and f8_arg0 >= #SvS.Reports.MatchOutcomeArray then
f8_local1 = false
else
f8_local1 = true
end
f8_local0( f8_local1 )
return SvS.Reports.MatchOutcomeArray[f8_arg0 + 1]
end,
GetReportOutcomeText = function ( f9_arg0 )
return Engine.Localize( SvS.Reports.MatchOutcomeStrings[f9_arg0] )
end,
BuildSquadMemberCompareData = function ( f10_arg0, f10_arg1, f10_arg2 )
if not Lobby.GetSquadMemberInfo then
return
else
local f10_local0 = Lobby.GetSquadMemberInfo( f10_arg1 - 1, f10_arg2, f10_arg0 )
f10_local0.name = f10_local0.gamertag
f10_local0.weaponIndex = f10_local0.weapon
return f10_local0
end
end,
BuildSquadCompareData = function ( f11_arg0 )
if not Squad.FoundMatch() then
return
end
local f11_local0 = {
isCompare = true,
enemySquadName = Squad.GetEnemySquadName() or ""
}
local f11_local1 = Squad.GetCompareInfoForLobby( f11_arg0 )
f11_local0.yourWins = f11_local1.friendlyWins or 0
f11_local0.yourLosses = f11_local1.friendlyLosses or 0
f11_local0.yourWinStreak = f11_local1.friendlyWinStreak or 0
f11_local0.enemyWins = f11_local1.enemyWins or 0
f11_local0.enemyLosses = f11_local1.enemyLosses or 0
f11_local0.enemyWinStreak = f11_local1.enemyWinStreak or 0
f11_local0.enemyTeam = {}
f11_local0.yourTeam = {}
for f11_local2 = 1, SvS.MaxSquadSize, 1 do
f11_local0.enemyTeam[f11_local2] = SvS.BuildSquadMemberCompareData( f11_arg0, f11_local2, true, memberInfo )
if not f11_local0.enemyTeam[f11_local2].name then
return nil
end
f11_local0.yourTeam[f11_local2] = SvS.BuildSquadMemberCompareData( f11_arg0, f11_local2, false, memberInfo )
if not f11_local0.yourTeam[f11_local2].name then
return nil
end
end
local f11_local2 = Lobby.GetSquadMemberInfo( 0, true, f11_arg0 )
f11_local0.enemyPlayercardProps = {
gamertag = f11_local2.gamertag,
clantag = f11_local2.clantag,
rank = f11_local2.rank,
prestige = f11_local2.prestige,
background = f11_local2.background,
patchEmblem = f11_local2.patch
}
return f11_local0
end,
CachePostMatchData = function ( f12_arg0 )
SvS.PostMatchDataCache = f12_arg0
end,
GetCachedPostMatchData = function ()
return SvS.PostMatchDataCache
end,
ShouldDisplayAAR = function ()
return Engine.GetClientMatchData( "alliesScore" ) ~= nil
end,
GetPlaylistFromSquadMode = function ( f15_arg0 )
local f15_local0, f15_local1 = Squad.GetSquadModePlaylist( Engine.GetFirstActiveController(), f15_arg0.PlaylistTagValue )
return f15_local0, f15_local1
end,
GetCurrentSquadModeInfo = function ()
local f16_local0 = Engine.GetDvarInt( SvS.SquadModeDvar )
for f16_local4, f16_local5 in pairs( SvS.SquadModes ) do
if f16_local5.ModeDvarValue == f16_local0 then
return f16_local5
end
end
end,
SetCurrentSquadModeInfo = function ( f17_arg0 )
Engine.SetDvarInt( SvS.SquadModeDvar, f17_arg0.ModeDvarValue )
end,
IsSquadModeDisabled = function ( f18_arg0 )
local f18_local0, f18_local1 = SvS.GetPlaylistFromSquadMode( f18_arg0 )
if f18_local0 == -1 or f18_local1 == -1 then
return true
else
return not Playlist.GetItemEnabled( f18_local0, f18_local1 )
end
end,
IsCurrentSquadModeDisabled = function ()
return SvS.IsSquadModeDisabled( SvS.GetCurrentSquadModeInfo() )
end,
GetSquadPlaylistImage = function ( f20_arg0 )
local f20_local0, f20_local1 = SvS.GetPlaylistFromSquadMode( f20_arg0.Modes[1] )
if f20_local0 == -1 or f20_local1 == -1 then
return ""
else
return Playlist.GetItemImage( f20_local0, f20_local1 )
end
end,
GetSquadPlaylistImageByMode = function ( f21_arg0 )
local f21_local0, f21_local1 = SvS.GetPlaylistFromSquadMode( f21_arg0 )
if f21_local0 == -1 or f21_local1 == -1 then
return ""
else
return Playlist.GetItemImage( f21_local0, f21_local1 )
end
end,
GetSquadCategoryDesc = function ( f22_arg0 )
return f22_arg0.DescLocRef and Engine.Localize( f22_arg0.DescLocRef ) or ""
end,
GetSquadModeDesc = function ( f23_arg0 )
local f23_local0, f23_local1 = SvS.GetPlaylistFromSquadMode( f23_arg0 )
return Engine.MarkLocalized( Playlist.GetItemDesc( f23_local0, f23_local1 ) )
end,
GetSquadModeTitleText = function ( f24_arg0 )
local f24_local0, f24_local1 = SvS.GetPlaylistFromSquadMode( f24_arg0 )
return Engine.MarkLocalized( Playlist.GetItemName( f24_local0, f24_local1 ) )
end,
GetSquadCategoryFromMode = function ( f25_arg0 )
for f25_local0 = 1, #SvS.SquadCategories, 1 do
local f25_local3 = SvS.SquadCategories[f25_local0]
for f25_local4 = 1, #f25_local3.Modes, 1 do
if f25_local3.Modes[f25_local4] == f25_arg0 then
return f25_local3
end
end
end
end,
GetSquadMemberIndexFromOrderIndex = function ( f26_arg0, f26_arg1 )
return Engine.GetPlayerDataEx( f26_arg0, CoD.StatsGroup.Ranked, "squadHQ", "aiSquadMembers", f26_arg1 ) or 0
end,
SetSquadMemberOrder = function ( f27_arg0, f27_arg1, f27_arg2 )
return Engine.SetPlayerDataEx( f27_arg0, CoD.StatsGroup.Ranked, "squadHQ", "aiSquadMembers", f27_arg1, f27_arg2 )
end,
FindSquadMemberOrderIndex = function ( f28_arg0, f28_arg1 )
for f28_local0 = 0, SvS.OrderArraySize - 1, 1 do
if Engine.GetPlayerDataEx( f28_arg0, CoD.StatsGroup.Ranked, "squadHQ", "aiSquadMembers", f28_local0 ) == f28_arg1 then
return f28_local0
end
end
end
}

View File

@@ -0,0 +1,512 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function PushSystemLinkGameSetupMenu()
Engine.SetDvarBool( "systemlink_host", true )
MatchRules.SetUsingMatchRulesData( 1 )
end
function SystemLinkStartGame( f2_arg0, f2_arg1 )
if Engine.GetDvarString( "ui_gametype" ) == "horde" then
Lobby.SetBotsConnectType( 0 )
elseif Lobby.GetBotsConnectType() == 0 then
Lobby.SetBotsConnectType( 1 )
end
local f2_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f2_arg0 )
f2_local0.startingController = f2_arg1.controller
CharacterScene.FreeCharacterScene()
local f2_local1 = LUI.mp_menus.Aliens.LobbyGetIntroVideo()
if f2_local1 and f2_local1 ~= "" and not LUI.mp_menus.Aliens.HasSeenVideo( f2_arg1.controller, f2_local1 ) then
LUI.mp_menus.Aliens.SetHasSeenVideo( f2_arg1.controller, f2_local1 )
LUI.mp_menus.Aliens.AliensPlayVideo( f2_arg1.controller, f2_local1, {
name = "start_transition_to_game",
immediate = true
} )
else
f2_arg0:dispatchEventToRoot( {
name = "start_transition_to_game",
immediate = true
} )
end
end
function StartTheGameHandler( f3_arg0, f3_arg1 )
local f3_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f3_arg0 )
Lobby.StartServer( f3_local0.startingController )
LUI.UIRoot.BlockButtonInput( Engine.GetLuiRoot(), false, "MenuTransition" )
end
function SystemLinkGameSetup( f4_arg0, f4_arg1 )
LUI.FlowManager.RequestAddMenu( f4_arg0, "gamesetup_menu_main", true, f4_arg1.controller, false )
end
function SystemLinkEditSquad( f5_arg0, f5_arg1 )
Cac.SetEditSquadMember( Cac.GetActiveSquadMember( f5_arg1.controller ) )
LUI.FlowManager.RequestAddMenu( f5_arg0, "cac_edit_main", true, f5_arg1.controller, false, {
open_char_list = true,
classLocation = "loadouts",
squadLocation = "privateMatchSquadMembers",
squadMemberIndex = Cac.GetEditSquadMember(),
allowMemberSwap = true
} )
end
function LeaveSystemLink( f6_arg0, f6_arg1 )
if Lobby.GetBotsConnectType() > 0 then
Lobby.SetBotsConnectType( 0 )
end
if MLG.AreMLGRulesEnabled() then
MLG.Toggle( f6_arg0, f6_arg1 )
end
LUI.FlowManager.RequestLeaveMenu( f6_arg0 )
end
function GameSetupCreateHandler( f7_arg0, f7_arg1 )
local f7_local0 = Engine.GetFirstActiveController()
f7_arg0:dispatchEventToRoot( LUI.ButtonHelperText.CommonEvents.addBackButton )
f7_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addGameSummaryButton )
Engine.Exec( MPConfig.default_dvars, f7_local0 )
if Engine.IsAliensMode() then
LUI.mp_menus.Aliens.AliensRunConfig( f7_local0 )
LUI.mp_menus.Aliens.InitGameTypeToAliens()
end
RefreshMLGRules( f7_arg0, f7_local0 )
MLG.Refresh( f7_arg0 )
end
function GameSetupOptionsFeeder( f8_arg0 )
local f8_local0 = Engine.IsAliensMode()
local f8_local1 = {}
if not f8_arg0.slot then
DebugPrint( "[WARNING] CAC: using cac slot index 0, this is only ok if you are editing a menu" )
local f8_local2 = 0
end
local f8_local3 = Cac.GetCustomClassLoc( f8_arg0.classLocation )
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "start_game_btn_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_START_GAME_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_DESC_START_MATCH" ),
button_action_func = SystemLinkStartGame
}
}
if not f8_local0 then
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "game_setup_btn_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_GAME_SETUP_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_DESC_GAME_SETUP" ),
button_action_func = SystemLinkGameSetup
}
}
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "create_squad_btn_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_CREATE_A_CLASS_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_DESC_CREATE_A_CLASS" ),
button_action_func = SystemLinkEditSquad,
button_over_func = TriggerUpdateRestrictionsIcon,
button_up_func = TriggerUpdateRestrictionsIcon
},
handlers = {
create_class_update_restrictions = TriggerUpdateRestrictionsIcon
},
children = {
{
type = "lobby_restriction_icon"
}
}
}
else
if LUI.mp_menus.Aliens.ExtinctionHasMapSelection() then
f8_local1[#f8_local1 + 1] = LUI.mp_menus.Aliens.MapSelectionButton()
end
if LUI.mp_menus.Aliens.ExtinctionHasModeSelection() then
f8_local1[#f8_local1 + 1] = LUI.mp_menus.Aliens.ModeSelectionButton()
end
if LUI.mp_menus.Aliens.ExtinctionHasDifficultySelection() then
f8_local1[#f8_local1 + 1] = LUI.mp_menus.Aliens.DifficultySelectionButton()
end
end
local f8_local4 = Engine.GetDvarString( "ui_gametype" )
if not f8_local0 and f8_local4 ~= "horde" then
local f8_local5 = tonumber( Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f8_local4, GameTypesTable.Cols.TeamChoice ) )
if f8_local5 and f8_local5 == 1 then
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "friendly_bot_button_id",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = GenericMenuDims.menu_right_more,
top = 0,
bottom = GenericButtonSettings.Styles.GradientButton.height
}
},
properties = {
variant = GenericButtonSettings.Variants.Select,
content_margin = 40,
content_width = 225,
text_padding_with_content = 275,
button_text = Engine.Localize( "@LUA_MENU_FRIENDLY_BOTS_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_FRIENDLY_BOTS_DESC" ),
button_display_func = FriendlyBotButtonDisplayText,
button_left_func = FriendlyBotButtonLeft,
button_right_func = FriendlyBotButtonRight,
button_over_func = MBh.EmitEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true,
immediate = true
} )
}
}
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "friendly_bots_difficulty_button_id",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = GenericMenuDims.menu_right_more,
top = 0,
bottom = GenericButtonSettings.Styles.GradientButton.height
}
},
properties = {
variant = GenericButtonSettings.Variants.Select,
content_margin = 40,
content_width = 225,
text_padding_with_content = 275,
button_text = Engine.Localize( "@LUA_MENU_BOTDIFFICULTY_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_FRIENDLY_BOTDIFFICULTY_DESC" ),
button_display_func = FriendlyBotsDifficultyButtonDisplayText,
button_left_func = FriendlyBotsDifficultyButtonLeft,
button_right_func = FriendlyBotsDifficultyButtonRight,
button_over_func = MBh.EmitEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true,
immediate = true
} )
}
}
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "enemy_bot_button_id",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = GenericMenuDims.menu_right_more,
top = 0,
bottom = GenericButtonSettings.Styles.GradientButton.height
}
},
properties = {
variant = GenericButtonSettings.Variants.Select,
content_margin = 40,
content_width = 225,
text_padding_with_content = 275,
button_text = Engine.Localize( "@LUA_MENU_ENEMY_BOTS_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_ENEMY_BOTS_DESC" ),
button_display_func = EnemyBotButtonDisplayText,
button_left_func = EnemyBotButtonLeft,
button_right_func = EnemyBotButtonRight,
button_over_func = MBh.EmitEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true,
immediate = true
} )
}
}
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "enemy_bots_difficulty_button_id",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = GenericMenuDims.menu_right_more,
top = 0,
bottom = GenericButtonSettings.Styles.GradientButton.height
}
},
properties = {
variant = GenericButtonSettings.Variants.Select,
content_margin = 40,
content_width = 225,
text_padding_with_content = 275,
button_text = Engine.Localize( "@LUA_MENU_BOTDIFFICULTY_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_ENEMY_BOTDIFFICULTY_DESC" ),
button_display_func = EnemyBotsDifficultyButtonDisplayText,
button_left_func = EnemyBotsDifficultyButtonLeft,
button_right_func = EnemyBotsDifficultyButtonRight,
button_over_func = MBh.EmitEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true,
immediate = true
} )
}
}
else
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "bot_button_id",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = GenericMenuDims.menu_right_more,
top = 0,
bottom = GenericButtonSettings.Styles.GradientButton.height
}
},
properties = {
variant = GenericButtonSettings.Variants.Select,
content_margin = 40,
content_width = 225,
text_padding_with_content = 275,
button_text = Engine.Localize( "@LUA_MENU_BOTS_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_BOTS_DESC" ),
button_display_func = FFABotButtonDisplayText,
button_left_func = FFABotButtonLeft,
button_right_func = FFABotButtonRight,
button_over_func = MBh.EmitEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true,
immediate = true
} )
}
}
f8_local1[#f8_local1 + 1] = {
type = "UIGenericButton",
id = "bots_difficulty_button_id",
states = {
default = {
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = GenericMenuDims.menu_right_more,
top = 0,
bottom = GenericButtonSettings.Styles.GradientButton.height
}
},
properties = {
variant = GenericButtonSettings.Variants.Select,
content_margin = 40,
content_width = 225,
text_padding_with_content = 275,
button_text = Engine.Localize( "@LUA_MENU_BOTDIFFICULTY_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_BOTDIFFICULTY_DESC" ),
button_display_func = FFABotsDifficultyButtonDisplayText,
button_left_func = FFABotsDifficultyButtonLeft,
button_right_func = FFABotsDifficultyButtonRight,
button_over_func = MBh.EmitEventToRoot( {
name = "lobby_slide_disable",
dispatchChildren = true,
immediate = true
} )
}
}
end
f8_local1[#f8_local1 + 1] = {
type = "UITimer",
id = "bot_button_timer_id",
properties = {
event = "bot_button_refresh",
interval = 200
}
}
end
f8_local1[#f8_local1 + 1] = {
type = "button_desc_text",
id = "systemlink_gamesetup_description_id"
}
return f8_local1
end
function menu_gamesetup_systemlink()
local f9_local0 = Engine.IsAliensMode()
return {
type = "UIElement",
id = "menu_systemlink_gamesetup_root",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = GameSetupCreateHandler,
start_transition_to_game = HandleStartTransitionToGame,
lobby_transition_complete = StartTheGameHandler,
lobby_update_timer = function ( f10_arg0, f10_arg1 )
MLG.Refresh( f10_arg0 )
end
},
children = {
{
type = "UITimer",
id = "lobby_update_timer",
properties = {
event = {
name = "lobby_update_timer"
},
disposable = false,
interval = 200
}
},
{
type = "generic_menu_title",
id = "system_link_menu_title",
properties = {
menu_title = Engine.Localize( "@PLATFORM_SYSTEM_LINK_TITLE" )
},
handlers = {
lobby_transition_to_game = MBh.AnimateToState( "hidden", Lobby.TransitionTime ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
}
},
{
type = "character_playing_as",
id = "character_playing_as_id"
},
{
type = "lobby_loading_widget"
},
{
type = "lobby_game_type_title"
},
{
type = "lobby_game_type_icon"
},
{
type = "UIVerticalList",
id = "live_systemlink_options_id",
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom,
alpha = 1
},
hidden = {
alpha = 0
}
},
childrenFeeder = GameSetupOptionsFeeder,
handlers = {
lobby_transition_to_game = MBh.AnimateToState( "hidden", Lobby.TransitionTime ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime ),
bot_button_refresh = BotButtonRefresh,
menu_create = BotButtonRefresh
}
},
{
type = "UIBindButton",
id = "lobby_bind_buttons_id",
handlers = {
button_secondary = LeaveSystemLink,
button_select = OpenAfterActionReport,
button_start = function ( f11_arg0, f11_arg1 )
MLG.Toggle( f11_arg0:getParent(), f11_arg1 )
if MatchRules.AllowCustomClasses( "loadouts" ) then
f11_arg0:dispatchEventToRoot( {
name = "create_class_update_restrictions",
controller = f11_arg1.controller
} )
end
end
}
},
{
type = "UIElement",
id = "LowerSliderID",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alpha = 1
},
hidden = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 100,
bottom = 100,
alpha = 0
}
},
handlers = {
lobby_transition_to_game = MBh.AnimateToState( "hidden", Lobby.TransitionTime ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
},
children = {
{
type = "map_info_text",
id = "map_info_text_id"
},
{
type = "button_helper_text_main",
id = "cac_button_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
}
}
}
}
}
end
LUI.MenuBuilder.registerDef( "menu_gamesetup_systemlink", menu_gamesetup_systemlink )
LUI.FlowManager.RegisterStackPushBehaviour( "menu_gamesetup_systemlink", PushSystemLinkGameSetupMenu )
LUI.FlowManager.RegisterStackPopBehaviour( "menu_gamesetup_systemlink", function ()
Engine.SetDvarBool( "systemlink_host", false )
end )
LockTable( _M )

View File

@@ -0,0 +1,429 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
DebugPrint( "Registering " .. _NAME )
GameDataColumn = {
Host = 0,
Map = 1,
Clients = 2,
Game = 3,
Ping = 4
}
COLUMN_0 = 0
COLUMN_1 = 360
COLUMN_2 = 560
COLUMN_3 = 700
function OnCreate( f1_arg0, f1_arg1 )
local f1_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f1_arg0 )
f1_local0.serverCount = 0
f1_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
f1_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_action",
helper_text = Engine.Localize( "@MENU_JOIN_GAME1" ),
side = "left",
clickable = true
} )
f1_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_alt1",
helper_text = Engine.Localize( "@MENU_SB_TOOLTIP_BTN_REFRESH" ),
side = "left",
clickable = true
} )
local f1_local1 = Lobby.BuildServerList
local f1_local2 = f1_arg1.controller
if not f1_local2 then
f1_local2 = Engine.GetFirstActiveController()
end
f1_local1( f1_local2 )
end
function JoinGame( f2_arg0, f2_arg1 )
local f2_local0 = Lobby.JoinServer
local f2_local1 = f2_arg1.controller
if not f2_local1 then
f2_local1 = Engine.GetFirstActiveController()
end
f2_local0( f2_local1, f2_arg1.idx )
end
function UpdateGameList( f3_arg0, f3_arg1 )
local f3_local0 = f3_arg1.controller
if not f3_local0 then
f3_local0 = Engine.GetFirstActiveController()
end
local f3_local1 = LUI.FlowManager.GetMenuScopedDataFromElement( f3_arg0 )
Lobby.UpdateServerDisplayList( f3_local0 )
local f3_local2 = Lobby.GetServerCount( f3_local0 )
if f3_local2 ~= f3_local1.serverCount then
f3_local1.serverCount = f3_local2
f3_arg0:processEvent( {
name = "menu_refresh",
immediate = true
} )
f3_arg0:processEvent( {
name = "gain_focus",
immediate = true
} )
end
end
function RefreshServers( f4_arg0, f4_arg1 )
local f4_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f4_arg0 )
f4_local0.serverCount = 0
if f4_local0.serverList then
local f4_local1 = Lobby.RefreshServerList
local f4_local2 = f4_arg1.controller
if not f4_local2 then
f4_local2 = Engine.GetFirstActiveController()
end
f4_local1( f4_local2 )
f4_local0.serverList:processEvent( {
name = "lose_focus",
immediate = true
} )
f4_local0.serverList:clearSavedState()
f4_local0.serverList:processEvent( {
name = "menu_refresh",
dispatchChildren = true
} )
end
end
function CreateHeaderDef()
local f5_local0 = {
type = "UIElement",
id = "header_row_id",
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 2,
left = 2,
right = -2,
height = GenericTitleBarDims.TitleBarHeight
}
}
}
local f5_local1 = {
[#f5_local1 + 1] = CreateRowBackground( Colors.generic_menu_bg_color ),
[#f5_local1 + 1] = CreateColumnShade( "column_shade_rect_id", false, COLUMN_1, COLUMN_2 ),
[#f5_local1 + 1] = CreateColumnShade( "column_shade_rect_2_id", true, COLUMN_3, -1 ),
[#f5_local1 + 1] = CreateColumnText( "host_header", Engine.Localize( "@MENU_HOST_NAME" ), true, false, COLUMN_0, COLUMN_1 ),
[#f5_local1 + 1] = CreateColumnText( "map_header", Engine.Localize( "@MENU_MAP" ), true, false, COLUMN_1, COLUMN_2 ),
[#f5_local1 + 1] = CreateColumnText( "players_header", Engine.Localize( "@MENU_NUMPLAYERS" ), true, false, COLUMN_2, COLUMN_3 ),
[#f5_local1 + 1] = CreateColumnText( "type_header", Engine.Localize( "@MENU_TYPE1" ), true, true, COLUMN_3, 0 )
}
f5_local0.children = f5_local1
return f5_local0
end
function CreateRowDef( f6_arg0, f6_arg1, f6_arg2, f6_arg3 )
local f6_local0 = {
type = "UIButton",
id = "row_" .. f6_arg1,
disabled = f6_arg2,
focusable = not f6_arg2,
properties = {
button_height = GenericButtonDims.button_height
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = MBh.Property( "button_height" ),
left = 0,
right = 0
}
},
handlers = {
button_action = MBh.EmitEventToRoot( {
name = "select_game",
idx = f6_arg1
} )
}
}
local f6_local1 = {
[#f6_local1 + 1] = CreateRowBackground( f6_arg3 ),
[#f6_local1 + 1] = CreateColumnShade( "column_shade_rect_id", false, COLUMN_1, COLUMN_2 ),
[#f6_local1 + 1] = CreateColumnShade( "column_shade_rect_2_id", true, COLUMN_3, -1 ),
[#f6_local1 + 1] = CreateColumnText( "host_text", Lobby.GetServerData( f6_arg0, f6_arg1, GameDataColumn.Host ), true, false, COLUMN_0, COLUMN_1 ),
[#f6_local1 + 1] = CreateColumnText( "map_text", Lobby.GetServerData( f6_arg0, f6_arg1, GameDataColumn.Map ), true, false, COLUMN_1, COLUMN_2 ),
[#f6_local1 + 1] = CreateColumnText( "players_text", Lobby.GetServerData( f6_arg0, f6_arg1, GameDataColumn.Clients ), true, false, COLUMN_2, COLUMN_3 ),
[#f6_local1 + 1] = CreateColumnText( "type_text", Lobby.GetServerData( f6_arg0, f6_arg1, GameDataColumn.Game ), true, true, COLUMN_3, 0 )
}
f6_local0.children = f6_local1
return f6_local0
end
function CreateRowBackground( f7_arg0 )
return {
type = "UIImage",
id = "background",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 1,
right = -1,
red = f7_arg0.r,
green = f7_arg0.g,
blue = f7_arg0.b,
material = RegisterMaterial( "white" ),
alpha = 0.05
},
over = {
material = RegisterMaterial( "btn_cas_fill_f" ),
red = 1,
green = 1,
blue = 1,
alpha = 1
}
},
handlers = {
button_over = MBh.AnimateToState( "over" ),
button_up = MBh.AnimateToState( "default" )
}
}
end
function CreateColumnShade( f8_arg0, f8_arg1, f8_arg2, f8_arg3 )
return {
type = "UIImage",
id = f8_arg0,
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = f8_arg1,
top = 0,
bottom = 0,
left = f8_arg2,
right = f8_arg3,
red = 0.05,
green = 0.05,
blue = 0.05,
alpha = 0.25,
material = RegisterMaterial( "white" )
},
over = {
alpha = 0
}
},
handlers = {
button_over = MBh.AnimateToState( "over" ),
button_up = MBh.AnimateToState( "default" )
}
}
end
function CreateColumnText( f9_arg0, f9_arg1, f9_arg2, f9_arg3, f9_arg4, f9_arg5 )
return {
type = "UIText",
id = f9_arg0,
properties = {
text = f9_arg1
},
states = {
default = {
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left,
leftAnchor = f9_arg2,
rightAnchor = f9_arg3,
topAnchor = false,
bottomAnchor = false,
left = f9_arg4 + 5,
right = f9_arg5,
top = -CoD.TextSettings.NormalFont.Height / 2,
bottom = CoD.TextSettings.NormalFont.Height / 2,
red = Colors.cac_label_text.r,
green = Colors.cac_label_text.g,
blue = Colors.cac_label_text.b,
alpha = 1
},
over = {
red = Colors.cac_focus_text.r,
green = Colors.cac_focus_text.g,
blue = Colors.cac_focus_text.b,
alpha = 1
},
disabled = {
alpha = 0
}
},
handlers = {
button_over = MBh.AnimateToState( "over" ),
button_up = MBh.AnimateToState( "default" ),
button_disable = MBh.AnimateToState( "disabled" )
}
}
end
function LinkGamesFeeder( f10_arg0 )
local f10_local0 = f10_arg0.controller
if not f10_local0 then
f10_local0 = Engine.GetFirstActiveController()
end
local f10_local1 = Lobby.GetServerCount( f10_local0 )
local f10_local2 = 16
local f10_local3 = {}
for f10_local4 = 0, f10_local2 - 1, 1 do
f10_local3[#f10_local3 + 1] = CreateRowDef( f10_local0, f10_local4, f10_local1 <= f10_local4, f10_local4 % 2 and Colors.white or Colors.black )
end
return f10_local3
end
function menu_systemlink_join()
return {
type = "UIElement",
id = "menu_systemlink_join_root",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = OnCreate,
select_game = JoinGame
},
children = {
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Swatches.Overlay.Color, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "white" ),
alpha = Swatches.Overlay.AlphaMore
} )
}
},
{
type = "UIElement",
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
left = 200,
right = -200,
height = 550
}
},
children = {
{
type = "generic_drop_shadow",
properties = {
offset_shadow = 0
}
},
{
type = "generic_menu_titlebar",
id = "menu_systemlink_join_title_id",
properties = {
fill_alpha = 1,
font = CoD.TextSettings.BoldFont,
title_bar_text = Engine.Localize( "@PLATFORM_SYSTEM_LINK_TITLE" ),
title_bar_text_indent = GenericTitleBarDims.TitleBarLCapWidth,
title_bar_alignment = LUI.Alignment.Left
}
},
{
type = "generic_menu_background",
id = "menu_systemlink_join_bg_id",
properties = {
fill_alpha = 1
},
children = {
CreateHeaderDef(),
{
type = "UIVerticalList",
id = "menu_systemlink_join_game_list_id",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = GenericTitleBarDims.TitleBarHeight + 4,
bottom = 600,
left = 2,
right = -2
}
},
childrenFeeder = LinkGamesFeeder,
handlers = {
update_game_list = UpdateGameList,
menu_create = function ( f12_arg0, f12_arg1 )
local f12_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f12_arg0 )
f12_local0.serverList = f12_arg0
RefreshServers( f12_arg0, f12_arg1 )
end
}
},
{
type = "button_helper_text_main",
id = "online_vault_helper_text_id",
properties = {
left_inset = 10,
right_inset = -10,
top_margin = GenericFooterDims.TopMargin_WithoutBackground,
height = 42,
spacing = 12,
background_alpha = 0
}
}
}
}
}
},
{
type = "UITimer",
id = "menu_systemlink_join_update_timer",
properties = {
event = "update_game_list",
interval = 250,
disposable = false,
broadcastToRoot = true
}
},
{
type = "UIBindButton",
id = "menu_systemlink_join_bind_button_id",
handlers = {
button_secondary = MBh.LeaveMenu(),
button_alt1 = RefreshServers
}
}
}
}
end
LUI.MenuBuilder.registerDef( "menu_systemlink_join", menu_systemlink_join )
LockTable( _M )

View File

@@ -0,0 +1,204 @@
local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function SystemLinkJoinGame( f1_arg0, f1_arg1 )
Cac.ValidateAllPlayersPrivateSquadMembers()
if Engine.IsConsoleGame() then
if Engine.OfflineProfileCanSave( f1_arg1.controller ) then
LUI.FlowManager.RequestPopupMenu( f1_arg0, "menu_systemlink_join", true, f1_arg1.controller, false )
else
LUI.FlowManager.RequestPopupMenu( f1_arg0, "savegame_error_mp", true, f1_arg1.controller, false, {
callback_params = {
continue_to_menu = "menu_systemlink_join"
}
} )
end
else
DebugPrint( "Menu Unsupported on PC at the moment..." )
end
end
function SystemLinkCreateGame( f2_arg0, f2_arg1 )
local f2_local0 = Engine.OfflineProfileCanSave( f2_arg1.controller )
Cac.ValidateAllPlayersPrivateSquadMembers()
if f2_local0 then
LUI.FlowManager.RequestAddMenu( f2_arg0, "menu_gamesetup_systemlink", false, f2_arg1.controller, false, {} )
else
LUI.FlowManager.RequestPopupMenu( f2_arg0, "savegame_error_mp", true, f2_arg1.controller, false, {
callback_params = {
continue_to_menu = "menu_gamesetup_systemlink"
}
} )
end
end
f0_local0 = function ( f3_arg0, f3_arg1 )
local f3_local0 = "loadouts"
Cac.ValidateAllPlayersPrivateSquadMembers()
LUI.FlowManager.RequestAddMenu( f3_arg0, "cac_member_select_main", true, f3_arg1.controller, false, {
next_screen = "cac_edit_main",
squad_location = "privateMatchSquadMembers",
class_location = f3_local0
} )
end
function SystemLinkCreateHandler( f4_arg0, f4_arg1 )
LUI.FlowManager.RequestSetStack( f4_arg0, {
{
name = "mp_main_menu"
}
} )
ConfigureResolution()
Engine.Exec( MPConfig.default_dvars )
f4_arg0:dispatchEventToRoot( LUI.ButtonHelperText.CommonEvents.addBackButton )
f4_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addGameSummaryButton )
local f4_local0 = TryForceOpenAfterActionReport( f4_arg0, f4_arg1 )
if MLG.AreMLGRulesEnabled() then
MLG.Toggle( f4_arg0, f4_arg1 )
MLG.Hide( f4_arg0 )
end
if not f4_local0 then
Engine.Exec( "SelectOfflineProfile" )
end
Engine.PLMRefreshData()
end
f0_local1 = function ( f5_arg0, f5_arg1 )
LUI.FlowManager.RequestPopupMenu( f5_arg0, "menu_ps3_profile", true, f5_arg1.controller, false )
end
f0_local2 = function ( f6_arg0, f6_arg1 )
Engine.SetDvarBool( "systemlink", false )
Engine.Exec( "forcesplitscreencontrol systemLinkExit" )
LUI.FlowManager.RequestLeaveMenu( self )
end
function SystemLinkOptionsFeeder( f7_arg0 )
local f7_local0 = Engine.IsAliensMode()
local f7_local1 = {
[#f7_local1 + 1] = {
type = "UIGenericButton",
id = "join_game_btn_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_JOIN_GAME_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_DESC_JOIN_GAME" ),
button_action_func = SystemLinkJoinGame
}
},
[#f7_local1 + 1] = {
type = "UIGenericButton",
id = "create_game_btn_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_CREATE_GAME_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_DESC_CREATE_GAME" ),
button_action_func = SystemLinkCreateGame
}
}
}
if not f7_local0 then
f7_local1[#f7_local1 + 1] = {
type = "UIGenericButton",
id = "create_squad_btn_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_CREATE_A_CLASS_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_DESC_CREATE_A_CLASS" ),
button_action_func = f0_local0
}
}
else
f7_local1[#f7_local1 + 1] = LUI.mp_menus.AliensLoadout.GetAliensLoadoutButton()
if LUI.mp_menus.Aliens.CanAccessIntelMenu() then
f7_local1[#f7_local1 + 1] = LUI.mp_menus.AliensIntel.GetAliensIntelButton()
end
end
if Engine.IsPS3() then
f7_local1[#f7_local1 + 1] = {
type = "UIGenericButton",
id = "create_offline_profile_btn_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_CHANGE_OFFLINE_PROFILE" ),
desc_text = Engine.Localize( "@LUA_MENU_CHANGE_OFFLINE_PROFILE_DESC" ),
button_action_func = f0_local1
}
}
end
f7_local1[#f7_local1 + 1] = {
type = "button_desc_text",
id = "systemlink_description_id"
}
return f7_local1
end
function menu_systemlink()
local f8_local0 = Engine.IsAliensMode()
return {
type = "UIElement",
id = "menu_systemlink_root",
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = SystemLinkCreateHandler,
open_after_action_report = OpenAfterActionReport,
open_ps3_profile_menu = f0_local1,
exit_system_link = f0_local2
},
children = {
{
type = "generic_menu_title",
id = "system_link_menu_title",
properties = {
menu_title = Engine.Localize( "@PLATFORM_SYSTEM_LINK_TITLE" )
}
},
{
type = "UIVerticalList",
id = "live_systemlink_options_id",
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom
}
},
childrenFeeder = SystemLinkOptionsFeeder
},
{
type = "UIBindButton",
id = "lobby_bind_buttons_id",
handlers = {
button_secondary = f0_local2,
button_select = OpenAfterActionReport
}
},
{
type = "button_helper_text_main",
id = "system_link_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
}
}
}
end
LUI.MenuBuilder.registerDef( "menu_systemlink", menu_systemlink )
LUI.FlowManager.RegisterStackPopBehaviour( "menu_systemlink", clearMatchData )
LockTable( _M )