diff --git a/CHANGELOG.md b/CHANGELOG.md index f0f952d..fffbd0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,9 @@ -## 0.3.2 - - Added: Dragging horizontally on knob control - ## 0.3.1 - - Fixed: With Detached Cursor setting OFF, interaction cursor did not show - - Added: Settings for cursor shape and color + - Fixed: Addon settings doesn't show in MP ## 0.3.0 + - Added: Settings for cursor shape and color + - Added: Dragging horizontally on knob control - Added: Allow interactions while remote controlling - Changed: Removed ACE Dependency - Changed: Keybinds moved from CBA Keybinds to Arma Modded Keybinds diff --git a/addons/core/functions/fnc_getVehicleConfig.sqf b/addons/core/functions/fnc_getVehicleConfig.sqf index 76d39ca..1826855 100644 --- a/addons/core/functions/fnc_getVehicleConfig.sqf +++ b/addons/core/functions/fnc_getVehicleConfig.sqf @@ -1,3 +1,4 @@ +#include "script_component.hpp" /* * hct_core_fnc_getVehicleConfig * diff --git a/addons/core/functions/fnc_hasModule.sqf b/addons/core/functions/fnc_hasModule.sqf index e185dbd..3b7a897 100644 --- a/addons/core/functions/fnc_hasModule.sqf +++ b/addons/core/functions/fnc_hasModule.sqf @@ -1,3 +1,4 @@ +#include "script_component.hpp" /* * hct_core_fnc_hasModule * @@ -15,7 +16,7 @@ private _vehicleModuleArray = _vehicle getVariable ["hct_modules", []]; private _isClass = if(!isNil "_className") then [{_vehicle isKindOf _className}, {true}]; private _hasModule = false; { // forEach _vehicleModuleArray - _name = _x # 0; + _name = _x # MODULEINDEX_MODULENAME; if (_moduleName == _name) exitWith { _hasModule = true; }; diff --git a/addons/core/functions/fnc_init.sqf b/addons/core/functions/fnc_init.sqf index 57813b8..6a49c98 100644 --- a/addons/core/functions/fnc_init.sqf +++ b/addons/core/functions/fnc_init.sqf @@ -1,3 +1,5 @@ +#include "script_component.hpp" + ["vehicle", {[hct_player, vehicle hct_player] call hct_core_fnc_vehicleChanged}, true] call CBA_fnc_addPlayerEventHandler; hct_interaction_vehicleSwitchedEH = ["turret", { diff --git a/addons/core/functions/fnc_load.sqf b/addons/core/functions/fnc_load.sqf index 2c831b4..3c5bd83 100644 --- a/addons/core/functions/fnc_load.sqf +++ b/addons/core/functions/fnc_load.sqf @@ -1,3 +1,4 @@ +#include "script_component.hpp" /* * hct_core_fnc_load * diff --git a/addons/core/functions/fnc_loadAll.sqf b/addons/core/functions/fnc_loadAll.sqf index 8333479..1f70c4f 100644 --- a/addons/core/functions/fnc_loadAll.sqf +++ b/addons/core/functions/fnc_loadAll.sqf @@ -1,3 +1,4 @@ +#include "script_component.hpp" /* * hct_core_fnc_loadAll * diff --git a/addons/core/functions/fnc_perFixed.sqf b/addons/core/functions/fnc_perFixed.sqf index e272aae..ab98d4a 100644 --- a/addons/core/functions/fnc_perFixed.sqf +++ b/addons/core/functions/fnc_perFixed.sqf @@ -1,3 +1,4 @@ +#include "script_component.hpp" /* * hct_core_fnc_perFixed * @@ -30,8 +31,8 @@ private _modules = (_vehicle getVariable ["hct_modules", []]); private ["_func"]; { //forEach vehicle hct_modules sleep _moduleDelay; - if (_x # 1) then { - _func = missionNamespace getVariable (_x # 5); + if (_x # MODULEINDEX_STARTUP) then { + _func = missionNamespace getVariable (_x # MODULEINDEX_PERFIXED); if (!isNil {_func}) then {[_vehicle] call _func;}; }; } forEach _modules; diff --git a/addons/core/functions/fnc_perFrame.sqf b/addons/core/functions/fnc_perFrame.sqf index a920097..981f72f 100644 --- a/addons/core/functions/fnc_perFrame.sqf +++ b/addons/core/functions/fnc_perFrame.sqf @@ -1,3 +1,4 @@ +#include "script_component.hpp" /* * hct_core_fnc_perFrame * @@ -41,8 +42,8 @@ if (_frameTime > 1) exitWith {}; private ["_func"]; { //forEach vehicle hct_modules - if (_x # 1) then { - _func = missionNamespace getVariable (_x # 3); + if (_x # MODULEINDEX_STARTUP) then { + _func = missionNamespace getVariable (_x # MODULEINDEX_PERFRAME); if (!isNil {_func}) then {[_vehicle, _frameTime] call _func;}; }; } forEach (_vehicle getVariable ["hct_modules", []]); diff --git a/addons/core/functions/fnc_perSecond.sqf b/addons/core/functions/fnc_perSecond.sqf index ad8f47f..3d45afd 100644 --- a/addons/core/functions/fnc_perSecond.sqf +++ b/addons/core/functions/fnc_perSecond.sqf @@ -1,3 +1,4 @@ +#include "script_component.hpp" /* * hct_core_fnc_perSecond * @@ -30,8 +31,8 @@ private _modules = (_vehicle getVariable ["hct_modules", []]); private ["_func"]; { //forEach vehicle hct_modules sleep _moduleDelay; - if (_x # 1) then { - _func = missionNamespace getVariable (_x # 4); + if (_x # MODULEINDEX_STARTUP) then { + _func = missionNamespace getVariable (_x # MODULEINDEX_PERSECOND); if (!isNil {_func}) then {[_vehicle] call _func;}; }; } forEach _modules; diff --git a/addons/core/functions/fnc_shutDownAll.sqf b/addons/core/functions/fnc_shutDownAll.sqf index e275fd6..235d8f9 100644 --- a/addons/core/functions/fnc_shutDownAll.sqf +++ b/addons/core/functions/fnc_shutDownAll.sqf @@ -1,3 +1,4 @@ +#include "script_component.hpp" /* * hct_core_fnc_setup * @@ -31,8 +32,8 @@ with uiNamespace do { private ["_func"]; { //forEach vehicle hct_modules - if (_x # 1) then { - _func = missionNamespace getVariable (_x # 5); + if (_x # MODULEINDEX_STARTUP) then { + _func = missionNamespace getVariable (_x # MODULEINDEX_SHUTDOWN); if (!isNil {_func}) then {[_vehicle] call _func;}; }; _x set [1, false]; diff --git a/addons/core/script_component.hpp b/addons/core/script_component.hpp index c87c11e..760f0db 100644 --- a/addons/core/script_component.hpp +++ b/addons/core/script_component.hpp @@ -13,3 +13,17 @@ #endif #include "\z\HCT\addons\main\script_macros.hpp" + +#define ANIMTYPE_NONE 0 +#define ANIMTYPE_ANIM 1 +#define ANIMTYPE_ASRC 2 +#define ANIMTYPE_DOOR 3 + +#define MODULEINDEX_MODULENAME 0 +#define MODULEINDEX_STARTUP 1 +#define MODULEINDEX_SETUP 2 +#define MODULEINDEX_PERFRAME 3 +#define MODULEINDEX_PERSECOND 4 +#define MODULEINDEX_PERFIXED 5 +#define MODULEINDEX_DRAW3D 6 +#define MODULEINDEX_SHUTDOWN 7 diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index 349cbb1..cd6e57b 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -5,4 +5,6 @@ ADDON = false; #include "XEH_PREP.hpp" //PREP_RECOMPILE_END; +call FUNC(preInit); + ADDON = true; diff --git a/addons/interaction/XEH_preInit_server.sqf b/addons/interaction/XEH_preInit_server.sqf index 4307b04..ea99354 100644 --- a/addons/interaction/XEH_preInit_server.sqf +++ b/addons/interaction/XEH_preInit_server.sqf @@ -1,4 +1,2 @@ #include "script_component.hpp" //only executed on server - -call FUNC(preInit); diff --git a/addons/interaction/functions/fnc_draw3D.sqf b/addons/interaction/functions/fnc_draw3D.sqf index bf15288..7d34f4b 100644 --- a/addons/interaction/functions/fnc_draw3D.sqf +++ b/addons/interaction/functions/fnc_draw3D.sqf @@ -1,3 +1,4 @@ +#include "script_component.hpp" /* * hct_interaction_fnc_Draw3D * @@ -62,8 +63,8 @@ if (!isNil "hct_interaction_knobHolding" && !hct_interaction_dragging) then { private ["_func"]; { //forEach vehicle hct_modules - if (_x # 1) then { - _func = missionNamespace getVariable (_x # 6); + if (_x # MODULEINDEX_STARTUP) then { + _func = missionNamespace getVariable (_x # MODULEINDEX_DRAW3D); if (!isNil {_func}) then {[_vehicle, _frameTime] call _func;}; }; } forEach (_vehicle getVariable ["hct_modules", []]); diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index ada1f19..93fdede 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 0 #define MINOR 3 -#define PATCH 2 +#define PATCH 1 #define BUILD 0