From 608541af84b2c1cff8f16555247a37b205e92206 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 16 Feb 2018 17:32:26 -0600 Subject: [PATCH] Arsenal - Add stat for scope magnification --- addons/arsenal/ACE_Arsenal_Stats.hpp | 8 ++++++ addons/arsenal/XEH_PREP.hpp | 1 + .../fnc_statTextStatement_scopeMag.sqf | 26 +++++++++++++++++++ addons/arsenal/stringtable.xml | 16 ++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 addons/arsenal/functions/fnc_statTextStatement_scopeMag.sqf diff --git a/addons/arsenal/ACE_Arsenal_Stats.hpp b/addons/arsenal/ACE_Arsenal_Stats.hpp index b9fbfc39c02..ca8f236e94d 100644 --- a/addons/arsenal/ACE_Arsenal_Stats.hpp +++ b/addons/arsenal/ACE_Arsenal_Stats.hpp @@ -66,6 +66,14 @@ class GVAR(stats) { barStatement = QUOTE([ARR_3(_this select 0, _this select 1, [ARR_3([ARR_2(0, 3.2)], [ARR_2(-1, 1100)], 2006)])] call FUNC(statBarStatement_impact)); tabs[] = {{0,1,2}, {}}; }; + class ACE_scopeMagnification: statBase { + scope = 2; + priority = 2; + displayName = CSTRING(statMagnification); + showText = 1; + textStatement = QUOTE(call FUNC(statTextStatement_scopeMag)); + tabs[] = {{}, {0}}; + }; class ACE_ballisticProtection: statBase { scope = 2; priority = 5; diff --git a/addons/arsenal/XEH_PREP.hpp b/addons/arsenal/XEH_PREP.hpp index e74de9c1aa8..52b3d2e2426 100644 --- a/addons/arsenal/XEH_PREP.hpp +++ b/addons/arsenal/XEH_PREP.hpp @@ -52,6 +52,7 @@ PREP(statBarStatement_impact); PREP(statTextStatement_accuracy); PREP(statTextStatement_mass); PREP(statTextStatement_rateOfFire); +PREP(statTextStatement_scopeMag); PREP(updateCamPos); PREP(updateRightPanel); PREP(updateUniqueItemsList); diff --git a/addons/arsenal/functions/fnc_statTextStatement_scopeMag.sqf b/addons/arsenal/functions/fnc_statTextStatement_scopeMag.sqf new file mode 100644 index 00000000000..54458472150 --- /dev/null +++ b/addons/arsenal/functions/fnc_statTextStatement_scopeMag.sqf @@ -0,0 +1,26 @@ +/* + * Author: PabstMirror + * Text statement for the scope magnification stat. + * + * Arguments: + * 0: not used + * 1: item config path (CONFIG) + * + * Return Value: + * String to display + * + * Public: No + */ +#include "script_component.hpp" + +params ["", "_config"]; +TRACE_1("statTextStatement_scopeMag",_config); + +private _minZoom = 999; // FOV, so smaller is more zoomed in +{ + _minZoom = _minZoom min (getNumber (_x >> "opticsZoomMin")); +} forEach configProperties [_config >> "ItemInfo" >> "OpticsModes"]; + +if (_minZoom in [0, 999]) exitWith {"?"}; + +format ["%1x", (0.25/_minZoom) toFixed 1] diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index 518d2bf9d84..3f4ce4e5a2d 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -686,6 +686,22 @@ Potassium levels Taux de potassium + + Magnification + 放大倍率 + Grossissement + Aumento + Ingrandimento + Powiększenie + Увеличение + Vergrößerung + Zvětšení + Aumentox + 배율 + 放大倍数 + 拡大 + Büyütme + Page Page