From 112c9f319f82e85460623dad054da3d9cfa34c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sun, 18 Jan 2015 18:34:45 -0300 Subject: [PATCH] scopes: partial fix --- addons/scopes/RscTitles.hpp | 4 ++-- addons/scopes/XEH_postInit.sqf | 2 +- addons/scopes/functions/fnc_canAdjustScope.sqf | 2 +- addons/scopes/scripts/script_component.hpp | 1 + addons/scopes/scripts/zeroingOnLoad.sqf | 8 +++++--- .../{agm_scopes_click.wav => ace_scopes_click.wav} | Bin 6 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 addons/scopes/scripts/script_component.hpp rename addons/scopes/sounds/{agm_scopes_click.wav => ace_scopes_click.wav} (100%) diff --git a/addons/scopes/RscTitles.hpp b/addons/scopes/RscTitles.hpp index daa028ab88..79de7e8214 100644 --- a/addons/scopes/RscTitles.hpp +++ b/addons/scopes/RscTitles.hpp @@ -1,10 +1,10 @@ class RscTitles { - class ACE_Scope_Zeroing { + class ACE_Scopes_Zeroing { idd = -1; movingEnable = 0; enableSimulation = 1; enableDisplay = 1; - onLoad = QUOTE(_this spawn compile preprocessFileLineNumbers 'z\ace\scopes\scripts\zeroingOnLoad.sqf'; uiNamespace setVariable [ARR_2('ACE_Scopes_Debug', _this)];); + onLoad = QUOTE(_this spawn compile preprocessFileLineNumbers QUOTE(QUOTE(PATHTOF(scripts\zeroingOnLoad.sqf))); uiNamespace setVariable [ARR_2('ACE_Scopes_Debug', _this)];); duration = 1e+011; fadein = 0; fadeout = 0; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 651d522027..b7fd4bfc3a 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -96,7 +96,7 @@ if !(hasInterface) exitWith {}; ] call cba_fnc_registerKeybind; ["ACE3", - localize "adjustScopeRight", + localize "STR_ACE_Scopes_AdjustRight", { // Conditions: canInteract _exceptions = []; diff --git a/addons/scopes/functions/fnc_canAdjustScope.sqf b/addons/scopes/functions/fnc_canAdjustScope.sqf index 883c14bb76..8aea2ff9e4 100644 --- a/addons/scopes/functions/fnc_canAdjustScope.sqf +++ b/addons/scopes/functions/fnc_canAdjustScope.sqf @@ -29,7 +29,7 @@ if (isNil QGVAR(Adjustment)) then { GVAR(Adjustment) = [[0,0], [0,0], [0,0]]; }; -if (isNil "AGM_Scopes_Optics") then { +if (isNil QGVAR(Optics)) then { GVAR(Optics) = ["", "", ""]; }; diff --git a/addons/scopes/scripts/script_component.hpp b/addons/scopes/scripts/script_component.hpp new file mode 100644 index 0000000000..acca51b4b5 --- /dev/null +++ b/addons/scopes/scripts/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\scopes\script_component.hpp" diff --git a/addons/scopes/scripts/zeroingOnLoad.sqf b/addons/scopes/scripts/zeroingOnLoad.sqf index c78d5785f3..591b5fc07b 100644 --- a/addons/scopes/scripts/zeroingOnLoad.sqf +++ b/addons/scopes/scripts/zeroingOnLoad.sqf @@ -1,7 +1,9 @@ +#include "script_component.hpp" + disableSerialization; _display = _this select 0; -uiNamespace setVariable ["ACE_Scopes_ZeroingDisplay", _display]; +uiNamespace setVariable [QGVAR(ZeroingDisplay, _display]; _vertical = _display displayCtrl 925002; _horizontal = _display displayCtrl 925003; @@ -11,8 +13,8 @@ _weapons = [ handgunWeapon player ]; -if ((currentWeapon player) in _weapons) then { - _zeroing = ACE_Scopes_Adjustment select (_weapons find (currentWeapon player)); +if ((currentWeapon ACE_player) in _weapons) then { + _zeroing = GVAR(Adjustment) select (_weapons find (currentWeapon ACE_player)); _horizontal ctrlSetText (str (_zeroing select 0)); _vertical ctrlSetText (str (_zeroing select 1)); }; diff --git a/addons/scopes/sounds/agm_scopes_click.wav b/addons/scopes/sounds/ace_scopes_click.wav similarity index 100% rename from addons/scopes/sounds/agm_scopes_click.wav rename to addons/scopes/sounds/ace_scopes_click.wav