Arsenal - Sort by protection (helm, uniform, vest) (#7952)

* Arsenal - Sort by protection (helm, uniform, vest)

* Update fnc_sortStatement_protection.sqf

* split to 2 different sorts
This commit is contained in:
PabstMirror 2020-10-29 11:38:31 -05:00 committed by GitHub
parent b389740a29
commit b991fe1343
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 0 deletions

View File

@ -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));
};
};

View File

@ -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);

View File

@ -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 <CONFIG>
* 1: Ballistic (passthrough) coefficent <NUMBER>
* 2: Explosive (armor) coefficent <NUMBER>
*
* Return Value:
* Sorting Value <NUMBER>
*
* 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

View File

@ -416,6 +416,12 @@
<Japanese>装弾数で並び替え</Japanese>
<Turkish>Mermi sayısına göre sırala</Turkish>
</Key>
<Key ID="STR_ACE_Arsenal_sortByProtectionBallistic">
<English>Sort by ballistic protection</English>
</Key>
<Key ID="STR_ACE_Arsenal_sortByProtectionExplosive">
<English>Sort by explosive protection</English>
</Key>
<Key ID="STR_ACE_Arsenal_buttonShareTooltip">
<English>Share or stop sharing the selected loadout</English>
<Spanish>Compartir o dejar de compartir el equipamiento seleccionado</Spanish>