From af7f9ee17b3e4e1332448072bf20934d213d930f Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Tue, 9 Apr 2024 14:57:59 +0200 Subject: [PATCH] Added equipment tag system --- cScripts/CfgEquipmentTags.hpp | 90 ++++++++++ cScripts/CfgFunctions.hpp | 9 +- cScripts/Loadouts/CfgLoadouts_Alpha.hpp | 4 +- cScripts/Loadouts/CfgLoadouts_Bravo_Atlas.hpp | 3 +- cScripts/Loadouts/CfgLoadouts_Bravo_Crew.hpp | 2 +- .../Loadouts/CfgLoadouts_Bravo_Viking.hpp | 12 +- .../Loadouts/CfgLoadouts_Charlie_Squad.hpp | 8 +- .../Loadouts/CfgLoadouts_Charlie_Weapon.hpp | 2 +- cScripts/Loadouts/CfgLoadouts_Common.hpp | 2 +- cScripts/Loadouts/CfgLoadouts_Training.hpp | 2 +- .../gear/fn_gear_getLoadoutCompany.sqf | 24 +++ .../functions/gear/fn_gear_getLoadoutRole.sqf | 25 --- .../functions/gear/fn_gear_getLoadoutTags.sqf | 23 +++ .../functions/gear/fn_gear_getTagItems.sqf | 46 ++++++ cScripts/functions/gear/fn_gear_getTags.sqf | 22 +++ cScripts/functions/gear/fn_gear_isTag.sqf | 30 ++++ .../systems/fn_getArsenalWhitelist.sqf | 154 ++++++++---------- description.ext | 1 + 18 files changed, 327 insertions(+), 132 deletions(-) create mode 100644 cScripts/CfgEquipmentTags.hpp create mode 100644 cScripts/functions/gear/fn_gear_getLoadoutCompany.sqf delete mode 100644 cScripts/functions/gear/fn_gear_getLoadoutRole.sqf create mode 100644 cScripts/functions/gear/fn_gear_getLoadoutTags.sqf create mode 100644 cScripts/functions/gear/fn_gear_getTagItems.sqf create mode 100644 cScripts/functions/gear/fn_gear_getTags.sqf create mode 100644 cScripts/functions/gear/fn_gear_isTag.sqf diff --git a/cScripts/CfgEquipmentTags.hpp b/cScripts/CfgEquipmentTags.hpp new file mode 100644 index 000000000..b9f8d51e4 --- /dev/null +++ b/cScripts/CfgEquipmentTags.hpp @@ -0,0 +1,90 @@ +class CfgEquipmentTags { + Common[] = {"G_Aviator"}; + + CommonBlufor[] = {"G_Aviator"}; + + CommonBluforCompanyAlpha[] = {"ace_banana"}; + CommonBluforCompanyBravo[] = {"ace_banana"}; + CommonBluforCompanyCharlie[] = {"ace_banana"}; + + // Weapons + coll_system_rifle[] = {"class_rhs_weap_m4a1"}; + class_rhs_weap_m4a1[] = { + "rhs_weap_m4a1_carryhandle", + "rhs_weap_m4a1_carryhandle_mstock", + "rhs_weap_m4a1", + "rhs_weap_m4a1_mstock", + "rhs_weap_m4a1_d", + "rhs_weap_m4a1_d_mstock", + "rhs_weap_m4a1_wd", + "rhs_weap_m4a1_wd_mstock", + + "rhs_weap_m4a1_blockII", + "rhs_weap_m4a1_blockII_KAC", + "rhs_weap_m4a1_blockII_bk", + "rhs_weap_m4a1_blockII_KAC_bk", + "rhs_weap_m4a1_blockII_d", + "rhs_weap_m4a1_blockII_KAC_d", + "rhs_weap_m4a1_blockII_wd", + "rhs_weap_m4a1_blockII_KAC_wd", + + "equ_magazines_basic_stanag", + "equ_scopes_basic" + }; + + equ_magazines_basic_stanag[] = { + "rhs_mag_30Rnd_556x45_M855A1_Stanag", + "ACE_30Rnd_556x45_Stanag_M995_AP_mag" + }; + equ_magazines_basic_pmag[] = { + "rhs_mag_30Rnd_556x45_M855A1_PMAG", + "rhs_mag_30Rnd_556x45_M855A1_PMAG_Tracer_Red", + "rhs_mag_30Rnd_556x45_M855A1_PMAG_Tan", + "rhs_mag_30Rnd_556x45_M855A1_PMAG_Tan_Tracer_Red", + "rhs_mag_30Rnd_556x45_Mk262_PMAG" + }; + + equ_scopes_basic[] = {}; + + // Grenades + coll_throwable[] = { + "equ_grenades", + "equ_smokes", + "equ_chemlights" + }; + equ_grenades[] = { + "HandGrenade", + "rhs_mag_m67", + "B_IR_Grenade", + "ACE_M84", + }; + equ_smokes[] = { + "SmokeShell", + "SmokeShellRed", + "SmokeShellBlue", + "SmokeShellGreen", + "SmokeShellOrange", + "SmokeShellYellow", + "SmokeShellPurple", + }; + equ_chemlights[] = { + "ACE_Chemlight_HiWhite", + "ACE_Chemlight_HiBlue", + "ACE_Chemlight_HiGreen", + "ACE_Chemlight_HiYellow", + "ACE_Chemlight_HiRed", + "ACE_Chemlight_IR", + }; + + // Communication + equ_radio_basic[] = {}; + equ_radio_advanced[] = {}; + + // Medical + equ_medical_level_0[] = {}; + equ_medical_level_1[] = {}; + equ_medical_level_2[] = {}; + equ_medical_level_3[] = {}; + + // +}; diff --git a/cScripts/CfgFunctions.hpp b/cScripts/CfgFunctions.hpp index 229001bf2..8ed13c7c9 100644 --- a/cScripts/CfgFunctions.hpp +++ b/cScripts/CfgFunctions.hpp @@ -229,6 +229,8 @@ class cScripts { class gear_applyFunctions {}; class gear_selectLoadout {}; class gear_getSideConfig {}; + + class gear_getLoadoutCompany {}; class gear_setupRadios {}; @@ -238,8 +240,13 @@ class cScripts { class gear_removeLoadout {}; class gear_hasSavedLoadout {}; + // equipmentTags + class gear_getTagItems {}; + class gear_getTags {}; + class gear_isTag {}; + // other - class gear_getLoadoutRole {}; + class gear_getLoadoutTags {}; class gear_getLoadoutName {}; }; class diag { diff --git a/cScripts/Loadouts/CfgLoadouts_Alpha.hpp b/cScripts/Loadouts/CfgLoadouts_Alpha.hpp index aa37ed07c..6ad0985fc 100644 --- a/cScripts/Loadouts/CfgLoadouts_Alpha.hpp +++ b/cScripts/Loadouts/CfgLoadouts_Alpha.hpp @@ -19,7 +19,7 @@ class Cav_B_A_AirController_F: Cav_B_Alpha_base_F { category[] += {"cScripts_Loadout_Cat_Alpha_TACP"}; scope = 2; loadout = [["rhs_weap_m4a1_blockII_bk","ACE_muzzle_mzls_L","acc_pointer_IR","rhsusf_acc_ACOG_RMR",["ACE_30Rnd_556x45_Stanag_M995_AP_mag",30],[],"rhsusf_acc_rvg_blk"],[],["rhs_weap_M320","","","",["ACE_HuntIR_M203",1],[],""],["USP_G3C_RS2_MC",[["ACE_tourniquet",4],["ItemcTabHCam",1],["ACE_MapTools",1],["ACE_IR_Strobe_Item",2],["ACE_microDAGR",1],["ACE_splint",4],["ACE_Flashlight_XL50",1],["kat_Painkiller",2,10],["SmokeShellPurple",2,1],["Laserbatteries",1,1]]],["rhsusf_plateframe_grenadier",[["ACE_packingBandage",20],["ACE_IR_Strobe_Item",2],["ItemAndroid",1],["kat_chestSeal",2],["kat_guedel",1],["kat_ncdKit",1],["rhs_mag_M664_red_cluster",2,1],["1Rnd_SmokeRed_Grenade_shell",2,1],["1Rnd_SmokeBlue_Grenade_shell",2,1],["ACE_HuntIR_M203",2,1],["ACE_30Rnd_556x45_Stanag_M995_AP_mag",6,30],["ACE_HandFlare_Green",2,1],["SmokeShellBlue",2,1],["SmokeShellRed",2,1]]],["USP_TACTICAL_PACK_CCT2",[["Rev_darter_item",1],["ACE_HuntIR_monitor",1],["ACE_EntrenchingTool",1],["ACE_UAVBattery",1],[["ACE_Vector","","","",[],[],""],1]]],"rhsusf_opscore_mc_cover_pelt_cam","rhsusf_oakley_goggles_clr",["Laserdesignator","","","",["Laserbatteries",1],[],""],["ItemMap","B_UavTerminal","","ItemCompass","ItemWatch","USP_PVS15"]]; - role = "officer"; + equipmentTags[] = {"role_officer"}; }; class Cav_B_A_DroneOperator_F: Cav_B_Alpha_base_F { @@ -35,7 +35,7 @@ class Cav_B_A_DroneOperator_F: Cav_B_Alpha_base_F { // category[] += {"cScripts_Loadout_Cat_Alpha_Leadership"}; // scope = 2; // loadout = [["rhs_weap_m4a1_blockII_bk","ACE_muzzle_mzls_L","acc_pointer_IR","rhsusf_acc_ACOG_RMR",["ACE_30Rnd_556x45_Stanag_M995_AP_mag",30],[],"rhsusf_acc_rvg_blk"],[],["rhs_weap_M320","","","",["ACE_HuntIR_M203",1],[],""],["USP_G3C_RS2_MC",[["ACE_tourniquet",4],["ItemcTabHCam",1],["ACE_MapTools",1],["ACE_IR_Strobe_Item",2],["ACE_microDAGR",1],["ACE_splint",4],["ACE_Flashlight_XL50",1],["kat_Painkiller",2,10],["SmokeShellPurple",2,1],["Laserbatteries",1,1]]],["rhsusf_plateframe_grenadier",[["ACE_packingBandage",20],["ACE_IR_Strobe_Item",2],["rhs_mag_M664_red_cluster",2,1],["1Rnd_SmokeRed_Grenade_shell",2,1],["1Rnd_SmokeBlue_Grenade_shell"],2,1],["ACE_HuntIR_M203",2,1],["ACE_30Rnd_556x45_Stanag_M995_AP_mag",6,30],["ACE_HandFlare_Green",2,1],["SmokeShellBlue",2,1],["SmokeShellRed",2,1]]],["USP_TACTICAL_PACK_CCT7"],[["Rev_darter_item",1],["ACE_HuntIR_monitor",1],["ACE_EntrenchingTool",1],["ACE_UAVBattery",1],["Laserbatteries",1,1],[["ACE_Vector","","","",[],[],""],1]]],"rhsusf_opscore_mc_cover_pelt_cam","rhsusf_shemagh2_gogg_grn",["Laserdesignator","","","",["Laserbatteries",1],[],""],["ItemMap","ItemcTab","","ItemCompass","ItemWatch","USP_PVS15"]]; -// role = "officer"; +// equipmentTags[] = {"role_officer"}; // }; // Named diff --git a/cScripts/Loadouts/CfgLoadouts_Bravo_Atlas.hpp b/cScripts/Loadouts/CfgLoadouts_Bravo_Atlas.hpp index ea750644b..0004c38ec 100644 --- a/cScripts/Loadouts/CfgLoadouts_Bravo_Atlas.hpp +++ b/cScripts/Loadouts/CfgLoadouts_Bravo_Atlas.hpp @@ -5,7 +5,8 @@ class Cav_B_Bravo_Atlas_base_F: Cav_B_Bravo_base_F { insignia = "cav_insignia_Specialized_Medic0"; abilityMedic = 2; - role = "doctor"; + equipmentTags[] = {"tag_doctor"}; + icon = "iconManMedic"; }; diff --git a/cScripts/Loadouts/CfgLoadouts_Bravo_Crew.hpp b/cScripts/Loadouts/CfgLoadouts_Bravo_Crew.hpp index 9a339e4f9..0957b8fc0 100644 --- a/cScripts/Loadouts/CfgLoadouts_Bravo_Crew.hpp +++ b/cScripts/Loadouts/CfgLoadouts_Bravo_Crew.hpp @@ -1,6 +1,6 @@ class Cav_B_Bravo_TankCrew_Base_F: Cav_B_Bravo_base_F { scope = 0; - role = "crew"; + equipmentTags[] = {"role_crew"}; }; class Cav_B_B_Tank_Commander_F: Cav_B_Bravo_TankCrew_Base_F { displayName = "$STR_cav_Bravo_Characters_B_Tank_Commander"; diff --git a/cScripts/Loadouts/CfgLoadouts_Bravo_Viking.hpp b/cScripts/Loadouts/CfgLoadouts_Bravo_Viking.hpp index 3833f66d9..7d540c245 100644 --- a/cScripts/Loadouts/CfgLoadouts_Bravo_Viking.hpp +++ b/cScripts/Loadouts/CfgLoadouts_Bravo_Viking.hpp @@ -1,7 +1,7 @@ class Cav_B_B_Scout_Base_F: Cav_B_Bravo_base_F { platoon = 2; scope = 0; - role = "weapons"; + equipmentTags[] = {"role_weapons"}; }; class Cav_B_B_Scout_Officer_F: Cav_B_B_Scout_Base_F { @@ -10,7 +10,7 @@ class Cav_B_B_Scout_Officer_F: Cav_B_B_Scout_Base_F { category[] += {"cScripts_Loadout_Cat_Bravo_Viking_Leadership"}; loadout = [["rhs_weap_mk18_KAC","rhsusf_acc_SF3P556","rhsusf_acc_anpeq15","rhsusf_acc_ACOG_RMR",["rhs_mag_30Rnd_556x45_M855A1_PMAG_Tracer_Red",30],[],"rhsusf_acc_grip2"],[],["rhsusf_weap_glock17g4","","acc_flashlight_pistol","",["rhsusf_mag_17Rnd_9x19_FMJ",17],[],""],["USP_G3C_RS_KP_OR_MC",[["ACE_packingBandage",10],["ACE_quikclot",10],["ACE_tourniquet",4],["ACE_microDAGR",1],["ACE_Flashlight_XL50",1],["ACE_MapTools",1],["kat_chestSeal",2],["kat_guedel",1],["ACE_splint",1]]],["USP_CRYE_CPC_LEAD_BELT_MC",[["ItemcTabHCam",1],["ACE_EarPlugs",1],["HandGrenade",2,1],["SmokeShell",4,1],["ACE_IR_Strobe_Item",4],["SmokeShellBlue",2,1],["rhsusf_mag_17Rnd_9x19_FMJ",2,17],["ACE_HandFlare_Yellow",2,1],["rhs_mag_mk3a2",2,1],["rhs_mag_30Rnd_556x45_M855A1_PMAG_Tracer_Red",3,30],["30Rnd_556x45_Stanag_red",4,30],["SmokeShellPurple",1,1],["SmokeShellYellow",2,1]]],["USP_TACTICAL_PACK_CCT6",[["ACE_HuntIR_monitor",1],["ACE_splint",8],["ACE_tourniquet",8],["ACE_SpraypaintGreen",1],["ACE_artilleryTable",1],["ACE_CableTie",5],["ACE_EarPlugs",2],["kat_Painkiller",2,10],["B_IR_Grenade",2,1],["SmokeShellGreen",2,1],["SmokeShellYellow",2,1],["ACE_Chemlight_IR",2,1]]],"USP_OPS_FASTXP_TAN_MC_03","USP_DETCORD_SMG1_BLK2",["ACE_Vector","","","",[],[],""],["ItemMap","ItemcTab","","ItemCompass","ItemWatch","USP_PVS31_LOW"]]; icon = "iconManOfficer"; - role = "officer"; + equipmentTags[] = {"role_officer"}; }; class Cav_B_B_Scout_PlatoonLeader_F: Cav_B_B_Scout_Officer_F { @@ -31,7 +31,7 @@ class Cav_B_B_Scout_PlatoonMedic_F: Cav_B_B_Scout_Officer_F { loadout = [["rhs_weap_m4a1_blockII","rhsusf_acc_SF3P556","rhsusf_acc_anpeq15","rhsusf_acc_ACOG_RMR",["rhs_mag_30Rnd_556x45_M855A1_PMAG",30],[],""],[],[],["USP_G3C_RS_KP_OR_MC",[["ACE_tourniquet",10],["ACE_EarPlugs",1],["ACE_MapTools",1],["ACE_microDAGR",1],["ACE_Flashlight_XL50",1],["ACE_IR_Strobe_Item",2],["ACE_CableTie",2],["ACE_epinephrine",6],["kat_Painkiller",2,10],["kat_Carbonate",2,10],["ACE_Chemlight_IR",2,1],["kat_Penthrox",4,10]]],["USP_CRYE_CPC_MEDIC_BELT_MC",[["ACE_surgicalKit",1],["kat_IV_16",15],["kat_amiodarone",5],["kat_atropine",5],["ACE_adenosine",3],["kat_chestSeal",10],["kat_EACA",10],["kat_fentanyl",5],["kat_ketamine",5],["kat_larynx",10],["kat_lidocaine",10],["kat_nalbuphine",10],["kat_naloxone",5],["kat_nitroglycerin",10],["kat_norepinephrine",10],["kat_phenylephrine",10],["kat_stethoscope",1],["kat_Pulseoximeter",5],["kat_IO_FAST",5],["kat_aatKit",5],["ACE_splint",2],["kat_accuvac",1],["SmokeShell",4,1],["rhs_mag_30Rnd_556x45_M855A1_PMAG",6,30],["SmokeShellBlue",2,1],["SmokeShellPurple",1,1],["kat_Penthrox",5,10]]],["USP_TACTICAL_PACK",[["ACE_plasmaIV",5],["ACE_plasmaIV_500",4],["ACE_salineIV",1],["ACE_elasticBandage",30],["ACE_packingBandage",10],["ACE_quikclot",30],["ACE_salineIV_250",2],["USP_PVS31",1],["ACE_splint",4]]],"USP_OPS_FASTXP_TAN_MC_03","USP_MFRAME_BLK2",["ACE_Vector","","","",[],[],""],["ItemMap","ItemAndroid","","ItemCompass","ACE_Altimeter",""]]; insignia = "cav_insignia_specialized_cls"; abilityMedic = 2; - role = "medic"; + equipmentTags[] = {"tag_medic"}; icon = "iconManMedic"; }; @@ -53,7 +53,7 @@ class Cav_B_B_Scout_SquadLeader_F: Cav_B_B_Scout_Base_F { scope = 2; category[] += {"cScripts_Loadout_Cat_Bravo_Viking_Leadership"}; loadout = [["rhs_weap_mk18_KAC","rhsusf_acc_SF3P556","rhsusf_acc_anpeq15","rhsusf_acc_g33_xps3",["rhs_mag_30Rnd_556x45_M855A1_PMAG_Tracer_Red",30],[],"rhsusf_acc_grip2"],[],[],["USP_G3C_RS_KP_OR_MC",[["ACE_packingBandage",10],["ACE_quikclot",10],["ACE_tourniquet",4],["kat_chestSeal",2],["kat_guedel",1],["ACE_microDAGR",1],["ACE_MapTools",1],["ACE_Chemlight_Shield",1],["ACE_Chemlight_White",1,1]]],["USP_CRYE_CPC_COMMS_BELT_MC",[["ACE_EarPlugs",1],["HandGrenade",2,1],["SmokeShell",4,1],["SmokeShellBlue",2,1],["SmokeShellYellow",2,1],["rhs_mag_mk3a2",2,1],["rhs_mag_30Rnd_556x45_M855A1_PMAG_Tracer_Red",3,30],["30Rnd_556x45_Stanag_red",4,30],["SmokeShellPurple",1,1]]],["USP_TACTICAL_PACK_CCT7",[["ACE_HuntIR_monitor",1],["ACE_splint",8],["ACE_tourniquet",8],["ACE_SpraypaintGreen",1],["ACE_artilleryTable",1],["ACE_CableTie",5],["ACE_EarPlugs",2],["kat_Painkiller",2,10],["B_IR_Grenade",2,1],["ACE_Chemlight_IR",2,1]]],"USP_OPS_FASTXP_TAN_MC_06","UK3CB_G_Ballistic_Black",["ACE_Vector","","","",[],[],""],["ItemMap","ItemAndroid","","ItemCompass","ItemWatch","USP_PVS31_HIGH"]]; - role = "squadleader"; + equipmentTags[] = {"role_squadleader"}; icon = "iconManLeader"; }; class Cav_B_B_Scout_WSL_F_Local: Cav_B_B_Scout_Base_F { @@ -69,7 +69,7 @@ class Cav_B_B_Scout_TeamLeader_F: Cav_B_B_Scout_Base_F { scope = 2; category[] += {"cScripts_Loadout_Cat_Bravo_Viking_Squad"}; loadout = [["rhs_weap_m4a1_blockII_grip2_KAC","rhsusf_acc_SF3P556","rhsusf_acc_anpeq15","rhsusf_acc_ACOG_RMR",["30Rnd_556x45_Stanag_red",30],[],"rhsusf_acc_grip2"],[],[],["USP_G3C_RS_KP_OR_MC",[["ACE_packingBandage",10],["kat_chestSeal",2],["kat_guedel",1],["ACE_quikclot",10],["ACE_tourniquet",4],["ACE_microDAGR",1],["ACE_MapTools",1],["ACE_Chemlight_Shield",1],["ACE_Chemlight_White",1,1]]],["USP_VEST_STRANDHOGG2_MC",[["HandGrenade",2,1],["SmokeShell",4,1],["SmokeShellBlue",2,1],["SmokeShellYellow",2,1],["SmokeShellPurple",1,1],["rhs_mag_mk3a2",2,1],["30Rnd_556x45_Stanag_red",6,30],["rhs_mag_30Rnd_556x45_M855A1_PMAG_Tan_Tracer_Red",4,30]]],["USP_PACK_BREACHER_MC",[["ACE_HuntIR_monitor",1],["ACE_EntrenchingTool",1],["ACE_SpraypaintGreen",1],["ACE_tourniquet",4],["ACE_CableTie",5],["ACE_splint",2],["kat_Painkiller",2,10],["ACE_Chemlight_IR",2,1]]],"USP_OPS_FASTXP_TAN_MC_05","UK3CB_G_Ballistic_Black_Shemagh_Green",["ACE_Vector","","","",[],[],""],["ItemMap","ItemAndroid","","ItemCompass","ItemWatch","USP_PVS31_HIGH"]]; - role = "fireteamleader"; + equipmentTags[] = {"role_fireteamleader"}; icon = "iconManLeader"; }; class Cav_B_B_Scout_AutomaticRifleman_F: Cav_B_B_Scout_Base_F { @@ -101,7 +101,7 @@ class Cav_B_B_Scout_RiflemanAT_F: Cav_B_B_Scout_Base_F { displayName = "MAAWS Specialist"; scope = 2; category[] += {"cScripts_Loadout_Cat_Bravo_Viking_Squad"}; - role = "weapons"; + equipmentTags[] = {"role_weapons"}; loadout = [["rhs_weap_m4a1_blockII_KAC","rhsusf_acc_SF3P556","rhsusf_acc_anpeq15","rhsusf_acc_ACOG_RMR",["30Rnd_556x45_Stanag_red",30],[],"rhsusf_acc_grip2"],["launch_MRAWS_green_F","","","",[],[],""],[],["USP_G3C_RS_KP_OR_MC",[["ACE_packingBandage",10],["kat_chestSeal",2],["kat_guedel",1],["ACE_quikclot",10],["ACE_tourniquet",4],["ACE_microDAGR",1],["ACE_MapTools",1]]],["USP_CRYE_CPC_COMMS_BELT_MC",[["HandGrenade",2,1],["SmokeShell",4,1],["ACE_Chemlight_IR",2,1],["rhs_mag_mk3a2",4,1],["30Rnd_556x45_Stanag_red",9,30],["SmokeShellPurple",1,1],["ACE_CTS9",2,1],["kat_Painkiller",2,10]]],["rhsusf_falconii_mc",[["ACE_EntrenchingTool",1],["",2,0],["MRAWS_HEAT_F",1,1],["MRAWS_HE_F",2,1]]],"USP_OPS_FASTXP_TAN_MC_03","USP_MFRAME_SMC1_TAN2",["ACE_Vector","","","",[],[],""],["ItemMap","ItemAndroid","","ItemCompass","ItemWatch","USP_PVS15"]]; }; class Cav_B_B_Scout_CombatLifeSaver_F: Cav_B_B_Scout_Base_F { diff --git a/cScripts/Loadouts/CfgLoadouts_Charlie_Squad.hpp b/cScripts/Loadouts/CfgLoadouts_Charlie_Squad.hpp index d07c900d2..807832bb7 100644 --- a/cScripts/Loadouts/CfgLoadouts_Charlie_Squad.hpp +++ b/cScripts/Loadouts/CfgLoadouts_Charlie_Squad.hpp @@ -2,7 +2,7 @@ class Cav_B_C_Officer_F: Cav_B_Charlie_base_F { displayName = "$STR_Cav_Charlie_Characters_C_Officer"; category[] += {"cScripts_Loadout_Cat_Charlie_Leadership"}; scope = 0; - role = "officer"; + equipmentTags[] = {"role_officer"}; icon = "iconManOfficer"; }; class Cav_B_C_PlatoonLeader_F: Cav_B_C_Officer_F { @@ -26,7 +26,7 @@ class Cav_B_C_PlatoonMedic_F: Cav_B_C_Officer_F { loadout = [["rhs_weap_m4a1_blockII","rhsusf_acc_SF3P556","rhsusf_acc_anpeq15","rhsusf_acc_ACOG_RMR",["rhs_mag_30Rnd_556x45_M855A1_PMAG",30],[],""],[],[],["USP_G3C_RS_KP_OR_MC",[["ACE_tourniquet",10],["ACE_EarPlugs",1],["ACE_MapTools",1],["ACE_microDAGR",1],["ACE_Flashlight_XL50",1],["ACE_IR_Strobe_Item",2],["ACE_CableTie",2],["ACE_epinephrine",6],["kat_PenthroxItem",4],["kat_Painkiller",2,10],["kat_Carbonate",2,10],["ACE_Chemlight_IR",2,1]]],["USP_CRYE_CPC_MEDIC_BELT_MC",[["ACE_surgicalKit",1],["kat_IV_16",15],["kat_amiodarone",5],["kat_atropine",5],["ACE_adenosine",3],["kat_chestSeal",10],["kat_EACA",10],["kat_fentanyl",5],["kat_ketamine",5],["kat_larynx",10],["kat_lidocaine",10],["kat_nalbuphine",10],["kat_naloxone",5],["kat_nitroglycerin",10],["kat_norepinephrine",10],["kat_phenylephrine",10],["kat_stethoscope",1],["kat_Pulseoximeter",5],["kat_IO_FAST",5],["kat_aatKit",5],["ACE_splint",2],["SmokeShell",4,1],["rhs_mag_30Rnd_556x45_M855A1_PMAG",7,30],["SmokeShellBlue",2,1],["SmokeShellPurple",1,1],["kat_Penthrox",5,10]]],["USP_TACTICAL_PACK",[["ACE_plasmaIV",5],["ACE_plasmaIV_500",4],["ACE_salineIV",1],["ACE_elasticBandage",30],["ACE_packingBandage",10],["ACE_quikclot",10],["ACE_salineIV_250",2],["USP_PVS15",1],["kat_accuvac",1],["ACE_splint",6]]],"USP_OPSCORE_FASTMTC_CTW","USP_MFRAME_BLK2",["ACE_Vector","","","",[],[],""],["ItemMap","ItemAndroid","","ItemCompass","ACE_Altimeter",""]]; insignia = "cav_insignia_specialized_cls"; abilityMedic = 2; - role = "medic"; + equipmentTags[] = {"tag_medic"}; icon = "iconManMedic"; }; class Cav_B_C_Drone_Operator_F_Local: Cav_B_C_Officer_F { @@ -40,7 +40,7 @@ class Cav_B_C_SquadLeader_F: Cav_B_Charlie_base_F { scope = 2; category[] += {"cScripts_Loadout_Cat_Charlie_Leadership"}; loadout = [["rhs_weap_m4a1_m320","rhsusf_acc_SF3P556","rhsusf_acc_anpeq15_bk","rhsusf_acc_ACOG_RMR_3d",["rhs_mag_30Rnd_556x45_M855A1_PMAG_Tan",30],[],""],[],[],["USP_G3C_RS2_KP_OR_MC",[["ACE_tourniquet",4],["ACE_Flashlight_XL50",1],["ACE_MapTools",1],["ACE_microDAGR",1],["ACE_packingBandage",14],["kat_chestSeal",2],["kat_guedel",1],["ACE_EarPlugs",1],["kat_Painkiller",2,10]]],["USP_CRYE_JPC_TLB",[["rhs_mag_30Rnd_556x45_M855A1_PMAG_Tan_Tracer_Red",9,30],["SmokeShell",4,1],["HandGrenade",2,1],["SmokeShellPurple",1,1],["rhs_mag_m713_Red",3,1],["rhs_mag_m714_White",4,1],["SmokeShellBlue",2,1]]],["USP_REEBOW_3DAP_MC",[["ACE_HuntIR_monitor",1],["USP_PVS15",1],["ACE_splint",2],["ACE_SpraypaintRed",1],["ACE_EntrenchingTool",1],["ACE_CableTie",2]]],"USP_OPSCORE_FASTMTC_CMGTW","",["ACE_Vector","","","",[],[],""],["ItemMap","ItemAndroid","","ItemCompass","ACE_Altimeter",""]]; - role = "squadleader"; + equipmentTags[] = {"role_squadleader"}; icon = "iconManLeader"; }; class Cav_B_C_FireTeamLeader_F: Cav_B_Charlie_base_F { @@ -77,7 +77,7 @@ class Cav_B_C_CombatLifeSaver_F: Cav_B_Charlie_base_F { category[] += {"cScripts_Loadout_Cat_Charlie_Squad"}; loadout = [["rhs_weap_m4a1_blockII_KAC","rhsusf_acc_SF3P556","rhsusf_acc_anpeq15","rhsusf_acc_ACOG_RMR",["rhs_mag_30Rnd_556x45_M855A1_PMAG_Tan",30],[],""],[],[],["USP_G3C_CU_KP_OR_MC",[["ACE_tourniquet",4],["ACE_Flashlight_XL50",1],["ACE_MapTools",1],["ACE_microDAGR",1],["ACE_packingBandage",14],["ACE_splint",2],["ACE_EarPlugs",1],["ACE_Chemlight_IR",2,1]]],["USP_CRYE_JPC_DMB",[["SmokeShell",4,1],["rhs_mag_30Rnd_556x45_M855A1_PMAG_Tan",9,30],["HandGrenade",2,1],["SmokeShellBlue",1,1],["SmokeShellPurple",1,1]]],["USP_DELTA_BAG_MC",[["USP_PVS15",1],["ACE_packingBandage",40],["ACE_quikclot",40],["ACE_EntrenchingTool",1],["ACE_splint",8],["ACE_tourniquet",12],["kat_chestSeal",10],["ACE_epinephrine",3],["kat_guedel",10],["kat_ncdKit",5],["kat_pocketBVM",1],["kat_accuvac",1],["kat_phenylephrineAuto",3],["kat_CarbonateItem",1],["kat_Painkiller",7,10]]],"USP_OPSCORE_FASTMTC_GSW","USP_MFRAME_TAN",[],["ItemMap","","","ItemCompass","ACE_Altimeter",""]]; insignia = "cav_insignia_specialized_cls"; abilityMedic = 1; - role = "cls"; + equipmentTags[] = {"tag_cls"}; icon = "iconManMedic"; }; class Cav_B_C_Marksman_F_Local: Cav_B_Charlie_base_F { diff --git a/cScripts/Loadouts/CfgLoadouts_Charlie_Weapon.hpp b/cScripts/Loadouts/CfgLoadouts_Charlie_Weapon.hpp index 7ca95f210..4f552441f 100644 --- a/cScripts/Loadouts/CfgLoadouts_Charlie_Weapon.hpp +++ b/cScripts/Loadouts/CfgLoadouts_Charlie_Weapon.hpp @@ -1,6 +1,6 @@ class Cav_B_Charlie_Weapons_base_F: Cav_B_Charlie_base_F { category[] += {"cScripts_Loadout_Cat_Charlie_Weapons"}; - role = "weapons"; + equipmentTags[] = {"role_weapons"}; }; class Cav_B_C_Weapons_SquadLeader_F: Cav_B_C_SquadLeader_F { diff --git a/cScripts/Loadouts/CfgLoadouts_Common.hpp b/cScripts/Loadouts/CfgLoadouts_Common.hpp index 8a2af07eb..46b6e36a3 100644 --- a/cScripts/Loadouts/CfgLoadouts_Common.hpp +++ b/cScripts/Loadouts/CfgLoadouts_Common.hpp @@ -16,7 +16,7 @@ class CommonBlufor { //preLoadout = ""; //postLoadout = ""; - //role = ""; + //equipmentTags[] = {}; //icon = ""; }; diff --git a/cScripts/Loadouts/CfgLoadouts_Training.hpp b/cScripts/Loadouts/CfgLoadouts_Training.hpp index c31323b68..faba303bb 100644 --- a/cScripts/Loadouts/CfgLoadouts_Training.hpp +++ b/cScripts/Loadouts/CfgLoadouts_Training.hpp @@ -2,7 +2,7 @@ class Cav_B_Training_base_F: Cav_B_Seventh_Cavalry_Base_F { category[] = {"cScripts_Loadout_Cat_Training"}; scope = 0; - role = "training"; + equipmentTags[] = {"role_training"}; }; class Cav_B_Training_Cadre_F: Cav_B_Training_base_F { diff --git a/cScripts/functions/gear/fn_gear_getLoadoutCompany.sqf b/cScripts/functions/gear/fn_gear_getLoadoutCompany.sqf new file mode 100644 index 000000000..48867c537 --- /dev/null +++ b/cScripts/functions/gear/fn_gear_getLoadoutCompany.sqf @@ -0,0 +1,24 @@ +#include "..\script_component.hpp"; +/* + * Author: SGT.Brostrom.A + * This function return your company + * + * Arguments: + * None + * + * Return Value: + * CompanyName + * + * Example: + * call cScripts_fnc_player_getLoadoutCompany; + * + * Public: No + */ + +//FIXME: Mabe not have afterall? +params [["_loadout","",[]]]; + +private _config = missionConfigFile >> "CfgLoadouts" >> _loadout; +private _company = getArray (_config >> "company"); + +_company; diff --git a/cScripts/functions/gear/fn_gear_getLoadoutRole.sqf b/cScripts/functions/gear/fn_gear_getLoadoutRole.sqf deleted file mode 100644 index 71488a4c4..000000000 --- a/cScripts/functions/gear/fn_gear_getLoadoutRole.sqf +++ /dev/null @@ -1,25 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: CPL.Brostrom.A - * This function return your role - * - * Arguments: - * None - * - * Return Value: - * Role - * - * Example: - * call cScripts_fnc_gear_getLoadoutRole - * - */ - -private _return = "trooper"; - -private _loadout = GETVAR(player,EGVAR(Gear,loadoutClass),typeOf player); - -private _config = missionConfigFile >> "CfgLoadouts" >> _loadout; -private _role = getText (_config >> "role"); -if (_role != "") then {_return = _role}; - -_return \ No newline at end of file diff --git a/cScripts/functions/gear/fn_gear_getLoadoutTags.sqf b/cScripts/functions/gear/fn_gear_getLoadoutTags.sqf new file mode 100644 index 000000000..6bc8ab95b --- /dev/null +++ b/cScripts/functions/gear/fn_gear_getLoadoutTags.sqf @@ -0,0 +1,23 @@ +#include "..\script_component.hpp" +/* + * Author: CPL.Brostrom.A + * This function return lodout tags + * + * Arguments: + * None + * + * Return Value: + * Tags + * + * Example: + * call cScripts_fnc_gear_getLoadoutTags + * + */ + +private _loadout = GETVAR(player,EGVAR(Gear,loadoutClass), typeOf player); + +private _config = missionConfigFile >> "CfgLoadouts" >> _loadout; +private _tags = getArray (_config >> "equipmentTags"); +if (_tags isEqualTo []) then {[]}; + +_tags diff --git a/cScripts/functions/gear/fn_gear_getTagItems.sqf b/cScripts/functions/gear/fn_gear_getTagItems.sqf new file mode 100644 index 000000000..36f7dd47c --- /dev/null +++ b/cScripts/functions/gear/fn_gear_getTagItems.sqf @@ -0,0 +1,46 @@ +#include "..\script_component.hpp" +/* + * Author: CPL.Brostrom.A + * This function return given equipment tag items. + * + * Arguments: + * 0: Loadout + * + * Return Value: + * Tags + * + * Example: + * ["CommonDefault"] call cScripts_fnc_gear_getTagItems + * ["CommonBluforCompanyAlpha"] call cScripts_fnc_gear_getTagItems + * + */ + +params [["_tag","",[""]]]; + +if (_tag isEqualTo "") exitWith {[]}; + +private _fn_getTagItemsList = { + params [["_tag","",[]]]; + private _equipmentTag = getArray (missionConfigFile >> "CfgEquipmentTags" >> _tag); + _equipmentTag; +}; + +private _equipmentTagObjects = [_tag] call _fn_getTagItemsList; + +private _itemList = []; +{ + if (call EFUNC(gear,isTag)) then { + _equipmentTagObjects append [_x]; + continue; + }; + if ([_x] call FUNC(checkItemValidity)) then { + _itemList append [_x]; + continue; + }; + if (count _equipmentTagObjects >= 100) then { + SHOW_CHAT_WARNING_1("equipmentTag", "Infinit loop suspected for %1 exiting item list creation!", _tag); + break; + } +} forEach _equipmentTagObjects; + +_equipmentTag; \ No newline at end of file diff --git a/cScripts/functions/gear/fn_gear_getTags.sqf b/cScripts/functions/gear/fn_gear_getTags.sqf new file mode 100644 index 000000000..c3ddf4919 --- /dev/null +++ b/cScripts/functions/gear/fn_gear_getTags.sqf @@ -0,0 +1,22 @@ +#include "..\script_component.hpp" +/* + * Author: CPL.Brostrom.A + * This function return your equipmetTags + * + * Arguments: + * 0: Loadout + * + * Return Value: + * Tags + * + * Example: + * [typeOf player] call cScripts_fnc_gear_getTags + * + */ + +params [["_loadout","",[]]]; + +private _config = missionConfigFile >> "CfgLoadouts" >> _loadout; +private _tags = getArray (_config >> "equipmentTags"); + +_tags; \ No newline at end of file diff --git a/cScripts/functions/gear/fn_gear_isTag.sqf b/cScripts/functions/gear/fn_gear_isTag.sqf new file mode 100644 index 000000000..2cc987a4a --- /dev/null +++ b/cScripts/functions/gear/fn_gear_isTag.sqf @@ -0,0 +1,30 @@ +#include "..\script_component.hpp" +/* + * Author: CPL.Brostrom.A + * This function return true or false if the tag is a equipmentTag or not + * + * Arguments: + * 0: Tag + * + * Return Value: + * True/False + * + * Example: + * call cScripts_fnc_gear_isTag + * + */ + +params [["_item","",[]]]; + +private _cfgMagazines = getText (configFile >> 'CfgMagazines' >> _item >> 'displayName'); +private _cfgWeapons = getText (configFile >> 'CfgWeapons' >> _item >> 'displayName'); +private _cfgVehicles = getText (configFile >> 'CfgVehicles' >> _item >> 'displayName'); +private _cfgEquipmentTags = isArray (missionConfigFile >> "CfgEquipmentTags" >> _item); + +if (_cfgMagazines != "") exitWith {false}; +if (_cfgWeapons != "") exitWith {false}; +if (_cfgVehicles != "") exitWith {false}; + +if (_cfgEquipmentTags) exitWith {true}; + +false \ No newline at end of file diff --git a/cScripts/functions/systems/fn_getArsenalWhitelist.sqf b/cScripts/functions/systems/fn_getArsenalWhitelist.sqf index 906164d11..04b28e076 100644 --- a/cScripts/functions/systems/fn_getArsenalWhitelist.sqf +++ b/cScripts/functions/systems/fn_getArsenalWhitelist.sqf @@ -19,103 +19,79 @@ if !(isClass (missionConfigFile >> "CfgLoadouts" >> _classname)) exitWith { []; }; -private _loadout = parseSimpleArray getText (missionConfigFile >> "CfgLoadouts" >> _classname >> "loadout"); -private _unitItems = str _loadout splitString "[]," joinString ","; -_unitItems = parseSimpleArray ("[" + _unitItems + "]"); -_unitItems = _unitItems arrayIntersect _unitItems select {_x isEqualType "" && {_x != ""}}; - - -private _commonGear = GET_CONTAINER_KEYS("arsenal_common"); +// All equipmentTags +private _allEquipmentTags = configProperties [missionConfigFile >> "CfgEquipmentTags"]; - -private _organization = call EFUNC(Player,getOrganization); -private _orgItems = switch (_organization#1) do { - case "alpha": { - GET_CONTAINER_KEYS("alpha_company"); - }; - case "bravo": { - // Bravo has two platoons that have different requirements - private _companyItems = GET_CONTAINER_KEYS("bravo_company"); - private _platoonItems = switch (_organization#0) do { - case 1: { - GET_CONTAINER_KEYS("bravo_company_atlas"); - }; - case 2: { - GET_CONTAINER_KEYS("bravo_company_viking"); - }; - default {[]}; - }; - _companyItems + _platoonItems; - }; - case "charlie": { - GET_CONTAINER_KEYS("charlie_company"); - }; - default {GET_CONTAINER_KEYS("arsenal_company_fallback");}; +// Loadout Items +private _loadout = parseSimpleArray getText (missionConfigFile >> "CfgLoadouts" >> _classname >> "loadout"); +private _loadoutSpecificItems = str _loadout splitString "[]," joinString ","; +_loadoutSpecificItems = parseSimpleArray ("[" + _loadoutSpecificItems + "]"); +_loadoutSpecificItems = _loadoutSpecificItems arrayIntersect _loadoutSpecificItems select {_x isEqualType "" && {_x != ""}}; + +// Global items +private _anySideCommonItems = ["Common"] call EFUNC(gear,getTagItems); + +// Side items +private _side = [side group player] call EFUNC(gear,getSideConfig); +private _commonSideItems = switch (_side) do { + case "CommonBlufor": { ["CommonBlufor"] call EFUNC(gear,getTagItems); }; + case "CommonOpfor": { ["CommonOpfor"] call EFUNC(gear,getTagItems); }; + case "CommonIndependant": { ["CommonIndependant"] call EFUNC(gear,getTagItems); }; + case "CommonCivilian": { ["CommonCivilian"] call EFUNC(gear,getTagItems); }; + default { ["CommonDefault"] call EFUNC(gear,getTagItems); }; }; - -private _roleSpecific = switch ([player] call EFUNC(gear,getLoadoutRole)) do { - case "officer": {GET_CONTAINER_KEYS("arsenal_role_officer");}; - case "squadleader": {GET_CONTAINER_KEYS("arsenal_role_squadleader");}; - case "fireteamleader": {GET_CONTAINER_KEYS("arsenal_role_fireteamleader");}; - case "weapons": {GET_CONTAINER_KEYS("arsenal_role_weapons");}; - case "pilot"; - case "rotarypilot": {GET_CONTAINER_KEYS("arsenal_role_rotarypilot");}; - case "rotarycrew": {GET_CONTAINER_KEYS("arsenal_role_pilotcrew");}; - case "rotarycls": { - private _rotaryRole = GET_CONTAINER_KEYS("arsenal_role_pilotcrew"); - private _clsRole = GET_CONTAINER_KEYS("arsenal_role_cls"); - _rotaryRole + _clsRole; - }; - case "pilotfighter": {GET_CONTAINER_KEYS("arsenal_role_pilotfighter");}; - case "pilottransport": {GET_CONTAINER_KEYS("arsenal_role_pilottransport");}; - case "cls": {GET_CONTAINER_KEYS("arsenal_role_cls");}; - case "medic": {GET_CONTAINER_KEYS("arsenal_role_medic");}; - case "doctor": {GET_CONTAINER_KEYS("arsenal_role_doctor");}; - default {[]}; +// Side company items +private _company = (call EFUNC(player,getOrganization))#1; +private _titleCompany = [_company] call CBA_fnc_capitalize; +private _companyItems = switch (_side) do { + case "CommonBlufor": { ["CommonBluforCompany"+_titleCompany] call EFUNC(gear,getTagItems); }; + case "CommonOpfor": { ["CommonOpforCompany"+_titleCompany] call EFUNC(gear,getTagItems); }; + case "CommonIndependant": { ["CommonIndependantCompany"+_titleCompany] call EFUNC(gear,getTagItems); }; + case "CommonCivilian": { ["CommonCivilianCompany"+_titleCompany] call EFUNC(gear,getTagItems); }; + default { ["CommonDefaultCompany"+_titleCompany] call EFUNC(gear,getTagItems); }; }; - -private _primaryWeapon = if (!isNil{_loadout#0#0}) then {_loadout#0#0} else {""}; -private _primarySpecific = switch (true) do { - case (_primaryWeapon isKindof ['rhs_weap_mk18_m320', configFile >> 'CfgWeapons'] - || _primaryWeapon isKindof ['rhs_weap_m16a4_carryhandle_M203', configFile >> 'CfgWeapons'] - || _primaryWeapon isKindof ['rhs_weap_m4a1_m320', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS("arsenal_weap_ugl");}; - - case (_primaryWeapon isKindof ['rhs_weap_m4a1', configFile >> 'CfgWeapons'] - || _primaryWeapon isKindof ['rhs_weap_m16a4', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS("arsenal_weap_m4");}; - - case (_primaryWeapon isKindof ['rhs_weap_sr25_ec', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS("arsenal_weap_sr25");}; - - case (_primaryWeapon isKindof ['rhs_weap_m240_base', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS("arsenal_weap_m240");}; - - case (_primaryWeapon isKindof ['rhs_weap_m249_pip', configFile >> 'CfgWeapons'] - || _primaryWeapon isKindof ['rhs_weap_m249_pip_L', configFile >> 'CfgWeapons'] - || _primaryWeapon isKindof ['rhs_weap_m249_pip_S', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS("arsenal_weap_m249");}; - default {[]}; +// Side company platoon items +private _companyPlatoon = (call EFUNC(player,getOrganization))#0; +private _companyPlatoonItems = switch (_side) do { + case "CommonBlufor": { ["CommonBluforCompany"+_titleCompany+_companyPlatoon] call EFUNC(gear,getTagItems); }; + case "CommonOpfor": { ["CommonOpforCompany"+_titleCompany+_companyPlatoon] call EFUNC(gear,getTagItems); }; + case "CommonIndependant": { ["CommonIndependantCompany"+_titleCompany+_companyPlatoon] call EFUNC(gear,getTagItems); }; + case "CommonCivilian": { ["CommonCivilianCompany"+_titleCompany+_companyPlatoon] call EFUNC(gear,getTagItems); }; + default { ["CommonDefaultCompany"+_titleCompany+_companyPlatoon] call EFUNC(gear,getTagItems); }; }; -private _handgunWeapon = if (!isNil{_loadout#2#0}) then {_loadout#2#0} else {""}; -private _handgunSpecific = switch (true) do { - case (_handgunWeapon isKindOf ['rhs_weap_M320', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS("arsenal_weap_ugl");}; - case (_handgunWeapon isKindOf ['rhsusf_weap_glock17g4', configFile >> 'CfgWeapons'] - || _handgunWeapon isKindOf ['UK3CB_P320_BLK', configFile >> 'CfgWeapons'] - || _handgunWeapon isKindOf ['UK3CB_P320_DES', configFile >> 'CfgWeapons'] - || _handgunWeapon isKindOf ['rhsusf_weap_m1911a1', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS("arsenal_weap_sidearm");}; - default {[]}; -}; +// Add loadout equipmnet tag items +private _tagItems = []; +private _equipmentTags = call EGVAR(gear,getLoadoutTags); +{ + private _items = [_x] call EGVAR(gear,getTagItems); + _tagItemsList append _items; +} forEach _equipmentTags; + +// Weapon System Items +private _weaponSystemItems = []; +{ + private _classTag = [_x, 0, 5] call BIS_fnc_trimString; + if (_classTag != "class_") then {continue}; + private _classWeaponName = [_x, 5] call BIS_fnc_trimString; + private _primaryWeapon = if (!isNil{_loadout#0#0}) then {_loadout#0#0} else {""}; + private _handgunWeapon = if (!isNil{_loadout#2#0}) then {_loadout#2#0} else {""}; + private _launcherWeapon = if (!isNil{_loadout#1#0}) then {_loadout#1#0} else {""}; + + if {_primaryWeapon isKindof [_classWeaponName, configFile >> 'CfgWeapons']} then { + _weaponSystemItems append [_x] call EGVAR(gear,getTagItems); + }; + if {_handgunWeapon isKindof [_classWeaponName, configFile >> 'CfgWeapons']} then { + _weaponSystemItems append [_x] call EGVAR(gear,getTagItems); + }; + if {_launcherWeapon isKindof [_classWeaponName, configFile >> 'CfgWeapons']} then { + _weaponSystemItems append [_x] call EGVAR(gear,getTagItems); + }; +} forEach _allEquipmentTags; -private _launcherWeapon = if (!isNil{_loadout#1#0}) then {_loadout#1#0} else {""}; -private _launcherSpecific = switch (true) do { - case (_launcherWeapon isKindOf ['rhs_weap_fgm148', configFile >> 'CfgWeapons'] - || _launcherWeapon isKindof ['rhs_weap_fim92', configFile >> 'CfgWeapons'] - || _launcherWeapon isKindof ['rhs_weap_maaws', configFile >> 'CfgWeapons'] - || _launcherWeapon isKindof ['launch_MRAWS_green_F', configFile >> 'CfgWeapons'] - || _launcherWeapon isKindof ['launch_MRAWS_sand_F', configFile >> 'CfgWeapons'] - || _launcherWeapon isKindof ['launch_MRAWS_olive_F', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS("arsenal_weap_launchers");}; - default {[]}; -}; +private _whitelist = _loadoutSpecificItems + _commonSideItems + _companyItems + _companyPlatoonItems + _weaponSystemItems; -private _whitelist = _commonGear + _unitItems + _orgItems + _roleSpecific + _primarySpecific + _handgunSpecific + _launcherSpecific; _whitelist diff --git a/description.ext b/description.ext index 6de5b007c..870c5043b 100644 --- a/description.ext +++ b/description.ext @@ -71,5 +71,6 @@ class CfgFunctions { #include "cScripts\CfgFunctions.hpp" }; #include "cScripts\CfgLoadouts.hpp" +#include "cScripts\CfgEquipmentTags.hpp" /* OTHER */