2015-01-11 16:42:31 +00:00
|
|
|
// by commy2
|
2015-01-12 04:02:33 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-29 07:38:46 +00:00
|
|
|
ADDON = false;
|
|
|
|
|
2016-02-22 14:20:36 +00:00
|
|
|
#include "XEH_PREP.hpp"
|
2015-01-12 04:02:33 +00:00
|
|
|
|
2015-01-13 23:27:42 +00:00
|
|
|
//ACE events global variables
|
2016-02-06 20:18:01 +00:00
|
|
|
GVAR(eventsLocation) = createLocation ["ACE_HashLocation", [-10000,-10000,-10000], 0, 0];
|
|
|
|
GVAR(eventsLocation) setText QGVAR(eventsLocation);
|
2015-01-13 23:27:42 +00:00
|
|
|
|
2016-02-20 21:41:24 +00:00
|
|
|
// backwards comp
|
2016-02-20 22:11:50 +00:00
|
|
|
DFUNC(canUseWeapon) = {
|
|
|
|
ACE_DEPRECATED("ace_common_fnc_canUseWeapon","3.7.0","CBA_fnc_canUseWeapon");
|
|
|
|
_this call CBA_fnc_canUseWeapon;
|
|
|
|
};
|
2016-02-20 21:41:24 +00:00
|
|
|
|
2016-02-20 22:30:40 +00:00
|
|
|
DFUNC(selectWeaponMode) = {
|
|
|
|
ACE_DEPRECATED("ace_common_fnc_selectWeaponMode","3.7.0","CBA_fnc_selectWeapon");
|
|
|
|
_this call CBA_fnc_selectWeapon;
|
|
|
|
};
|
|
|
|
|
2015-04-17 17:21:41 +00:00
|
|
|
GVAR(syncedEvents) = HASH_CREATE;
|
2015-10-16 03:33:05 +00:00
|
|
|
GVAR(showHudHash) = [] call FUNC(hashCreate);
|
2015-06-11 07:45:42 +00:00
|
|
|
|
2015-08-25 18:18:59 +00:00
|
|
|
//GVARS for execNextFrame and waitAndExec and waitUntilAndExecute
|
2015-05-26 03:46:56 +00:00
|
|
|
GVAR(waitAndExecArray) = [];
|
2015-06-11 07:45:42 +00:00
|
|
|
GVAR(nextFrameNo) = diag_frameno;
|
|
|
|
GVAR(nextFrameBufferA) = [];
|
|
|
|
GVAR(nextFrameBufferB) = [];
|
2015-08-25 18:18:59 +00:00
|
|
|
GVAR(waitUntilAndExecArray) = [];
|
2015-04-17 17:21:41 +00:00
|
|
|
|
2015-09-03 04:58:24 +00:00
|
|
|
GVAR(settingsInitFinished) = false;
|
|
|
|
GVAR(runAtSettingsInitialized) = [];
|
|
|
|
|
2015-09-21 16:37:19 +00:00
|
|
|
// @todo: Generic local-managed global-synced objects (createVehicleLocal)
|
2015-04-17 17:21:41 +00:00
|
|
|
|
2015-03-10 19:59:40 +00:00
|
|
|
//Debug
|
|
|
|
ACE_COUNTERS = [];
|
|
|
|
|
2015-05-14 23:45:53 +00:00
|
|
|
// Load settings on the server and broadcast them
|
2015-02-03 00:13:31 +00:00
|
|
|
if (isServer) then {
|
2015-01-30 21:56:45 +00:00
|
|
|
call FUNC(loadSettingsOnServer);
|
|
|
|
};
|
2015-01-16 14:30:49 +00:00
|
|
|
|
2016-01-13 00:18:12 +00:00
|
|
|
GVAR(statusEffect_Names) = [];
|
|
|
|
GVAR(statusEffect_isGlobal) = [];
|
2015-09-21 16:37:19 +00:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////
|
|
|
|
// Set up PlayerChanged eventhandler for pre init
|
|
|
|
//////////////////////////////////////////////////
|
|
|
|
|
2015-09-21 15:32:21 +00:00
|
|
|
ACE_player = objNull;
|
2015-09-21 16:37:19 +00:00
|
|
|
uiNamespace setVariable ["ACE_player", objNull];
|
2015-01-16 14:30:49 +00:00
|
|
|
|
2015-09-21 16:37:19 +00:00
|
|
|
// @todo check if this can be removed
|
2015-01-11 16:42:31 +00:00
|
|
|
if (hasInterface) then {
|
2015-01-16 14:30:49 +00:00
|
|
|
// PFH to update the ACE_player variable
|
2015-09-21 15:32:21 +00:00
|
|
|
GVAR(PreInit_playerChanged_PFHID) = [{
|
2015-04-03 15:50:52 +00:00
|
|
|
if !(ACE_player isEqualTo (call FUNC(player))) then {
|
2015-12-14 12:17:48 +00:00
|
|
|
private _oldPlayer = ACE_player;
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-04-03 15:50:52 +00:00
|
|
|
ACE_player = call FUNC(player);
|
2015-01-12 21:34:01 +00:00
|
|
|
uiNamespace setVariable ["ACE_player", ACE_player];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-16 14:30:49 +00:00
|
|
|
// Raise ACE event
|
2015-01-16 15:14:18 +00:00
|
|
|
["playerChanged", [ACE_player, _oldPlayer]] call FUNC(localEvent);
|
2015-01-12 21:34:01 +00:00
|
|
|
};
|
2015-08-04 07:34:31 +00:00
|
|
|
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
2015-01-14 21:29:52 +00:00
|
|
|
|
2015-09-21 16:37:19 +00:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////
|
2015-05-10 05:53:20 +00:00
|
|
|
// Time handling
|
2015-09-21 16:37:19 +00:00
|
|
|
//////////////////////////////////////////////////
|
|
|
|
|
2015-05-10 05:53:20 +00:00
|
|
|
ACE_time = diag_tickTime;
|
|
|
|
ACE_realTime = diag_tickTime;
|
|
|
|
ACE_virtualTime = diag_tickTime;
|
2015-05-10 14:50:58 +00:00
|
|
|
ACE_diagTime = diag_tickTime;
|
2015-05-10 05:53:20 +00:00
|
|
|
ACE_gameTime = time;
|
2015-05-22 19:29:56 +00:00
|
|
|
ACE_pausedTime = 0;
|
|
|
|
ACE_virtualPausedTime = 0;
|
2015-05-10 05:53:20 +00:00
|
|
|
|
2015-08-04 07:34:31 +00:00
|
|
|
[FUNC(timePFH), 0, []] call CBA_fnc_addPerFrameHandler;
|
2015-05-10 05:53:20 +00:00
|
|
|
|
2015-03-23 15:16:50 +00:00
|
|
|
// Init toHex
|
|
|
|
[0] call FUNC(toHex);
|
|
|
|
|
2015-09-21 16:37:19 +00:00
|
|
|
isHC = !hasInterface && !isDedicated; // deprecated because no tag
|
|
|
|
missionNamespace setVariable ["ACE_isHC", ACE_isHC];
|
|
|
|
uiNamespace setVariable ["ACE_isHC", ACE_isHC];
|
2015-02-14 19:29:07 +00:00
|
|
|
|
2015-09-21 16:37:19 +00:00
|
|
|
ADDON = true;
|