diff --git a/addons/arsenal/ACE_Arsenal_Sorts.hpp b/addons/arsenal/ACE_Arsenal_Sorts.hpp index 17c5abf4a0..6d5125d7ff 100644 --- a/addons/arsenal/ACE_Arsenal_Sorts.hpp +++ b/addons/arsenal/ACE_Arsenal_Sorts.hpp @@ -61,4 +61,16 @@ class GVAR(sorts) { tabs[] = {{}, {4}}; statement = QUOTE(_this call FUNC(sortStatement_magCount)); }; + + class ACE_protectionBallistic: sortBase { + scope = 2; + displayName = CSTRING(sortByProtectionBallistic); + tabs[] = {{3,4,6}, {}}; + statement = QUOTE([ARR_3(_this, 1000000, 1000)] call FUNC(sortStatement_protection)); + }; + + class ACE_protectionExplosive: ACE_protectionBallistic { + displayName = CSTRING(sortByProtectionExplosive); + statement = QUOTE([ARR_3(_this, 1000, 1000000)] call FUNC(sortStatement_protection)); + }; }; diff --git a/addons/arsenal/XEH_PREP.hpp b/addons/arsenal/XEH_PREP.hpp index 4879e6d7a1..209f882738 100644 --- a/addons/arsenal/XEH_PREP.hpp +++ b/addons/arsenal/XEH_PREP.hpp @@ -67,6 +67,7 @@ PREP(sortStatement_accuracy); PREP(sortStatement_magCount); PREP(sortStatement_mass); PREP(sortStatement_mod); +PREP(sortStatement_protection); PREP(sortStatement_rateOfFire); PREP(sortStatement_scopeMag); PREP(statBarStatement_accuracy); diff --git a/addons/arsenal/functions/fnc_sortStatement_protection.sqf b/addons/arsenal/functions/fnc_sortStatement_protection.sqf new file mode 100644 index 0000000000..4ab0509e42 --- /dev/null +++ b/addons/arsenal/functions/fnc_sortStatement_protection.sqf @@ -0,0 +1,23 @@ +#include "script_component.hpp" +/* + * Author: PabstMirror + * Statement to sort items by their protection (combination of ballistic and explosive). + * + * Arguments: + * 0: Item Config + * 1: Ballistic (passthrough) coefficent + * 2: Explosive (armor) coefficent + * + * Return Value: + * Sorting Value + * + * Public: No +*/ + +params ["_itemCfg", "_ballisticCo", "_explosiveCo"]; + +(([[_itemCfg], ["passthrough", "armor"]] call BIS_fnc_configExtremes) select 1) params [["_passthroughMax", 0], ["_armorMax", 0]]; + +private _protectionCombined = _passthroughMax * _ballisticCo + _armorMax * _explosiveCo; + +_protectionCombined diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index dcb2d22a64..2585abc530 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -416,6 +416,12 @@ 装弾数で並び替え Mermi sayısına göre sırala + + Sort by ballistic protection + + + Sort by explosive protection + Share or stop sharing the selected loadout Compartir o dejar de compartir el equipamiento seleccionado