2488 lines
100 KiB
Lua
2488 lines
100 KiB
Lua
local f0_local0 = module
|
|
local f0_local1, f0_local2 = ...
|
|
f0_local0( f0_local1, package.seeall )
|
|
CoD.PrintModuleLoad( _NAME )
|
|
RecapLayout = {
|
|
Width = 333,
|
|
GridH = 80.25,
|
|
GridHGutter = 4,
|
|
Height = 545,
|
|
GridVSlim = 60,
|
|
GridVTall = 80,
|
|
GridVGutter = 8,
|
|
XWhenLeft = 100,
|
|
XWhenRight = 560,
|
|
Y = 100,
|
|
LockAlpha = 0.25
|
|
}
|
|
if Engine.UsingSplitscreenUpscaling() then
|
|
RecapLayout.Width = RecapLayout.GridH * 6 + RecapLayout.GridHGutter * 5
|
|
RecapLayout.Height = RecapLayout.GridVTall * 3 + RecapLayout.GridVGutter * 2
|
|
end
|
|
f0_local0 = function ( f1_arg0, f1_arg1 )
|
|
local f1_local0 = false
|
|
if f1_arg1 then
|
|
if f1_arg0 == "infect" and not Cac.IsClassInUse( f1_arg1, Cac.GetSquadLoc(), Cac.GetActiveSquadMember( f1_arg1 ), "defaultClassesTeam" .. Game.GetPlayerTeam(), 0 ) then
|
|
f1_local0 = true
|
|
elseif f1_arg0 == "horde" or f1_arg0 == "sotf" or f1_arg0 == "sotf_ffa" or f1_arg0 == "gun" then
|
|
f1_local0 = true
|
|
end
|
|
end
|
|
return f1_local0
|
|
end
|
|
|
|
f0_local1 = function ( f2_arg0, f2_arg1, f2_arg2 )
|
|
local f2_local0 = Engine.GetDvarString( "g_gametype" )
|
|
if f0_local0( f2_local0, f2_arg2 ) then
|
|
if f2_arg1 == Cac.Indices.Weapons.Primary then
|
|
if f2_local0 == "infect" then
|
|
if Game.GetPlayerTeam() == Teams.allies then
|
|
f2_arg0 = "iw6_maul"
|
|
elseif Game.GetPlayerTeam() == Teams.axis then
|
|
f2_arg0 = "iw6_knifeonly"
|
|
end
|
|
elseif f2_local0 == "horde" then
|
|
f2_arg0 = "iw6_mp443"
|
|
elseif f2_local0 == "sotf" or f2_local0 == "sotf_ffa" then
|
|
f2_arg0 = Engine.TableLookup( HuntedWeaponsTable.File, HuntedWeaponsTable.Cols.Index, Game.GetOmnvar( "ui_sotf_pistol" ), HuntedWeaponsTable.Cols.Ref )
|
|
elseif f2_local0 == "gun" then
|
|
local f2_local1 = Game.GetOmnvar( "ui_fakeloadout_weapon1" )
|
|
if f2_local1 > -1 then
|
|
f2_arg0 = Engine.TableLookupByRow( StatsTable.File, f2_local1, StatsTable.Cols.WeaponRef )
|
|
else
|
|
f2_arg0 = "none"
|
|
end
|
|
end
|
|
else
|
|
f2_arg0 = "none"
|
|
end
|
|
end
|
|
return f2_arg0
|
|
end
|
|
|
|
f0_local2 = function ( f3_arg0, f3_arg1 )
|
|
if f0_local0( Engine.GetDvarString( "g_gametype" ), f3_arg1 ) then
|
|
f3_arg0 = "icon_weapon_ph_camo"
|
|
end
|
|
return f3_arg0
|
|
end
|
|
|
|
local f0_local3 = function ( f4_arg0, f4_arg1, f4_arg2, f4_arg3 )
|
|
local f4_local0 = Engine.GetDvarString( "g_gametype" )
|
|
if f0_local0( f4_local0, f4_arg3 ) then
|
|
if f4_local0 == "gun" and f4_arg2 == Cac.Indices.Weapons.Primary then
|
|
local f4_local1 = Game.GetOmnvar( "ui_fakeloadout_weapon1_attach" .. tostring( f4_arg1 + 1 ) )
|
|
if f4_local1 > -1 then
|
|
f4_arg0 = Engine.TableLookupByRow( AttachmentTable.File, f4_local1, AttachmentTable.Cols.BaseRef )
|
|
else
|
|
f4_arg0 = "none"
|
|
end
|
|
elseif f4_arg2 == Cac.Indices.Weapons.Primary and f4_arg1 == 0 then
|
|
if f4_local0 == "horde" then
|
|
f4_arg0 = "xmags"
|
|
elseif f4_local0 == "sotf" or f4_local0 == "sotf_ffa" or f4_local0 == "infect" then
|
|
f4_arg0 = "none"
|
|
end
|
|
else
|
|
f4_arg0 = "none"
|
|
end
|
|
end
|
|
return f4_arg0
|
|
end
|
|
|
|
local f0_local4 = function ( f5_arg0, f5_arg1 )
|
|
if f0_local0( Engine.GetDvarString( "g_gametype" ), f5_arg1 ) then
|
|
f5_arg0 = "icon_weapon_ph_primary_reticle"
|
|
end
|
|
return f5_arg0
|
|
end
|
|
|
|
local f0_local5 = function ( f6_arg0, f6_arg1, f6_arg2 )
|
|
local f6_local0 = Engine.GetDvarString( "g_gametype" )
|
|
if f0_local0( f6_local0, f6_arg2 ) then
|
|
if f6_arg1 == Cac.Indices.Grenade.Primary then
|
|
if f6_local0 == "infect" then
|
|
if Game.GetPlayerTeam() == Teams.allies then
|
|
f6_arg0 = "proximity_explosive"
|
|
elseif Game.GetPlayerTeam() == Teams.axis then
|
|
f6_arg0 = "throwingknife"
|
|
end
|
|
elseif f6_local0 == "horde" then
|
|
f6_arg0 = "proximity_explosive"
|
|
elseif f6_local0 == "sotf" or f6_local0 == "sotf_ffa" then
|
|
f6_arg0 = "throwingknife"
|
|
elseif f6_local0 == "gun" then
|
|
f6_arg0 = "none"
|
|
end
|
|
elseif f6_local0 == "infect" then
|
|
if Game.GetPlayerTeam() == Teams.allies then
|
|
f6_arg0 = "concussion_grenade"
|
|
elseif Game.GetPlayerTeam() == Teams.axis then
|
|
f6_arg0 = "none"
|
|
end
|
|
elseif f6_local0 == "horde" then
|
|
f6_arg0 = "concussion_grenade"
|
|
elseif f6_local0 == "sotf" or f6_local0 == "sotf_ffa" then
|
|
f6_arg0 = "flash_grenade"
|
|
elseif f6_local0 == "gun" then
|
|
f6_arg0 = "none"
|
|
end
|
|
end
|
|
return f6_arg0
|
|
end
|
|
|
|
local f0_local6 = function ( f7_arg0 )
|
|
local f7_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f7_arg0 )
|
|
return {
|
|
controller = f7_local0.controller,
|
|
squadLocation = f7_local0.squadLocation,
|
|
squadMemberIndex = f7_local0.memberIndex,
|
|
classLocation = f7_local0.loadoutLocation,
|
|
slot = f7_local0.loadoutSlot
|
|
}
|
|
end
|
|
|
|
local f0_local7 = function ( f8_arg0 )
|
|
local self = LUI.UIElement.new( {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
top = 0,
|
|
left = 0,
|
|
bottom = 0,
|
|
width = RecapLayout.GridHGutter
|
|
} )
|
|
local f8_local1 = LUI.UIImage.new
|
|
local f8_local2 = {
|
|
material = RegisterMaterial( "white" ),
|
|
topAnchor = f8_arg0,
|
|
bottomAnchor = not f8_arg0,
|
|
leftAnchor = true,
|
|
rightAnchor = true
|
|
}
|
|
local f8_local3
|
|
if f8_arg0 then
|
|
f8_local3 = 4
|
|
if not f8_local3 then
|
|
|
|
else
|
|
f8_local2.top = f8_local3
|
|
f8_local2.left = 1
|
|
if f8_arg0 then
|
|
f8_local3 = 16
|
|
if not f8_local3 then
|
|
|
|
else
|
|
f8_local2.bottom = f8_local3
|
|
f8_local2.right = -1
|
|
f8_local2.red = 1
|
|
f8_local2.green = 1
|
|
f8_local2.blue = 1
|
|
f8_local2.alpha = 0.1
|
|
f8_local1 = f8_local1( f8_local2 )
|
|
self:addElement( f8_local1 )
|
|
if f8_arg0 and Engine.InFrontend() then
|
|
f8_local1:registerAnimationState( "focus", {
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0.1
|
|
} )
|
|
f8_local1:registerAnimationState( "locked", CoD.ColorizeState( Colors.cac_button ) )
|
|
f8_local1:registerEventHandler( "button_over", MBh.AnimateToState( "focus" ) )
|
|
f8_local1:registerEventHandler( "button_up", MBh.AnimateToState( "default" ) )
|
|
f8_local1:registerEventHandler( "button_lock", MBh.AnimateToState( "locked" ) )
|
|
f8_local1:registerEventHandler( "button_unlock", MBh.AnimateToState( "default" ) )
|
|
end
|
|
return self
|
|
end
|
|
end
|
|
f8_local3 = 0
|
|
end
|
|
end
|
|
f8_local3 = -RecapLayout.GridVSlim
|
|
end
|
|
|
|
local f0_local8 = function ()
|
|
local self = LUI.UIElement.new( {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
left = 0,
|
|
bottom = RecapLayout.GridVGutter,
|
|
right = 0
|
|
} )
|
|
self:addElement( LUI.UIImage.new( {
|
|
material = RegisterMaterial( "white" ),
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = -1,
|
|
left = 0,
|
|
bottom = 1,
|
|
right = 0,
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0.2
|
|
} ) )
|
|
return self
|
|
end
|
|
|
|
local f0_local9 = function ( f10_arg0, f10_arg1, f10_arg2, f10_arg3, f10_arg4, f10_arg5, f10_arg6, f10_arg7 )
|
|
local f10_local0 = f10_arg7 or false
|
|
local self = LUI.UIImage.new( {
|
|
material = RegisterMaterial( "white" ),
|
|
topAnchor = false,
|
|
leftAnchor = false,
|
|
bottomAnchor = false,
|
|
rightAnchor = false,
|
|
top = f10_arg1 - f10_arg3 / 2,
|
|
left = f10_arg0 - f10_arg2 / 2,
|
|
width = f10_arg2,
|
|
height = f10_arg3,
|
|
alpha = 0
|
|
} )
|
|
self.locked = false
|
|
self:registerAnimationState( "moved", {
|
|
topAnchor = false,
|
|
leftAnchor = false,
|
|
bottomAnchor = false,
|
|
rightAnchor = false,
|
|
top = f10_arg1 - f10_arg3 / 2 - Cac.Layout.SpecialistStreak.row_offset / 2,
|
|
left = f10_arg0 - f10_arg2 / 2,
|
|
width = f10_arg2,
|
|
height = f10_arg3
|
|
} )
|
|
self:registerAnimationState( "restore_position", {
|
|
topAnchor = false,
|
|
leftAnchor = false,
|
|
bottomAnchor = false,
|
|
rightAnchor = false,
|
|
top = f10_arg1 - f10_arg3 / 2,
|
|
left = f10_arg0 - f10_arg2 / 2,
|
|
width = f10_arg2,
|
|
height = f10_arg3
|
|
} )
|
|
local f10_local2 = function ( f11_arg0, f11_arg1 )
|
|
local f11_local0 = f10_arg4( f11_arg0, f11_arg1 )
|
|
local f11_local1 = f11_local0.material
|
|
local f11_local2 = f11_local0.alpha and f11_local0.alpha or 1
|
|
local f11_local3 = f11_arg0.locked and 2.63 or 1
|
|
local f11_local4 = {
|
|
material = f11_local1,
|
|
alpha = f11_local2
|
|
}
|
|
if f11_arg0.locked then
|
|
f11_local4.alphaMultiplier = f11_local3
|
|
end
|
|
f11_arg0:registerAnimationState( "current", f11_local4 )
|
|
f11_arg0:animateToState( "current" )
|
|
end
|
|
|
|
self:registerEventHandler( "update_cac_info_panel", function ( element, event )
|
|
f10_local2( element, event )
|
|
end )
|
|
if Engine.InFrontend() then
|
|
self:registerAnimationState( "locked", CoD.ColorizeState( Colors.black, {
|
|
alphaMultiplier = 2.63
|
|
} ) )
|
|
if f10_arg5 then
|
|
if not f10_local0 then
|
|
self:registerEventHandler( "button_lock", function ( element, event )
|
|
element.locked = true
|
|
f10_local2( element, event )
|
|
element:animateToState( "locked" )
|
|
end )
|
|
end
|
|
self:registerEventHandler( "button_unlock", function ( element, event )
|
|
local f14_local0 = f10_arg4( element, event )
|
|
local f14_local1 = f14_local0.alpha and f14_local0.alpha or 1
|
|
element.locked = false
|
|
f10_local2( element, event )
|
|
element:registerAnimationState( "unlocked", CoD.ColorizeState( Colors.white, {
|
|
alpha = f14_local1
|
|
} ) )
|
|
element:animateToState( "unlocked" )
|
|
end )
|
|
if not f10_arg6 then
|
|
self:registerEventHandler( "button_over", f10_local2 )
|
|
self:registerEventHandler( "button_up", f10_local2 )
|
|
end
|
|
end
|
|
if f10_arg6 then
|
|
self:registerEventHandler( "button_over", function ( element, event )
|
|
f10_local2( element, event )
|
|
element:animateToState( "locked" )
|
|
end )
|
|
self:registerEventHandler( "button_up", function ( element, event )
|
|
local f16_local0 = f10_arg4( element, event )
|
|
local f16_local1 = f16_local0.alpha and f16_local0.alpha or 1
|
|
f10_local2( element, event )
|
|
element:registerAnimationState( "unlocked", CoD.ColorizeState( Colors.white, {
|
|
alpha = f16_local1
|
|
} ) )
|
|
element:animateToState( "unlocked" )
|
|
end )
|
|
end
|
|
end
|
|
return self
|
|
end
|
|
|
|
local f0_local10 = function ()
|
|
local f17_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "cac_edit_main" )
|
|
local f17_local1 = nil
|
|
if Engine.InFrontend() then
|
|
f17_local1 = GetCurrentGameType()
|
|
else
|
|
f17_local1 = GameX.GetGameMode()
|
|
end
|
|
if f17_local1 == "infect" and Cac.IsDefaultClass( f17_local0.classLocation ) and f17_local0.currTeam == Teams.axis then
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
local f0_local11 = function ( f18_arg0, f18_arg1, f18_arg2, f18_arg3, f18_arg4, f18_arg5, f18_arg6, f18_arg7 )
|
|
local f18_local0 = f18_arg0 * RecapLayout.GridH + math.max( 0, f18_arg0 - 1 ) * RecapLayout.GridHGutter
|
|
local f18_local1 = 4
|
|
local f18_local2 = 7
|
|
local f18_local3 = 0
|
|
if f18_arg3 then
|
|
local f18_local4, self, f18_local6, f18_local7 = GetTextDimensions( f18_arg3, CoD.TextSettings.SmallFont.Font, CoD.TextSettings.SmallFont.Height )
|
|
f18_local3 = f18_local6 - f18_local4
|
|
end
|
|
local f18_local4 = LUI.UIGenericButton.new
|
|
local self = {}
|
|
local f18_local6 = {
|
|
style = GenericButtonSettings.Styles.FlatButton,
|
|
force_disable_action_button = true,
|
|
disable_height_guard = true
|
|
}
|
|
local f18_local7
|
|
if f18_arg5 then
|
|
f18_local7 = CoD.TextSettings.NormalFont.Height
|
|
if not f18_local7 then
|
|
|
|
else
|
|
f18_local6.background_padding = f18_local7
|
|
f18_local6.disable_border = true
|
|
f18_local6.use_locking = true
|
|
f18_local6.button_action_func = function ( f19_arg0, f19_arg1 )
|
|
if f18_arg2 then
|
|
local f19_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f19_arg0 )
|
|
f19_arg0:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_alt1",
|
|
helper_text = "",
|
|
side = "left",
|
|
immediate = true,
|
|
clickable = true
|
|
} )
|
|
if f19_local0 and f19_local0.squadLocation == "squadMembers" then
|
|
f19_arg0:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_alt2",
|
|
helper_text = "",
|
|
side = "left",
|
|
immediate = true,
|
|
clickable = true
|
|
} )
|
|
end
|
|
f19_arg0:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_start",
|
|
helper_text = "",
|
|
side = "left",
|
|
immediate = true,
|
|
clickable = true
|
|
} )
|
|
f19_arg0:processEvent( {
|
|
name = "gain_focus"
|
|
} )
|
|
if f19_arg0.id ~= "edit_killstreaks" then
|
|
if f19_arg0.id == "edit_weapon_primary_camo" or f19_arg0.id == "edit_weapon_primary_reticle" then
|
|
f19_arg0:dispatchEventToRoot( {
|
|
name = "close_info_column",
|
|
immediate = true
|
|
} )
|
|
else
|
|
f19_arg0:dispatchEventToRoot( {
|
|
name = "expand_info_column",
|
|
immediate = true
|
|
} )
|
|
end
|
|
f19_arg0:dispatchEventToRoot( {
|
|
name = "hide_character_image",
|
|
immediate = true
|
|
} )
|
|
end
|
|
f18_arg2( f19_arg0, f19_arg1 )
|
|
else
|
|
Engine.PlaySound( CoD.SFX.DenySelect )
|
|
end
|
|
end
|
|
|
|
f18_local6.button_over_func = function ( f20_arg0, f20_arg1 )
|
|
local f20_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f20_arg0 )
|
|
local f20_local1 = f0_local6( f20_arg0 )
|
|
f20_local1.name = "update_selection_info"
|
|
f20_local1.selection_id = f20_arg0.id
|
|
f20_local1.weaponIndex = f20_arg0.properties.weaponIndex
|
|
f20_local1.immediate = true
|
|
f20_arg0:dispatchEventToRoot( f20_local1 )
|
|
f20_local0.selectionIDFocused = f20_arg0.id
|
|
f20_local0.weaponIndexFocused = f20_arg0.properties.weaponIndex
|
|
f20_local0.attachIndexFocused = f20_arg0.properties.attachIndex
|
|
if f20_arg0.properties.weaponIndex then
|
|
local f20_local2 = f0_local6( f20_arg0 )
|
|
f20_local2.name = "refresh_info_pane"
|
|
f20_local2.dispatchChildren = true
|
|
f20_local2.weaponIndex = f20_arg0.properties.weaponIndex
|
|
f20_local2.selection_id = f20_arg0.id
|
|
f20_local2.immediate = true
|
|
f20_arg0:dispatchEventToRoot( f20_local2 )
|
|
end
|
|
f20_arg0:processEvent( {
|
|
name = "update_restriction_icon"
|
|
} )
|
|
if MatchRules.AllowCustomClasses( f20_local0.classLocation ) then
|
|
if f20_arg0.restricted then
|
|
f20_arg0:dispatchEventToRoot( {
|
|
name = "show_class_restrictions_warning",
|
|
immediate = true
|
|
} )
|
|
else
|
|
f20_arg0:dispatchEventToRoot( {
|
|
name = "hide_class_restrictions_warning",
|
|
immediate = true
|
|
} )
|
|
end
|
|
end
|
|
f20_arg0:dispatchEventToRoot( {
|
|
name = "collapse_info_column",
|
|
immediate = true
|
|
} )
|
|
f20_arg0:dispatchEventToRoot( {
|
|
name = "show_character_image",
|
|
immediate = true
|
|
} )
|
|
end
|
|
|
|
if f18_arg4 then
|
|
f18_local7 = GenericButtonSettings.Variants.Info
|
|
if not f18_local7 then
|
|
|
|
else
|
|
f18_local6.variant = f18_local7
|
|
f18_local6.button_text = f18_arg3
|
|
f18_local6.button_display_func = f18_arg4
|
|
f18_local6.text_align_without_content = LUI.Alignment.Left
|
|
f18_local6.text_padding_without_content = f18_local1
|
|
f18_local7 = CoD.TextSettings.SmallFont.Height
|
|
local f18_local8
|
|
if f18_arg1 then
|
|
f18_local8 = RecapLayout.GridVSlim
|
|
if not f18_local8 then
|
|
|
|
else
|
|
f18_local6.y_offset = 0.5 * (f18_local7 - f18_local8)
|
|
f18_local6.text_default_color = Colors.cac_label_text
|
|
if f18_arg5 then
|
|
f18_local7 = Colors.cac_label_text
|
|
if not f18_local7 then
|
|
|
|
else
|
|
f18_local6.text_focus_color = f18_local7
|
|
if f18_arg5 then
|
|
f18_local7 = Colors.cac_label_text
|
|
if not f18_local7 then
|
|
|
|
else
|
|
f18_local6.text_lock_color = f18_local7
|
|
f18_local6.text_align_with_content = LUI.Alignment.Left
|
|
f18_local6.text_padding_with_content = f18_local1
|
|
f18_local6.label_align = LUI.Alignment.Left
|
|
f18_local6.content_margin = -(f18_local1 + f18_local3 + 2 * f18_local2 + RecapLayout.GridHGutter)
|
|
f18_local6.content_width = f18_local0
|
|
f18_local6.content_default_color = Colors.generic_button_content_focus_color
|
|
if f18_arg5 then
|
|
f18_local7 = Colors.generic_button_content_focus_color
|
|
if not f18_local7 then
|
|
|
|
else
|
|
f18_local6.content_focus_color_without_bg = f18_local7
|
|
if f18_arg5 then
|
|
f18_local7 = Colors.generic_button_content_focus_color
|
|
if not f18_local7 then
|
|
|
|
else
|
|
f18_local6.content_lock_color = f18_local7
|
|
f18_local4 = f18_local4( self, f18_local6 )
|
|
if Engine.InFrontend() then
|
|
f18_local4:registerEventHandler( "button_lock", function ( element, event )
|
|
element:dispatchEventToRoot( {
|
|
name = "lock_recap"
|
|
} )
|
|
element:animateToState( "locked" )
|
|
end )
|
|
f18_local4:addEventHandler( "restore_focus", function ( f22_arg0, f22_arg1 )
|
|
local f22_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f22_arg0 )
|
|
f22_arg0:dispatchEventToRoot( {
|
|
name = "unlock_recap"
|
|
} )
|
|
f22_arg0:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_alt1",
|
|
helper_text = Engine.Localize( "@LUA_MENU_CLEAR" ),
|
|
side = "left",
|
|
immediate = true,
|
|
clickable = true
|
|
} )
|
|
local f22_local1 = nil
|
|
if f22_local0 and f22_local0.squadLocation == "squadMembers" then
|
|
f22_arg0:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_alt2",
|
|
helper_text = Engine.Localize( "@LUA_MENU_OPERATIONS" ),
|
|
side = "left",
|
|
immediate = true,
|
|
clickable = true
|
|
} )
|
|
f22_local1 = "@LUA_MENU_MP_LB_HELPER_TEXT"
|
|
else
|
|
f22_local1 = "@LUA_MENU_MP_RANDOMIZE_LOADOUT"
|
|
end
|
|
if LUI.mp_menus.LoadoutBuilder.IsLoadoutBuilderEnabled() then
|
|
local f22_local2 = LUI.mp_menus.LoadoutBuilder.IsLoadoutBuilderButtonAnimEnabled()
|
|
f22_arg0:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_start",
|
|
helper_text = Engine.Localize( f22_local1 ),
|
|
side = "left",
|
|
immediate = true,
|
|
clickable = true,
|
|
useAnimIntro = f22_local2,
|
|
flash = f22_local2
|
|
} )
|
|
end
|
|
f22_arg0:animateToState( "default" )
|
|
end )
|
|
f18_local4:registerAnimationState( "locked", {
|
|
alphaMultiplier = 2.63
|
|
} )
|
|
if f18_arg3 == Engine.Localize( "@MENU_STRIKE_PACKAGE_CAPS" ) then
|
|
f18_local4:registerEventHandler( "cac_set_slot", function ( element, event )
|
|
local f23_local0 = f0_local10()
|
|
local f23_local1 = element
|
|
local f23_local2 = element.processEvent
|
|
local f23_local3 = {}
|
|
local f23_local4
|
|
if f23_local0 then
|
|
f23_local4 = "disable"
|
|
if not f23_local4 then
|
|
|
|
else
|
|
f23_local3.name = f23_local4
|
|
f23_local2( f23_local1, f23_local3 )
|
|
end
|
|
end
|
|
f23_local4 = "enable"
|
|
end )
|
|
end
|
|
end
|
|
f18_local4:registerAnimationState( "default", {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
top = 0,
|
|
left = 0,
|
|
bottom = 0,
|
|
right = f18_local0,
|
|
alpha = 1,
|
|
alphaMultiplier = 1
|
|
} )
|
|
f18_local4:animateToState( "default" )
|
|
if f18_arg3 and f18_arg4 then
|
|
self = f0_local7( true )
|
|
self:registerAnimationState( "default", {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
top = 0,
|
|
left = f18_local1 + f18_local3 + f18_local2,
|
|
bottom = 0,
|
|
width = RecapLayout.GridHGutter
|
|
} )
|
|
self:animateToState( "default" )
|
|
f18_local4:addElement( self )
|
|
end
|
|
if Engine.IsConsoleGame() == false and Engine.InFrontend() == false then
|
|
f18_local4.m_ignoreMouseFocus = true
|
|
end
|
|
if f18_arg6 then
|
|
self = LUI.UIImage.new( {
|
|
rightAnchor = true,
|
|
leftAnchor = false,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
right = 0,
|
|
bottom = 2,
|
|
width = 32,
|
|
height = 32,
|
|
material = RegisterMaterial( "icon_new_3" ),
|
|
alpha = 0
|
|
} )
|
|
self.id = "weapon_restriction_icon"
|
|
self:registerAnimationState( "visible", {
|
|
alpha = 1
|
|
} )
|
|
self:setPriority( 1 )
|
|
f18_local6 = function ( f24_arg0, f24_arg1 )
|
|
if f18_arg6( f24_arg0 ) then
|
|
f24_arg0:animateToState( "visible" )
|
|
f18_local4.restricted = true
|
|
else
|
|
f24_arg0:animateToState( "default" )
|
|
f18_local4.restricted = false
|
|
end
|
|
if f24_arg1.resetSelected then
|
|
if f18_local4.restricted then
|
|
f24_arg0:dispatchEventToRoot( {
|
|
name = "show_class_restrictions_warning",
|
|
immediate = true
|
|
} )
|
|
else
|
|
f24_arg0:dispatchEventToRoot( {
|
|
name = "hide_class_restrictions_warning",
|
|
immediate = true
|
|
} )
|
|
end
|
|
end
|
|
end
|
|
|
|
self:registerEventHandler( "update_cac_info_panel", f18_local6 )
|
|
self:registerEventHandler( "update_restriction_icon", f18_local6 )
|
|
f18_local4:addElement( self )
|
|
end
|
|
if f18_arg7 and Engine.InFrontend() then
|
|
self = LUI.UIImage.new( {
|
|
rightAnchor = true,
|
|
leftAnchor = false,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
right = 0,
|
|
bottom = 2,
|
|
width = 32,
|
|
height = 32,
|
|
material = RegisterMaterial( "icon_new_2" ),
|
|
alpha = 0
|
|
} )
|
|
self.id = "bnt_new_item_icon"
|
|
self:registerAnimationState( "visible", {
|
|
alpha = 1
|
|
} )
|
|
self:setPriority( 1 )
|
|
f18_local6 = function ( f25_arg0, f25_arg1 )
|
|
if f18_arg7( f25_arg0 ) then
|
|
f25_arg0:animateToState( "visible" )
|
|
else
|
|
f25_arg0:animateToState( "default" )
|
|
end
|
|
end
|
|
|
|
self:registerEventHandler( "menu_create", f18_local6 )
|
|
self:registerEventHandler( "refresh_new_icons", f18_local6 )
|
|
f18_local4:addElement( self )
|
|
end
|
|
return f18_local4
|
|
end
|
|
end
|
|
f18_local7 = Colors.cac_button
|
|
end
|
|
end
|
|
f18_local7 = nil
|
|
end
|
|
end
|
|
f18_local7 = nil
|
|
end
|
|
end
|
|
f18_local7 = nil
|
|
end
|
|
end
|
|
f18_local8 = RecapLayout.GridVTall
|
|
end
|
|
end
|
|
f18_local7 = GenericButtonSettings.Variants.Plain
|
|
end
|
|
end
|
|
f18_local7 = 0
|
|
end
|
|
|
|
local f0_local12 = function ( f26_arg0, f26_arg1, f26_arg2, f26_arg3 )
|
|
local self = LUI.UIHorizontalList.new()
|
|
if Engine.InFrontend() then
|
|
LUI.UIHorizontalList.SetNoWrap( self, true )
|
|
if f26_arg2 then
|
|
self.updateNavigation = function ( f27_arg0 )
|
|
LUI.UIHorizontalList.UpdateNavigation( f27_arg0 )
|
|
f26_arg2( f27_arg0 )
|
|
end
|
|
|
|
end
|
|
else
|
|
self.updateNavigation = function ()
|
|
|
|
end
|
|
|
|
end
|
|
self.id = "row_" .. f26_arg0
|
|
self:registerAnimationState( "default", {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
left = 0,
|
|
right = 0,
|
|
bottom = f26_arg1
|
|
} )
|
|
self:registerAnimationState( "expanded", {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
left = 0,
|
|
right = 0,
|
|
bottom = f26_arg1 + Cac.Layout.SpecialistStreak.row_offset
|
|
} )
|
|
self:animateToState( "default" )
|
|
self:makeFocusable()
|
|
for f26_local4, f26_local5 in ipairs( f26_arg3 ) do
|
|
if f26_local4 > 1 then
|
|
self:addElement( f0_local7() )
|
|
end
|
|
self:addElement( f26_local5 )
|
|
end
|
|
return self
|
|
end
|
|
|
|
local f0_local13 = function ( f29_arg0 )
|
|
local f29_local0 = {
|
|
"@MENU_PRIMARY_CAPS",
|
|
"@MENU_SECONDARY_CAPS"
|
|
}
|
|
local f29_local1 = {
|
|
3,
|
|
2
|
|
}
|
|
local f29_local2 = Engine.Localize( f29_local0[f29_arg0 + 1] )
|
|
local f29_local3 = f0_local11( f29_local1[f29_arg0 + 1], false, function ( f30_arg0, f30_arg1 )
|
|
local f30_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f30_arg0 )
|
|
local f30_local1 = f0_local6( f30_arg0 )
|
|
f30_local1.itemIndex = f29_arg0
|
|
f30_local1.titleBarText = f29_local2
|
|
local f30_local2 = Cac.GetWeaponClass( Cac.GetWeapon( f30_arg1.controller, f30_local1.squadLocation, f30_local1.squadMemberIndex, f30_local1.classLocation, f30_local1.slot, f29_arg0 ) )
|
|
local f30_local3 = Cac.GetWeapon( f30_arg1.controller, f30_local1.squadLocation, f30_local1.squadMemberIndex, f30_local1.classLocation, f30_local1.slot, f29_arg0 )
|
|
f30_local0.defaultFocus = {}
|
|
local f30_local4 = f30_local0.defaultFocus
|
|
local f30_local5 = #f30_local0.defaultFocus + 1
|
|
local f30_local6
|
|
if f30_local3 ~= "iw6_knifeonly" and f30_local2 ~= "" then
|
|
f30_local6 = f30_local2
|
|
else
|
|
f30_local6 = false
|
|
end
|
|
f30_local4[f30_local5] = f30_local6
|
|
f30_local4 = Cac.EditPopupButtonsFactory
|
|
f30_local5 = Cac.GetWeaponCategoryNameCaps
|
|
f30_local6 = Cac.EditChooseWeaponTypeAction
|
|
local f30_local7 = Cac.GetWeaponTypes( f29_arg0 == 0 )
|
|
local f30_local8 = f30_local2
|
|
local f30_local9 = Cac.GetItemClassDescriptions
|
|
local f30_local10 = nil
|
|
local f30_local11 = f30_local3
|
|
local f30_local12 = Cac.IsAbilityPickedBySlotName( f30_arg1.controller, f30_local1.squadLocation, f30_local1.squadMemberIndex, f30_local1.classLocation, f30_local1.slot, "Elite", "specialty_twoprimaries", "abilitiesPicked" )
|
|
if f30_local12 then
|
|
f30_local12 = f29_arg0 == 1
|
|
end
|
|
f30_local1.buttonFeeder = f30_local4( f30_local5, f30_local6, f30_local7, f30_local8, f30_local9, f30_local10, f30_local11, f30_local12, Cac.GetWeapon( f30_arg1.controller, f30_local1.squadLocation, f30_local1.squadMemberIndex, f30_local1.classLocation, f30_local1.slot, 1 - f29_arg0 ), "cac_edit_main" )
|
|
f30_local1.checkRestriction = function ( f31_arg0 )
|
|
if MatchRules.AllowCustomClasses( f30_local1.classLocation ) then
|
|
local f31_local0, f31_local1 = Cac.SafeGetMatchRule( "commonOption", "weaponClassRestricted", f31_arg0 )
|
|
if f31_local0 then
|
|
local f31_local2 = f31_local1
|
|
end
|
|
return f31_local2 or Cac.CheckWeaponTypeRestrictions( f31_arg0, f30_arg1.controller )
|
|
else
|
|
|
|
end
|
|
end
|
|
|
|
f30_local1.restrictType = "weaponRestricted"
|
|
f30_local1.openMenuOnClose = f30_local1
|
|
f30_local1.openMenuOnClose.menu = "cac_edit_popup_main"
|
|
LUI.FlowManager.RequestPopupMenu( element, "cac_edit_popup_main", true, f30_arg1.controller, false, f30_local1 )
|
|
end, f29_local2, function ( f32_arg0, f32_arg1 )
|
|
local f32_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f32_arg0 )
|
|
if not f32_local0.controller then
|
|
return ""
|
|
end
|
|
local f32_local1 = Cac.GetWeapon( f32_local0.controller, f32_local0.squadLocation, f32_local0.memberIndex, f32_local0.loadoutLocation, f32_local0.loadoutSlot, f29_arg0 )
|
|
if not Engine.InFrontend() then
|
|
f32_local1 = f0_local1( f32_local1, f29_arg0, f32_local0.controller )
|
|
end
|
|
return Cac.GetWeaponName( f32_local1 )
|
|
end, true, function ( f33_arg0 )
|
|
local f33_local0, f33_local1, f33_local2 = nil
|
|
local f33_local3 = LUI.FlowManager.GetMenuScopedDataFromElement( f33_arg0 )
|
|
if MatchRules.AllowCustomClasses( f33_local3.loadoutLocation ) then
|
|
local f33_local4 = Cac.GetWeapon( f33_local3.controller, f33_local3.squadLocation, f33_local3.memberIndex, f33_local3.loadoutLocation, f33_local3.loadoutSlot, f29_arg0 )
|
|
local f33_local5 = false
|
|
if f33_local4 ~= "none" and f33_local4 ~= "iw6_knifeonly" then
|
|
local f33_local6, f33_local7, f33_local8 = Cac.SafeGetMatchRule( "commonOption", "weaponClassRestricted", Cac.GetWeaponClass( f33_local4 ) )
|
|
f33_local2 = f33_local8
|
|
f33_local5 = f33_local6 and f33_local7
|
|
end
|
|
local f33_local9, f33_local6, f33_local7 = Cac.SafeGetMatchRule( "commonOption", "weaponRestricted", f33_local4 )
|
|
f33_local2 = f33_local7
|
|
return f33_local9 and f33_local6 or f33_local5
|
|
else
|
|
|
|
end
|
|
end, function ( f34_arg0 )
|
|
local f34_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f34_arg0 )
|
|
if f34_local0.exclusiveController then
|
|
if f29_arg0 == Cac.Indices.Weapons.Primary then
|
|
return Cac.AnyUnseenMDLCItems( f34_local0.exclusiveController, {
|
|
"Weapon_Primary"
|
|
} )
|
|
else
|
|
return Cac.AnyUnseenMDLCItems( f34_local0.exclusiveController, {
|
|
"Weapon_Secondary"
|
|
} )
|
|
end
|
|
else
|
|
|
|
end
|
|
end )
|
|
local f29_local4 = "edit_weapon_"
|
|
local f29_local5
|
|
if f29_arg0 == Cac.Indices.Weapons.Primary then
|
|
f29_local5 = "primary"
|
|
if not f29_local5 then
|
|
|
|
else
|
|
f29_local3.id = f29_local4 .. f29_local5
|
|
f29_local3.properties.weaponIndex = f29_arg0
|
|
f29_local3:registerEventHandler( "update_cac_info_panel", MBh.EmitEvent( "content_refresh" ) )
|
|
f29_local3:registerEventHandler( "second_primary_focus", function ( element, event )
|
|
if f29_arg0 == 1 then
|
|
element:processEvent( {
|
|
name = "gain_focus"
|
|
} )
|
|
end
|
|
end )
|
|
f29_local3:addElement( f0_local9( 0, 10, 128, 64, function ( f36_arg0, f36_arg1 )
|
|
local f36_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f29_local3 )
|
|
local f36_local1 = Cac.GetWeapon( f36_local0.controller, f36_local0.squadLocation, f36_local0.memberIndex, f36_local0.loadoutLocation, f36_local0.loadoutSlot, f29_arg0 )
|
|
if not Engine.InFrontend() then
|
|
f36_local1 = f0_local1( f36_local1, f29_arg0, f36_local0.controller )
|
|
end
|
|
local f36_local2 = Cac.GetWeaponImage( f36_local1, f29_arg0 )
|
|
if f36_local1 == "none" and (f36_arg1.name == "button_lock" or f36_arg1.name == "button_over" or f36_arg1.resetSelected == f29_local3.id) then
|
|
f36_local2 = f36_local2 .. "_black"
|
|
end
|
|
return {
|
|
material = RegisterMaterial( f36_local2 )
|
|
}
|
|
end, true ) )
|
|
if Engine.InFrontend() then
|
|
local self = LUI.UIImage.new()
|
|
self.id = "weapon_new_icon"
|
|
self:registerAnimationState( "default", {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
bottom = 2,
|
|
width = 32,
|
|
height = 32,
|
|
material = RegisterMaterial( "icon_perks_overkill" ),
|
|
red = Colors.yellow.r,
|
|
green = Colors.yellow.g,
|
|
blue = Colors.yellow.b,
|
|
alpha = 0
|
|
} )
|
|
self:registerAnimationState( "visible", {
|
|
alpha = 1
|
|
} )
|
|
self:animateToState( "default" )
|
|
self:registerEventHandler( "update_cac_info_panel", function ( element, event )
|
|
local f37_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
|
if Cac.IsAbilityPickedBySlotName( f37_local0.controller, f37_local0.squadLocation, f37_local0.memberIndex, f37_local0.loadoutLocation, f37_local0.loadoutSlot, "Elite", "specialty_twoprimaries", "abilitiesPicked" ) and Cac.IsWeaponClassSecondary( Cac.GetWeaponClass( Cac.GetWeapon( f37_local0.controller, f37_local0.squadLocation, f37_local0.memberIndex, f37_local0.loadoutLocation, f37_local0.loadoutSlot, f29_arg0 ) ), true ) and f29_arg0 == 1 then
|
|
element:animateToState( "visible" )
|
|
else
|
|
element:animateToState( "default" )
|
|
end
|
|
end )
|
|
f29_local3:addElement( self )
|
|
end
|
|
return f29_local3
|
|
end
|
|
end
|
|
f29_local5 = "secondary"
|
|
end
|
|
|
|
local f0_local14 = function ()
|
|
local f38_local0 = f0_local11( 1, true, function ( f39_arg0, f39_arg1 )
|
|
local f39_local0 = f0_local6( f39_arg0 )
|
|
local f39_local1 = Cac.GetWeapon( f39_local0.controller, f39_local0.squadLocation, f39_local0.squadMemberIndex, f39_local0.classLocation, f39_local0.slot, Cac.Indices.Weapons.Primary )
|
|
if IsPublicMatch() then
|
|
Cac.UpdateCamoGoldChallenge( f39_local0.controller, f39_local1, true )
|
|
end
|
|
f39_local0.itemIndex = Cac.Indices.Weapons.Primary
|
|
f39_local0.itemTypeString = Engine.Localize( "@LUA_MENU_CHOOSE_CAMO_CAPS" )
|
|
f39_local0.ImageFunction = Cac.GetCamoImage
|
|
f39_local0.ItemGetFunction = Cac.GetCamo
|
|
f39_local0.ItemSetFunction = Cac.SetWeaponCamo
|
|
f39_local0.itemList = Cac.GetCamoList( f39_local0.controller, f39_local1 )
|
|
f39_local0.ItemGetNameFunction = Cac.GetCamoName
|
|
f39_local0.ImageDimensions = Cac.Layout.ChooseCamoIcon
|
|
f39_local0.selection_id = "edit_weapon_primary_camo"
|
|
f39_local0.scrollBar = true
|
|
f39_local0.elementsPerRow = 5
|
|
f39_local0.customWidth = 720
|
|
LUI.FlowManager.RequestPopupMenu( f39_arg0, "cac_edit_choose_image_popup", true, f39_arg1.controller, false, f39_local0 )
|
|
end, nil, nil, true, nil, function ( f40_arg0 )
|
|
local f40_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f40_arg0 )
|
|
if f40_local0.exclusiveController then
|
|
return Cac.AnyUnseenMDLCItems( f40_local0.exclusiveController, {
|
|
"Camo"
|
|
} )
|
|
else
|
|
|
|
end
|
|
end )
|
|
f38_local0.id = "edit_weapon_primary_camo"
|
|
f38_local0.properties.weaponIndex = Cac.Indices.Weapons.Primary
|
|
f38_local0:addElement( f0_local9( 0, 10, 48, 48, function ( f41_arg0, f41_arg1 )
|
|
local f41_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f38_local0 )
|
|
local f41_local1 = Cac.GetCamo( f41_local0.controller, f41_local0.squadLocation, f41_local0.memberIndex, f41_local0.loadoutLocation, f41_local0.loadoutSlot, Cac.Indices.Weapons.Primary )
|
|
local f41_local2 = Cac.GetCamoImage( f41_local1 )
|
|
local f41_local3 = 0.8
|
|
if f41_local1 == "none" and (f41_arg1.name == "button_lock" or f41_arg1.name == "button_over" or f41_arg1.resetSelected == f38_local0.id) then
|
|
f41_local2 = f41_local2 .. "_black"
|
|
end
|
|
if not Engine.InFrontend() then
|
|
f41_local2 = f0_local2( f41_local2, f41_local0.controller )
|
|
end
|
|
return {
|
|
material = RegisterMaterial( f41_local2 ),
|
|
alpha = f41_local3
|
|
}
|
|
end, true, nil, true ) )
|
|
return f38_local0
|
|
end
|
|
|
|
local f0_local15 = function ( f42_arg0, f42_arg1 )
|
|
local f42_local0 = "edit_weapon_"
|
|
local f42_local1
|
|
if f42_arg0 then
|
|
f42_local1 = "secondary"
|
|
if not f42_local1 then
|
|
|
|
else
|
|
f42_local0 = f42_local0 .. f42_local1 .. "_attach" .. f42_arg1 + 1
|
|
if f42_arg0 then
|
|
f42_local1 = Cac.Indices.Weapons.Secondary
|
|
if not f42_local1 then
|
|
|
|
else
|
|
local f42_local2 = nil
|
|
local f42_local3 = f0_local11( 1, true, function ( f43_arg0, f43_arg1 )
|
|
local f43_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f43_arg0 )
|
|
local f43_local1 = Cac.IsAbilityPickedBySlotName( f43_local0.controller, f43_local0.squadLocation, f43_local0.memberIndex, f43_local0.loadoutLocation, f43_local0.loadoutSlot, "Equipment", "specialty_extra_attachment", "abilitiesPicked" )
|
|
if not (f42_local1 ~= Cac.Indices.Weapons.Primary or not f43_local1 and f42_arg1 >= 2) or not (f42_local1 ~= Cac.Indices.Weapons.Secondary or not f43_local1 and f42_arg1 >= 1) or f42_arg1 < #Cac.GetAttachmentTypeList( Cac.GetWeapon( f43_local0.controller, f43_local0.squadLocation, f43_local0.memberIndex, f43_local0.loadoutLocation, f43_local0.loadoutSlot, f42_local1 ) ) then
|
|
local f43_local2 = f0_local6( f43_arg0 )
|
|
f43_local2.weaponIndex = f42_local1
|
|
f43_local2.attachIndex = f42_arg1
|
|
LUI.FlowManager.RequestPopupMenu( f43_arg0, "cac_edit_weapon_attach_choose_main", true, f43_arg1.controller, false, f43_local2 )
|
|
f43_arg0:dispatchEventToRoot( {
|
|
name = "change_attachment_lock",
|
|
weaponIndex = f42_local1,
|
|
attachIndex = Cac.GetAttachmentClassInUse( f43_local0.controller, f43_local0.squadLocation, f43_local0.memberIndex, f43_local0.loadoutLocation, f43_local0.loadoutSlot, f42_local1, Cac.GetAttachmentType( Cac.GetAttachment( f43_local0.controller, f43_local0.squadLocation, f43_local0.memberIndex, f43_local0.loadoutLocation, f43_local0.loadoutSlot, f42_local1, f42_arg1 ) ) )
|
|
} )
|
|
end
|
|
end, nil, nil, f42_arg0, function ( f44_arg0 )
|
|
local f44_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f44_arg0 )
|
|
if MatchRules.AllowCustomClasses( f44_local0.loadoutLocation ) then
|
|
local f44_local1, f44_local2, f44_local3 = nil
|
|
local f44_local4 = Cac.GetAttachment( f44_local0.controller, f44_local0.squadLocation, f44_local0.memberIndex, f44_local0.loadoutLocation, f44_local0.loadoutSlot, f42_local1, f42_arg1 )
|
|
local f44_local5 = false
|
|
if f44_local4 ~= "none" then
|
|
local f44_local6, f44_local7, f44_local8 = Cac.SafeGetMatchRule( "commonOption", "attachmentClassRestricted", Cac.GetAttachmentType( f44_local4 ) )
|
|
f44_local3 = f44_local8
|
|
f44_local5 = f44_local6 and f44_local7
|
|
end
|
|
local f44_local9, f44_local6, f44_local7 = Cac.SafeGetMatchRule( "commonOption", "attachmentRestricted", f44_local4 )
|
|
f44_local3 = f44_local7
|
|
return f44_local9 and f44_local6 or f44_local5
|
|
else
|
|
|
|
end
|
|
end )
|
|
f42_local3.id = f42_local0
|
|
f42_local3.properties = f42_local3.properties or {}
|
|
f42_local3.properties.weaponIndex = f42_local1
|
|
f42_local3.properties.attachIndex = f42_arg1
|
|
f42_local3.properties.secondaryActionFunc = f42_local3.m_eventHandlers.button_action
|
|
f42_local3:addEventHandler( "gain_focus", function ( f45_arg0, f45_arg1 )
|
|
local f45_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f45_arg0 )
|
|
local f45_local1 = Cac.GetWeapon( f45_local0.controller, f45_local0.squadLocation, f45_local0.squadMemberIndex, f45_local0.classLocation, f45_local0.slot, f42_local1 )
|
|
local f45_local2 = Cac.GetWeaponClass( f45_local1 )
|
|
local f45_local3 = Cac.IsAbilityPickedBySlotName( f45_local0.controller, f45_local0.squadLocation, f45_local0.memberIndex, f45_local0.loadoutLocation, f45_local0.loadoutSlot, "Equipment", "specialty_extra_attachment", "abilitiesPicked" )
|
|
if not (f45_local2 ~= "weapon_projectile" and f45_local1 ~= "none" and f45_local1 ~= "iw6_knifeonly" and (f45_local3 or f42_arg1 <= 1 or f42_local1 ~= 0)) or not (f45_local3 or f42_arg1 <= 0 or f42_local1 ~= 1) or #Cac.GetAttachmentTypeList( f45_local1 ) <= f42_arg1 then
|
|
f45_arg0.m_eventHandlers.button_action = function ( f46_arg0, f46_arg1 )
|
|
Engine.PlaySound( CoD.SFX.DenySelect )
|
|
end
|
|
|
|
else
|
|
f45_arg0.m_eventHandlers.button_action = f42_local3.properties.secondaryActionFunc
|
|
end
|
|
end )
|
|
f42_local3:registerEventHandler( "update_cac_info_panel", function ( element, event )
|
|
if Engine.InFrontend() then
|
|
local f47_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
|
if event.grenadeConflict then
|
|
f47_local0.attachConflict = false
|
|
end
|
|
local f47_local1 = Cac.IsAbilityPickedBySlotName( f47_local0.controller, f47_local0.squadLocation, f47_local0.memberIndex, f47_local0.loadoutLocation, f47_local0.loadoutSlot, "Equipment", "specialty_extra_attachment", "abilitiesPicked" )
|
|
if not (f42_local1 ~= Cac.Indices.Weapons.Primary or not f47_local1 and f42_arg1 >= 2) or f42_local1 == Cac.Indices.Weapons.Secondary and (f47_local1 or f42_arg1 < 1) then
|
|
local f47_local2 = Cac.GetAttachment( f47_local0.controller, f47_local0.squadLocation, f47_local0.memberIndex, f47_local0.loadoutLocation, f47_local0.loadoutSlot, f42_local1, f42_arg1 )
|
|
if event.grenadeConflict then
|
|
if f47_local2 == "shotgun" or f47_local2 == "gl" then
|
|
Cac.SetAttachment( f47_local0.controller, f47_local0.squadLocation, f47_local0.memberIndex, f47_local0.loadoutLocation, f47_local0.loadoutSlot, f42_local1, f42_arg1, "none" )
|
|
f47_local2 = "none"
|
|
element:dispatchEventToRoot( {
|
|
name = "update_restriction_icon"
|
|
} )
|
|
end
|
|
elseif f47_local2 == "shotgun" or f47_local2 == "gl" then
|
|
f47_local0.attachConflict = true
|
|
elseif f47_local0.attachConflict then
|
|
Cac.SetFirstUnlockedGrenade( f47_local0.controller, f47_local0.squadLocation, f47_local0.memberIndex, f47_local0.loadoutLocation, f47_local0.loadoutSlot, 0 )
|
|
end
|
|
end
|
|
end
|
|
end )
|
|
f42_local3:registerEventHandler( "third_attach_focus", function ( element, event )
|
|
if f42_arg1 == 2 then
|
|
element:processEvent( {
|
|
name = "gain_focus"
|
|
} )
|
|
end
|
|
end )
|
|
f42_local3:registerEventHandler( "change_attachment_lock", function ( element, event )
|
|
local f49_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
|
local f49_local1 = Cac.GetFirstOpenAttachment( f49_local0.controller, f49_local0.squadLocation, f49_local0.memberIndex, f49_local0.loadoutLocation, f49_local0.loadoutSlot, f42_local1 )
|
|
if event.attachIndex then
|
|
if event.attachIndex == f42_arg1 and event.weaponIndex == element.properties.weaponIndex then
|
|
element:processEvent( {
|
|
name = "button_lock",
|
|
dispatchChildren = true
|
|
} )
|
|
else
|
|
element:animateToState( "default" )
|
|
element:processEvent( {
|
|
name = "button_unlock",
|
|
graphicsOnly = true
|
|
} )
|
|
end
|
|
elseif f49_local1 == f42_arg1 and event.weaponIndex == element.properties.weaponIndex then
|
|
element:processEvent( {
|
|
name = "button_lock",
|
|
dispatchChildren = true
|
|
} )
|
|
else
|
|
element:animateToState( "default" )
|
|
element:processEvent( {
|
|
name = "button_unlock",
|
|
graphicsOnly = true
|
|
} )
|
|
end
|
|
end )
|
|
f42_local3:registerEventHandler( "unlock_attachments", function ( element, event )
|
|
element:processEvent( {
|
|
name = "button_unlock"
|
|
} )
|
|
end )
|
|
local f42_local4 = function ( f51_arg0, f51_arg1 )
|
|
local f51_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f42_local3 )
|
|
local f51_local1 = nil
|
|
local f51_local2 = 1
|
|
local f51_local3
|
|
if Engine.InFrontend() or Engine.GetDvarString( "g_gametype" ) ~= gun then
|
|
f51_local3 = false
|
|
else
|
|
f51_local3 = true
|
|
end
|
|
local f51_local4 = f51_local3 or Cac.IsAbilityPickedBySlotName( f51_local0.controller, f51_local0.squadLocation, f51_local0.memberIndex, f51_local0.loadoutLocation, f51_local0.loadoutSlot, "Equipment", "specialty_extra_attachment", "abilitiesPicked" )
|
|
if not (f51_local4 or f42_arg1 <= 1 or f42_local1 ~= 0) or not f51_local4 and f42_arg1 > 0 and f42_local1 == 1 then
|
|
f51_local1 = "icon_locked"
|
|
f51_local2 = 0.07
|
|
if f51_arg1.name == "button_lock" or f51_arg1.name == "button_over" or f51_arg1.resetSelected == f42_local3.id then
|
|
f51_local1 = "icon_locked_black"
|
|
f51_local2 = 1
|
|
end
|
|
else
|
|
local f51_local5 = Cac.GetAttachment( f51_local0.controller, f51_local0.squadLocation, f51_local0.memberIndex, f51_local0.loadoutLocation, f51_local0.loadoutSlot, f42_local1, f42_arg1 )
|
|
local f51_local6 = Cac.GetWeapon( f51_local0.controller, f51_local0.squadLocation, f51_local0.memberIndex, f51_local0.loadoutLocation, f51_local0.loadoutSlot, f42_local1 )
|
|
local f51_local7 = Cac.GetWeaponClass( f51_local6 )
|
|
if not Engine.InFrontend() then
|
|
f51_local5 = f0_local3( f51_local5, f42_arg1, f42_local1, f51_local0.controller )
|
|
end
|
|
f51_local1 = Cac.GetAttachmentImage( f51_local5, f51_local6, f42_local1, f42_arg1 + 1 )
|
|
if not (f51_local7 ~= "weapon_projectile" and f51_local6 ~= "none" and f51_local6 ~= "iw6_knifeonly" and (f51_local4 or f42_arg1 <= 1 or f42_local1 ~= 0)) or not (f51_local4 or f42_arg1 <= 0 or f42_local1 ~= 1) or #Cac.GetAttachmentTypeList( f51_local6 ) <= f42_arg1 then
|
|
f51_local1 = "icon_locked"
|
|
f51_local2 = 0.07
|
|
if f51_arg1.name == "button_lock" or f51_arg1.name == "button_over" or f51_arg1.resetSelected == f42_local3.id then
|
|
f51_local1 = "icon_locked_black"
|
|
f51_local2 = 1
|
|
end
|
|
elseif f51_local5 == "none" then
|
|
local f51_local8 = f51_arg0:getParent()
|
|
if f51_arg1.name == "button_lock" or f51_arg1.name == "button_over" or f51_arg1.resetSelected == f42_local3.id or f51_arg1.name == "update_cac_info_panel" and (f51_arg0.locked or f51_local8:isInFocus()) then
|
|
f51_local1 = f51_local1 .. "_black"
|
|
f51_local2 = 1
|
|
else
|
|
f51_local2 = 0.07
|
|
end
|
|
end
|
|
end
|
|
return {
|
|
material = RegisterMaterial( f51_local1 ),
|
|
alpha = f51_local2
|
|
}
|
|
end
|
|
|
|
local f42_local5
|
|
if f42_arg0 then
|
|
f42_local5 = 10
|
|
if not f42_local5 then
|
|
|
|
else
|
|
f42_local3:addElement( f0_local9( 0, f42_local5, 48, 48, f42_local4, true ) )
|
|
if Engine.InFrontend() then
|
|
local self = LUI.UIImage.new()
|
|
self.id = "attachment_new_icon"
|
|
self:registerAnimationState( "default", {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
bottom = 2,
|
|
width = 32,
|
|
height = 32,
|
|
material = RegisterMaterial( "icon_perks_extra_attach" ),
|
|
red = Colors.yellow.r,
|
|
green = Colors.yellow.g,
|
|
blue = Colors.yellow.b,
|
|
alpha = 0
|
|
} )
|
|
self:registerAnimationState( "visible", {
|
|
alpha = 1
|
|
} )
|
|
self:animateToState( "default" )
|
|
self:registerEventHandler( "update_cac_info_panel", function ( element, event )
|
|
local f52_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
|
local f52_local1 = Cac.IsAbilityPickedBySlotName( f52_local0.controller, f52_local0.squadLocation, f52_local0.memberIndex, f52_local0.loadoutLocation, f52_local0.loadoutSlot, "Equipment", "specialty_extra_attachment", "abilitiesPicked" )
|
|
if (not (not f52_local1 or f42_arg1 <= 1 or f42_local1 ~= 0) or f52_local1 and f42_arg1 > 0 and f42_local1 == 1) and Cac.GetAttachment( f52_local0.controller, f52_local0.squadLocation, f52_local0.memberIndex, f52_local0.loadoutLocation, f52_local0.loadoutSlot, f42_local1, f42_arg1 ) == "none" then
|
|
element:animateToState( "visible" )
|
|
else
|
|
element:animateToState( "default" )
|
|
end
|
|
end )
|
|
f42_local3:addElement( self )
|
|
end
|
|
return f42_local3
|
|
end
|
|
end
|
|
f42_local5 = 0
|
|
end
|
|
end
|
|
f42_local1 = Cac.Indices.Weapons.Primary
|
|
end
|
|
end
|
|
f42_local1 = "primary"
|
|
end
|
|
|
|
local f0_local16 = function ()
|
|
local f53_local0 = f0_local11( 1, true, function ( f54_arg0, f54_arg1 )
|
|
local f54_local0 = f0_local6( f54_arg0 )
|
|
f54_local0.itemIndex = Cac.Indices.Weapons.Primary
|
|
f54_local0.itemList = Cac.GetReticleList( f54_local0.controller, Cac.GetAttachmentWithReticles( f54_local0.controller, f54_local0.squadLocation, f54_local0.squadMemberIndex, f54_local0.classLocation, f54_local0.slot, f54_local0.itemIndex ) )
|
|
f54_local0.itemTypeString = Engine.Localize( "@LUA_MENU_CHOOSE_RETICLE_CAPS" )
|
|
f54_local0.ImageFunction = Cac.GetReticleImage
|
|
f54_local0.ItemGetFunction = Cac.GetReticle
|
|
f54_local0.ItemSetFunction = Cac.SetWeaponReticle
|
|
f54_local0.ItemGetNameFunction = Cac.GetReticleName
|
|
f54_local0.ImageDimensions = Cac.Layout.ChooseReticleIcon
|
|
f54_local0.selection_id = "edit_weapon_primary_reticle"
|
|
f54_local0.scrollBar = true
|
|
f54_local0.elementsPerRow = 5
|
|
f54_local0.customWidth = 720
|
|
LUI.FlowManager.RequestPopupMenu( f54_arg0, "cac_edit_choose_image_popup", true, f54_arg1.controller, false, f54_local0 )
|
|
end )
|
|
f53_local0.id = "edit_weapon_primary_reticle"
|
|
f53_local0.properties.weaponIndex = Cac.Indices.Weapons.Primary
|
|
f53_local0.properties.secondaryActionFunc = f53_local0.m_eventHandlers.button_action
|
|
f53_local0:addEventHandler( "gain_focus", function ( f55_arg0, f55_arg1 )
|
|
local f55_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f55_arg0 )
|
|
if Cac.GetWeapon( f55_local0.controller, f55_local0.squadLocation, f55_local0.squadMemberIndex, f55_local0.classLocation, f55_local0.slot, Cac.Indices.Weapons.Primary ) == "iw6_knifeonly" then
|
|
f55_arg0.m_eventHandlers.button_action = function ( f56_arg0, f56_arg1 )
|
|
Engine.PlaySound( CoD.SFX.DenySelect )
|
|
end
|
|
|
|
else
|
|
f55_arg0.m_eventHandlers.button_action = f53_local0.properties.secondaryActionFunc
|
|
end
|
|
end )
|
|
f53_local0:addElement( f0_local9( 0, 0, 48, 48, function ( f57_arg0, f57_arg1 )
|
|
local f57_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f53_local0 )
|
|
local f57_local1 = Cac.GetReticle( f57_local0.controller, f57_local0.squadLocation, f57_local0.memberIndex, f57_local0.loadoutLocation, f57_local0.loadoutSlot, Cac.Indices.Weapons.Primary )
|
|
local f57_local2 = Cac.GetReticleImage( f57_local1 )
|
|
local f57_local3 = Cac.GetWeapon( f57_local0.controller, f57_local0.squadLocation, f57_local0.memberIndex, f57_local0.loadoutLocation, f57_local0.loadoutSlot, Cac.Indices.Weapons.Primary )
|
|
local f57_local4 = 1
|
|
if f57_local3 == "iw6_knifeonly" then
|
|
f57_local2 = "icon_locked"
|
|
f57_local4 = 0.07
|
|
if f57_arg1.name == "button_lock" or f57_arg1.name == "button_over" or f57_arg1.resetSelected == f53_local0.id then
|
|
f57_local2 = "icon_locked_black"
|
|
f57_local4 = 1
|
|
end
|
|
elseif f57_local1 == "none" and (f57_arg1.name == "button_lock" or f57_arg1.name == "button_over" or f57_arg1.resetSelected == f53_local0.id) then
|
|
f57_local2 = f57_local2 .. "_black"
|
|
end
|
|
if not Engine.InFrontend() then
|
|
f57_local2 = f0_local4( f57_local2, f57_local0.controller )
|
|
end
|
|
return {
|
|
material = RegisterMaterial( f57_local2 ),
|
|
alpha = f57_local4
|
|
}
|
|
end, true ) )
|
|
return f53_local0
|
|
end
|
|
|
|
local f0_local17 = function ( f58_arg0 )
|
|
local f58_local0 = function ( f59_arg0, f59_arg1 )
|
|
local f59_local0 = f0_local6( f59_arg0 )
|
|
f59_local0.itemIndex = f58_arg0
|
|
f59_local0.itemTypeString = f58_arg0 and Engine.Localize( "@MENU_LETHAL_CAPS" ) or Engine.Localize( "@LUA_MENU_TACTICAL_CAPS" )
|
|
f59_local0.disableSetDefaultFocus = false
|
|
f59_local0.selection_id = f58_arg0 and "edit_lethal" or "edit_tactical"
|
|
f59_local0.ImageFunction = Cac.GetGrenadeImage
|
|
f59_local0.ItemGetFunction = Cac.GetPerk
|
|
f59_local0.ItemSetFunction = Cac.SetPerk
|
|
f59_local0.itemList = Cac.GetGrenadeList( f58_arg0 )
|
|
f59_local0.ItemGetNameFunction = Cac.GetPerkName
|
|
f59_local0.ImageDimensions = Cac.Layout.ChooseGrenadeIcon
|
|
f59_local0.restrictType = "perkRestricted"
|
|
LUI.FlowManager.RequestPopupMenu( f59_arg0, "cac_edit_choose_image_popup", true, f59_arg1.controller, false, f59_local0 )
|
|
end
|
|
|
|
local f58_local1 = {
|
|
"@MENU_LETHAL_CAPS",
|
|
"@MENU_SPECIAL_EQUIPMENT_CAPS"
|
|
}
|
|
local f58_local2 = {
|
|
Cac.GetPrimaryGrenade,
|
|
Cac.GetSecondaryGrenade
|
|
}
|
|
local f58_local3 = f0_local11( 2, true, f58_local0, Engine.Localize( f58_local1[f58_arg0 + 1] ), nil, nil, function ( f60_arg0 )
|
|
local f60_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f60_arg0 )
|
|
if MatchRules.AllowCustomClasses( f60_local0.loadoutLocation ) then
|
|
local f60_local1, f60_local2, f60_local3 = Cac.SafeGetMatchRule( "commonOption", "perkRestricted", Cac.GetPerk( f60_local0.controller, f60_local0.squadLocation, f60_local0.memberIndex, f60_local0.loadoutLocation, f60_local0.loadoutSlot, f58_arg0 ) )
|
|
local f60_local4 = f60_local1 and f60_local2
|
|
local f60_local5 = false
|
|
if f58_arg0 == 0 then
|
|
for f60_local14, f60_local15 in pairs( Cac.Indices.Weapons ) do
|
|
local f60_local9
|
|
if f60_local15 == Cac.Indices.Weapons.Primary then
|
|
f60_local9 = 2
|
|
if not f60_local9 then
|
|
|
|
else
|
|
for f60_local10 = 0, f60_local9, 1 do
|
|
local f60_local13 = Cac.GetAttachment( f60_local0.controller, f60_local0.squadLocation, f60_local0.memberIndex, f60_local0.loadoutLocation, f60_local0.loadoutSlot, f60_local15, f60_local10 )
|
|
if f60_local13 == "shotgun" or f60_local13 == "gl" then
|
|
f60_local1, f60_local2 = Cac.SafeGetMatchRule( "commonOption", "attachmentClassRestricted", "undermount" )
|
|
if not f60_local5 then
|
|
f60_local5 = f60_local1 and f60_local2
|
|
end
|
|
f60_local1, f60_local2 = Cac.SafeGetMatchRule( "commonOption", "attachmentRestricted", f60_local13 )
|
|
if not f60_local5 then
|
|
f60_local5 = f60_local1 and f60_local2
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
f60_local9 = 1
|
|
end
|
|
end
|
|
return f60_local4 or f60_local5
|
|
else
|
|
|
|
end
|
|
end )
|
|
local f58_local4 = "edit_"
|
|
local f58_local5
|
|
if f58_arg0 == 0 then
|
|
f58_local5 = "lethal"
|
|
if not f58_local5 then
|
|
|
|
else
|
|
f58_local3.id = f58_local4 .. f58_local5
|
|
f58_local3.properties.weaponIndex = f58_arg0
|
|
f58_local3:registerEventHandler( "update_cac_info_panel", function ( element, event )
|
|
if Engine.InFrontend() then
|
|
local f61_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f58_local3 )
|
|
if event.attachConflict then
|
|
f61_local0.attachConflict = event.attachConflict
|
|
end
|
|
if f58_arg0 == 0 and f61_local0.attachConflict then
|
|
for f61_local1 = 0, 2, 1 do
|
|
local f61_local4 = Cac.GetAttachment( f61_local0.controller, f61_local0.squadLocation, f61_local0.memberIndex, f61_local0.loadoutLocation, f61_local0.loadoutSlot, 0, f61_local1 )
|
|
if f61_local4 == "shotgun" or f61_local4 == "gl" then
|
|
Cac.SetPerk( f61_local0.controller, f61_local0.squadLocation, f61_local0.memberIndex, f61_local0.loadoutLocation, f61_local0.loadoutSlot, 0, "specialty_null" )
|
|
break
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end )
|
|
f58_local3:addElement( f0_local9( 0, 8, 40, 40, function ( f62_arg0, f62_arg1 )
|
|
local f62_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f58_local3 )
|
|
local f62_local1 = f58_local2[f58_arg0 + 1]( f62_local0.controller, f62_local0.squadLocation, f62_local0.memberIndex, f62_local0.loadoutLocation, f62_local0.loadoutSlot, f58_arg0 )
|
|
local f62_local2 = nil
|
|
local f62_local3 = Engine.GetDvarString( "g_gametype" )
|
|
if f58_arg0 == 0 then
|
|
for f62_local12, f62_local13 in pairs( Cac.Indices.Weapons ) do
|
|
local f62_local7
|
|
if f62_local13 == Cac.Indices.Weapons.Primary then
|
|
f62_local7 = 2
|
|
if not f62_local7 then
|
|
|
|
else
|
|
for f62_local8 = 0, f62_local7, 1 do
|
|
local f62_local11 = Cac.GetAttachment( f62_local0.controller, f62_local0.squadLocation, f62_local0.memberIndex, f62_local0.loadoutLocation, f62_local0.loadoutSlot, f62_local13, f62_local8 )
|
|
if f62_local11 == "shotgun" or f62_local11 == "gl" then
|
|
f62_local2 = Cac.GetAttachmentImage( f62_local11, Cac.GetWeapon( f62_local0.controller, f62_local0.squadLocation, f62_local0.memberIndex, f62_local0.loadoutLocation, f62_local0.loadoutSlot, f62_local13 ), f62_local13, f62_local8 )
|
|
break
|
|
end
|
|
end
|
|
if f62_local2 then
|
|
|
|
end
|
|
end
|
|
end
|
|
f62_local7 = 1
|
|
end
|
|
end
|
|
if not Engine.InFrontend() then
|
|
if f0_local0( f62_local3, f62_local0.controller ) then
|
|
f62_local2 = nil
|
|
end
|
|
f62_local1 = f0_local5( f62_local1, f58_arg0, f62_local0.controller )
|
|
end
|
|
if not f62_local2 then
|
|
f62_local2 = Cac.GetGrenadeImage( Cac.StripSuffix( f62_local1, "_mp" ), f58_arg0 )
|
|
if f62_local1 == "specialty_null" and (f62_arg1.name == "button_lock" or f62_arg1.name == "button_over" or f62_arg1.resetSelected == f58_local3.id) then
|
|
f62_local2 = f62_local2 .. "_black"
|
|
end
|
|
end
|
|
return {
|
|
material = RegisterMaterial( f62_local2 )
|
|
}
|
|
end, true ) )
|
|
if Engine.InFrontend() then
|
|
local self = LUI.UIImage.new()
|
|
self.id = "grenade_new_icon_" .. f58_arg0
|
|
local f58_local7 = self
|
|
local f58_local8 = self.registerAnimationState
|
|
local f58_local9 = "default"
|
|
local f58_local10 = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
bottom = 2,
|
|
width = 32,
|
|
height = 32
|
|
}
|
|
local f58_local11
|
|
if f58_arg0 == Cac.Indices.Grenade.Primary then
|
|
f58_local11 = RegisterMaterial( "icon_perks_extra_lethal" )
|
|
if not f58_local11 then
|
|
|
|
else
|
|
f58_local10.material = f58_local11
|
|
f58_local10.red = Colors.yellow.r
|
|
f58_local10.green = Colors.yellow.g
|
|
f58_local10.blue = Colors.yellow.b
|
|
f58_local10.alpha = 0
|
|
f58_local8( f58_local7, f58_local9, f58_local10 )
|
|
self:registerAnimationState( "visible", {
|
|
alpha = 1
|
|
} )
|
|
self:animateToState( "default" )
|
|
self:registerEventHandler( "update_cac_info_panel", function ( element, event )
|
|
local f63_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
|
if Cac.IsAbilityPickedBySlotName( f63_local0.controller, f63_local0.squadLocation, f63_local0.memberIndex, f63_local0.loadoutLocation, f63_local0.loadoutSlot, "Equipment", f58_arg0 and "specialty_extra_deadly" or "specialty_extra_equipment", "abilitiesPicked" ) and Cac.GetPerk( f63_local0.controller, f63_local0.squadLocation, f63_local0.memberIndex, f63_local0.loadoutLocation, f63_local0.loadoutSlot, f58_arg0 ) == "specialty_null" then
|
|
element:animateToState( "visible" )
|
|
else
|
|
element:animateToState( "default" )
|
|
end
|
|
end )
|
|
f58_local3:addElement( self )
|
|
end
|
|
end
|
|
f58_local11 = RegisterMaterial( "icon_perks_extra_tactical" )
|
|
end
|
|
return f58_local3
|
|
end
|
|
end
|
|
f58_local5 = "tactical"
|
|
end
|
|
|
|
local f0_local18 = function ( f64_arg0, f64_arg1, f64_arg2, f64_arg3, f64_arg4, f64_arg5, f64_arg6, f64_arg7 )
|
|
local f64_local0 = Engine.GetDvarString( "g_gametype" )
|
|
local f64_local1 = false
|
|
local f64_local2 = LUI.FlowManager.GetMenuScopedDataFromElement( f64_arg0 )
|
|
if not Engine.InFrontend() and f0_local0( f64_local0, f64_local2.controller ) then
|
|
f64_local1 = true
|
|
f64_arg2 = 40
|
|
f64_arg3 = 48
|
|
f64_arg4 = 1
|
|
f64_arg7 = false
|
|
end
|
|
f64_arg0:closeChildren()
|
|
local f64_local3 = 0
|
|
if f64_arg7 then
|
|
local f64_local4 = Cac.Abilities.Settings.GrabBagCapacity / Cac.CalculateAbilityCapacity( f64_local2.controller, f64_local2.squadLocation, f64_local2.memberIndex, f64_local2.loadoutLocation, f64_local2.loadoutSlot )
|
|
f64_arg2 = f64_arg2 * f64_local4
|
|
f64_arg3 = f64_arg3 * f64_local4
|
|
f64_arg4 = f64_arg4 * f64_local4
|
|
f64_arg0:registerAnimationState( "scaled", {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = (8 - Cac.Layout.AbilitiesBar.slot_height / 2) * f64_local4,
|
|
left = 0,
|
|
right = 0,
|
|
height = Cac.Layout.AbilitiesBar.slot_height
|
|
} )
|
|
f64_arg0:animateToState( "scaled", 0 )
|
|
end
|
|
if not f64_local1 then
|
|
for f64_local15, f64_local16 in ipairs( Cac.GetAbilityTypes() ) do
|
|
for f64_local14 = 1, Cac.Abilities.Settings.AbilitiesPerCategory, 1 do
|
|
if Cac.IsAbilityPicked( f64_local2.controller, f64_local2.squadLocation, f64_local2.memberIndex, f64_local2.loadoutLocation, f64_local2.loadoutSlot, f64_local16, f64_local14 - 1, f64_arg5 ) then
|
|
local f64_local7 = Cac.GetAbilityRef( f64_local16 )
|
|
local f64_local8 = Cac.GetAbilitySlotRef( f64_local7, f64_local14 )
|
|
local f64_local9 = Cac.GetPerkImage( f64_local8 )
|
|
local f64_local10 = Cac.GetPerkCost( f64_local8 )
|
|
local self = LUI.UIElement.new( {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
top = 0,
|
|
left = 0,
|
|
width = f64_arg2 * f64_local10 + f64_arg4 * math.max( 0, f64_local10 - 1 ),
|
|
height = f64_arg3
|
|
} )
|
|
f64_local3 = f64_local3 + f64_local10
|
|
self.id = f64_arg6 .. "slot_" .. f64_local3
|
|
local f64_local12 = LUI.UIImage.new( CoD.ColorizeState( Cac.Swatches.slot, {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = 0.05
|
|
} ) )
|
|
f64_local12:registerAnimationState( "locked", CoD.ColorizeState( Cac.Swatches.selection, {
|
|
alpha = 1
|
|
} ) )
|
|
f64_local12:registerEventHandler( "button_over", MBh.AnimateToState( "locked" ) )
|
|
f64_local12:registerEventHandler( "button_up", MBh.AnimateToState( "default" ) )
|
|
if f64_arg0.editingAbilities then
|
|
f64_local12:animateToState( "locked" )
|
|
end
|
|
f64_local12:registerEventHandler( "button_lock", function ( element, event )
|
|
f64_arg0.editingAbilities = true
|
|
element:animateToState( "locked" )
|
|
end )
|
|
f64_local12:registerEventHandler( "button_unlock", function ( element, event )
|
|
f64_arg0.editingAbilities = false
|
|
element:animateToState( "default" )
|
|
end )
|
|
self:addElement( f64_local12 )
|
|
local f64_local13 = LUI.UIImage.new( CoD.ColorizeState( Colors.white, {
|
|
material = RegisterMaterial( f64_local9 ),
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
top = 1,
|
|
left = -(f64_arg2 - 2) / 2,
|
|
width = f64_arg2 - 2,
|
|
height = f64_arg2 - 2
|
|
} ) )
|
|
if Engine.InFrontend() then
|
|
f64_local13:registerAnimationState( "locked", CoD.ColorizeState( Colors.black ) )
|
|
f64_local13:registerEventHandler( "button_lock", MBh.AnimateToState( "locked" ) )
|
|
f64_local13:registerEventHandler( "button_unlock", MBh.AnimateToState( "default" ) )
|
|
f64_local13:registerEventHandler( "button_over", MBh.AnimateToState( "locked" ) )
|
|
f64_local13:registerEventHandler( "button_up", MBh.AnimateToState( "default" ) )
|
|
if f64_arg0.editingAbilities then
|
|
f64_local13:animateToState( "locked" )
|
|
end
|
|
end
|
|
self:addElement( f64_local13 )
|
|
self:addElement( LUI.UIImage.new( CoD.ColorizeState( Colors.cac_ability[f64_local7], {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = f64_arg2,
|
|
left = 0,
|
|
right = 0,
|
|
height = 5,
|
|
material = RegisterMaterial( "white" )
|
|
} ) ) )
|
|
f64_arg0:addElement( self )
|
|
end
|
|
end
|
|
end
|
|
end
|
|
local f64_local4
|
|
if f64_arg7 then
|
|
f64_local4 = Cac.CalculateAbilityCapacity( f64_local2.controller, f64_local2.squadLocation, f64_local2.memberIndex, f64_local2.loadoutLocation, f64_local2.loadoutSlot )
|
|
if not f64_local4 then
|
|
|
|
else
|
|
if f64_arg7 and f64_local4 ~= f64_local2.upperBound then
|
|
f64_local2.upperBound = f64_local4
|
|
f64_arg0:dispatchEventToRoot( {
|
|
name = "update_cac_info_panel",
|
|
controller = f64_local2.controller,
|
|
dispatchChildren = true,
|
|
resetSelected = f64_arg1.resetSelected
|
|
} )
|
|
end
|
|
for f64_local5 = f64_local3 + 1, f64_local4, 1 do
|
|
local f64_local14 = LUI.UIElement.new( {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
top = 0,
|
|
left = 0,
|
|
width = f64_arg2,
|
|
height = f64_arg2
|
|
} )
|
|
f64_local14.id = f64_arg6 .. "empty_slot_" .. f64_local5
|
|
local f64_local17 = LUI.UIImage.new( CoD.ColorizeState( Cac.Swatches.slot, {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = 0.05
|
|
} ) )
|
|
if Engine.InFrontend() then
|
|
f64_local17:registerAnimationState( "over", CoD.ColorizeState( Cac.Swatches.slot_over, {
|
|
alpha = 0.5
|
|
} ) )
|
|
f64_local17:registerEventHandler( "button_over", MBh.AnimateToState( "over" ) )
|
|
f64_local17:registerEventHandler( "button_up", MBh.AnimateToState( "default" ) )
|
|
f64_local17:registerEventHandler( "button_over_disabled", MBh.AnimateToState( "over" ) )
|
|
f64_local17:registerEventHandler( "button_up_disabled", MBh.AnimateToState( "over" ) )
|
|
f64_local17:registerEventHandler( "button_lock", function ( element, event )
|
|
f64_arg0.editingAbilities = true
|
|
element:animateToState( "over" )
|
|
end )
|
|
f64_local17:registerEventHandler( "button_unlock", function ( element, event )
|
|
f64_arg0.editingAbilities = false
|
|
element:animateToState( "default" )
|
|
end )
|
|
if f64_arg1.selected then
|
|
f64_local17:animateToState( "over", 0 )
|
|
end
|
|
end
|
|
f64_local14:addElement( f64_local17 )
|
|
f64_arg0:addElement( f64_local14 )
|
|
end
|
|
end
|
|
end
|
|
f64_local4 = Cac.Abilities.Settings.GrabBagCapacity
|
|
end
|
|
|
|
local f0_local19 = function ()
|
|
local f69_local0 = Engine.GetDvarString( "g_gametype" )
|
|
local f69_local1 = false
|
|
local f69_local2 = f0_local11( 4, false, function ( f70_arg0, f70_arg1 )
|
|
local f70_local0 = f0_local6( f70_arg0 )
|
|
local f70_local1 = LUI.FlowManager.GetMenuScopedDataFromElement( f70_arg0 )
|
|
f70_local0.itemIndex = Cac.Indices.StreakType
|
|
f70_local0.titleBarText = Engine.Localize( "@LUA_MENU_STREAK_TYPE_CAPS" )
|
|
if not f70_local1.defaultFocus then
|
|
f70_local1.defaultFocus = {}
|
|
end
|
|
f70_local1.defaultFocus[#f70_local1.defaultFocus + 1] = Cac.GetPerk( f70_arg1.controller, f70_local0.squadLocation, f70_local0.squadMemberIndex, f70_local0.classLocation, f70_local0.slot, Cac.Indices.StreakType )
|
|
f70_local0.buttonFeeder = Cac.EditPopupButtonsFactory( Cac.GetPerkName, Cac.DefaultEditChooseStreakTypeAction, Cac.StreakTypes, Cac.GetPerk( f70_arg1.controller, f70_local0.squadLocation, f70_local0.squadMemberIndex, f70_local0.classLocation, f70_local0.slot, Cac.Indices.StreakType ), Cac.GetItemClassDescriptions, nil, nil, nil, nil, "cac_edit_main" )
|
|
f70_local0.checkRestriction = function ( f71_arg0 )
|
|
if MatchRules.AllowCustomClasses( f70_local0.classLocation ) then
|
|
local f71_local0, f71_local1, f71_local2 = Cac.SafeGetMatchRule( "commonOption", "killstreakClassRestricted", f71_arg0 )
|
|
if f71_local0 then
|
|
local f71_local3 = f71_local1
|
|
end
|
|
return f71_local3 or Cac.CheckKillstreakTypeRestrictions( f71_arg0 )
|
|
else
|
|
|
|
end
|
|
end
|
|
|
|
f70_local0.openMenuOnClose = f70_local0
|
|
f70_local0.openMenuOnClose.menu = "cac_edit_popup_main"
|
|
f70_arg0:dispatchEventToRoot( {
|
|
name = "hide_abilities_info_panel",
|
|
immediate = true
|
|
} )
|
|
LUI.FlowManager.RequestPopupMenu( element, "cac_edit_popup_main", true, f70_arg1.controller, false, f70_local0 )
|
|
end, Engine.Localize( "@MENU_STRIKE_PACKAGE_CAPS" ), function ( f72_arg0, f72_arg1 )
|
|
local f72_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f72_arg0 )
|
|
if not Engine.InFrontend() and f0_local0( f69_local0, f72_local0.exclusiveController ) then
|
|
f69_local1 = true
|
|
end
|
|
if f69_local1 then
|
|
return ""
|
|
elseif not f72_local0.controller then
|
|
return ""
|
|
end
|
|
local f72_local1 = Cac.GetStreakType( f72_local0.controller, f72_local0.squadLocation, f72_local0.memberIndex, f72_local0.loadoutLocation, f72_local0.loadoutSlot )
|
|
if f72_local1 == "specialty_null" then
|
|
f72_local1 = "streaktype_assault"
|
|
end
|
|
return Cac.GetPerkName( f72_local1 )
|
|
end, nil, function ( f73_arg0 )
|
|
local f73_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f73_arg0 )
|
|
if MatchRules.AllowCustomClasses( f73_local0.loadoutLocation ) then
|
|
local f73_local1 = false
|
|
local f73_local2 = true
|
|
local f73_local3 = Cac.GetStreakType( f73_local0.controller, f73_local0.squadLocation, f73_local0.memberIndex, f73_local0.loadoutLocation, f73_local0.loadoutSlot )
|
|
if f73_local3 == "specialty_null" then
|
|
f73_local3 = "streaktype_assault"
|
|
end
|
|
local f73_local4, f73_local5, f73_local6 = Cac.SafeGetMatchRule( "commonOption", "killstreakClassRestricted", f73_local3 )
|
|
local f73_local7 = f73_local4 and f73_local5
|
|
local f73_local8
|
|
if f73_local3 == "streaktype_specialist" then
|
|
f73_local8 = "perkRestricted"
|
|
if not f73_local8 then
|
|
|
|
else
|
|
for f73_local9 = Cac.Indices.Killstreaks.Streak1, Cac.Indices.Killstreaks.Streak3, 1 do
|
|
local f73_local12 = Cac.GetStreak( f73_local0.controller, f73_local0.squadLocation, f73_local0.memberIndex, f73_local0.loadoutLocation, f73_local0.loadoutSlot, Cac.GetStreakTypeReference( f73_local3 ), f73_local9 )
|
|
if f73_local12 ~= "none" then
|
|
f73_local2 = false
|
|
if f73_local3 == "streaktype_specialist" then
|
|
f73_local12 = Cac.StripSuffix( f73_local12, "_ks" )
|
|
f73_local4, f73_local5, f73_local6 = Cac.SafeGetMatchRule( "commonOption", "perkClassRestricted", Cac.GetPerkGroup( f73_local12 ) )
|
|
if not f73_local1 then
|
|
f73_local1 = f73_local4 and f73_local5
|
|
end
|
|
end
|
|
f73_local4, f73_local5, f73_local6 = Cac.SafeGetMatchRule( "commonOption", f73_local8, f73_local12 )
|
|
if not f73_local1 then
|
|
f73_local1 = f73_local4 and f73_local5
|
|
end
|
|
end
|
|
end
|
|
local f73_local9, f73_local10 = Cac.ArePerksRestricted( f73_local0.controller, f73_local0.squadLocation, f73_local0.memberIndex, f73_local0.loadoutLocation, f73_local0.loadoutSlot, "specialistBonusStreaks" )
|
|
if f73_local2 then
|
|
f73_local2 = f73_local10
|
|
end
|
|
if f73_local3 == "streaktype_specialist" and not f73_local1 then
|
|
f73_local1 = f73_local9
|
|
end
|
|
if not f73_local1 then
|
|
local f73_local13 = f73_local7
|
|
end
|
|
return f73_local13 and not f73_local2
|
|
end
|
|
end
|
|
f73_local8 = "killstreakRestricted"
|
|
else
|
|
|
|
end
|
|
end )
|
|
f69_local2:registerEventHandler( "update_cac_info_panel", MBh.EmitEvent( "content_refresh" ) )
|
|
f69_local2:registerEventHandler( "refresh_specialist_abilities_recap", function ( element, event )
|
|
local f74_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
|
local f74_local1 = f69_local2:getFirstDescendentById( "text_label" )
|
|
local f74_local2 = f69_local2:getFirstDescendentById( "content_text_label" )
|
|
local f74_local3 = 4 * RecapLayout.GridH + 3 * RecapLayout.GridHGutter
|
|
local f74_local4 = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
left = 4 - f74_local3 / 2,
|
|
right = f74_local3 / 2,
|
|
top = 0,
|
|
bottom = CoD.TextSettings.NormalFont.Height
|
|
}
|
|
local f74_local5 = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
left = -f74_local3 / 2,
|
|
right = f74_local3 / 2,
|
|
top = 0,
|
|
bottom = CoD.TextSettings.NormalFont.Height
|
|
}
|
|
local f74_local6 = CoD.ColorizeState( Colors.cac_label_text, f74_local4 )
|
|
local f74_local7 = CoD.ColorizeState( Colors.generic_button_content_focus_color, f74_local5 )
|
|
f74_local1:registerAnimationState( "default", f74_local6 )
|
|
f74_local2:registerAnimationState( "default", f74_local7 )
|
|
if event.selected then
|
|
local f74_local8 = CoD.ColorizeState( Colors.cac_button, f74_local4 )
|
|
local f74_local9 = CoD.ColorizeState( Colors.cac_button, f74_local5 )
|
|
f74_local0.specialistStrike = true
|
|
f74_local1:registerAnimationState( "newState", f74_local8 )
|
|
f74_local2:registerAnimationState( "newState", f74_local9 )
|
|
f74_local1:animateToState( "newState" )
|
|
f74_local2:animateToState( "newState" )
|
|
else
|
|
f74_local1:animateToState( "default" )
|
|
f74_local2:animateToState( "default" )
|
|
end
|
|
element:dispatchEventToChildren( event )
|
|
end )
|
|
f69_local2.id = "edit_killstreaks"
|
|
local f69_local3 = {
|
|
Cac.GetStreak1,
|
|
Cac.GetStreak2,
|
|
Cac.GetStreak3
|
|
}
|
|
if not f69_local1 then
|
|
local self = LUI.UIText.new( CoD.ColorizeState( Colors.white, {
|
|
font = CoD.TextSettings.SmallFont.Font,
|
|
topAnchor = false,
|
|
leftAnchor = true,
|
|
bottomAnchor = true,
|
|
rightAnchor = false,
|
|
bottom = -Cac.Layout.AbilitiesBar.slot_height,
|
|
left = 0,
|
|
right = 32,
|
|
height = CoD.TextSettings.SmallFont.Height
|
|
} ) )
|
|
self:setText( "" )
|
|
self:registerAnimationState( "locked", CoD.ColorizeState( Colors.cac_button, {} ) )
|
|
self:registerEventHandler( "update_cac_info_panel", function ( element, event )
|
|
local f75_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f69_local2 )
|
|
if Cac.GetPerk( f75_local0.controller, f75_local0.squadLocation, f75_local0.memberIndex, f75_local0.loadoutLocation, f75_local0.loadoutSlot, Cac.Indices.StreakType ) == "streaktype_specialist" then
|
|
local f75_local1 = 0
|
|
for f75_local2 = 1, 3, 1 do
|
|
local f75_local5 = Cac.GetPerkCost( Cac.StripSuffix( f69_local3[f75_local2]( f75_local0.controller, f75_local0.squadLocation, f75_local0.memberIndex, f75_local0.loadoutLocation, f75_local0.loadoutSlot ), "_ks" ) )
|
|
if f75_local5 ~= "" and f75_local5 then
|
|
f75_local1 = f75_local1 + f75_local5 + 1
|
|
end
|
|
end
|
|
element:setText( Engine.Localize( "@LUA_MENU_BONUS_AT_N_KILLS", math.max( 8, f75_local1 + 2 ) ) )
|
|
else
|
|
element:setText( "" )
|
|
end
|
|
end )
|
|
self:registerEventHandler( "button_lock", MBh.AnimateToState( "locked" ) )
|
|
self:registerEventHandler( "button_unlock", MBh.AnimateToState( "default" ) )
|
|
self:registerEventHandler( "button_over", MBh.AnimateToState( "locked" ) )
|
|
self:registerEventHandler( "button_up", MBh.AnimateToState( "default" ) )
|
|
f69_local2:addElement( self )
|
|
end
|
|
local self = Cac.Layout.SpecialistStreak.PreviewButton.width
|
|
local f69_local5 = Cac.Layout.SpecialistStreak.PreviewButton.height
|
|
for f69_local6 = 0, 2, 1 do
|
|
local f69_local9 = f69_local6
|
|
local f69_local10 = f0_local9( (Cac.Layout.SpecialistStreak.PreviewButton.width + 40) * (f69_local9 - 1), 8, self, f69_local5, function ( f76_arg0, f76_arg1 )
|
|
local f76_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f69_local2 )
|
|
local f76_local1 = f69_local3[f69_local9 + 1]( f76_local0.controller, f76_local0.squadLocation, f76_local0.memberIndex, f76_local0.loadoutLocation, f76_local0.loadoutSlot )
|
|
local f76_local2 = Cac.GetStreakIcon( f76_local1, f76_local0.controller )
|
|
local f76_local3 = 1
|
|
if f76_local1 == nil or f76_local1 == "none" or f76_local1 == "specialty_null" or f76_local1 == "" then
|
|
f76_local3 = 0.1
|
|
end
|
|
if f76_local1 == "none" and (f76_arg1.name == "button_lock" or f76_arg1.name == "button_over" or f76_arg1.resetSelected == f69_local2.id) then
|
|
f76_local2 = f76_local2 .. "_black"
|
|
f76_local3 = 1
|
|
end
|
|
if f69_local1 then
|
|
f76_local2 = "icon_weapon_ph_sp_diamond_64"
|
|
f76_local3 = 0.1
|
|
end
|
|
return {
|
|
material = RegisterMaterial( f76_local2 ),
|
|
alpha = f76_local3
|
|
}
|
|
end, true, true )
|
|
if not f69_local1 then
|
|
f69_local10:registerEventHandler( "refresh_specialist_abilities_recap", function ( element, event )
|
|
local f77_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
|
element:animateToState( event.specialistType and "moved" or "restore_position", 100 )
|
|
end )
|
|
local f69_local11 = LUI.UIText.new( CoD.ColorizeState( Colors.white, {
|
|
font = CoD.TextSettings.SmallFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
bottom = 0,
|
|
left = -25,
|
|
width = 30,
|
|
height = CoD.TextSettings.SmallFont.Height
|
|
} ) )
|
|
f69_local11:setText( "" )
|
|
f69_local11:setTextStyle( CoD.TextStyle.Outlined )
|
|
f69_local11:registerAnimationState( "invert", CoD.ColorizeState( Colors.black, {} ) )
|
|
f69_local11:registerEventHandler( "update_cac_info_panel", function ( element, event )
|
|
local f78_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f69_local2 )
|
|
local f78_local1 = f69_local3[f69_local9 + 1]( f78_local0.controller, f78_local0.squadLocation, f78_local0.memberIndex, f78_local0.loadoutLocation, f78_local0.loadoutSlot )
|
|
local f78_local2 = Cac.GetPerk( f78_local0.controller, f78_local0.squadLocation, f78_local0.memberIndex, f78_local0.loadoutLocation, f78_local0.loadoutSlot, Cac.Indices.StreakType )
|
|
local f78_local3 = 0
|
|
if f78_local2 == "streaktype_specialist" then
|
|
if f78_local1 ~= "none" then
|
|
for f78_local4 = 0, f69_local9, 1 do
|
|
local f78_local7 = Cac.GetPerkCost( Cac.StripSuffix( f69_local3[f78_local4 + 1]( f78_local0.controller, f78_local0.squadLocation, f78_local0.memberIndex, f78_local0.loadoutLocation, f78_local0.loadoutSlot ), "_ks" ) )
|
|
if f78_local7 ~= "" and f78_local7 then
|
|
f78_local3 = f78_local3 + f78_local7 + 1
|
|
end
|
|
end
|
|
else
|
|
f78_local3 = ""
|
|
end
|
|
else
|
|
f78_local3 = Cac.GetStreakCost( f78_local1 )
|
|
end
|
|
element:setText( f78_local3 )
|
|
end )
|
|
f69_local11:registerEventHandler( "button_lock", function ( element, event )
|
|
element:setTextStyle( CoD.TextStyle.None )
|
|
element:animateToState( "invert" )
|
|
end )
|
|
f69_local11:registerEventHandler( "button_over", function ( element, event )
|
|
element:setTextStyle( CoD.TextStyle.None )
|
|
element:animateToState( "invert" )
|
|
end )
|
|
f69_local11:registerEventHandler( "button_up", function ( element, event )
|
|
element:setTextStyle( CoD.TextStyle.Outlined )
|
|
element:animateToState( "default" )
|
|
end )
|
|
f69_local10:addElement( f69_local11 )
|
|
end
|
|
f69_local2:addElement( f69_local10 )
|
|
end
|
|
local f69_local6 = LUI.UIHorizontalList.new()
|
|
f69_local6.id = "specialist_ability_recap"
|
|
f69_local6.editingAbilities = false
|
|
f69_local6:registerAnimationState( "default", {
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
bottom = -2,
|
|
left = 0,
|
|
right = 0,
|
|
height = Cac.Layout.AbilitiesBar.slot_height,
|
|
alignment = LUI.Alignment.Center,
|
|
spacing = Cac.Layout.AbilitiesBar.slot_spacing,
|
|
alpha = 0
|
|
} )
|
|
f69_local6:animateToState( "default" )
|
|
f69_local6:registerAnimationState( "visible", {
|
|
alpha = 1
|
|
} )
|
|
f69_local6:registerEventHandler( "refresh_specialist_abilities_recap", function ( element, event )
|
|
local f82_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
|
element:animateToState( event.specialistType and "visible" or "default", 100 )
|
|
f0_local18( element, event, Cac.Layout.AbilitiesBar.slot_width, Cac.Layout.AbilitiesBar.slot_height, Cac.Layout.AbilitiesBar.slot_spacing, "specialistBonusStreaks", "specialist_" )
|
|
end )
|
|
f69_local2:addElement( f69_local6 )
|
|
return f69_local2
|
|
end
|
|
|
|
local f0_local20 = function ()
|
|
local f83_local0 = f0_local11( 4, false, function ( f84_arg0, f84_arg1 )
|
|
local f84_local0 = f0_local6( f84_arg0 )
|
|
f84_arg0:dispatchEventToRoot( {
|
|
name = "hide_abilities_info_panel",
|
|
immediate = true
|
|
} )
|
|
LUI.FlowManager.RequestPopupMenu( f84_arg0, "cac_ability_alt_main", true, f84_arg1.controller, false, f84_local0 )
|
|
end, Engine.Localize( "@MENU_ABILITIES_CAPS" ), nil, nil, function ( f85_arg0 )
|
|
local f85_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f85_arg0 )
|
|
if MatchRules.AllowCustomClasses( f85_local0.loadoutLocation ) then
|
|
return Cac.ArePerksRestricted( f85_local0.controller, f85_local0.squadLocation, f85_local0.memberIndex, f85_local0.loadoutLocation, f85_local0.loadoutSlot, "abilitiesPicked" )
|
|
else
|
|
|
|
end
|
|
end )
|
|
f83_local0.id = "edit_abilities"
|
|
f83_local0:registerEventHandler( "second_primary_focus", MBh.EmitEvent( "lose_focus" ) )
|
|
f83_local0:registerEventHandler( "third_attach_focus", MBh.EmitEvent( "lose_focus" ) )
|
|
local self = LUI.UIHorizontalList.new( {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 8 - Cac.Layout.AbilitiesBar.slot_height / 2,
|
|
left = 0,
|
|
right = 0,
|
|
height = Cac.Layout.AbilitiesBar.slot_height,
|
|
alignment = LUI.Alignment.Center,
|
|
spacing = Cac.Layout.AbilitiesBar.slot_spacing
|
|
} )
|
|
self.id = "ability_recap"
|
|
self.editingAbilities = false
|
|
self:registerEventHandler( "refresh_abilities_recap", function ( element, event )
|
|
local f86_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
|
f86_local0.editingAbilities = false
|
|
if event.item and Engine.InFrontend() and event.item ~= "specialty_null" and event.item ~= "none" and event.item ~= "iw6_knifeonly" and event.item ~= "uav" and Cac.CalculateAbilityCapacity( f86_local0.controller, f86_local0.squadLocation, f86_local0.memberIndex, f86_local0.loadoutLocation, f86_local0.loadoutSlot ) - Cac.CountSpentPoints( f86_local0.controller, f86_local0.squadLocation, f86_local0.memberIndex, f86_local0.loadoutLocation, f86_local0.loadoutSlot, "abilitiesPicked" ) < 0 then
|
|
Cac.RemoveLastPerk( f86_local0.controller, f86_local0.squadLocation, f86_local0.memberIndex, f86_local0.loadoutLocation, f86_local0.loadoutSlot, "abilitiesPicked", true )
|
|
end
|
|
f0_local18( element, event, Cac.Layout.AbilitiesBar.slot_width, Cac.Layout.AbilitiesBar.slot_height, Cac.Layout.AbilitiesBar.slot_spacing, "abilitiesPicked", "abilities_", true )
|
|
end )
|
|
f83_local0:addElement( self )
|
|
return f83_local0
|
|
end
|
|
|
|
local f0_local21 = function ( f87_arg0 )
|
|
f87_arg0:processEvent( {
|
|
name = "update_cac_info_panel",
|
|
dispatchChildren = true
|
|
} )
|
|
f87_arg0:processEvent( {
|
|
name = "refresh_abilities_recap"
|
|
} )
|
|
end
|
|
|
|
local f0_local22 = function ( f88_arg0, f88_arg1 )
|
|
local f88_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f88_arg0 )
|
|
f88_arg0.properties = f88_arg0.properties or {}
|
|
if not f88_arg0.properties.exclusiveController or not f88_arg0.properties.squad_location or not f88_arg0.properties.class_location then
|
|
DebugPrint( "WARNING: Missing init data for cac_edit_main. Placeholder values will be used." )
|
|
end
|
|
f88_local0.controller = f88_arg0.properties.exclusiveController or 0
|
|
local f88_local1 = f88_arg0.properties.squad_location
|
|
if not f88_local1 then
|
|
f88_local1 = Cac.GetSquadLoc()
|
|
end
|
|
f88_local0.squadLocation = f88_local1
|
|
f88_local1 = f88_arg0.properties.member_index
|
|
if not f88_local1 then
|
|
f88_local1 = Cac.GetEditSquadMember()
|
|
end
|
|
f88_local0.memberIndex = f88_local1
|
|
f88_local0.loadoutLocation = f88_arg0.properties.class_location or "loadouts"
|
|
f88_local0.loadoutSlot = f88_arg0.properties.loadout_slot or 0
|
|
f88_local0.upperBound = Cac.CalculateAbilityCapacity( f88_local0.controller, f88_local0.squadLocation, f88_local0.memberIndex, f88_local0.loadoutLocation, f88_local0.loadoutSlot )
|
|
f0_local21( f88_arg0 )
|
|
end
|
|
|
|
local f0_local23 = function ( f89_arg0, f89_arg1 )
|
|
local f89_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f89_arg0 )
|
|
local f89_local1 = f89_local0.selectionIDFocused
|
|
if f89_local1 then
|
|
if f89_local1 == "edit_weapon_primary" or f89_local1 == "edit_weapon_secondary" then
|
|
local f89_local2 = f89_local0.weaponIndexFocused
|
|
local f89_local3 = Cac.Indices.Weapons.Primary
|
|
f89_local2 = REG18 and "iw6_knifeonly" or "none"
|
|
Cac.SetWeapon( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, f89_local0.weaponIndexFocused, f89_local2 )
|
|
f89_arg0:dispatchEventToRoot( {
|
|
name = "refresh_abilities_recap",
|
|
controller = f89_arg1.controller,
|
|
specialistType = false,
|
|
item = f89_local2,
|
|
resetSelected = f89_local1
|
|
} )
|
|
elseif f89_local1 == "edit_weapon_primary_attach1" or f89_local1 == "edit_weapon_primary_attach2" or f89_local1 == "edit_weapon_primary_attach3" or f89_local1 == "edit_weapon_secondary_attach1" or f89_local1 == "edit_weapon_secondary_attach2" or f89_local1 == "edit_lethal" then
|
|
if f89_local1 == "edit_lethal" then
|
|
local f89_local2 = Cac.HasAttachments( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, 0, {
|
|
"gl",
|
|
"shotgun"
|
|
} )
|
|
local f89_local3 = Cac.HasAttachments( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, 1, {
|
|
"gl",
|
|
"shotgun"
|
|
} )
|
|
if f89_local2 and f89_local1 == "edit_lethal" then
|
|
Cac.SetAttachment( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, Cac.Indices.Weapons.Primary, f89_local2 - 1, "none" )
|
|
elseif f89_local3 and f89_local1 == "edit_lethal" then
|
|
Cac.SetAttachment( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, Cac.Indices.Weapons.Secondary, f89_local3 - 1, "none" )
|
|
else
|
|
Cac.SetPerk( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, f89_local0.weaponIndexFocused, "specialty_null" )
|
|
end
|
|
else
|
|
if Cac.AttachmentHasReticles( Cac.GetAttachment( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, f89_local0.weaponIndexFocused, f89_local0.attachIndexFocused ) ) then
|
|
Cac.SetWeaponReticle( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, 0, "none" )
|
|
end
|
|
Cac.SetAttachment( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, f89_local0.weaponIndexFocused, f89_local0.attachIndexFocused, "none" )
|
|
end
|
|
local f89_local2 = Cac.GetAttachment( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, f89_local0.weaponIndexFocused, 0 )
|
|
local f89_local3 = Cac.GetAttachment( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, f89_local0.weaponIndexFocused, 1 )
|
|
local f89_local4 = Cac.GetAttachment( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, f89_local0.weaponIndexFocused, 2 )
|
|
if f89_local2 == "none" and f89_local3 ~= "none" then
|
|
Cac.SetAttachment( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, f89_local0.weaponIndexFocused, 0, f89_local3 )
|
|
Cac.SetAttachment( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, f89_local0.weaponIndexFocused, 1, "none" )
|
|
f89_local2 = f89_local3
|
|
f89_local3 = "none"
|
|
end
|
|
if f89_local3 == "none" and f89_local4 ~= "none" then
|
|
Cac.SetAttachment( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, f89_local0.weaponIndexFocused, 1, f89_local4 )
|
|
Cac.SetAttachment( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, f89_local0.weaponIndexFocused, 2, "none" )
|
|
f89_local3 = f89_local4
|
|
end
|
|
f89_arg0:dispatchEventToRoot( {
|
|
name = "refresh_abilities_recap",
|
|
controller = f89_arg1.controller,
|
|
specialistType = false,
|
|
resetSelected = f89_local1
|
|
} )
|
|
elseif f89_local1 == "edit_tactical" then
|
|
Cac.SetPerk( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, f89_local0.weaponIndexFocused, "specialty_null" )
|
|
f89_arg0:dispatchEventToRoot( {
|
|
name = "refresh_abilities_recap",
|
|
controller = f89_arg1.controller,
|
|
specialistType = false,
|
|
resetSelected = f89_local1
|
|
} )
|
|
elseif f89_local1 == "edit_weapon_primary_camo" then
|
|
Cac.SetWeaponCamo( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, 0, "none" )
|
|
elseif f89_local1 == "edit_weapon_primary_reticle" then
|
|
if Cac.EquippedAttachmentsHaveReticles( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, 0 ) then
|
|
local f89_local2 = Cac.GetAttachmentWithReticles( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, 0 )
|
|
local f89_local3 = f89_local2 and Cac.GetReticleDefault( f89_local2 )
|
|
if f89_local3 then
|
|
Cac.SetWeaponReticle( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, 0, f89_local3 )
|
|
end
|
|
else
|
|
Cac.SetWeaponReticle( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, 0, "none" )
|
|
end
|
|
elseif f89_local1 == "edit_killstreaks" then
|
|
local f89_local2 = Cac.GetStreakType( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot )
|
|
if f89_local2 == "specialty_null" then
|
|
f89_local2 = "streaktype_assault"
|
|
end
|
|
if f89_local2 == "streaktype_specialist" then
|
|
Cac.ResetAbilities( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, "specialistBonusStreaks", true )
|
|
f89_arg0:dispatchEventToRoot( {
|
|
name = "refresh_specialist_abilities_recap",
|
|
controller = f89_arg1.controller,
|
|
specialistType = true,
|
|
selected = true
|
|
} )
|
|
end
|
|
Cac.ResetKillstreak( f89_arg1.controller, f89_local0.squadLocation, f89_local0.squadMemberIndex, f89_local0.classLocation, f89_local0.slot, Cac.GetStreakTypeReference( f89_local2 ) )
|
|
elseif f89_local1 == "edit_abilities" then
|
|
Cac.ResetAbilities( f89_arg1.controller, f89_local0.squadLocation, f89_local0.memberIndex, f89_local0.loadoutLocation, f89_local0.loadoutSlot, "abilitiesPicked", false )
|
|
f89_arg0:dispatchEventToRoot( {
|
|
name = "refresh_abilities_recap",
|
|
controller = f89_arg1.controller,
|
|
resetSelected = f89_local1,
|
|
selected = true
|
|
} )
|
|
end
|
|
f89_arg0:dispatchEventToRoot( {
|
|
name = "update_cac_info_panel",
|
|
controller = f89_arg1.controller,
|
|
dispatchChildren = true,
|
|
resetSelected = f89_local1
|
|
} )
|
|
local f89_local2 = f0_local6( f89_arg0 )
|
|
f89_local2.name = "update_selection_info"
|
|
f89_local2.selection_id = f89_local1
|
|
f89_local2.weaponIndex = f89_local0.weaponIndexFocused
|
|
f89_local2.immediate = true
|
|
f89_arg0:dispatchEventToRoot( f89_local2 )
|
|
if f89_local0.weaponIndexFocused then
|
|
local f89_local3 = f0_local6( f89_arg0 )
|
|
f89_local3.name = "refresh_info_pane"
|
|
f89_local3.dispatchChildren = true
|
|
f89_local3.weaponIndex = f89_local0.weaponIndexFocused
|
|
f89_local3.selection_id = f89_local1
|
|
f89_local3.immediate = true
|
|
f89_arg0:dispatchEventToRoot( f89_local3 )
|
|
if f89_local1 ~= "edit_lethal" and f89_local1 ~= "edit_tactical" and f89_local1 ~= "edit_weapon_primary" then
|
|
if f89_local0.weaponIndexFocused == Cac.Indices.Weapons.Primary then
|
|
f89_arg0:dispatchEventToRoot( {
|
|
name = "update_squad_member_window_weapon",
|
|
weapon = Cac.BuildPrimaryWeaponName( f89_arg1.controller, f89_local0.squadLocation, f89_local0.squadMemberIndex, f89_local0.classLocation, f89_local0.slot )
|
|
} )
|
|
elseif f89_local0.weaponIndexFocused == Cac.Indices.Weapons.Secondary then
|
|
f89_arg0:dispatchEventToRoot( {
|
|
name = "update_squad_member_window_stowed_weapon",
|
|
weapon = Cac.BuildSecondaryWeaponName( f89_arg1.controller, f89_local0.squadLocation, f89_local0.squadMemberIndex, f89_local0.classLocation, f89_local0.slot )
|
|
} )
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
local f0_local24 = function ( f90_arg0, f90_arg1 )
|
|
local f90_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f90_arg0 )
|
|
if not f90_local0 or f90_local0.squadLocation ~= "squadMembers" then
|
|
return
|
|
else
|
|
LUI.FlowManager.RequestPopupMenu( f90_arg0, "operations_main_menu", true, f90_arg1.controller, false )
|
|
end
|
|
end
|
|
|
|
local f0_local25 = function ( f91_arg0, f91_arg1 )
|
|
if not LUI.mp_menus.LoadoutBuilder.IsLoadoutBuilderEnabled() then
|
|
return
|
|
end
|
|
local f91_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f91_arg0 )
|
|
local f91_local1 = {}
|
|
if f91_local0 and f91_local0.squadLocation ~= "squadMembers" then
|
|
LUI.mp_menus.LoadoutBuilder.RequestBuildLoadout( f91_arg1.controller, "Random", false )
|
|
else
|
|
LUI.FlowManager.RequestPopupMenu( f91_arg0, "popup_lb_type", true, f91_arg1.controller, false )
|
|
end
|
|
end
|
|
|
|
LUI.MenuBuilder.registerType( "cac_recap", function ( menu, controller )
|
|
local self = LUI.UIElement.new( {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
top = RecapLayout.Y,
|
|
left = RecapLayout.XWhenRight,
|
|
width = RecapLayout.Width,
|
|
height = RecapLayout.Height
|
|
} )
|
|
self.properties = controller
|
|
if Engine.InFrontend() then
|
|
self:registerAnimationState( "left", {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
top = RecapLayout.Y,
|
|
left = RecapLayout.XWhenLeft,
|
|
width = RecapLayout.Width,
|
|
height = RecapLayout.Height
|
|
} )
|
|
self:registerEventHandler( "cac_recap_slide_left", MBh.AnimateToState( "left", 125 ) )
|
|
self:registerEventHandler( "cac_recap_slide_right", MBh.AnimateToState( "default", 125 ) )
|
|
self:addEventHandler( "gain_focus", function ( f93_arg0, f93_arg1 )
|
|
self:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_alt1",
|
|
helper_text = Engine.Localize( "@LUA_MENU_CLEAR" ),
|
|
side = "left",
|
|
immediate = true,
|
|
clickable = true
|
|
} )
|
|
local f93_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f93_arg0 )
|
|
local f93_local1 = nil
|
|
if f93_local0 and f93_local0.squadLocation == "squadMembers" then
|
|
self:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_alt2",
|
|
helper_text = Engine.Localize( "@LUA_MENU_OPERATIONS" ),
|
|
side = "left",
|
|
immediate = true,
|
|
clickable = true
|
|
} )
|
|
f93_local1 = "@LUA_MENU_MP_LB_HELPER_TEXT"
|
|
else
|
|
f93_local1 = "@LUA_MENU_MP_RANDOMIZE_LOADOUT"
|
|
end
|
|
if LUI.mp_menus.LoadoutBuilder.IsLoadoutBuilderEnabled() then
|
|
local f93_local2 = LUI.mp_menus.LoadoutBuilder.IsLoadoutBuilderButtonAnimEnabled()
|
|
self:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_start",
|
|
helper_text = Engine.Localize( f93_local1 ),
|
|
side = "left",
|
|
immediate = true,
|
|
clickable = true,
|
|
useAnimIntro = f93_local2,
|
|
flash = f93_local2
|
|
} )
|
|
end
|
|
end )
|
|
local f92_local1 = LUI.UIElement.new()
|
|
f92_local1:registerAnimationState( "default", {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = -12,
|
|
left = -RecapLayout.XWhenRight,
|
|
bottom = 0,
|
|
right = 0,
|
|
alpha = 0
|
|
} )
|
|
f92_local1:animateToState( "default" )
|
|
f92_local1:registerAnimationState( "visible", {
|
|
alpha = 1
|
|
} )
|
|
f92_local1:registerEventHandler( "lock_recap", MBh.AnimateToState( "visible" ) )
|
|
f92_local1:registerEventHandler( "unlock_recap", MBh.AnimateToState( "default" ) )
|
|
local f92_local2 = LUI.UIImage.new()
|
|
f92_local2:registerAnimationState( "default", CoD.ColorizeState( Cac.Swatches.overlay, {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = 0.75
|
|
} ) )
|
|
f92_local2:animateToState( "default" )
|
|
f92_local1:addElement( f92_local2 )
|
|
local f92_local3 = LUI.UIImage.new()
|
|
f92_local3:registerAnimationState( "default", {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = false,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = -11,
|
|
width = 32,
|
|
material = RegisterMaterial( "box_dropshadow_vert_spacer" ),
|
|
alpha = 0.5
|
|
} )
|
|
f92_local3:animateToState( "default" )
|
|
f92_local1:addElement( f92_local3 )
|
|
self:addElement( f92_local1 )
|
|
end
|
|
local f92_local1 = LUI.UIVerticalList.new()
|
|
f92_local1:makeFocusable()
|
|
LUI.UIHorizontalList.SetNoWrap( f92_local1, true )
|
|
f92_local1:registerAnimationState( "default", {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
left = 0,
|
|
bottom = 0,
|
|
right = 0,
|
|
alignment = LUI.Alignment.Middle,
|
|
alpha = 1
|
|
} )
|
|
f92_local1:registerAnimationState( "locked", {
|
|
alpha = RecapLayout.LockAlpha
|
|
} )
|
|
f92_local1:animateToState( "default" )
|
|
f92_local1:registerEventHandler( "lock_recap", MBh.AnimateToState( "locked" ) )
|
|
f92_local1:registerEventHandler( "unlock_recap", MBh.AnimateToState( "default" ) )
|
|
self:addElement( f92_local1 )
|
|
local f92_local2 = f0_local13( Cac.Indices.Weapons.Primary )
|
|
local f92_local3 = f0_local14()
|
|
local f92_local4 = f0_local15( false, 0 )
|
|
local f92_local5 = f0_local15( false, 1 )
|
|
local f92_local6 = f0_local15( false, 2 )
|
|
local f92_local7 = f0_local16()
|
|
local f92_local8 = f0_local13( Cac.Indices.Weapons.Secondary )
|
|
local f92_local9 = f0_local15( true, 0 )
|
|
local f92_local10 = f0_local15( true, 1 )
|
|
local f92_local11 = f0_local17( Cac.Indices.Grenade.Primary )
|
|
local f92_local12 = f0_local17( Cac.Indices.Grenade.Secondary )
|
|
local f92_local13 = f0_local20()
|
|
local f92_local14 = f0_local19()
|
|
if Engine.UsingSplitscreenUpscaling() then
|
|
f92_local1:addElement( f0_local12( 0, RecapLayout.GridVTall, nil, {
|
|
f92_local2,
|
|
f92_local4,
|
|
f92_local5,
|
|
f92_local6
|
|
} ) )
|
|
f92_local1:addElement( f0_local8() )
|
|
f92_local1:addElement( f0_local12( 1, RecapLayout.GridVTall, nil, {
|
|
f92_local8,
|
|
f92_local9,
|
|
f92_local10,
|
|
f92_local11
|
|
} ) )
|
|
f92_local1:addElement( f0_local8() )
|
|
f92_local1:addElement( f0_local12( 2, RecapLayout.GridVTall, nil, {
|
|
f92_local13,
|
|
f92_local12
|
|
} ) )
|
|
else
|
|
local f92_local15 = function ( f94_arg0 )
|
|
f92_local2.navigation.up = f92_local14
|
|
f92_local3.navigation.up = f92_local14
|
|
f92_local2.navigation.down = f92_local4
|
|
f92_local3.navigation.down = f92_local7
|
|
end
|
|
|
|
local f92_local16 = function ( f95_arg0 )
|
|
f92_local4.navigation.up = f92_local2
|
|
f92_local5.navigation.up = f92_local2
|
|
f92_local6.navigation.up = f92_local2
|
|
f92_local7.navigation.up = f92_local3
|
|
f92_local4.navigation.down = f92_local8
|
|
f92_local5.navigation.down = f92_local8
|
|
f92_local6.navigation.down = f92_local9
|
|
f92_local7.navigation.down = f92_local10
|
|
end
|
|
|
|
local f92_local17 = function ( f96_arg0 )
|
|
f92_local8.navigation.up = f92_local4
|
|
f92_local9.navigation.up = f92_local6
|
|
f92_local10.navigation.up = f92_local7
|
|
f92_local8.navigation.down = f92_local11
|
|
f92_local9.navigation.down = f92_local12
|
|
f92_local10.navigation.down = f92_local12
|
|
end
|
|
|
|
local f92_local18 = function ( f97_arg0 )
|
|
f92_local11.navigation.up = f92_local8
|
|
f92_local12.navigation.up = f92_local9
|
|
f92_local11.navigation.down = f92_local13
|
|
f92_local12.navigation.down = f92_local13
|
|
end
|
|
|
|
local f92_local19 = function ( f98_arg0 )
|
|
f92_local13.navigation.up = f92_local11
|
|
f92_local13.navigation.down = f92_local14
|
|
end
|
|
|
|
local f92_local20 = function ( f99_arg0 )
|
|
f92_local14.navigation.up = f92_local13
|
|
f92_local14.navigation.down = f92_local2
|
|
end
|
|
|
|
local f92_local21 = nil
|
|
if Engine.InFrontend() then
|
|
f92_local21 = {
|
|
f92_local2,
|
|
f92_local3
|
|
}
|
|
else
|
|
f92_local21 = {
|
|
f92_local2
|
|
}
|
|
end
|
|
f92_local1:addElement( f0_local12( 0, RecapLayout.GridVTall, f92_local15, f92_local21 ) )
|
|
f92_local1:addSpacer( RecapLayout.GridVGutter, 0 )
|
|
f92_local1:addElement( f0_local12( 1, RecapLayout.GridVSlim, f92_local16, {
|
|
f92_local4,
|
|
f92_local5,
|
|
f92_local6,
|
|
f92_local7
|
|
} ) )
|
|
f92_local1:addElement( f0_local8() )
|
|
f92_local1:addElement( f0_local12( 2, RecapLayout.GridVTall, f92_local17, {
|
|
f92_local8,
|
|
f92_local9,
|
|
f92_local10
|
|
} ) )
|
|
f92_local1:addElement( f0_local8() )
|
|
f92_local1:addElement( f0_local12( 3, RecapLayout.GridVSlim, f92_local18, {
|
|
f92_local11,
|
|
f92_local12
|
|
} ) )
|
|
f92_local1:addElement( f0_local8() )
|
|
f92_local1:addElement( f0_local12( 4, RecapLayout.GridVTall, f92_local19, {
|
|
f92_local13
|
|
} ) )
|
|
f92_local1:addElement( f0_local8() )
|
|
local f92_local22 = f0_local12( 5, RecapLayout.GridVTall, f92_local20, {
|
|
f92_local14
|
|
} )
|
|
self:registerEventHandler( "refresh_specialist_abilities_recap", function ( element, event )
|
|
f92_local22:animateToState( event.specialistType and "expanded" or "default", 100 )
|
|
if not event.dispatchChildren then
|
|
f92_local14:processEvent( event )
|
|
return true
|
|
else
|
|
|
|
end
|
|
end )
|
|
f92_local1:addElement( f92_local22 )
|
|
end
|
|
f92_local1:registerEventHandler( "refresh_abilities_recap", function ( element, event )
|
|
if not event.dispatchChildren then
|
|
f92_local13:processEvent( event )
|
|
return true
|
|
else
|
|
|
|
end
|
|
end )
|
|
f92_local1:registerEventHandler( "cac_set_slot", function ( element, event )
|
|
assert( event.slot )
|
|
local f102_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
|
if not (f102_local0.loadoutSlot == event.slot and (not event.classLocation or f102_local0.loadoutLocation == event.classLocation)) or f102_local0.attachConflict then
|
|
if event.classLocation then
|
|
f102_local0.loadoutLocation = event.classLocation
|
|
end
|
|
f102_local0.loadoutSlot = event.slot
|
|
f102_local0.attachConflict = false
|
|
f0_local21( element )
|
|
end
|
|
end )
|
|
local f92_local15 = LUI.UIBindButton.new()
|
|
f92_local15.id = "cac_recap_bind_button"
|
|
f92_local15:registerEventHandler( "button_alt1", f0_local23 )
|
|
f92_local15:registerEventHandler( "button_alt2", f0_local24 )
|
|
if Engine.InFrontend() then
|
|
f92_local15:registerEventHandler( "button_start", f0_local25 )
|
|
end
|
|
self:addElement( f92_local15 )
|
|
self:registerEventHandler( "menu_create", f0_local22 )
|
|
if not Engine.InFrontend() then
|
|
self:registerEventHandler( "gamepad_button", function ()
|
|
|
|
end )
|
|
end
|
|
return self
|
|
end )
|
|
LockTable( _M )
|