diff --git a/addons/arsenal/ACE_Arsenal_Stats.hpp b/addons/arsenal/ACE_Arsenal_Stats.hpp index 5fdd9cfa0d..f7493b4840 100644 --- a/addons/arsenal/ACE_Arsenal_Stats.hpp +++ b/addons/arsenal/ACE_Arsenal_Stats.hpp @@ -75,6 +75,14 @@ class GVAR(stats) { textStatement = QUOTE(call FUNC(statTextStatement_scopeMag)); tabs[] = {{}, {0}}; }; + class ACE_binoMagnification: statBase { + scope = 2; + priority = 2; + displayName = CSTRING(statMagnification); + showText = 1; + textStatement = QUOTE(call FUNC(statTextStatement_binoMag)); + tabs[] = {{9}, {}}; + }; class ACE_scopeVisionMode: statBase { scope = 2; priority = 1.6; @@ -83,6 +91,14 @@ class GVAR(stats) { textStatement = QUOTE(call FUNC(statTextStatement_scopeVisionMode)); tabs[] = {{}, {0}}; }; + class ACE_binoVisionMode: statBase { + scope = 2; + priority = 1.6; + displayName = CSTRING(statVisionModeGeneric); + showText = 1; + textStatement = QUOTE(call FUNC(statTextStatement_binoVisionMode)); + tabs[] = {{8,9}, {}}; + }; class ACE_ballisticProtection: statBase { scope = 2; priority = 5; @@ -128,4 +144,12 @@ class GVAR(stats) { textStatement = QUOTE(call FUNC(statTextStatement_explosionTime)); tabs[] = {{}, {5}}; }; + class ACE_magCount: statBase { + scope = 2; + priority = 1; + displayName = CSTRING(statMagCount); + showText = 1; + textStatement = QUOTE(call FUNC(statTextStatement_magCount)); + tabs[] = {{}, {4}}; + }; }; diff --git a/addons/arsenal/XEH_PREP.hpp b/addons/arsenal/XEH_PREP.hpp index bfb9c07a9a..3b14abe96b 100644 --- a/addons/arsenal/XEH_PREP.hpp +++ b/addons/arsenal/XEH_PREP.hpp @@ -73,6 +73,8 @@ PREP(scanConfig); PREP(showItem); PREP(sortPanel); PREP(sortStatement_accuracy); +PREP(statTextStatement_binoMag); +PREP(statTextStatement_binoVisionMode); PREP(sortStatement_amount); PREP(sortStatement_magCount); PREP(sortStatement_mass); @@ -86,6 +88,7 @@ PREP(statBarStatement_impact); PREP(statBarStatement_rateOfFIre); PREP(statTextStatement_accuracy); PREP(statTextStatement_explosionTime); +PREP(statTextStatement_magCount); PREP(statTextStatement_mass); PREP(statTextStatement_rateOfFire); PREP(statTextStatement_scopeMag); diff --git a/addons/arsenal/functions/fnc_statTextStatement_binoMag.sqf b/addons/arsenal/functions/fnc_statTextStatement_binoMag.sqf new file mode 100644 index 0000000000..b84d8d4178 --- /dev/null +++ b/addons/arsenal/functions/fnc_statTextStatement_binoMag.sqf @@ -0,0 +1,35 @@ +#include "script_component.hpp" +/* + * Author: PabstMirror, LinkIsGrim + * Text statement for the binocular magnification stat. + * + * Arguments: + * 0: Not used + * 1: Item config path + * + * Return Value: + * Stat Text + * + * Public: No + */ + +params ["", "_config"]; +TRACE_1("statTextStatement_binoMag",_config); + +_minZoom = getNumber (_config >> "opticsZoomMin"); // FOV, so smaller is more zoomed in +_maxZoom = getNumber (_config >> "opticsZoomMax"); + +if (_minZoom == 0) exitWith {"?"}; + +private _maxMagnification = (0.25 / _minZoom) toFixed 1; +private _minMagnification = (0.25 / _maxZoom); +if (_minMagnification < 1) then { + _minMagnification = 1; +}; +_minMagnification = _minMagnification toFixed 1; + +if (_minMagnification == _maxMagnification) exitWith { + format ["%1x", _maxMagnification] +}; + +format ["%1x-%2x", _minMagnification, _maxMagnification] diff --git a/addons/arsenal/functions/fnc_statTextStatement_binoVisionMode.sqf b/addons/arsenal/functions/fnc_statTextStatement_binoVisionMode.sqf new file mode 100644 index 0000000000..bbc3ac2053 --- /dev/null +++ b/addons/arsenal/functions/fnc_statTextStatement_binoVisionMode.sqf @@ -0,0 +1,27 @@ +#include "script_component.hpp" +/* + * Author: Dedmen, johnb43, LinkIsGrim + * Text statement for the binocular/NVG vision mode stat. + * + * Arguments: + * 0: Not used + * 1: Item config path + * + * Return Value: + * Stat Text + * + * Public: No + */ + +params ["", "_config"]; +TRACE_1("statTextStatement_binoVisionMode",_config); + +private _text = []; +private _visionModes = getArray (_config >> "visionMode") apply {toLower _x}; +{ + if (_x in _visionModes) then { + _text pushBack (localize ([LSTRING(VisionNormal), LSTRING(VisionNight), LSTRING(VisionThermal)] select _forEachIndex)); + }; +} forEach ["normal", "nvg", "ti"]; + +_text joinString ", " diff --git a/addons/arsenal/functions/fnc_statTextStatement_magCount.sqf b/addons/arsenal/functions/fnc_statTextStatement_magCount.sqf new file mode 100644 index 0000000000..312010acf0 --- /dev/null +++ b/addons/arsenal/functions/fnc_statTextStatement_magCount.sqf @@ -0,0 +1,19 @@ +#include "script_component.hpp" +/* + * Author: LinkIsGrim + * Text statement for the magazine capacity stat. + * + * Arguments: + * 0: Stats Array (not used) + * 1: Item config path + * + * Return Value: + * String to display + * + * Public: No +*/ + +params ["", "_config"]; +TRACE_1("statTextStatement_magCount",_config) + +getNumber (_config >> "count"); diff --git a/addons/arsenal/functions/fnc_statTextStatement_scopeMag.sqf b/addons/arsenal/functions/fnc_statTextStatement_scopeMag.sqf index 681d76aab1..4cc521c2ec 100644 --- a/addons/arsenal/functions/fnc_statTextStatement_scopeMag.sqf +++ b/addons/arsenal/functions/fnc_statTextStatement_scopeMag.sqf @@ -17,11 +17,31 @@ params ["", "_config"]; TRACE_1("statTextStatement_scopeMag",_config); private _minZoom = 999; // FOV, so smaller is more zoomed in +private _maxZoom = 1.25; // Cap at 1x zoomed out +private _opticsModes = "true" configClasses (_config >> "ItemInfo" >> "OpticsModes"); { + // If there is a primary mode then just use that + if (getNumber (_x >> "useModelOptics") == 1 || {count _opticsModes == 1}) exitWith { + _minZoom = getNumber (_x >> "opticsZoomMin"); + _maxZoom = getNumber (_x >> "opticsZoomMax"); + }; + // Otherwise go through the optic's modes _minZoom = _minZoom min (getNumber (_x >> "opticsZoomMin")); -} forEach configProperties [_config >> "ItemInfo" >> "OpticsModes"]; + _maxZoom = _maxZoom max (getNumber (_x >> "opticsZoomMax")); +} forEach _opticsModes; if (_minZoom in [0, 999]) exitWith {"?"}; -format ["%1x", (0.25 / _minZoom) toFixed 1] +private _maxMagnification = (0.25 / _minZoom) toFixed 1; +private _minMagnification = (0.25 / _maxZoom); +if (_minMagnification < 1) then { + _minMagnification = 1; +}; +_minMagnification = _minMagnification toFixed 1; + +if (_minMagnification == _maxMagnification) exitWith { + format ["%1x", _maxMagnification] +}; + +format ["%1x-%2x", _minMagnification, _maxMagnification] diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index 7d8657fe2a..dbbed5fade 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -1240,6 +1240,70 @@ Desteklenmiyor 지원되지 않음 + + Vision Mode + Sichtmodus + ビジョン モード + Modalità Visiva + 視覺模式 + 视觉模式 + 보기 모드 + Mode de vision + Tryb Wizji + Режим видения + Modo de Visão + Režim sledování + Görüş Modu + Modo de visión + + + Normal + Normal + Normalna + Normal + Нормальное + Normální + Normal + Normale + Normale + 通常 + 일반 + 正常 + 正常 + Normal + + + Night + Nacht + Noc + Visão Norturna + Ночное + Noční + Nocturna + Notturno + Nocturne + 暗視装置 + 야간 + 夜视 + 夜視 + Gece + + + Thermal + Wärme + Termo + Térmica + Тепловизор + Termální + Térmica + Termico + Thermique + 熱源画像 + 열상 + 热成像 + 熱成像 + Termal + Page Página @@ -1505,5 +1569,8 @@ 工具 Araçlar + + Ammo count + diff --git a/addons/ballistics/ACE_Arsenal_Stats.hpp b/addons/ballistics/ACE_Arsenal_Stats.hpp index 67e7d246e3..1a731b08b6 100644 --- a/addons/ballistics/ACE_Arsenal_Stats.hpp +++ b/addons/ballistics/ACE_Arsenal_Stats.hpp @@ -24,6 +24,7 @@ class EGVAR(arsenal,stats) { stats[] = {"ammo", "displayName"}; displayName = "$STR_dn_ammo"; showText = 1; + condition = QUOTE(getText (_this select 1 >> _this select 0 select 0) isNotEqualTo ''); textStatement = QUOTE(params [ARR_2('_stat', '_config')]; private _ammoDisplayName = getText (configFile >> 'CfgAmmo' >> (getText (_config >> 'ammo')) >> _stat select 1); [ARR_2(_ammoDisplayName, getText (_config >> _stat select 0))] select (_ammoDisplayName == '')); tabs[] = {{}, {4}}; }; @@ -50,11 +51,11 @@ class EGVAR(arsenal,stats) { class ACE_magMuzzleVelocity: statBase { scope = 2; priority = 3; - stats[] = {"initSpeed"}; + stats[] = {"initSpeed", "ammo"}; displayName= CSTRING(statMuzzleVelocity); showText= 1; textStatement = QUOTE([ARR_2(_this select 0, _this select 1)] call FUNC(statTextStatement_magazineMuzzleVelocity)); - condition = QUOTE(getNumber (_this select 1 >> (_this select 0) select 0) > 0); + condition = QUOTE(getText (_this select 1 >> _this select 0 select 1) isNotEqualTo '' && {getNumber (_this select 1 >> (_this select 0) select 0) > 0}); tabs[] = {{}, {4}}; }; class ACE_weaponMuzzleVelocity: statBase { diff --git a/addons/nightvision/ACE_Arsenal_Stats.hpp b/addons/nightvision/ACE_Arsenal_Stats.hpp new file mode 100644 index 0000000000..0b42d136f6 --- /dev/null +++ b/addons/nightvision/ACE_Arsenal_Stats.hpp @@ -0,0 +1,12 @@ +class EGVAR(arsenal,stats) { + class statBase; + class GVAR(generation): statBase { + scope = 2; + priority = 1.6; + condition = QUOTE('nvg' in (getArray ((_this select 1) >> 'visionMode') apply {toLower _x})); + displayName = CSTRING(NVGeneration); + showText = 1; + textStatement = QUOTE(call FUNC(statTextStatement_NVGeneration)); + tabs[] = {{8}, {}}; + }; +}; diff --git a/addons/nightvision/XEH_PREP.hpp b/addons/nightvision/XEH_PREP.hpp index c212d22b18..988cfaa623 100644 --- a/addons/nightvision/XEH_PREP.hpp +++ b/addons/nightvision/XEH_PREP.hpp @@ -10,3 +10,4 @@ PREP(pfeh); PREP(refreshGoggleType); PREP(scaleCtrl); PREP(setupDisplayEffects); +PREP(statTextStatement_NVGeneration); diff --git a/addons/nightvision/config.cpp b/addons/nightvision/config.cpp index f416af9d38..3e629585e2 100644 --- a/addons/nightvision/config.cpp +++ b/addons/nightvision/config.cpp @@ -34,3 +34,4 @@ class CfgPatches { #include "CfgWeapons.hpp" #include "ACE_Settings.hpp" #include "RscTitles.hpp" +#include "ACE_Arsenal_Stats.hpp" diff --git a/addons/nightvision/functions/fnc_statTextStatement_NVGeneration.sqf b/addons/nightvision/functions/fnc_statTextStatement_NVGeneration.sqf new file mode 100644 index 0000000000..0ecb8979db --- /dev/null +++ b/addons/nightvision/functions/fnc_statTextStatement_NVGeneration.sqf @@ -0,0 +1,24 @@ +#include "script_component.hpp" +/* + * Author: LinkIsGrim + * Text statement for the NV Generation stat. + * + * Arguments: + * 0: Not used + * 1: Item config path + * + * Return Value: + * Stat Text + * + * Public: No + */ + +params ["", "_config"]; +TRACE_1("statTextStatement_nvGeneration",_config); + +private _gen = 3; // Default +if (isNumber (_config >> QGVAR(generation))) then { + _gen = getNumber (_config >> QGVAR(generation)); +}; + +format [localize LSTRING(statGen), _gen]; diff --git a/addons/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index 62c6a59bad..4683867546 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -466,5 +466,11 @@ Efecto obturador por los fogonazos de la boca del cañón 총구화염에 의한 셔터효과를 구현합니다 + + Night Vision Generation + + + Gen %1 +