2737 lines
75 KiB
Lua
2737 lines
75 KiB
Lua
local f0_local0 = module
|
|
local f0_local1, f0_local2 = ...
|
|
f0_local0( f0_local1, package.seeall )
|
|
CoD.PrintModuleLoad( _NAME )
|
|
function HandleAliensLoadout( f1_arg0, f1_arg1 )
|
|
LUI.FlowManager.RequestAddMenu( f1_arg0, "aliens_cac_menu", true, f1_arg1.controller, false )
|
|
end
|
|
|
|
function GetAliensLoadoutButton()
|
|
return {
|
|
type = "UIGenericButton",
|
|
id = "aliens_loadout_btn_id",
|
|
properties = {
|
|
button_text = Engine.Localize( "@ALIENS_LOADOUT" ),
|
|
desc_text = Engine.Localize( "@ALIENS_LOADOUT_DESC" ),
|
|
button_action_func = HandleAliensLoadout
|
|
}
|
|
}
|
|
end
|
|
|
|
function aliensCacFeeder( f3_arg0 )
|
|
assert( f3_arg0.exclusiveController, "The Alien Loadout setup menu should NEVER be opened with out and exclusive controller\n" )
|
|
local f3_local0 = LUI.mp_menus.Aliens
|
|
local f3_local1 = f3_arg0.exclusiveController
|
|
local f3_local2 = f3_local0.IsChaosEnabled()
|
|
local f3_local3 = {}
|
|
local f3_local4 = f3_local0.GetAlienPerk( f3_local1, 0 )
|
|
local f3_local5 = f3_local0.GetFieldForPerk( f3_local4, f3_local0.AlienPerks.Cols.Name )
|
|
local f3_local6 = f3_local0.GetFieldForPerk( f3_local4, f3_local0.AlienPerks.Cols.Desc )
|
|
local f3_local7 = f3_local0.GetFieldForPerk( f3_local4, f3_local0.AlienPerks.Cols.Icon )
|
|
local f3_local8 = Engine.Localize( "@ALIENS_SOLDIER_CLASS" )
|
|
local f3_local9, f3_local10, f3_local11, f3_local12 = GetTextDimensions( f3_local8, CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
|
|
local f3_local13 = f3_local0.GetAlienPerk( f3_local1, 1 )
|
|
local f3_local14 = f3_local0.GetFieldForPerk( f3_local13, f3_local0.AlienPerks.Cols.Name )
|
|
local f3_local15 = f3_local0.GetFieldForPerk( f3_local13, f3_local0.AlienPerks.Cols.Desc )
|
|
local f3_local16 = f3_local0.GetFieldForPerk( f3_local13, f3_local0.AlienPerks.Cols.Icon )
|
|
local f3_local17 = Engine.Localize( "@ALIENS_PISTOL_TYPE" )
|
|
local f3_local18, f3_local19, f3_local20, f3_local21 = GetTextDimensions( f3_local17, CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
|
|
local f3_local22 = f3_local0.GetAlienAbility( f3_local1, "munition" )
|
|
local f3_local23 = f3_local0.GetFieldForAbility( f3_local22, f3_local0.AlienAbilities.Cols.Name )
|
|
local f3_local24 = f3_local0.GetFieldForAbility( f3_local22, f3_local0.AlienAbilities.Cols.Desc )
|
|
local f3_local25 = f3_local0.GetFieldForAbility( f3_local22, f3_local0.AlienAbilities.Cols.Icon )
|
|
local f3_local26 = Engine.Localize( "@ALIENS_AMMO_TYPE" )
|
|
local f3_local27, f3_local28, f3_local29, f3_local30 = GetTextDimensions( f3_local26, CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
|
|
local f3_local31 = f3_local0.GetAlienAbility( f3_local1, "support" )
|
|
local f3_local32 = f3_local0.GetFieldForAbility( f3_local31, f3_local0.AlienAbilities.Cols.Name )
|
|
local f3_local33 = f3_local0.GetFieldForAbility( f3_local31, f3_local0.AlienAbilities.Cols.Desc )
|
|
local f3_local34 = f3_local0.GetFieldForAbility( f3_local31, f3_local0.AlienAbilities.Cols.Icon )
|
|
local f3_local35 = Engine.Localize( "@ALIENS_TEAM_SUPPORT" )
|
|
local f3_local36, f3_local37, f3_local38, f3_local39 = GetTextDimensions( f3_local35, CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
|
|
local f3_local40 = f3_local0.GetAlienAbility( f3_local1, "offense" )
|
|
local f3_local41 = f3_local0.GetFieldForAbility( f3_local40, f3_local0.AlienAbilities.Cols.Name )
|
|
local f3_local42 = f3_local0.GetFieldForAbility( f3_local40, f3_local0.AlienAbilities.Cols.Desc )
|
|
local f3_local43 = f3_local0.GetFieldForAbility( f3_local40, f3_local0.AlienAbilities.Cols.Icon )
|
|
local f3_local44 = Engine.Localize( "@ALIENS_STRIKE_PACKAGE" )
|
|
local f3_local45, f3_local46, f3_local47, f3_local48 = GetTextDimensions( f3_local44, CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
|
|
local f3_local49 = f3_local0.GetAlienAbility( f3_local1, "defense" )
|
|
local f3_local50 = f3_local0.GetFieldForAbility( f3_local49, f3_local0.AlienAbilities.Cols.Name )
|
|
local f3_local51 = f3_local0.GetFieldForAbility( f3_local49, f3_local0.AlienAbilities.Cols.Desc )
|
|
local f3_local52 = f3_local0.GetFieldForAbility( f3_local49, f3_local0.AlienAbilities.Cols.Icon )
|
|
local f3_local53 = Engine.Localize( "@ALIENS_EQUALIZER" )
|
|
local f3_local54, f3_local55, f3_local56, f3_local57 = GetTextDimensions( f3_local53, CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height )
|
|
local f3_local58 = nil
|
|
if Engine.IsGamepadEnabled() == 1 then
|
|
f3_local58 = 1
|
|
else
|
|
f3_local58 = 0
|
|
end
|
|
if LUI.mp_menus.AliensPurchasables.UsingExtinctionTokens() and not f3_local2 then
|
|
f3_local3[#f3_local3 + 1] = {
|
|
type = "aliens_cac_armory_button"
|
|
}
|
|
end
|
|
if not f3_local2 then
|
|
f3_local3[#f3_local3 + 1] = {
|
|
type = "aliens_cac_menu_button",
|
|
id = "perk_1_id",
|
|
properties = {
|
|
ability_text = f3_local8,
|
|
ability_text_width = f3_local11 - f3_local9 + 130,
|
|
selected_ability_text = Engine.Localize( f3_local5 ),
|
|
selected_ability_desc_text = Engine.Localize( f3_local6 ),
|
|
icon = RegisterMaterial( f3_local7 ),
|
|
isPerkSlot = 1,
|
|
perkSlot = 0
|
|
},
|
|
handlers = {
|
|
button_action = function ( f4_arg0, f4_arg1 )
|
|
OpenSelectionMenu( f4_arg0, f4_arg1, 1, 0, 0, 0, 0 )
|
|
f4_arg0:dispatchEventToRoot( {
|
|
name = "hide_tip",
|
|
immediate = true
|
|
} )
|
|
f4_arg0:dispatchEventToRoot( {
|
|
name = "dim_all",
|
|
immediate = true
|
|
} )
|
|
f4_arg0:dispatchEventToChildren( {
|
|
name = "button_locked",
|
|
immediate = true
|
|
} )
|
|
end,
|
|
button_over = function ( f5_arg0, f5_arg1 )
|
|
f5_arg0:dispatchEventToRoot( {
|
|
name = "show_all",
|
|
immediate = true
|
|
} )
|
|
f5_arg0:dispatchEventToRoot( {
|
|
name = "update_tip",
|
|
immediate = true,
|
|
new_Text = Engine.Localize( "@ALIENS_SOLDIER_TYPE_DESC" )
|
|
} )
|
|
f5_arg0:dispatchEventToRoot( {
|
|
name = "show_tip",
|
|
immediate = true
|
|
} )
|
|
f5_arg0:dispatchEventToRoot( {
|
|
name = "selection_info_set_header_text",
|
|
newText = Engine.Localize( "@ALIENS_SOLDIER_CLASS" ),
|
|
disabled_in_chaos = true
|
|
} )
|
|
end
|
|
}
|
|
}
|
|
end
|
|
if not f3_local2 then
|
|
f3_local3[#f3_local3 + 1] = {
|
|
type = "aliens_cac_menu_button",
|
|
id = "perk_2_id",
|
|
properties = {
|
|
ability_text = f3_local17,
|
|
ability_text_width = f3_local20 - f3_local18 + 130,
|
|
selected_ability_text = Engine.Localize( f3_local14 ),
|
|
selected_ability_desc_text = Engine.Localize( f3_local15 ),
|
|
icon = RegisterMaterial( f3_local16 ),
|
|
isPerkSlot = 1,
|
|
perkSlot = 1
|
|
},
|
|
handlers = {
|
|
button_action = function ( f6_arg0, f6_arg1 )
|
|
OpenSelectionMenu( f6_arg0, f6_arg1, 1, 1, 0, 0, 0 )
|
|
f6_arg0:dispatchEventToRoot( {
|
|
name = "hide_tip",
|
|
immediate = true
|
|
} )
|
|
f6_arg0:dispatchEventToRoot( {
|
|
name = "dim_all",
|
|
immediate = true
|
|
} )
|
|
f6_arg0:dispatchEventToChildren( {
|
|
name = "button_locked",
|
|
immediate = true
|
|
} )
|
|
end,
|
|
button_over = function ( f7_arg0, f7_arg1 )
|
|
f7_arg0:dispatchEventToRoot( {
|
|
name = "show_all",
|
|
immediate = true
|
|
} )
|
|
f7_arg0:dispatchEventToRoot( {
|
|
name = "update_tip",
|
|
immediate = true,
|
|
new_Text = Engine.Localize( "@ALIENS_PISTOL_TYPE_DESC" )
|
|
} )
|
|
f7_arg0:dispatchEventToRoot( {
|
|
name = "show_tip",
|
|
immediate = true
|
|
} )
|
|
f7_arg0:dispatchEventToRoot( {
|
|
name = "selection_info_set_header_text",
|
|
immediate = true,
|
|
newText = Engine.Localize( "@ALIENS_PISTOL_TYPE" ),
|
|
disabled_in_chaos = true
|
|
} )
|
|
end
|
|
}
|
|
}
|
|
end
|
|
if not f3_local2 then
|
|
f3_local3[#f3_local3 + 1] = {
|
|
type = "aliens_cac_menu_button",
|
|
id = "munition_id",
|
|
properties = {
|
|
ability_text = f3_local26,
|
|
ability_text_width = f3_local29 - f3_local27 + 130,
|
|
selected_ability_text = Engine.Localize( f3_local23 ),
|
|
selected_ability_desc_text = Engine.Localize( f3_local24 ),
|
|
icon = RegisterMaterial( f3_local25 ),
|
|
isPerkSlot = 0,
|
|
isActionSlot = 1,
|
|
isNerfSlot = 0,
|
|
actionSlot = f3_local0.AlienAbilities.Up,
|
|
dpadAlpha = f3_local58,
|
|
upArrowAlpha = 1
|
|
},
|
|
handlers = {
|
|
button_action = function ( f8_arg0, f8_arg1 )
|
|
OpenSelectionMenu( f8_arg0, f8_arg1, 0, 0, 1, f3_local0.AlienAbilities.Up, 0 )
|
|
f8_arg0:dispatchEventToRoot( {
|
|
name = "hide_tip",
|
|
immediate = true
|
|
} )
|
|
f8_arg0:dispatchEventToRoot( {
|
|
name = "dim_all",
|
|
immediate = true
|
|
} )
|
|
f8_arg0:dispatchEventToChildren( {
|
|
name = "button_locked",
|
|
immediate = true
|
|
} )
|
|
end,
|
|
button_over = function ( f9_arg0, f9_arg1 )
|
|
f9_arg0:dispatchEventToRoot( {
|
|
name = "show_all",
|
|
immediate = true
|
|
} )
|
|
f9_arg0:dispatchEventToRoot( {
|
|
name = "update_tip",
|
|
immediate = true,
|
|
new_Text = Engine.Localize( "@ALIENS_AMMO_TYPE_DESC" )
|
|
} )
|
|
f9_arg0:dispatchEventToRoot( {
|
|
name = "show_tip",
|
|
immediate = true
|
|
} )
|
|
f9_arg0:dispatchEventToRoot( {
|
|
name = "selection_info_set_header_text",
|
|
immediate = true,
|
|
newText = Engine.Localize( "@ALIENS_AMMO_TYPE" ),
|
|
disabled_in_chaos = true
|
|
} )
|
|
end
|
|
}
|
|
}
|
|
end
|
|
if not f3_local2 then
|
|
f3_local3[#f3_local3 + 1] = {
|
|
type = "aliens_cac_menu_button",
|
|
id = "support_id",
|
|
properties = {
|
|
ability_text = f3_local35,
|
|
ability_text_width = f3_local38 - f3_local36 + 130,
|
|
selected_ability_text = Engine.Localize( f3_local32 ),
|
|
selected_ability_desc_text = Engine.Localize( f3_local33 ),
|
|
icon = RegisterMaterial( f3_local34 ),
|
|
isPerkSlot = 0,
|
|
isActionSlot = 1,
|
|
isNerfSlot = 0,
|
|
actionSlot = f3_local0.AlienAbilities.Down,
|
|
dpadAlpha = f3_local58,
|
|
downArrowAlpha = 1
|
|
},
|
|
handlers = {
|
|
button_action = function ( f10_arg0, f10_arg1 )
|
|
OpenSelectionMenu( f10_arg0, f10_arg1, 0, 0, 1, f3_local0.AlienAbilities.Down, 0 )
|
|
f10_arg0:dispatchEventToRoot( {
|
|
name = "hide_tip",
|
|
immediate = true
|
|
} )
|
|
f10_arg0:dispatchEventToRoot( {
|
|
name = "dim_all",
|
|
immediate = true
|
|
} )
|
|
f10_arg0:dispatchEventToChildren( {
|
|
name = "button_locked",
|
|
immediate = true
|
|
} )
|
|
end,
|
|
button_over = function ( f11_arg0, f11_arg1 )
|
|
f11_arg0:dispatchEventToRoot( {
|
|
name = "show_all",
|
|
immediate = true
|
|
} )
|
|
f11_arg0:dispatchEventToRoot( {
|
|
name = "update_tip",
|
|
immediate = true,
|
|
new_Text = Engine.Localize( "@ALIENS_TEAM_SUPPORT_DESC" )
|
|
} )
|
|
f11_arg0:dispatchEventToRoot( {
|
|
name = "show_tip",
|
|
immediate = true
|
|
} )
|
|
f11_arg0:dispatchEventToRoot( {
|
|
name = "selection_info_set_header_text",
|
|
immediate = true,
|
|
newText = Engine.Localize( "@ALIENS_TEAM_SUPPORT" ),
|
|
disabled_in_chaos = true
|
|
} )
|
|
end
|
|
}
|
|
}
|
|
end
|
|
f3_local3[#f3_local3 + 1] = {
|
|
type = "aliens_cac_menu_button",
|
|
id = "offnese_id",
|
|
properties = {
|
|
ability_text = f3_local44,
|
|
ability_text_width = f3_local47 - f3_local45 + 130,
|
|
selected_ability_text = Engine.Localize( f3_local41 ),
|
|
selected_ability_desc_text = Engine.Localize( f3_local42 ),
|
|
icon = RegisterMaterial( f3_local43 ),
|
|
isPerkSlot = 0,
|
|
isActionSlot = 1,
|
|
isNerfSlot = 0,
|
|
actionSlot = f3_local0.AlienAbilities.Right,
|
|
dpadAlpha = f3_local58,
|
|
rightArrowAlpha = 1
|
|
},
|
|
handlers = {
|
|
button_action = function ( f12_arg0, f12_arg1 )
|
|
OpenSelectionMenu( f12_arg0, f12_arg1, 0, 0, 1, f3_local0.AlienAbilities.Right, 0 )
|
|
f12_arg0:dispatchEventToRoot( {
|
|
name = "hide_tip",
|
|
immediate = true
|
|
} )
|
|
f12_arg0:dispatchEventToRoot( {
|
|
name = "dim_all",
|
|
immediate = true
|
|
} )
|
|
f12_arg0:dispatchEventToChildren( {
|
|
name = "button_locked",
|
|
immediate = true
|
|
} )
|
|
end,
|
|
button_over = function ( f13_arg0, f13_arg1 )
|
|
f13_arg0:dispatchEventToRoot( {
|
|
name = "show_all",
|
|
immediate = true
|
|
} )
|
|
f13_arg0:dispatchEventToRoot( {
|
|
name = "update_tip",
|
|
immediate = true,
|
|
new_Text = Engine.Localize( "@ALIENS_STRIKE_PACKAGE_DESC" )
|
|
} )
|
|
f13_arg0:dispatchEventToRoot( {
|
|
name = "show_tip",
|
|
immediate = true
|
|
} )
|
|
f13_arg0:dispatchEventToRoot( {
|
|
name = "selection_info_set_header_text",
|
|
immediate = true,
|
|
newText = Engine.Localize( "@ALIENS_STRIKE_PACKAGE" )
|
|
} )
|
|
end
|
|
}
|
|
}
|
|
f3_local3[#f3_local3 + 1] = {
|
|
type = "aliens_cac_menu_button",
|
|
id = "defense_id",
|
|
properties = {
|
|
ability_text = f3_local53,
|
|
ability_text_width = f3_local56 - f3_local54 + 130,
|
|
selected_ability_text = Engine.Localize( f3_local50 ),
|
|
selected_ability_desc_text = Engine.Localize( f3_local51 ),
|
|
icon = RegisterMaterial( f3_local52 ),
|
|
isPerkSlot = 0,
|
|
isActionSlot = 1,
|
|
isNerfSlot = 0,
|
|
actionSlot = f3_local0.AlienAbilities.Left,
|
|
dpadAlpha = f3_local58,
|
|
leftArrowAlpha = 1
|
|
},
|
|
handlers = {
|
|
button_action = function ( f14_arg0, f14_arg1 )
|
|
OpenSelectionMenu( f14_arg0, f14_arg1, 0, 0, 1, f3_local0.AlienAbilities.Left, 0 )
|
|
f14_arg0:dispatchEventToRoot( {
|
|
name = "hide_tip",
|
|
immediate = true
|
|
} )
|
|
f14_arg0:dispatchEventToRoot( {
|
|
name = "dim_all",
|
|
immediate = true
|
|
} )
|
|
f14_arg0:dispatchEventToChildren( {
|
|
name = "button_locked",
|
|
immediate = true
|
|
} )
|
|
end,
|
|
button_over = function ( f15_arg0, f15_arg1 )
|
|
f15_arg0:dispatchEventToRoot( {
|
|
name = "show_all",
|
|
immediate = true
|
|
} )
|
|
f15_arg0:dispatchEventToRoot( {
|
|
name = "update_tip",
|
|
immediate = true,
|
|
new_Text = Engine.Localize( "@ALIENS_EQUALIZER_DESC" )
|
|
} )
|
|
f15_arg0:dispatchEventToRoot( {
|
|
name = "show_tip",
|
|
immediate = true
|
|
} )
|
|
f15_arg0:dispatchEventToRoot( {
|
|
name = "selection_info_set_header_text",
|
|
immediate = true,
|
|
newText = Engine.Localize( "@ALIENS_EQUALIZER" )
|
|
} )
|
|
end
|
|
}
|
|
}
|
|
if f3_local0.getAliensHasPlayerPrestiged( f3_arg0.exclusiveController ) and not f3_local2 then
|
|
f3_local3[#f3_local3 + 1] = {
|
|
type = "aliens_cac_menu_nerf_button",
|
|
id = "nerf_id",
|
|
properties = {},
|
|
handlers = {
|
|
button_action = function ( f16_arg0, f16_arg1 )
|
|
f16_arg0:dispatchEventToRoot( {
|
|
name = "hide_details_btn"
|
|
} )
|
|
OpenSelectionMenu( f16_arg0, f16_arg1, 0, 0, 0, 0, 1 )
|
|
f16_arg0:dispatchEventToRoot( {
|
|
name = "hide_tip",
|
|
immediate = true
|
|
} )
|
|
f16_arg0:dispatchEventToRoot( {
|
|
name = "dim_all",
|
|
immediate = true
|
|
} )
|
|
f16_arg0:dispatchEventToChildren( {
|
|
name = "button_locked",
|
|
immediate = true
|
|
} )
|
|
end,
|
|
button_over = function ( f17_arg0, f17_arg1 )
|
|
f17_arg0:dispatchEventToRoot( {
|
|
name = "show_all",
|
|
immediate = true
|
|
} )
|
|
f17_arg0:dispatchEventToRoot( {
|
|
name = "update_tip",
|
|
immediate = true,
|
|
new_Text = Engine.Localize( "@ALIENS_NERF_DESC" )
|
|
} )
|
|
f17_arg0:dispatchEventToRoot( {
|
|
name = "show_tip",
|
|
immediate = true
|
|
} )
|
|
f17_arg0:dispatchEventToRoot( {
|
|
name = "selection_info_set_header_text",
|
|
immediate = true,
|
|
newText = Engine.Localize( "@ALIENS_NERF" ),
|
|
disabled_in_chaos = true
|
|
} )
|
|
end
|
|
}
|
|
}
|
|
end
|
|
return f3_local3
|
|
end
|
|
|
|
function AltButtonAction( f18_arg0, f18_arg1 )
|
|
if Engine.GetDvarBool( "extinction_cac_enabled" ) then
|
|
Engine.PlaySound( CoD.SFX.MouseClick )
|
|
LUI.FlowManager.RequestAddMenu( f18_arg0, "cac_customize_main", true, f18_arg1.controller, false )
|
|
end
|
|
end
|
|
|
|
function aliens_cac_menu()
|
|
local f19_local0 = LUI.mp_menus.AliensPurchasables.UsingExtinctionTokens() and -30 or 0
|
|
return {
|
|
type = "UIElement",
|
|
id = "aliens_cac_main_id",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0
|
|
}
|
|
},
|
|
handlers = {
|
|
menu_create = function ( f20_arg0, f20_arg1 )
|
|
if Engine.IsConsoleGame() or Engine.IsGamepadEnabled() == 1 then
|
|
f20_arg0:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_action",
|
|
helper_text = Engine.Localize( "@ALIENS_SELECT" ),
|
|
side = "left",
|
|
clickable = false
|
|
} )
|
|
end
|
|
if Engine.GetDvarBool( "extinction_cac_enabled" ) then
|
|
f20_arg0:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_alt1",
|
|
helper_text = Engine.Localize( "@LUA_MENU_CUSTOMIZE_CHAR" ),
|
|
side = "left",
|
|
clickable = true
|
|
} )
|
|
end
|
|
Engine.SetDvarBool( "ui_onlineRequired", false )
|
|
end
|
|
,
|
|
menu_close = function ( f21_arg0, f21_arg1 )
|
|
f21_arg0:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_action",
|
|
helper_text = "",
|
|
side = "left",
|
|
clickable = false
|
|
} )
|
|
Engine.Exec( "uploadstats" )
|
|
end
|
|
|
|
},
|
|
children = {
|
|
{
|
|
type = "generic_menu_title",
|
|
id = "menu_title_text",
|
|
properties = {
|
|
menu_title = Engine.Localize( "@ALIENS_ABILITY_SETUP" )
|
|
}
|
|
},
|
|
{
|
|
type = "button_helper_text_main",
|
|
id = "button_helper_text_id",
|
|
handlers = {
|
|
menu_create = function ( f22_arg0, f22_arg1 )
|
|
f22_arg0:dispatchEventToRoot( LUI.ButtonHelperText.CommonEvents.addBackButton )
|
|
end
|
|
,
|
|
rebind_back_button = MBh.EmitEvent( {
|
|
name = "rebind",
|
|
buttonLeft = ButtonMap.button_secondary
|
|
} )
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
id = "bg_top",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "box_white_gradient_top" ),
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 100,
|
|
right = 550,
|
|
top = 145 + f19_local0,
|
|
bottom = 0,
|
|
red = 0,
|
|
green = 0,
|
|
blue = 0,
|
|
alpha = 0.25
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIVerticalList",
|
|
id = "menu_options_continer",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 100,
|
|
right = 550,
|
|
top = 145 + f19_local0,
|
|
bottom = 0,
|
|
alignment = LUI.Alignment.Top,
|
|
spacing = 1,
|
|
alpha = 1
|
|
},
|
|
dim_in = {
|
|
alpha = 0.3
|
|
},
|
|
dimmed = {
|
|
alpha = 0.3
|
|
}
|
|
},
|
|
childrenFeeder = aliensCacFeeder,
|
|
handlers = {
|
|
dim_all = MBh.AnimateSequence( {
|
|
{
|
|
"dim_in",
|
|
0
|
|
},
|
|
{
|
|
"dimmed",
|
|
100
|
|
}
|
|
} ),
|
|
show_all = MBh.AnimateToState( "default", 100 )
|
|
}
|
|
},
|
|
{
|
|
type = "alien_root_info_panel",
|
|
id = "alien_root_info_panel"
|
|
},
|
|
{
|
|
type = "alien_xp_widget",
|
|
id = "alien_xp_widget_id",
|
|
properties = {
|
|
exclusiveController = MBh.Property( "exclusiveController" )
|
|
}
|
|
},
|
|
{
|
|
type = "alien_tokens_widget",
|
|
id = "alien_tokens_widget_id",
|
|
properties = {
|
|
controller = MBh.Property( "exclusiveController" ),
|
|
xPos = 652,
|
|
yPos = 115
|
|
}
|
|
},
|
|
{
|
|
type = "weekly_bonus_widget",
|
|
id = "weekly_bonus_widget",
|
|
properties = {
|
|
controller = MBh.Property( "exclusiveController" ),
|
|
xPos = 625,
|
|
yPos = 535
|
|
}
|
|
},
|
|
{
|
|
type = "UIBindButton",
|
|
id = "bind_button_id",
|
|
handlers = {
|
|
button_secondary = MBh.LeaveMenu(),
|
|
button_alt1 = AltButtonAction
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function OpenSelectionMenu( f23_arg0, f23_arg1, f23_arg2, f23_arg3, f23_arg4, f23_arg5, f23_arg6 )
|
|
LUI.FlowManager.RequestPopupMenu( f23_arg0, "aliens_cac_select_ability_menu", true, f23_arg1.controller, false, {
|
|
isPerkSlot = f23_arg2,
|
|
perkSlot = f23_arg3,
|
|
isActionSlot = f23_arg4,
|
|
actionSlot = f23_arg5,
|
|
isNerfSlot = f23_arg6
|
|
} )
|
|
end
|
|
|
|
function RefreshInfoPane( f24_arg0, f24_arg1 )
|
|
f24_arg0:dispatchEventToRoot( {
|
|
name = "selection_info_set_message_text",
|
|
newText = f24_arg0.properties.button_desc,
|
|
immediate = true
|
|
} )
|
|
f24_arg0:dispatchEventToRoot( {
|
|
name = "selection_info_set_header_text",
|
|
newText = f24_arg0.properties.button_text,
|
|
immediate = true
|
|
} )
|
|
f24_arg0:dispatchEventToRoot( {
|
|
name = "update_selection",
|
|
ref = f24_arg0.properties.ref,
|
|
immediate = true
|
|
} )
|
|
end
|
|
|
|
function ActionSlotFeeder( f25_arg0 )
|
|
assert( f25_arg0.exclusiveController, "No Exclusive controller found when opening Action Slot Selection Menu." )
|
|
local f25_local0 = assert
|
|
local f25_local1
|
|
if f25_arg0.isPerkSlot ~= 1 and f25_arg0.isActionSlot ~= 1 and f25_arg0.isNerfSlot ~= 1 then
|
|
f25_local1 = false
|
|
else
|
|
f25_local1 = true
|
|
end
|
|
f25_local0( f25_local1 )
|
|
f25_local0 = LUI.mp_menus.Aliens
|
|
f25_local1 = 5
|
|
local f25_local2 = {}
|
|
local f25_local3 = f25_arg0.exclusiveController
|
|
local f25_local4 = nil
|
|
local f25_local5 = Lobby.GetAlienRankForXP( f25_local0.getAliensExperience( f25_local3 ) )
|
|
if f25_arg0.isPerkSlot == 1 then
|
|
f25_local1 = 4
|
|
assert( f25_arg0.perkSlot )
|
|
f25_local2 = f25_local0.GetBasePerkList( f25_arg0.perkSlot )
|
|
f25_local4 = f25_local0.GetAlienPerk( f25_local3, f25_arg0.perkSlot )
|
|
elseif f25_arg0.isActionSlot == 1 then
|
|
assert( f25_arg0.actionSlot )
|
|
f25_local2 = f25_local0.GetBaseAbilityListForActionSlot( f25_arg0.actionSlot )
|
|
f25_local4 = f25_local0.GetAlienAbility( f25_local3, f25_local0.GetDataLabelForSlot( f25_arg0.actionSlot ) )
|
|
elseif f25_arg0.isNerfSlot == 1 then
|
|
f25_local2 = f25_local0.GetBaseNerfList()
|
|
f25_local1 = #f25_local2
|
|
else
|
|
assert( true, "something bad happened, this is not feeding for an action slot of a perk slot, how is that possible?" )
|
|
end
|
|
local f25_local6 = {}
|
|
for f25_local7 = 1, f25_local1, 1 do
|
|
local f25_local10 = ""
|
|
local f25_local11 = ""
|
|
local f25_local12 = nil
|
|
local f25_local13 = ""
|
|
local f25_local14 = RegisterMaterial( "white" )
|
|
local f25_local15 = 0
|
|
local f25_local16 = 0
|
|
local f25_local17 = false
|
|
if f25_local2[f25_local7] then
|
|
local f25_local18 = f25_local2[f25_local7]
|
|
f25_local13 = f25_local18
|
|
if f25_arg0.isPerkSlot == 1 then
|
|
f25_local10 = Engine.Localize( f25_local0.GetFieldForPerk( f25_local18, f25_local0.AlienPerks.Cols.Name ) )
|
|
f25_local14 = RegisterMaterial( f25_local0.GetFieldForPerk( f25_local18, f25_local0.AlienPerks.Cols.Icon ) )
|
|
f25_local11 = Engine.Localize( f25_local0.GetFieldForPerk( f25_local18, f25_local0.AlienPerks.Cols.Desc ) )
|
|
f25_local15 = tonumber( f25_local0.GetFieldForPerk( f25_local18, f25_local0.AlienPerks.Cols.UnlockedAtRank ) )
|
|
if LUI.mp_menus.AliensPurchasables.UsingExtinctionTokens() then
|
|
local f25_local19 = f25_local0.GetFieldForPerk( f25_local18, f25_local0.AlienPerks.Cols.TokenUpgradeName )
|
|
if f25_local19 and f25_local19 ~= "" then
|
|
f25_local17 = Engine.AliensCheckIsItemPurchased( f25_arg0.exclusiveController, f25_local19 )
|
|
end
|
|
end
|
|
if f25_local0.getAliensHasPlayerPrestiged( f25_arg0.exclusiveController ) then
|
|
f25_local15 = 0
|
|
end
|
|
if f25_local4 == f25_local13 then
|
|
local f25_local20 = 1
|
|
end
|
|
f25_local16 = f25_local20 or 0
|
|
f25_local12 = function ( f26_arg0, f26_arg1 )
|
|
if f25_local5 < f25_local15 then
|
|
return
|
|
end
|
|
f25_local0.SetAlienPerk( f26_arg1.controller, f25_arg0.perkSlot, f25_local18 )
|
|
LUI.FlowManager.RequestLeaveMenu( f26_arg0 )
|
|
if f25_arg0.perkSlot == 0 and Engine.AliensCheckIsUpgradeEnabled( f25_local3, "multi_class" ) then
|
|
LUI.mp_menus.Aliens.setDefaultSecondaryClass( f26_arg1.controller )
|
|
OpenSecondaryClassSelection( f26_arg1.controller )
|
|
end
|
|
f26_arg0:dispatchEventToRoot( {
|
|
name = "refresh_cac_menu_buttons",
|
|
controller = f26_arg1.controller,
|
|
immediate = true
|
|
} )
|
|
end
|
|
|
|
elseif f25_arg0.isActionSlot == 1 then
|
|
f25_local10 = Engine.Localize( f25_local0.GetFieldForAbility( f25_local18, f25_local0.AlienAbilities.Cols.Name ) )
|
|
f25_local14 = RegisterMaterial( f25_local0.GetFieldForAbility( f25_local18, f25_local0.AlienAbilities.Cols.Icon ) )
|
|
f25_local11 = Engine.Localize( f25_local0.GetFieldForAbility( f25_local18, f25_local0.AlienAbilities.Cols.Desc ) )
|
|
f25_local15 = tonumber( f25_local0.GetFieldForAbility( f25_local18, f25_local0.AlienAbilities.Cols.UnlockedAtRank ) )
|
|
if f25_local0.getAliensHasPlayerPrestiged( f25_arg0.exclusiveController ) then
|
|
f25_local15 = 0
|
|
end
|
|
if f25_local4 == f25_local13 then
|
|
local f25_local21 = 1
|
|
end
|
|
f25_local16 = f25_local21 or 0
|
|
f25_local12 = function ( f27_arg0, f27_arg1 )
|
|
if f25_local5 < f25_local15 then
|
|
return
|
|
else
|
|
f25_local0.SetAlienAbility( f27_arg1.controller, f25_local0.GetDataLabelForSlot( f25_arg0.actionSlot ), f25_local18 )
|
|
f27_arg0:dispatchEventToRoot( {
|
|
name = "refresh_cac_menu_buttons",
|
|
controller = f27_arg1.controller,
|
|
immediate = true
|
|
} )
|
|
LUI.FlowManager.RequestLeaveMenu( f27_arg0 )
|
|
end
|
|
end
|
|
|
|
elseif f25_arg0.isNerfSlot == 1 then
|
|
f25_local10 = Engine.Localize( f25_local0.GetFieldForNerf( f25_local18, f25_local0.AlienNerfs.Cols.Name ) )
|
|
f25_local14 = RegisterMaterial( f25_local0.GetFieldForNerf( f25_local18, f25_local0.AlienNerfs.Cols.Icon ) )
|
|
f25_local11 = Engine.Localize( f25_local0.GetFieldForNerf( f25_local18, f25_local0.AlienNerfs.Cols.Desc ) )
|
|
if Engine.AliensCheckIsRelicEnabled( f25_local3, f25_local18 ) then
|
|
local f25_local22 = 1
|
|
end
|
|
f25_local16 = f25_local22 or 0
|
|
f25_local12 = function ( f28_arg0, f28_arg1 )
|
|
local f28_local0 = f28_arg0.properties.ref
|
|
local f28_local1 = Engine.AliensCheckIsRelicEnabled( f28_arg1.controller, f28_local0 )
|
|
local f28_local2 = 0
|
|
if f28_local1 then
|
|
LUI.mp_menus.Aliens.SetRelicEnabled( f28_arg1.controller, f28_local0, false )
|
|
elseif f25_local0.getNumEnabledNerfs( f28_arg1.controller ) < f25_local0.getAliensPrestigeLevel( f28_arg1.controller ) then
|
|
LUI.mp_menus.Aliens.SetRelicEnabled( f28_arg1.controller, f28_local0, true )
|
|
f28_local2 = 1
|
|
end
|
|
f28_arg0:dispatchEventToRoot( {
|
|
name = "refresh_cac_menu_buttons",
|
|
controller = f28_arg1.controller,
|
|
immediate = true
|
|
} )
|
|
f28_arg0:processEvent( {
|
|
name = "refresh_cac_is_checked",
|
|
showAsChecked = f28_local2,
|
|
dispatchChildren = true,
|
|
immediate = true
|
|
} )
|
|
end
|
|
|
|
end
|
|
end
|
|
local f25_local18 = #f25_local6 + 1
|
|
local f25_local19 = {
|
|
type = "aliens_cac_ability_button",
|
|
id = "selection_at_index" .. f25_local7,
|
|
listDefaultFocus = f25_local4 == f25_local13
|
|
}
|
|
local f25_local23 = {
|
|
button_text = f25_local10,
|
|
button_desc = f25_local11,
|
|
ref = f25_local13,
|
|
icon = f25_local14
|
|
}
|
|
local f25_local24
|
|
if f25_local5 < f25_local15 then
|
|
f25_local24 = 1
|
|
if not f25_local24 then
|
|
|
|
else
|
|
f25_local23.LockedOverlayAlpha = f25_local24
|
|
f25_local23.unlockLevel = Rank.GetRankDisplay( tostring( f25_local15 ), CoD.PlayMode.Aliens )
|
|
if f25_local15 <= f25_local5 then
|
|
f25_local24 = 1
|
|
if not f25_local24 then
|
|
|
|
else
|
|
f25_local23.checkBoxAlpha = f25_local24
|
|
f25_local23.showAsChecked = f25_local16
|
|
if f25_local13 ~= "" then
|
|
f25_local24 = 1
|
|
if not f25_local24 then
|
|
|
|
else
|
|
f25_local23.show_icon = f25_local24
|
|
f25_local23.isUpgraded = f25_local17
|
|
f25_local19.properties = f25_local23
|
|
f25_local19.handlers = {
|
|
button_action = f25_local12,
|
|
button_over = RefreshInfoPane
|
|
}
|
|
f25_local6[f25_local18] = f25_local19
|
|
end
|
|
end
|
|
f25_local24 = 0
|
|
end
|
|
end
|
|
f25_local24 = 0
|
|
end
|
|
end
|
|
f25_local24 = 0
|
|
end
|
|
return f25_local6
|
|
end
|
|
|
|
function aliens_cac_select_ability_menu()
|
|
return {
|
|
type = "UIElement",
|
|
id = "aliens_cac_select_ability_menu_id",
|
|
properties = {
|
|
isPerkSlot = 0,
|
|
perkSlot = -1,
|
|
isActionSlot = 0,
|
|
actionSlot = -1,
|
|
isNerfSlot = 0
|
|
},
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
alpha = 1
|
|
},
|
|
hidden = {
|
|
alpha = 0
|
|
}
|
|
},
|
|
handlers = {
|
|
hide_select_ability_menu = MBh.AnimateToState( "hidden", 0 ),
|
|
show_select_ability_menu = MBh.AnimateToState( "default", 0 ),
|
|
update_selection = function ( f30_arg0, f30_arg1 )
|
|
f30_arg0:processEvent( {
|
|
name = "updateInfoPanel",
|
|
ref = f30_arg1.ref,
|
|
isPerk = f30_arg0.properties.isPerkSlot,
|
|
isAction = f30_arg0.properties.isActionSlot,
|
|
isNerf = f30_arg0.properties.isNerfSlot,
|
|
dispatchChildren = true
|
|
} )
|
|
end
|
|
,
|
|
menu_create = function ( f31_arg0, f31_arg1 )
|
|
f31_arg0:dispatchEventToRoot( {
|
|
name = "rebind_back_button",
|
|
immediate = true
|
|
} )
|
|
if Engine.GetDvarBool( "extinction_cac_enabled" ) then
|
|
f31_arg0:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_alt1",
|
|
helper_text = "",
|
|
side = "left",
|
|
clickable = true
|
|
} )
|
|
end
|
|
end
|
|
,
|
|
menu_close = function ( f32_arg0, f32_arg1 )
|
|
if Engine.GetDvarBool( "extinction_cac_enabled" ) then
|
|
f32_arg0:dispatchEventToRoot( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "button_alt1",
|
|
helper_text = Engine.Localize( "@LUA_MENU_CUSTOMIZE_CHAR" ),
|
|
side = "left",
|
|
clickable = true
|
|
} )
|
|
end
|
|
end
|
|
|
|
},
|
|
children = {
|
|
{
|
|
type = "alien_info_panel",
|
|
id = "info_panel_id"
|
|
},
|
|
{
|
|
type = "UIGrid",
|
|
id = "selection_options_list",
|
|
properties = {
|
|
isPerkSlot = MBh.Property( "isPerkSlot" ),
|
|
perkSlot = MBh.Property( "perkSlot" ),
|
|
isActionSlot = MBh.Property( "isActionSlot" ),
|
|
actionSlot = MBh.Property( "actionSlot" ),
|
|
isNerfSlot = MBh.Property( "isNerfSlot" ),
|
|
exclusiveController = MBh.Property( "exclusiveController" ),
|
|
hSpacing = 15,
|
|
vSpacing = 22
|
|
},
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 600,
|
|
width = 555,
|
|
top = 150,
|
|
bottom = 0
|
|
}
|
|
},
|
|
childrenFeeder = ActionSlotFeeder
|
|
},
|
|
{
|
|
type = "UIBindButton",
|
|
id = "bind_button_id",
|
|
properties = {
|
|
current_selected_ref = "",
|
|
isPerk = MBh.Property( "isPerkSlot" ),
|
|
isAction = MBh.Property( "isActionSlot" ),
|
|
isNerf = MBh.Property( "isNerfSlot" ),
|
|
exclusiveController = MBh.Property( "exclusiveController" )
|
|
},
|
|
handlers = {
|
|
button_secondary = MBh.LeaveMenu()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function RefreshButtonTitleText( f33_arg0, f33_arg1 )
|
|
if f33_arg0.properties.isPerkSlot == 1 then
|
|
f33_arg0.properties.text = Engine.Localize( LUI.mp_menus.Aliens.GetFieldForPerk( LUI.mp_menus.Aliens.GetAlienPerk( f33_arg1.controller, f33_arg0.properties.perkSlot ), LUI.mp_menus.Aliens.AlienPerks.Cols.Name ) )
|
|
elseif f33_arg0.properties.isActionSlot == 1 then
|
|
f33_arg0.properties.text = Engine.Localize( LUI.mp_menus.Aliens.GetFieldForAbility( LUI.mp_menus.Aliens.GetAlienAbility( f33_arg1.controller, LUI.mp_menus.Aliens.GetDataLabelForSlot( f33_arg0.properties.actionSlot ) ), LUI.mp_menus.Aliens.AlienAbilities.Cols.Name ) )
|
|
end
|
|
f33_arg0:setText( f33_arg0.properties.text )
|
|
end
|
|
|
|
function aliens_cac_menu_button()
|
|
return {
|
|
type = "UIButton",
|
|
id = "loadoutbutton_id",
|
|
properties = {
|
|
isPerkSlot = 0,
|
|
perkSlot = -1,
|
|
isActionSlot = 0,
|
|
actionSlot = -1,
|
|
isNerfSlot = 0,
|
|
nerfSlot = -1,
|
|
ability_text = "",
|
|
ability_text_width = 0,
|
|
selected_ability_text = "",
|
|
selected_ability_desc_text = "",
|
|
icon = "white",
|
|
dpadAlpha = 0,
|
|
leftArrowAlpha = 0,
|
|
rightArrowAlpha = 0,
|
|
upArrowAlpha = 0,
|
|
downArrowAlpha = 0
|
|
},
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 70
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "btn_divider",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "white" ),
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 1,
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0.1
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
id = "btn_bkg",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "btn_alien_loadout_rtcap_f" ),
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 25,
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0
|
|
},
|
|
dim = {
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0.5
|
|
},
|
|
focus = {
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0.8
|
|
},
|
|
locked = {
|
|
red = Colors.frontend_hilite.r,
|
|
green = Colors.frontend_hilite.g,
|
|
blue = Colors.frontend_hilite.b,
|
|
alpha = 1
|
|
}
|
|
},
|
|
handlers = {
|
|
button_over = MBh.AnimateLoop( {
|
|
{
|
|
"focus",
|
|
0
|
|
},
|
|
{
|
|
"dim",
|
|
750
|
|
},
|
|
{
|
|
"focus",
|
|
750
|
|
}
|
|
} ),
|
|
button_up = MBh.AnimateToState( "default", 0 ),
|
|
button_locked = MBh.AnimateToState( "focus", 0 )
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
id = "SecondaryClassIcon",
|
|
properties = {
|
|
isPerkSlot = MBh.Property( "isPerkSlot" ),
|
|
perkSlot = MBh.Property( "perkSlot" )
|
|
},
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "white" ),
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 23,
|
|
right = 55,
|
|
top = 28,
|
|
bottom = -10,
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0
|
|
},
|
|
invisible = {
|
|
alpha = 0
|
|
},
|
|
visible = {
|
|
alpha = 1
|
|
},
|
|
focused = {
|
|
red = 0,
|
|
green = 0,
|
|
blue = 0
|
|
},
|
|
unfocused = {
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1
|
|
}
|
|
},
|
|
handlers = {
|
|
refresh_cac_menu_buttons = function ( f35_arg0, f35_arg1 )
|
|
local f35_local0 = f35_arg0.properties.isPerkSlot
|
|
local f35_local1 = f35_arg0.properties.perkSlot
|
|
local f35_local2 = f35_arg1.controller
|
|
local f35_local3 = LUI.mp_menus.Aliens.GetSecondaryClassRef( f35_local2 )
|
|
if Engine.AliensCheckIsUpgradeEnabled( f35_local2, "multi_class" ) and f35_local3 and f35_local0 == 1 and f35_local1 == 0 then
|
|
f35_arg0:setImage( RegisterMaterial( LUI.mp_menus.Aliens.GetFieldForPerk( f35_local3, LUI.mp_menus.Aliens.AlienPerks.Cols.Icon ) ) )
|
|
f35_arg0:animateToState( "visible" )
|
|
else
|
|
f35_arg0:animateToState( "invisible" )
|
|
end
|
|
end
|
|
,
|
|
menu_create = function ( f36_arg0, f36_arg1 )
|
|
local f36_local0 = f36_arg0.properties.exclusiveController
|
|
if Engine.AliensCheckIsUpgradeEnabled( f36_local0, "multi_class" ) then
|
|
local f36_local1 = LUI.mp_menus.Aliens.GetSecondaryClassRef( f36_local0 )
|
|
f36_arg0:processEvent( {
|
|
name = "refresh_cac_menu_buttons",
|
|
controller = f36_local0
|
|
} )
|
|
end
|
|
end
|
|
,
|
|
button_over = MBh.AnimateToState( "focused", 0 ),
|
|
button_up = MBh.AnimateToState( "unfocused", 0 ),
|
|
button_locked = MBh.AnimateToState( "focused", 0 )
|
|
}
|
|
},
|
|
{
|
|
type = "UIElement",
|
|
id = "dpad_icon_id",
|
|
properties = {
|
|
dpadAlpha = MBh.Property( "dpadAlpha" ),
|
|
leftArrowAlpha = MBh.Property( "leftArrowAlpha" ),
|
|
rightArrowAlpha = MBh.Property( "rightArrowAlpha" ),
|
|
upArrowAlpha = MBh.Property( "upArrowAlpha" ),
|
|
downArrowAlpha = MBh.Property( "downArrowAlpha" )
|
|
},
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 50,
|
|
top = 10,
|
|
bottom = -10,
|
|
alpha = MBh.Property( "dpadAlpha" )
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "up_id",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "alien_cash_dpad_up" ),
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
alpha = MBh.Property( "upArrowAlpha" )
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
id = "down_id",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "alien_cash_dpad_dn" ),
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
alpha = MBh.Property( "downArrowAlpha" )
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
id = "left_id",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "alien_cash_dpad_lt" ),
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
alpha = MBh.Property( "leftArrowAlpha" )
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
id = "right_id",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "alien_cash_dpad_rt" ),
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
alpha = MBh.Property( "rightArrowAlpha" )
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
id = "ability_icon",
|
|
properties = {
|
|
isPerkSlot = MBh.Property( "isPerkSlot" ),
|
|
perkSlot = MBh.Property( "perkSlot" ),
|
|
isActionSlot = MBh.Property( "isActionSlot" ),
|
|
actionSlot = MBh.Property( "actionSlot" ),
|
|
isNerfSlot = MBh.Property( "isNerfSlot" ),
|
|
nerfSlot = MBh.Property( "nerfSlot" ),
|
|
icon = MBh.Property( "icon" )
|
|
},
|
|
states = {
|
|
default = CoD.ColorizeState( Colors.white, {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
left = 58,
|
|
width = 48,
|
|
height = 48
|
|
} ),
|
|
focused = CoD.ColorizeState( Colors.black, {
|
|
scale = 0.1
|
|
} ),
|
|
unfocused = CoD.ColorizeState( Colors.black, {
|
|
scale = 0
|
|
} )
|
|
},
|
|
handlers = {
|
|
refresh_cac_menu_buttons = function ( f37_arg0, f37_arg1 )
|
|
if f37_arg0.properties.isPerkSlot == 1 then
|
|
f37_arg0.properties.icon = LUI.mp_menus.Aliens.GetFieldForPerk( LUI.mp_menus.Aliens.GetAlienPerk( f37_arg1.controller, f37_arg0.properties.perkSlot ), LUI.mp_menus.Aliens.AlienPerks.Cols.Icon )
|
|
elseif f37_arg0.properties.isActionSlot == 1 then
|
|
f37_arg0.properties.icon = LUI.mp_menus.Aliens.GetFieldForAbility( LUI.mp_menus.Aliens.GetAlienAbility( f37_arg1.controller, LUI.mp_menus.Aliens.GetDataLabelForSlot( f37_arg0.properties.actionSlot ) ), LUI.mp_menus.Aliens.AlienAbilities.Cols.Icon )
|
|
end
|
|
f37_arg0:setImage( RegisterMaterial( f37_arg0.properties.icon ) )
|
|
end
|
|
,
|
|
button_over = MBh.AnimateSequence( {
|
|
{
|
|
"unfocused",
|
|
0
|
|
},
|
|
{
|
|
"focused",
|
|
100
|
|
},
|
|
{
|
|
"unfocused",
|
|
100
|
|
}
|
|
} ),
|
|
button_up = MBh.AnimateToState( "default", 0 ),
|
|
button_locked = MBh.AnimateToState( "unfocused", 0 ),
|
|
menu_create = function ( f38_arg0, f38_arg1 )
|
|
f38_arg0:setImage( f38_arg0.properties.icon )
|
|
end
|
|
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "ability_text_id",
|
|
properties = {
|
|
text = MBh.Property( "ability_text" )
|
|
},
|
|
states = {
|
|
default = {
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 120,
|
|
right = 0,
|
|
top = 5,
|
|
bottom = 5 + CoD.TextSettings.NormalFont.Height,
|
|
red = 0.7,
|
|
green = 0.7,
|
|
blue = 0.7,
|
|
alpha = 1
|
|
},
|
|
focus = {
|
|
red = 0,
|
|
green = 0,
|
|
blue = 0
|
|
}
|
|
},
|
|
handlers = {
|
|
button_over = MBh.AnimateToState( "focus", 0 ),
|
|
button_up = MBh.AnimateToState( "default", 0 ),
|
|
button_locked = MBh.AnimateToState( "focus", 0 )
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "selected_ability_text_id",
|
|
properties = {
|
|
isPerkSlot = MBh.Property( "isPerkSlot" ),
|
|
perkSlot = MBh.Property( "perkSlot" ),
|
|
isActionSlot = MBh.Property( "isActionSlot" ),
|
|
actionSlot = MBh.Property( "actionSlot" ),
|
|
isNerfSlot = MBh.Property( "isNerfSlot" ),
|
|
nerfSlot = MBh.Property( "nerfSlot" ),
|
|
text = "",
|
|
text_selected = MBh.Property( "selected_ability_text" ),
|
|
w = MBh.Property( "ability_text_width" )
|
|
},
|
|
states = {
|
|
default = {
|
|
font = CoD.TextSettings.BoldFont.Font,
|
|
alignment = LUI.Alignment.Left,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = MBh.Property( "w" ),
|
|
right = 0,
|
|
top = 5,
|
|
bottom = 5 + CoD.TextSettings.BoldFont.Height,
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 1
|
|
},
|
|
focus = {
|
|
red = 0,
|
|
green = 0,
|
|
blue = 0
|
|
},
|
|
highlight = {
|
|
red = 0,
|
|
green = 0,
|
|
blue = 0
|
|
}
|
|
},
|
|
handlers = {
|
|
button_over = MBh.AnimateToState( "highlight", 0 ),
|
|
button_up = MBh.AnimateToState( "default", 0 ),
|
|
button_locked = MBh.AnimateToState( "focus", 0 ),
|
|
refresh_cac_menu_buttons = RefreshButtonTitleText,
|
|
menu_create = RefreshButtonTitleText
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "action_slot_selection_desc",
|
|
properties = {
|
|
isPerkSlot = MBh.Property( "isPerkSlot" ),
|
|
perkSlot = MBh.Property( "perkSlot" ),
|
|
isActionSlot = MBh.Property( "isActionSlot" ),
|
|
actionSlot = MBh.Property( "actionSlot" ),
|
|
isNerfSlot = MBh.Property( "isNerfSlot" ),
|
|
nerfSlot = MBh.Property( "nerfSlot" ),
|
|
text = MBh.Property( "selected_ability_desc_text" )
|
|
},
|
|
states = {
|
|
default = {
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 120,
|
|
right = -5,
|
|
top = 25,
|
|
bottom = 25 + CoD.TextSettings.NormalFont.Height,
|
|
red = 0.5,
|
|
green = 0.5,
|
|
blue = 0.5,
|
|
alpha = 1
|
|
},
|
|
focus = {
|
|
red = 0,
|
|
green = 0,
|
|
blue = 0
|
|
}
|
|
},
|
|
handlers = {
|
|
button_over = MBh.AnimateToState( "focus", 0 ),
|
|
button_up = MBh.AnimateToState( "default", 0 ),
|
|
button_locked = MBh.AnimateToState( "focus", 0 ),
|
|
refresh_cac_menu_buttons = function ( f39_arg0, f39_arg1 )
|
|
if f39_arg0.properties.isPerkSlot == 1 then
|
|
f39_arg0.properties.text = Engine.Localize( LUI.mp_menus.Aliens.GetFieldForPerk( LUI.mp_menus.Aliens.GetAlienPerk( f39_arg1.controller, f39_arg0.properties.perkSlot ), LUI.mp_menus.Aliens.AlienPerks.Cols.Desc ) )
|
|
elseif f39_arg0.properties.isActionSlot == 1 then
|
|
f39_arg0.properties.text = Engine.Localize( LUI.mp_menus.Aliens.GetFieldForAbility( LUI.mp_menus.Aliens.GetAlienAbility( f39_arg1.controller, LUI.mp_menus.Aliens.GetDataLabelForSlot( f39_arg0.properties.actionSlot ) ), LUI.mp_menus.Aliens.AlienAbilities.Cols.Desc ) )
|
|
end
|
|
f39_arg0:setText( f39_arg0.properties.text )
|
|
end
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function RelicImagesFeeder()
|
|
local f40_local0 = function ( f41_arg0, f41_arg1 )
|
|
if Engine.AliensCheckIsRelicEnabled( f41_arg1.controller, f41_arg0.properties.nerfRef ) then
|
|
f41_arg0:animateToState( "visible" )
|
|
else
|
|
f41_arg0:animateToState( "dim" )
|
|
end
|
|
end
|
|
|
|
local f40_local1 = {}
|
|
local f40_local2 = LUI.mp_menus.Aliens.GetBaseNerfList()
|
|
local f40_local3 = 350 / #f40_local2
|
|
for f40_local4 = 1, #f40_local2, 1 do
|
|
local f40_local7 = f40_local2[f40_local4]
|
|
f40_local1[#f40_local1 + 1] = {
|
|
type = "UIImage",
|
|
id = "nerf_icon_" .. f40_local4,
|
|
properties = {
|
|
nerfRef = f40_local7
|
|
},
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( LUI.mp_menus.Aliens.GetFieldForNerf( f40_local7, LUI.mp_menus.Aliens.AlienNerfs.Cols.Icon ) ),
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
width = f40_local3,
|
|
height = f40_local3,
|
|
top = 5,
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 1
|
|
},
|
|
focus = {
|
|
red = 0,
|
|
green = 0,
|
|
blue = 0
|
|
},
|
|
unfocus = {
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1
|
|
},
|
|
visible = {
|
|
alpha = 1
|
|
},
|
|
dim = {
|
|
alpha = 0.15
|
|
}
|
|
},
|
|
handlers = {
|
|
button_over = MBh.AnimateToState( "focus", 70 ),
|
|
button_up = MBh.AnimateToState( "unfocus", 70 ),
|
|
button_locked = MBh.AnimateToState( "focus", 0 ),
|
|
menu_create = f40_local0,
|
|
refresh_cac_menu_buttons = f40_local0
|
|
}
|
|
}
|
|
end
|
|
return f40_local1
|
|
end
|
|
|
|
function aliens_cac_menu_nerf_button()
|
|
local f42_local0 = 70
|
|
local f42_local1 = LUI.mp_menus.Aliens.GetBaseNerfList()
|
|
if #f42_local1 > 5 then
|
|
f42_local0 = 350 / #f42_local1 + 10
|
|
end
|
|
return {
|
|
type = "UIButton",
|
|
id = "loadoutbutton_id",
|
|
properties = {},
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = f42_local0
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "btn_divider",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "white" ),
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = -1,
|
|
bottom = 0,
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0.1
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
id = "btn_bkg",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "white" ),
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0
|
|
},
|
|
dim = {
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0.25
|
|
},
|
|
focus = {
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0.5
|
|
},
|
|
locked = {
|
|
red = Colors.frontend_hilite.r,
|
|
green = Colors.frontend_hilite.g,
|
|
blue = Colors.frontend_hilite.b,
|
|
alpha = 1
|
|
}
|
|
},
|
|
handlers = {
|
|
button_over = MBh.AnimateLoop( {
|
|
{
|
|
"focus",
|
|
0
|
|
},
|
|
{
|
|
"dim",
|
|
750
|
|
},
|
|
{
|
|
"focus",
|
|
750
|
|
}
|
|
} ),
|
|
button_up = MBh.AnimateToState( "default", 0 ),
|
|
button_locked = MBh.AnimateToState( "focus", 0 )
|
|
}
|
|
},
|
|
{
|
|
type = "UIHorizontalList",
|
|
id = "nerf_icons",
|
|
properties = {},
|
|
states = {
|
|
default = {
|
|
alignment = LUI.Alignment.Center,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = 0,
|
|
top = -f42_local0 / 2,
|
|
bottom = f42_local0 / 2,
|
|
spacing = 10
|
|
},
|
|
focus = {
|
|
red = 0,
|
|
green = 0,
|
|
blue = 0
|
|
},
|
|
unfocus = {
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1
|
|
}
|
|
},
|
|
childrenFeeder = RelicImagesFeeder,
|
|
handlers = {
|
|
button_over = MBh.AnimateToState( "focus", 70 ),
|
|
button_up = MBh.AnimateToState( "unfocus", 70 )
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function aliens_cac_ability_button( f43_arg0, f43_arg1, f43_arg2 )
|
|
local f43_local0 = 90
|
|
local f43_local1 = 90
|
|
local f43_local2 = f43_arg1 or {}
|
|
local f43_local3 = f43_local2.checkBoxAlpha or 1
|
|
local f43_local4 = f43_local2.LockedOverlayAlpha or 0
|
|
local f43_local5 = f43_local2.unlockLevel or 0
|
|
local f43_local6 = f43_local2.showAsChecked or 0
|
|
local f43_local7 = f43_local2.show_icon or 0
|
|
local f43_local8 = f43_local2.isUpgraded or false
|
|
local f43_local9 = f43_local2.ref or ""
|
|
local f43_local10 = f43_local2.button_text or ""
|
|
local f43_local11 = f43_local2.name or ""
|
|
local f43_local12 = f43_local2.desc or ""
|
|
local f43_local13 = f43_local2.icon
|
|
if not f43_local13 then
|
|
f43_local13 = RegisterMaterial( "white" )
|
|
end
|
|
local self = LUI.UIButton.new()
|
|
self.id = "generic_id"
|
|
self.properties = {
|
|
checkBoxAlpha = f43_local3,
|
|
LockedOverlayAlpha = f43_local4,
|
|
unlockLevel = f43_local5,
|
|
showAsChecked = f43_local6,
|
|
show_icon = f43_local7,
|
|
isUpgraded = f43_local8,
|
|
ref = f43_local9,
|
|
button_text = f43_local10,
|
|
name = f43_local11,
|
|
desc = f43_local12,
|
|
icon = f43_local13
|
|
}
|
|
self:registerAnimationState( "default", {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = f43_local0,
|
|
top = 0,
|
|
bottom = f43_local1
|
|
} )
|
|
self:animateToState( "default" )
|
|
local f43_local15 = LUI.UIElement.new()
|
|
f43_local15.id = "bkg_root_id"
|
|
f43_local15:registerAnimationState( "default", {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0,
|
|
alpha = 0.05
|
|
} )
|
|
f43_local15:registerAnimationState( "over", {
|
|
alpha = 0.8
|
|
} )
|
|
f43_local15:registerAnimationState( "over_dim", {
|
|
alpha = 0.5
|
|
} )
|
|
f43_local15:registerEventHandler( "button_over", MBh.AnimateLoop( {
|
|
{
|
|
"over",
|
|
0
|
|
},
|
|
{
|
|
"over_dim",
|
|
750,
|
|
true,
|
|
true
|
|
},
|
|
{
|
|
"over",
|
|
750
|
|
}
|
|
} ) )
|
|
f43_local15:registerEventHandler( "button_up", MBh.AnimateToState( "default", 0 ) )
|
|
f43_local15:animateToState( "default" )
|
|
self:addElement( f43_local15 )
|
|
f43_local15:addElement( LUI.mp_menus.CacEditChooseImagePopup.cac_edit_choose_image_button_background( nil, {} ) )
|
|
if f43_local8 then
|
|
local f43_local16 = math.random( -50, 50 )
|
|
local f43_local17 = math.random( -20, 10 )
|
|
local f43_local18 = LUI.UIElement.new()
|
|
f43_local18:setUseStencil( true )
|
|
f43_local18.id = "stencil_id"
|
|
f43_local18:registerAnimationState( "default", {
|
|
material = RegisterMaterial( "btn_alien_overlay" ),
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0
|
|
} )
|
|
f43_local18:animateToState( "default" )
|
|
self:addElement( f43_local18 )
|
|
local f43_local19 = LUI.UIImage.new()
|
|
f43_local19.id = "blood_splat_glow"
|
|
f43_local19:registerAnimationState( "default", {
|
|
material = RegisterMaterial( "btn_alien_overlay" ),
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = -50 + f43_local17,
|
|
bottom = 50 + f43_local17,
|
|
left = -100 + f43_local16,
|
|
right = 100 + f43_local16,
|
|
alpha = 0
|
|
} )
|
|
f43_local19:animateToState( "default" )
|
|
f43_local19:registerAnimationState( "glow", {
|
|
alpha = 0.2
|
|
} )
|
|
f43_local19:animateToState( "glow" )
|
|
f43_local18:addElement( f43_local19 )
|
|
end
|
|
local f43_local16 = LUI.UIImage.new()
|
|
f43_local16.id = "selection_tab_id"
|
|
f43_local16.properties = {
|
|
showAsChecked = f43_local6
|
|
}
|
|
f43_local16:registerAnimationState( "default", {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
top = 0,
|
|
bottom = 16,
|
|
left = 0,
|
|
right = 16,
|
|
material = RegisterMaterial( "widg_triangle" ),
|
|
alpha = 0
|
|
} )
|
|
f43_local16:registerAnimationState( "focused", {
|
|
red = Colors.white.r,
|
|
green = Colors.white.g,
|
|
blue = Colors.white.b,
|
|
alpha = 1
|
|
} )
|
|
f43_local16:registerAnimationState( "unfocused", {
|
|
red = Colors.white.r,
|
|
green = Colors.white.g,
|
|
blue = Colors.white.b,
|
|
alpha = 0
|
|
} )
|
|
f43_local16:registerAnimationState( "selected", {
|
|
red = Colors.alien_frontend_hilite.r,
|
|
green = Colors.alien_frontend_hilite.g,
|
|
blue = Colors.alien_frontend_hilite.b,
|
|
alpha = 1
|
|
} )
|
|
f43_local16:registerEventHandler( "button_over", function ( element, event )
|
|
element:animateToState( element.properties.showAsChecked and "selected" or "focused", 0 )
|
|
end )
|
|
f43_local16:registerEventHandler( "button_up", function ( element, event )
|
|
element:animateToState( element.properties.showAsChecked and "selected" or "unfocused", 0 )
|
|
end )
|
|
f43_local16:registerEventHandler( "menu_create", function ( element, event )
|
|
element:animateToState( element.properties.showAsChecked and "selected" or "unfocused", 0 )
|
|
end )
|
|
f43_local16:registerEventHandler( "refresh_cac_is_checked", function ( element, event )
|
|
local f47_local0 = event.showAsChecked and "selected" or "focused"
|
|
element.properties.showAsChecked = event.showAsChecked
|
|
element:animateToState( f47_local0, 0 )
|
|
end )
|
|
f43_local16:animateToState( "default" )
|
|
self:addElement( f43_local16 )
|
|
local f43_local17 = LUI.UIImage.new()
|
|
f43_local17.id = "ability_icon"
|
|
f43_local17:registerAnimationState( "default", {
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
width = 64,
|
|
height = 64,
|
|
scale = 0,
|
|
material = f43_local13,
|
|
alpha = f43_local7,
|
|
red = Colors.white.r,
|
|
green = Colors.white.g,
|
|
blue = Colors.white.b,
|
|
alpha = 1
|
|
} )
|
|
f43_local17:registerAnimationState( "focused", {
|
|
scale = 0.1,
|
|
red = Colors.black.r,
|
|
green = Colors.black.g,
|
|
blue = Colors.black.b,
|
|
alpha = 1
|
|
} )
|
|
f43_local17:registerAnimationState( "unfocused", {
|
|
scale = 0,
|
|
red = Colors.black.r,
|
|
green = Colors.black.g,
|
|
blue = Colors.black.b,
|
|
alpha = 1
|
|
} )
|
|
f43_local17:registerEventHandler( "button_over", MBh.AnimateSequence( {
|
|
{
|
|
"unfocused",
|
|
0
|
|
},
|
|
{
|
|
"focused",
|
|
100
|
|
},
|
|
{
|
|
"unfocused",
|
|
100
|
|
}
|
|
} ) )
|
|
f43_local17:registerEventHandler( "button_up", MBh.AnimateToState( "default", 0 ) )
|
|
f43_local17:animateToState( "default" )
|
|
self:addElement( f43_local17 )
|
|
local f43_local18 = LUI.UIElement.new()
|
|
f43_local18.id = "locked_overlay"
|
|
f43_local18:registerAnimationState( "default", {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
alpha = f43_local4
|
|
} )
|
|
f43_local18:animateToState( "default" )
|
|
self:addElement( f43_local18 )
|
|
local f43_local19 = LUI.UIImage.new()
|
|
f43_local19.id = "lock_img"
|
|
f43_local19:registerAnimationState( "default", {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
bottom = 0,
|
|
width = 16,
|
|
height = 16,
|
|
material = RegisterMaterial( "icon_unlock_active" )
|
|
} )
|
|
f43_local19:animateToState( "default" )
|
|
f43_local18:addElement( f43_local19 )
|
|
local f43_local20 = LUI.UIText.new()
|
|
f43_local20.id = "level_req_text"
|
|
f43_local20:registerAnimationState( "default", {
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
bottom = 0,
|
|
left = 16,
|
|
right = 0,
|
|
height = CoD.TextSettings.TinyFont.Height,
|
|
font = CoD.TextSettings.SmallFont.Font,
|
|
alignment = LUI.Alignment.Left,
|
|
red = Colors.white.r,
|
|
green = Colors.white.g,
|
|
blue = Colors.white.b
|
|
} )
|
|
f43_local20:setTextStyle( CoD.TextStyle.Outlined )
|
|
f43_local20:setText( tostring( f43_local5 ) )
|
|
f43_local20:animateToState( "default" )
|
|
f43_local18:addElement( f43_local20 )
|
|
return self
|
|
end
|
|
|
|
function OpenDescList( f48_arg0, f48_arg1, f48_arg2, f48_arg3, f48_arg4 )
|
|
LUI.FlowManager.RequestPopupMenu( f48_arg0, "alien_description_list", true, f48_arg1.controller, false, {
|
|
ref = f48_arg2,
|
|
isPerk = f48_arg3,
|
|
isAction = f48_arg4,
|
|
isNerf = isNerf
|
|
} )
|
|
end
|
|
|
|
function GetSeperator( f49_arg0 )
|
|
return {
|
|
type = "UIImage",
|
|
id = f49_arg0,
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "white" ),
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = isBold and 0 or 2,
|
|
right = isBold and 0 or -2,
|
|
top = 0,
|
|
bottom = 1,
|
|
red = 0.7,
|
|
green = 0.7,
|
|
blue = 0.7,
|
|
alpha = 0.2
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function DescListFeeder( f50_arg0 )
|
|
assert( f50_arg0.ref )
|
|
local f50_local0 = assert
|
|
local f50_local1 = f50_arg0.isPerk
|
|
if not f50_local1 then
|
|
f50_local1 = f50_arg0.isAction or f50_arg0.isNerf
|
|
end
|
|
f50_local0( f50_local1 )
|
|
f50_local0 = LUI.mp_menus.Aliens
|
|
local f50_local1, f50_local2, f50_local3, f50_local4 = nil
|
|
local f50_local5 = {
|
|
[#f50_local5 + 1] = GetSeperator( "sep" )
|
|
}
|
|
for f50_local6 = 1, 4, 1 do
|
|
local f50_local9 = f50_arg0.ref
|
|
if f50_local6 > 0 then
|
|
f50_local9 = f50_local9 .. "_" .. f50_local6
|
|
end
|
|
if f50_arg0.isPerk == 1 then
|
|
f50_local1 = f50_local0.GetFieldForPerk( f50_local9, f50_local0.AlienPerks.Cols.Desc )
|
|
f50_local2 = f50_local0.GetFieldForPerk( f50_local9, f50_local0.AlienPerks.Cols.Icon )
|
|
f50_local4 = ""
|
|
elseif f50_arg0.isAction then
|
|
local f50_local10 = LUI.mp_menus.Aliens
|
|
f50_local1 = f50_local0.GetFieldForAbility( f50_local9, f50_local0.AlienAbilities.Cols.Desc )
|
|
f50_local2 = f50_local0.GetFieldForAbility( f50_local9, f50_local0.AlienAbilities.Cols.Icon )
|
|
f50_local4 = "$" .. f50_local0.GetFieldForAbility( f50_local9, f50_local0.AlienAbilities.Cols.CurrencyCost )
|
|
else
|
|
f50_local1 = f50_local0.GetFieldForNerf( f50_local9, f50_local0.AlienNerfs.Cols.Desc )
|
|
f50_local2 = f50_local0.GetFieldForNerf( f50_local9, f50_local0.AlienNerfs.Cols.Icon )
|
|
f50_local4 = ""
|
|
end
|
|
local f50_local10 = #f50_local5 + 1
|
|
local f50_local11 = {
|
|
type = "alien_description_item",
|
|
id = "desc_item_" .. f50_local6,
|
|
focusable = false
|
|
}
|
|
local f50_local12 = {
|
|
descText = Engine.Localize( f50_local1 )
|
|
}
|
|
local f50_local13
|
|
if f50_local6 == 0 then
|
|
f50_local13 = ""
|
|
if not f50_local13 then
|
|
|
|
else
|
|
f50_local12.upgradeText = f50_local13
|
|
f50_local12.icon = RegisterMaterial( f50_local2 )
|
|
f50_local12.costText = f50_local4
|
|
f50_local12.background_alpha = f50_local6 % 2 and 0.05 or 0
|
|
f50_local11.properties = f50_local12
|
|
f50_local5[f50_local10] = f50_local11
|
|
end
|
|
end
|
|
f50_local13 = "+" .. f50_local6
|
|
end
|
|
return f50_local5
|
|
end
|
|
|
|
function DescListCreate( f51_arg0, f51_arg1 )
|
|
|
|
end
|
|
|
|
function DescListClose( f52_arg0, f52_arg1 )
|
|
f52_arg0:dispatchEventToRoot( {
|
|
name = "show_details_btn"
|
|
} )
|
|
end
|
|
|
|
function alien_description_list()
|
|
return {
|
|
type = "UIElement",
|
|
id = "desc_list_id",
|
|
properties = {
|
|
ref = "perk_health",
|
|
exclusiveController = MBh.Property( "exclusiveController" )
|
|
},
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 600,
|
|
width = 555,
|
|
top = 325,
|
|
height = 375
|
|
}
|
|
},
|
|
handlers = {
|
|
menu_create = DescListCreate,
|
|
menu_close = DescListClose
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIVerticalList",
|
|
id = "descriptions_list_vlist",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
spacing = 1
|
|
}
|
|
},
|
|
childrenFeeder = DescListFeeder
|
|
},
|
|
{
|
|
type = "UIBindButton",
|
|
id = "exit_button_handler_id",
|
|
handlers = {
|
|
button_secondary = MBh.LeaveMenu(),
|
|
button_alt1 = MBh.LeaveMenu()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function alien_description_item()
|
|
local f54_local0 = 68
|
|
local f54_local1 = 48
|
|
local f54_local2 = 48
|
|
return {
|
|
type = "UIButton",
|
|
id = "desc_item_id",
|
|
properties = {
|
|
descText = "descText",
|
|
upgradeText = "+1",
|
|
icon = RegisterMaterial( "specialty_armorvest" ),
|
|
costText = "$1111",
|
|
background_alpha = 0
|
|
},
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = f54_local0
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 2,
|
|
right = -2,
|
|
top = 0,
|
|
bottom = 0,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = MBh.Property( "background_alpha" )
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
id = "icon_image_id",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
left = 10,
|
|
right = 10 + f54_local1,
|
|
height = f54_local1,
|
|
material = MBh.Property( "icon" ),
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 1
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "plus_text_id",
|
|
properties = {
|
|
text = MBh.Property( "upgradeText" )
|
|
},
|
|
states = {
|
|
default = {
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = f54_local1 + 8,
|
|
right = f54_local1 + 60,
|
|
top = 2,
|
|
bottom = 2 + CoD.TextSettings.NormalFont.Height,
|
|
red = 0.7,
|
|
green = 0.7,
|
|
blue = 0.7,
|
|
alpha = 1
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "desc_text_id",
|
|
properties = {
|
|
text = MBh.Property( "descText" ),
|
|
textStyle = CoD.TextStyle.Shadowed
|
|
},
|
|
states = {
|
|
default = CoD.ColorizeState( Colors.primary_text_color, {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 115,
|
|
right = -55,
|
|
top = 12,
|
|
bottom = 12 + CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left
|
|
} )
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function getDetailsButtonPromptText()
|
|
return Engine.Localize( "@LUA_MENU_PROMPT_WITH_TEXT", Engine.IsGamepadEnabled() and "LUA_MENU_PAD_ALT1_BUTTON" or "PLATFORM_KB_ALT1_BUTTON", "ALIENS_DETAILS" )
|
|
end
|
|
|
|
function getDetailsExpandedButtonPromptText()
|
|
return Engine.Localize( "@LUA_MENU_PROMPT_WITH_TEXT", Engine.IsGamepadEnabled() and "LUA_MENU_PAD_ALT1_BUTTON" or "PLATFORM_KB_ALT1_BUTTON", "ALIENS_DETAILS_EXPANDED" )
|
|
end
|
|
|
|
function alien_info_panel()
|
|
return {
|
|
type = "UIElement",
|
|
id = "basic_info_panel_id",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 600,
|
|
width = 555,
|
|
top = 250,
|
|
height = 375
|
|
},
|
|
two_rows_pos = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 600,
|
|
width = 555,
|
|
top = 350,
|
|
height = 275
|
|
}
|
|
},
|
|
handlers = {
|
|
updateInfoPanel = function ( f58_arg0, f58_arg1 )
|
|
if f58_arg1.isNerf == 1 and 5 < #LUI.mp_menus.Aliens.GetBaseNerfList() then
|
|
f58_arg0:animateToState( "two_rows_pos", 0 )
|
|
end
|
|
end
|
|
|
|
},
|
|
children = {
|
|
{
|
|
type = "aliens_info_panel_header",
|
|
id = "info_panel_header_id"
|
|
},
|
|
{
|
|
type = "generic_menu_background_withfade",
|
|
id = "window_body_id",
|
|
children = {
|
|
{
|
|
type = "UIText",
|
|
id = "desc_text_id",
|
|
properties = {
|
|
text = "",
|
|
textStyle = CoD.TextStyle.Shadowed
|
|
},
|
|
states = {
|
|
default = CoD.ColorizeState( Colors.primary_text_color, {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 25,
|
|
right = -10,
|
|
top = 40,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left
|
|
} )
|
|
},
|
|
handlers = {
|
|
selection_info_set_message_text = function ( f59_arg0, f59_arg1 )
|
|
f59_arg0:setText( f59_arg1.newText )
|
|
end
|
|
|
|
}
|
|
},
|
|
{
|
|
type = "UIVerticalList",
|
|
properties = {
|
|
ref = "",
|
|
isPerk = 1,
|
|
isAction = 0,
|
|
isNerf = 0
|
|
},
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 90,
|
|
bottom = 0,
|
|
spacing = 1
|
|
}
|
|
},
|
|
childrenFeeder = DescListFeeder,
|
|
handlers = {
|
|
updateInfoPanel = function ( f60_arg0, f60_arg1 )
|
|
f60_arg0.properties.ref = f60_arg1.ref
|
|
f60_arg0.properties.isPerk = f60_arg1.isPerk
|
|
f60_arg0.properties.isAction = f60_arg1.isAction
|
|
f60_arg0.properties.isNerf = f60_arg1.isNerf
|
|
f60_arg0:closeChildren()
|
|
if f60_arg1.isNerf ~= 1 then
|
|
f60_arg0:processEvent( {
|
|
name = "menu_refresh",
|
|
immediate = true
|
|
} )
|
|
end
|
|
end
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function getDetailsSelectPromptText()
|
|
return Engine.Localize( "@LUA_MENU_PROMPT_WITH_TEXT", Engine.IsGamepadEnabled() and "LUA_MENU_PAD_PRIMARY_BUTTON" or "PLATFORM_KB_PRIMARY_BUTTON", "ALIENS_SELECT" )
|
|
end
|
|
|
|
function alien_root_info_panel()
|
|
return {
|
|
type = "UIElement",
|
|
id = "basic_info_tip_id",
|
|
states = {
|
|
default = {
|
|
alpha = 1,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 600,
|
|
width = 555,
|
|
top = 145,
|
|
height = 475
|
|
},
|
|
hidden = {
|
|
alpha = 0
|
|
}
|
|
},
|
|
handlers = {
|
|
hide_tip = function ( f63_arg0, f63_arg1 )
|
|
f63_arg0:animateToState( "hidden", 100 )
|
|
end
|
|
,
|
|
show_tip = function ( f64_arg0, f64_arg1 )
|
|
f64_arg0:animateToState( "default", 100 )
|
|
end
|
|
|
|
},
|
|
children = {
|
|
{
|
|
type = "aliens_info_panel_header",
|
|
id = "info_panel_tip_header_id"
|
|
},
|
|
{
|
|
type = "generic_menu_background_withfade",
|
|
id = "window_body_id",
|
|
children = {
|
|
{
|
|
type = "UIText",
|
|
id = "desc_text_id",
|
|
properties = {
|
|
text = "",
|
|
textStyle = CoD.TextStyle.Shadowed
|
|
},
|
|
states = {
|
|
default = CoD.ColorizeState( Colors.primary_text_color, {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 25,
|
|
right = -10,
|
|
top = 50,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left
|
|
} )
|
|
},
|
|
handlers = {
|
|
update_tip = function ( f65_arg0, f65_arg1 )
|
|
f65_arg0:setText( f65_arg1.new_Text )
|
|
end
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function alien_xp_widget( f66_arg0, f66_arg1, f66_arg2 )
|
|
local f66_local0 = LUI.mp_menus.Aliens
|
|
local f66_local1 = LUI.mp_menus.Operations
|
|
local f66_local2, f66_local3, f66_local4, f66_local5, f66_local6, f66_local7 = f66_local0.getAliensRankData( f66_arg1.exclusiveController )
|
|
local f66_local8 = 0.7
|
|
local f66_local9 = 0.7
|
|
local f66_local10 = 0.7
|
|
local f66_local11 = 360
|
|
local f66_local12 = 23
|
|
local f66_local13 = 25
|
|
local self = LUI.UIElement.new()
|
|
self.id = "xp_widget_aliens"
|
|
self.properties = {
|
|
rank_currLevel = f66_local2,
|
|
rank_nextLevel = f66_local4,
|
|
rank_percent = f66_local6
|
|
}
|
|
self:registerAnimationState( "default", {
|
|
leftAnchor = false,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
right = -135,
|
|
top = 100,
|
|
width = f66_local11,
|
|
height = 25
|
|
} )
|
|
self:animateToState( "default" )
|
|
if not f66_local7 then
|
|
local f66_local15 = f66_local1.operation_progress_bar( nil, {
|
|
width = f66_local11,
|
|
progress = f66_local6
|
|
} )
|
|
f66_local15:registerAnimationState( "positioned", {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 1,
|
|
bottom = 7
|
|
} )
|
|
f66_local15:animateToState( "positioned" )
|
|
self:addElement( f66_local15 )
|
|
local f66_local16 = LUI.UIImage.new()
|
|
f66_local16.id = "curr_bkg_id"
|
|
f66_local16:registerAnimationState( "default", {
|
|
material = f66_local3,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = f66_local13,
|
|
right = f66_local13 + f66_local12,
|
|
top = 3,
|
|
bottom = f66_local12
|
|
} )
|
|
f66_local16:animateToState( "default", 0 )
|
|
self:addElement( f66_local16 )
|
|
local f66_local17 = LUI.UIText.new()
|
|
f66_local17.id = "curr_rank_block_id"
|
|
f66_local17:registerAnimationState( "default", {
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = f66_local13,
|
|
top = -CoD.TextSettings.SmallFont.Height / 2 + 3,
|
|
bottom = CoD.TextSettings.SmallFont.Height / 2 + 3,
|
|
red = f66_local8,
|
|
green = f66_local9,
|
|
blue = f66_local10,
|
|
alpha = 0.7
|
|
} )
|
|
f66_local17:setText( f66_local2 )
|
|
f66_local17:animateToState( "default", 0 )
|
|
self:addElement( f66_local17 )
|
|
local f66_local18 = LUI.UIText.new()
|
|
f66_local18.id = "curr_rank_label_id"
|
|
f66_local18:registerAnimationState( "default", {
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
left = f66_local13 + f66_local12 + 5,
|
|
right = 0,
|
|
top = -CoD.TextSettings.SmallFont.Height / 2 + 3,
|
|
bottom = CoD.TextSettings.SmallFont.Height / 2 + 3,
|
|
red = f66_local8,
|
|
green = f66_local9,
|
|
blue = f66_local10,
|
|
alpha = 0.7
|
|
} )
|
|
f66_local18:setText( Engine.Localize( "@LUA_MENU_CURRENT_RANK" ) )
|
|
f66_local18:animateToState( "default", 0 )
|
|
self:addElement( f66_local18 )
|
|
end
|
|
local f66_local15 = LUI.UIImage.new()
|
|
f66_local15.id = "next_bkg_id"
|
|
f66_local15:registerAnimationState( "default", {
|
|
material = f66_local5,
|
|
leftAnchor = false,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = -f66_local13 - f66_local12,
|
|
right = -f66_local13,
|
|
top = 3,
|
|
bottom = f66_local12
|
|
} )
|
|
f66_local15:animateToState( "default", 0 )
|
|
self:addElement( f66_local15 )
|
|
local f66_local16 = LUI.UIText.new()
|
|
f66_local16.id = "next_rank_block_id"
|
|
f66_local16:registerAnimationState( "default", {
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
leftAnchor = false,
|
|
rightAnchor = true,
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
left = -f66_local13,
|
|
right = 0,
|
|
top = -CoD.TextSettings.SmallFont.Height / 2 + 3,
|
|
bottom = CoD.TextSettings.SmallFont.Height / 2 + 3,
|
|
red = Colors.alien_frontend_hilite.r,
|
|
green = Colors.alien_frontend_hilite.g,
|
|
blue = Colors.alien_frontend_hilite.b
|
|
} )
|
|
f66_local16:setText( f66_local4 )
|
|
f66_local16:animateToState( "default", 0 )
|
|
self:addElement( f66_local16 )
|
|
local f66_local17 = LUI.UIText.new()
|
|
f66_local17.id = "next_rank_label_id"
|
|
f66_local17:registerAnimationState( "default", {
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Right,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = -f66_local13 - f66_local12 - 5,
|
|
top = -CoD.TextSettings.SmallFont.Height / 2 + 3,
|
|
bottom = CoD.TextSettings.SmallFont.Height / 2 + 3,
|
|
red = f66_local8,
|
|
green = f66_local9,
|
|
blue = f66_local10,
|
|
alpha = "0.65"
|
|
} )
|
|
local f66_local18
|
|
if f66_local7 then
|
|
f66_local18 = Engine.Localize( "@LUA_MENU_MAX_RANK" )
|
|
if not f66_local18 then
|
|
|
|
else
|
|
f66_local17:setText( f66_local18 )
|
|
f66_local17:animateToState( "default", 0 )
|
|
self:addElement( f66_local17 )
|
|
return self
|
|
end
|
|
end
|
|
f66_local18 = Engine.Localize( "@LUA_MENU_NEXT_RANK" )
|
|
end
|
|
|
|
function SetAliensInfoHeaderText( f67_arg0, f67_arg1 )
|
|
assert( f67_arg1.newText )
|
|
f67_arg0.properties.header_text = f67_arg1.newText
|
|
local f67_local0 = f67_arg0:getChildById( "button_label_text" )
|
|
f67_local0:setText( f67_arg1.newText )
|
|
end
|
|
|
|
function aliens_info_panel_header( f68_arg0, f68_arg1 )
|
|
local f68_local0 = function ( f69_arg0, f69_arg1 )
|
|
f69_arg0:setText( f69_arg1.newText )
|
|
end
|
|
|
|
local f68_local1 = function ( f70_arg0, f70_arg1 )
|
|
if LUI.mp_menus.Aliens.IsChaosEnabled() and f70_arg1.disabled_in_chaos then
|
|
f70_arg0:animateToState( "visible" )
|
|
else
|
|
f70_arg0:animateToState( "default" )
|
|
end
|
|
end
|
|
|
|
local f68_local2 = 25
|
|
local f68_local3 = -25
|
|
local f68_local4 = LUI.Alignment.Left
|
|
local f68_local5 = LUI.Alignment.Right
|
|
local f68_local6 = ""
|
|
local f68_local7 = LUI.MenuGenerics.generic_menu_titlebar_background( nil, f68_arg1 )
|
|
local f68_local8 = CoD.TextSettings.BoldFont
|
|
local f68_local9 = 1
|
|
local self = LUI.UIText.new()
|
|
self.id = "title"
|
|
self:setText( f68_local6 )
|
|
self:registerAnimationState( "default", {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = -f68_local8.Height / 2 + f68_local9,
|
|
height = f68_local8.Height,
|
|
left = f68_local2,
|
|
right = 0,
|
|
font = f68_local8.Font,
|
|
alignment = f68_local4
|
|
} )
|
|
self:animateToState( "default" )
|
|
self:registerEventHandler( "selection_info_set_header_text", f68_local0 )
|
|
f68_local7:addElement( self )
|
|
f68_local8 = CoD.TextSettings.NormalFont
|
|
local f68_local11 = LUI.UIText.new()
|
|
f68_local11.id = "subTitle"
|
|
f68_local11:setText( Engine.Localize( "@ALIENS_DISABLED_IN_CHAOS" ) )
|
|
f68_local11:registerAnimationState( "default", {
|
|
font = f68_local8.Font,
|
|
alignment = f68_local5,
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = -f68_local8.Height / 2 + f68_local9,
|
|
height = f68_local8.Height,
|
|
left = 0,
|
|
right = f68_local3,
|
|
red = Colors.alien_frontend_hilite.r,
|
|
green = Colors.alien_frontend_hilite.g,
|
|
blue = Colors.alien_frontend_hilite.b,
|
|
alpha = 0
|
|
} )
|
|
f68_local11:registerAnimationState( "visible", {
|
|
alpha = 1
|
|
} )
|
|
f68_local11:animateToState( "default" )
|
|
f68_local11:registerEventHandler( "selection_info_set_header_text", f68_local1 )
|
|
f68_local7:addElement( f68_local11 )
|
|
return f68_local7
|
|
end
|
|
|
|
function secondaryClassOptionsFeeder( f71_arg0 )
|
|
local f71_local0 = LUI.mp_menus.Aliens
|
|
local f71_local1 = 0
|
|
local f71_local2 = f71_arg0.exclusiveController
|
|
local f71_local3 = f71_local0.GetAlienPerk( f71_local2, f71_local1 )
|
|
local f71_local4 = {}
|
|
local f71_local5 = f71_local0.GetBasePerkList( f71_local1 )
|
|
for f71_local6 = 1, #f71_local5, 1 do
|
|
local f71_local9 = f71_local6
|
|
if f71_local5[f71_local9] ~= f71_local3 and f71_local5[f71_local9] ~= "perk_none" then
|
|
f71_local4[#f71_local4 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "class_button_" .. f71_local9,
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
|
text = Engine.Localize( f71_local0.GetFieldForPerk( f71_local5[f71_local9], f71_local0.AlienPerks.Cols.Name ) ),
|
|
button_action_func = function ( f72_arg0, f72_arg1 )
|
|
f71_local0.SetSecondaryClass( f71_local2, f71_local5[f71_local9] )
|
|
f72_arg0:dispatchEventToRoot( {
|
|
name = "refresh_cac_menu_buttons",
|
|
controller = f72_arg1.controller
|
|
} )
|
|
LUI.FlowManager.RequestLeaveMenu( f72_arg0, true )
|
|
end
|
|
}
|
|
}
|
|
end
|
|
end
|
|
return f71_local4
|
|
end
|
|
|
|
function extinction_secondary_class_popup()
|
|
return {
|
|
type = "generic_selectionList_popup",
|
|
id = "extinction_secondary_class_popup",
|
|
properties = {
|
|
popup_title = "Choose a secondary class",
|
|
popup_childfeeder = secondaryClassOptionsFeeder,
|
|
additional_handlers = {
|
|
popup_back = function ( f74_arg0, f74_arg1 )
|
|
DebugPrint( "YO BITCHES" )
|
|
local f74_local0 = LUI.mp_menus.Aliens
|
|
if f74_local0.GetAlienPerk( f74_arg1.controller, 0 ) == f74_local0.GetSecondaryClassRef( f74_arg1.controller ) then
|
|
f74_local0.setDefaultSecondaryClass( f74_arg1.controller )
|
|
f74_arg0:dispatchEventToRoot( {
|
|
name = "refresh_cac_menu_buttons",
|
|
controller = f74_arg1.controller
|
|
} )
|
|
end
|
|
end
|
|
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function OpenSecondaryClassSelection( f75_arg0 )
|
|
LUI.FlowManager.RequestPopupMenu( nil, "extinction_secondary_class_popup", true, f75_arg0 )
|
|
end
|
|
|
|
LUI.MenuBuilder.registerDef( "aliens_cac_menu", aliens_cac_menu )
|
|
LUI.MenuBuilder.registerDef( "aliens_cac_menu_button", aliens_cac_menu_button )
|
|
LUI.MenuBuilder.registerDef( "aliens_cac_menu_nerf_button", aliens_cac_menu_nerf_button )
|
|
LUI.MenuBuilder.registerDef( "aliens_cac_select_ability_menu", aliens_cac_select_ability_menu )
|
|
LUI.MenuBuilder.registerType( "aliens_cac_ability_button", aliens_cac_ability_button )
|
|
LUI.MenuBuilder.registerDef( "extinction_secondary_class_popup", extinction_secondary_class_popup )
|
|
LUI.MenuBuilder.registerDef( "alien_description_list", alien_description_list )
|
|
LUI.MenuBuilder.registerDef( "alien_description_item", alien_description_item )
|
|
LUI.MenuBuilder.registerDef( "alien_info_panel", alien_info_panel )
|
|
LUI.MenuBuilder.registerType( "aliens_info_panel_header", aliens_info_panel_header )
|
|
LUI.MenuBuilder.registerDef( "alien_root_info_panel", alien_root_info_panel )
|
|
LUI.MenuBuilder.registerType( "alien_xp_widget", alien_xp_widget )
|
|
LockTable( _M )
|