diff --git a/addons/scopes/CfgEventHandlers.hpp b/addons/scopes/CfgEventHandlers.hpp index be85fcc84d..204f2e267e 100644 --- a/addons/scopes/CfgEventHandlers.hpp +++ b/addons/scopes/CfgEventHandlers.hpp @@ -13,7 +13,7 @@ class Extended_PostInit_EventHandlers { class Extended_Fired_EventHandlers { class CAManBase { class ADDON { - clientFired = QUOTE(if (_this select 0 == ACE_player) then { _this call FUNC(firedEH) };); + clientFired = QUOTE(if (_this select 0 == ACE_player) then { _this call FUNC(firedEH);};); }; }; }; @@ -21,7 +21,7 @@ class Extended_Fired_EventHandlers { class Extended_Take_EventHandlers { class CAManBase { class ADDON { - clientTake = QUOTE(if (_this select 0 == ACE_player) then{ _this call FUNC(inventoryCheck) };); + clientTake = QUOTE(if (_this select 0 == ACE_player) then{ _this call FUNC(inventoryCheck);};); }; }; }; @@ -29,7 +29,7 @@ class Extended_Take_EventHandlers { class Extended_Put_EventHandlers { class CAManBase { class ADDON { - clientPut = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(inventoryCheck)};); + clientPut = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(inventoryCheck);};); }; }; }; @@ -37,7 +37,7 @@ class Extended_Put_EventHandlers { class Extended_InitPost_EventHandlers { class CAManBase { class ADDON { - init = QUOTE(if (_this select 0 == call EFUNC(common,player)) then{ _this call FUNC(inventoryCheck) };); + init = QUOTE(if (_this select 0 == call EFUNC(common,player)) then{ _this call FUNC(inventoryCheck);};); }; }; }; @@ -45,7 +45,7 @@ class Extended_InitPost_EventHandlers { class Extended_Respawn_EventHandlers { class CAManBase { class ADDON { - respawn = QUOTE(if (_this select 0 == call EFUNC(common, player)) then{ _this call FUNC(inventoryCheck) };); + respawn = QUOTE(if (_this select 0 == call EFUNC(common,player)) then{ _this call FUNC(inventoryCheck);};); }; }; }; diff --git a/addons/scopes/RscTitles.hpp b/addons/scopes/RscTitles.hpp index f86f33e492..daa028ab88 100644 --- a/addons/scopes/RscTitles.hpp +++ b/addons/scopes/RscTitles.hpp @@ -4,7 +4,7 @@ class RscTitles { movingEnable = 0; enableSimulation = 1; enableDisplay = 1; - onLoad = QUOTE(_this spawn COMPILE_FILE(PATHTOF(scripts\zeroingOnLoad.sqf)); uiNamespace setVariable[QGVAR(Debug), _this];); + onLoad = QUOTE(_this spawn compile preprocessFileLineNumbers 'z\ace\scopes\scripts\zeroingOnLoad.sqf'; uiNamespace setVariable [ARR_2('ACE_Scopes_Debug', _this)];); duration = 1e+011; fadein = 0; fadeout = 0; @@ -12,7 +12,7 @@ class RscTitles { class RscPicture; class RscText; class controls { - class ACE_Scope_Zeroing_BG : RscPicture { + class ACE_Scopes_Zeroing_BG : RscPicture { idc = 925001; type = 0; text = PATHTOF(UI\scopes_bg.paa); @@ -29,7 +29,7 @@ class RscTitles { w = 0.4 * safezoneW; h = 0.3 * safezoneH; }; - class ACE_Scope_Zeroing_Vertical : RscText { + class ACE_Scopes_Zeroing_Vertical : RscText { idc = 925002; type = 0; style = 2; @@ -46,7 +46,7 @@ class RscTitles { w = 0.04 * safezoneW; h = 0.025 * safezoneH; }; - class ACE_Scope_Zeroing_Horizontal : RscText { + class ACE_Scopes_Zeroing_Horizontal : RscText { idc = 925003; type = 0; style = 0; @@ -70,6 +70,7 @@ class RscTitles { class RscInGameUI { class RscUnitInfo; class RscWeaponZeroing : RscUnitInfo { - onLoad = QUOTE(["onLoad", _this, "RscUnitInfo", "IGUI"] call COMPILE_FILE(PATHTOF(A3\ui_f\scripts\initDisplay.sqf)); uiNamespace setVariable["ACE_dlgWeaponZeroing", _this select 0];); + onLoad = QUOTE([ARR_4('onLoad',_this,'RscUnitInfo','IGUI')] call compile preprocessfilelinenumbers 'A3\ui_f\scripts\initDisplay.sqf'; uiNamespace setVariable [ARR_2('ACE_dlgWeaponZeroing', _this select 0)]; ); + //onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['ACE_dlgWeaponZeroing', _this select 0];"; }; }; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 2146c4741f..e93c7ef3dc 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -9,6 +9,9 @@ * Return Value: * None */ + +#include "script_component.hpp" + GVAR(fadeScript) = scriptNull; // show overlay after changing weapon/optic diff --git a/addons/scopes/config.cpp b/addons/scopes/config.cpp index c4f8d43fa6..bd81706c5d 100644 --- a/addons/scopes/config.cpp +++ b/addons/scopes/config.cpp @@ -21,8 +21,8 @@ class CfgPatches { class ACE_Default_Keys { class adjustScopeUp { displayName = "$STR_ACE_Scopes_AdjustUp"; - condition = QUOTE([_player] call FUNC(inventoryCheck); [_player, 0, 0.1] call FUNC(canAdjustScope)); - statement = QUOTE([_player, 0, 0.1] call FUNC(adjustScope)); + condition = QUOTE([_player] call FUNC(inventoryCheck); [ARR_3(_player, 0, 0.1)] call FUNC(canAdjustScope);); + statement = QUOTE([ARR_3(_player, 0, 0.1)] call FUNC(adjustScope);); allowHolding = 1; key = 201; shift = 0; @@ -31,24 +31,23 @@ class ACE_Default_Keys { }; class adjustScopeDown: adjustScopeUp { displayName = "$STR_ACE_Scopes_AdjustDown"; - condition = QUOTE([_player] call FUNC(inventoryCheck); [_player, 0, -0.1] call FUNC(canAdjustScope)); - statement = QUOTE([_player, 0, -0.1] call FUNC(adjustScope)); + condition = QUOTE([_player] call FUNC(inventoryCheck); [ARR_3(_player, 0, -0.1)] call FUNC(canAdjustScope);); + statement = QUOTE([ARR_3(_player, 0, -0.1)] call FUNC(adjustScope);); key = 209; }; class adjustScopeLeft: adjustScopeUp { displayName = "$STR_ACE_Scopes_AdjustLeft"; - condition = QUOTE([_player] call FUNC(inventoryCheck); [_player, -0.1, 0] call FUNC(canAdjustScope)); - statement = QUOTE([_player, -0.1, 0] call FUNC(adjustScope)); + condition = QUOTE([_player] call FUNC(inventoryCheck); [ARR_3(_player, -0.1, 0)] call FUNC(canAdjustScope);); + statement = QUOTE([ARR_3(_player, -0.1, 0)] call FUNC(adjustScope);); key = 209; control = 1; }; class adjustScopeRight: adjustScopeLeft { displayName = "$STR_ACE_Scopes_AdjustRight"; - condition = QUOTE([_player] call FUNC(inventoryCheck); [_player, 0.1, 0] call FUNC(canAdjustScope)); - statement = QUOTE([_player, 0.1, 0] call FUNC(adjustScope)); + condition = QUOTE([_player] call FUNC(inventoryCheck); [ARR_3(_player, 0.1, 0)] call FUNC(canAdjustScope);); + statement = QUOTE([ARR_3(_player, 0.1, 0)] call FUNC(adjustScope);); key = 201; }; }; #include "RscTitles.hpp" -#include "RscInGameUI.hpp" diff --git a/addons/scopes/functions/fnc_firedEH.sqf b/addons/scopes/functions/fnc_firedEH.sqf index be294aac54..4414f617d6 100644 --- a/addons/scopes/functions/fnc_firedEH.sqf +++ b/addons/scopes/functions/fnc_firedEH.sqf @@ -27,7 +27,7 @@ _weapons = [ ]; if !(_weaponType in _weapons) exitWith {}; -_zeroing = QGVAR(Adjustment) select (_weapons find _weaponType); +_zeroing = GVAR(Adjustment) select (_weapons find _weaponType); // convert zeroing from mils to degrees _zeroing = [_zeroing, {_this * 0.05625}] call EFUNC(common,map); diff --git a/addons/scopes/scripts/zeroingOnLoad.sqf b/addons/scopes/scripts/zeroingOnLoad.sqf index 7cee282cdf..c78d5785f3 100644 --- a/addons/scopes/scripts/zeroingOnLoad.sqf +++ b/addons/scopes/scripts/zeroingOnLoad.sqf @@ -1,18 +1,18 @@ disableSerialization; _display = _this select 0; -uiNamespace setVariable ["AGM_Scopes_ZeroingDisplay", _display]; +uiNamespace setVariable ["ACE_Scopes_ZeroingDisplay", _display]; _vertical = _display displayCtrl 925002; _horizontal = _display displayCtrl 925003; _weapons = [ - primaryWeapon player, - secondaryWeapon player, - handgunWeapon player + primaryWeapon player, + secondaryWeapon player, + handgunWeapon player ]; if ((currentWeapon player) in _weapons) then { - _zeroing = AGM_Scopes_Adjustment select (_weapons find (currentWeapon player)); - _horizontal ctrlSetText (str (_zeroing select 0)); - _vertical ctrlSetText (str (_zeroing select 1)); + _zeroing = ACE_Scopes_Adjustment select (_weapons find (currentWeapon player)); + _horizontal ctrlSetText (str (_zeroing select 0)); + _vertical ctrlSetText (str (_zeroing select 1)); };