-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Arsenal - Add stat for scope magnification (#6150)
- Loading branch information
1 parent
5bb27a2
commit 741407f
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
addons/arsenal/functions/fnc_statTextStatement_scopeMag.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters