Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arsenal - Add stat for scope magnification #6150

Merged
merged 1 commit into from
Feb 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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