Skip to content

Commit

Permalink
Arsenal - Add stat for scope magnification (#6150)
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror authored and jonpas committed Feb 18, 2018
1 parent 5bb27a2 commit 741407f
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
8 changes: 8 additions & 0 deletions addons/arsenal/ACE_Arsenal_Stats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions addons/arsenal/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
26 changes: 26 additions & 0 deletions addons/arsenal/functions/fnc_statTextStatement_scopeMag.sqf
Original file line number Diff line number Diff line change
@@ -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]
16 changes: 16 additions & 0 deletions addons/arsenal/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,22 @@
<English>Potassium levels</English>
<French>Taux de potassium</French>
</Key>
<Key ID="STR_ACE_Arsenal_statMagnification">
<English>Magnification</English>
<Chinese>放大倍率</Chinese>
<French>Grossissement</French>
<Spanish>Aumento</Spanish>
<Italian>Ingrandimento</Italian>
<Polish>Powiększenie</Polish>
<Russian>Увеличение</Russian>
<German>Vergrößerung</German>
<Czech>Zvětšení</Czech>
<Portuguese>Aumentox</Portuguese>
<Korean>배율</Korean>
<Chinesesimp>放大倍数</Chinesesimp>
<Japanese>拡大</Japanese>
<Turkish>Büyütme</Turkish>
</Key>
<Key ID="STR_ACE_Arsenal_page">
<English>Page</English>
<French>Page</French>
Expand Down

0 comments on commit 741407f

Please sign in to comment.