From 7911783a73e4bbbea277deb36d8a0f92c383a423 Mon Sep 17 00:00:00 2001 From: mrschick <58027418+mrschick@users.noreply.github.com> Date: Sun, 18 Aug 2024 12:43:59 +0200 Subject: [PATCH] Setting for adjustment UI while sighted in --- .../functions/fnc_applyScopeAdjustment.sqf | 28 +++++++++++-------- addons/scopes/initSettings.inc.sqf | 8 ++++++ addons/scopes/stringtable.xml | 5 ++++ 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf index 7f24e0f0b7..d356343099 100644 --- a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf +++ b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf @@ -32,17 +32,23 @@ _adjustment set [_weaponIndex, [_elevation, _windage, _zero]]; playSound selectRandom ["ACE_Scopes_Click_1", "ACE_Scopes_Click_2", "ACE_Scopes_Click_3"]; // slightly rotate the player if looking through optic -if (cameraView == "GUNNER" && !GVAR(simplifiedZeroing)) then { - // Convert adjustmentDifference from mils to degrees - _adjustmentDifference = _adjustmentDifference apply {MRAD_TO_DEG(_x)}; - _adjustmentDifference params ["_elevationDifference", "_windageDifference"]; - private _pitchBankYaw = [_unit] call EFUNC(common,getPitchBankYaw); - _pitchBankYaw params ["_pitch", "_bank", "_yaw"]; - _pitch = _pitch + _elevationDifference; - _yaw = _yaw + _windageDifference; - [_unit, _pitch, _bank, _yaw] call EFUNC(common,setPitchBankYaw); +if (cameraView == "GUNNER") then { + if (!GVAR(simplifiedZeroing)) then { + // Convert adjustmentDifference from mils to degrees + _adjustmentDifference = _adjustmentDifference apply {MRAD_TO_DEG(_x)}; + _adjustmentDifference params ["_elevationDifference", "_windageDifference"]; + private _pitchBankYaw = [_unit] call EFUNC(common,getPitchBankYaw); + _pitchBankYaw params ["_pitch", "_bank", "_yaw"]; + _pitch = _pitch + _elevationDifference; + _yaw = _yaw + _windageDifference; + [_unit, _pitch, _bank, _yaw] call EFUNC(common,setPitchBankYaw); + }; + + if (GVAR(inScopeAdjustment)) then { + [] call FUNC(showZeroing); + }; +} else { + [] call FUNC(showZeroing); }; -[] call FUNC(showZeroing); - true diff --git a/addons/scopes/initSettings.inc.sqf b/addons/scopes/initSettings.inc.sqf index 40ed62cbcc..693c6441f4 100644 --- a/addons/scopes/initSettings.inc.sqf +++ b/addons/scopes/initSettings.inc.sqf @@ -91,3 +91,11 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)]; false, 1 ] call CBA_fnc_addSetting; + +[ + QGVAR(inScopeAdjustment), "CHECKBOX", + LSTRING(inScopeAdjustment_displayName), + _category, + false, + 0 +] call CBA_fnc_addSetting; diff --git a/addons/scopes/stringtable.xml b/addons/scopes/stringtable.xml index 9a47f657cc..4174a91d02 100644 --- a/addons/scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -347,6 +347,11 @@ Replikuje systém naměřování puškohledů ze základní hry. Replica en los visores el sistema de homogeneizado de vanilla + + Show adjustment UI in scope + Zeige Absehenverstellungs-UI im Zielfernrohr + Mostra UI delle manopole nel mirino + Minor adjustment up Kleine Korrektur hoch