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