mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
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:
parent
b389740a29
commit
b991fe1343
@ -61,4 +61,16 @@ class GVAR(sorts) {
|
|||||||
tabs[] = {{}, {4}};
|
tabs[] = {{}, {4}};
|
||||||
statement = QUOTE(_this call FUNC(sortStatement_magCount));
|
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));
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -67,6 +67,7 @@ PREP(sortStatement_accuracy);
|
|||||||
PREP(sortStatement_magCount);
|
PREP(sortStatement_magCount);
|
||||||
PREP(sortStatement_mass);
|
PREP(sortStatement_mass);
|
||||||
PREP(sortStatement_mod);
|
PREP(sortStatement_mod);
|
||||||
|
PREP(sortStatement_protection);
|
||||||
PREP(sortStatement_rateOfFire);
|
PREP(sortStatement_rateOfFire);
|
||||||
PREP(sortStatement_scopeMag);
|
PREP(sortStatement_scopeMag);
|
||||||
PREP(statBarStatement_accuracy);
|
PREP(statBarStatement_accuracy);
|
||||||
|
23
addons/arsenal/functions/fnc_sortStatement_protection.sqf
Normal file
23
addons/arsenal/functions/fnc_sortStatement_protection.sqf
Normal 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
|
@ -416,6 +416,12 @@
|
|||||||
<Japanese>装弾数で並び替え</Japanese>
|
<Japanese>装弾数で並び替え</Japanese>
|
||||||
<Turkish>Mermi sayısına göre sırala</Turkish>
|
<Turkish>Mermi sayısına göre sırala</Turkish>
|
||||||
</Key>
|
</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">
|
<Key ID="STR_ACE_Arsenal_buttonShareTooltip">
|
||||||
<English>Share or stop sharing the selected loadout</English>
|
<English>Share or stop sharing the selected loadout</English>
|
||||||
<Spanish>Compartir o dejar de compartir el equipamiento seleccionado</Spanish>
|
<Spanish>Compartir o dejar de compartir el equipamiento seleccionado</Spanish>
|
||||||
|
Loading…
Reference in New Issue
Block a user