2015-01-12 18:22:58 +00:00
|
|
|
// ACE - Common
|
2015-01-12 04:02:33 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-05-14 22:12:40 +00:00
|
|
|
//IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent");
|
2015-02-03 00:14:16 +00:00
|
|
|
|
2015-06-11 07:45:42 +00:00
|
|
|
//Singe PFEH to handle execNextFrame and waitAndExec:
|
|
|
|
[{
|
|
|
|
private ["_entry"];
|
2015-07-03 01:14:58 +00:00
|
|
|
|
2015-06-11 07:45:42 +00:00
|
|
|
//Handle the waitAndExec array:
|
|
|
|
while {((count GVAR(waitAndExecArray)) > 0) && {((GVAR(waitAndExecArray) select 0) select 0) <= ACE_Time}} do {
|
|
|
|
_entry = GVAR(waitAndExecArray) deleteAt 0;
|
|
|
|
(_entry select 2) call (_entry select 1);
|
|
|
|
};
|
|
|
|
|
|
|
|
//Handle the execNextFrame array:
|
|
|
|
{
|
|
|
|
(_x select 0) call (_x select 1);
|
|
|
|
} forEach GVAR(nextFrameBufferA);
|
|
|
|
//Swap double-buffer:
|
|
|
|
GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB);
|
|
|
|
GVAR(nextFrameBufferB) = [];
|
|
|
|
GVAR(nextFrameNo) = diag_frameno + 1;
|
|
|
|
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
|
|
|
|
|
|
|
|
2015-02-03 04:45:04 +00:00
|
|
|
// Listens for global "SettingChanged" events, to update the force status locally
|
|
|
|
["SettingChanged", {
|
|
|
|
PARAMS_2(_name,_value);
|
|
|
|
if !(count _this > 2) exitWith {};
|
2015-05-14 22:12:40 +00:00
|
|
|
private ["_force", "_settingData"];
|
2015-02-03 04:45:04 +00:00
|
|
|
_force = _this select 2;
|
|
|
|
if (_force) then {
|
|
|
|
_settingData = [_name] call FUNC(getSettingData);
|
2015-02-03 05:37:13 +00:00
|
|
|
if (count _settingData == 0) exitWith {};
|
2015-02-03 04:45:04 +00:00
|
|
|
_settingData set [6,_force];
|
|
|
|
};
|
|
|
|
}] call FUNC(addEventhandler);
|
|
|
|
|
2015-08-02 01:01:35 +00:00
|
|
|
|
|
|
|
["HeadbugFixUsed", {
|
|
|
|
PARAMS_2(_profileName,_animation);
|
|
|
|
diag_log text format ["[ACE] Headbug Used: Name: %1, Animation: %2", _profileName, _animation];
|
|
|
|
}] call FUNC(addEventHandler);
|
|
|
|
|
|
|
|
|
2015-06-30 17:26:51 +00:00
|
|
|
//~~~~~Get Map Data~~~~~
|
|
|
|
//Find MGRS zone and 100km grid for current map
|
|
|
|
[] call FUNC(getMGRSdata);
|
|
|
|
//Prepare variables for FUNC(getMapGridFromPos)/FUNC(getMapPosFromGrid)
|
|
|
|
[] call FUNC(getMapGridData);
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-18 00:36:56 +00:00
|
|
|
["fixCollision", DFUNC(fixCollision)] call FUNC(addEventhandler);
|
|
|
|
["fixFloating", DFUNC(fixFloating)] call FUNC(addEventhandler);
|
|
|
|
["fixPosition", DFUNC(fixPosition)] call FUNC(addEventhandler);
|
2015-03-16 18:25:29 +00:00
|
|
|
|
2015-06-11 22:56:11 +00:00
|
|
|
["unloadPersonEvent", DFUNC(unloadPersonLocal)] call FUNC(addEventhandler);
|
|
|
|
|
2015-03-18 10:29:58 +00:00
|
|
|
["lockVehicle", {
|
|
|
|
_this setVariable [QGVAR(lockStatus), locked _this];
|
|
|
|
_this lock 2;
|
|
|
|
}] call FUNC(addEventhandler);
|
|
|
|
|
|
|
|
["unlockVehicle", {
|
|
|
|
_this lock (_this getVariable [QGVAR(lockStatus), locked _this]);
|
|
|
|
}] call FUNC(addEventhandler);
|
|
|
|
|
2015-03-24 18:07:39 +00:00
|
|
|
["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler);
|
2015-03-27 23:30:51 +00:00
|
|
|
["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler);
|
2015-04-12 08:05:49 +00:00
|
|
|
["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler);
|
2015-03-24 18:07:39 +00:00
|
|
|
|
2015-07-03 01:14:58 +00:00
|
|
|
if (isServer) then {
|
|
|
|
["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler);
|
|
|
|
};
|
|
|
|
|
2015-01-19 16:47:52 +00:00
|
|
|
// hack to get PFH to work in briefing
|
|
|
|
[QGVAR(onBriefingPFH), "onEachFrame", {
|
2015-05-21 16:42:44 +00:00
|
|
|
if (ACE_time > 0) exitWith {
|
2015-01-24 18:32:06 +00:00
|
|
|
[QGVAR(onBriefingPFH), "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
|
2015-01-19 16:47:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
call cba_common_fnc_onFrame;
|
|
|
|
}] call BIS_fnc_addStackedEventHandler;
|
|
|
|
/////
|
|
|
|
|
2015-01-11 18:20:14 +00:00
|
|
|
QGVAR(remoteFnc) addPublicVariableEventHandler {
|
2015-01-12 21:34:01 +00:00
|
|
|
(_this select 1) call FUNC(execRemoteFnc);
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
2015-01-11 18:20:14 +00:00
|
|
|
[missionNamespace] call FUNC(executePersistent);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-05-14 22:12:40 +00:00
|
|
|
private ["_currentVersion", "_previousVersion"];
|
2015-01-11 16:42:31 +00:00
|
|
|
// check previous version number from profile
|
2015-01-17 11:35:59 +00:00
|
|
|
_currentVersion = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version");
|
2015-01-12 04:02:33 +00:00
|
|
|
_previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
if (_currentVersion != _previousVersion) then {
|
2015-01-12 21:34:01 +00:00
|
|
|
// do something
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-12 21:34:01 +00:00
|
|
|
profileNamespace setVariable ["ACE_VersionNumberString", _currentVersion];
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
2015-04-18 02:26:27 +00:00
|
|
|
// ACE events
|
2015-01-17 01:12:37 +00:00
|
|
|
"ACEg" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); };
|
|
|
|
"ACEc" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); };
|
2015-01-13 23:27:42 +00:00
|
|
|
|
2015-04-18 02:26:27 +00:00
|
|
|
// Synced ACE events
|
|
|
|
// Handle JIP scenario
|
|
|
|
if(!isServer) then {
|
2015-04-30 18:49:38 +00:00
|
|
|
["PlayerJip", {
|
2015-04-18 02:26:27 +00:00
|
|
|
diag_log text format["[ACE] * JIP event synchronization initialized"];
|
|
|
|
["SEH_all", [player]] call FUNC(serverEvent);
|
|
|
|
}] call FUNC(addEventHandler);
|
|
|
|
} else {
|
|
|
|
["SEH_all", FUNC(_handleRequestAllSyncedEvents)] call FUNC(addEventHandler);
|
|
|
|
};
|
|
|
|
["SEH", FUNC(_handleSyncedEvent)] call FUNC(addEventHandler);
|
|
|
|
["SEH_s", FUNC(_handleRequestSyncedEvent)] call FUNC(addEventHandler);
|
2015-08-06 05:28:43 +00:00
|
|
|
if (isServer) then {
|
|
|
|
[FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler;
|
|
|
|
};
|
2015-05-09 11:25:19 +00:00
|
|
|
call FUNC(checkFiles);
|
2015-04-18 02:26:27 +00:00
|
|
|
|
2015-06-13 03:57:01 +00:00
|
|
|
|
|
|
|
// Create a pfh to wait until all postinits are ready and settings are initialized
|
|
|
|
[{
|
|
|
|
PARAMS_1(_args);
|
|
|
|
EXPLODE_1_PVT(_args,_waitingMsgSent);
|
|
|
|
// If post inits are not ready then wait
|
|
|
|
if !(SLX_XEH_MACHINE select 8) exitWith {};
|
|
|
|
|
|
|
|
// If settings are not initialized then wait
|
|
|
|
if (isNil QGVAR(settings) || {(!isServer) && (isNil QEGVAR(modules,serverModulesRead))}) exitWith {
|
|
|
|
if (!_waitingMsgSent) then {
|
|
|
|
_args set [0, true];
|
|
|
|
diag_log text format["[ACE] Waiting on settings from server"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
|
|
|
|
|
|
|
diag_log text format["[ACE] Settings received from server"];
|
|
|
|
|
|
|
|
// Event so that ACE_Modules have their settings loaded:
|
|
|
|
["InitSettingsFromModules", []] call FUNC(localEvent);
|
|
|
|
|
|
|
|
// Load user settings from profile
|
|
|
|
if (hasInterface) then {
|
|
|
|
call FUNC(loadSettingsFromProfile);
|
|
|
|
call FUNC(loadSettingsLocalizedText);
|
|
|
|
};
|
|
|
|
|
|
|
|
diag_log text format["[ACE] Settings initialized"];
|
|
|
|
|
|
|
|
//Event that settings are safe to use:
|
|
|
|
["SettingsInitialized", []] call FUNC(localEvent);
|
|
|
|
|
2015-08-04 07:34:31 +00:00
|
|
|
}, 0, [false]] call CBA_fnc_addPerFrameHandler;
|
2015-06-13 03:57:01 +00:00
|
|
|
|
|
|
|
|
2015-06-15 17:55:30 +00:00
|
|
|
["SettingsInitialized", {
|
|
|
|
[
|
|
|
|
GVAR(checkPBOsAction),
|
|
|
|
GVAR(checkPBOsCheckAll),
|
|
|
|
call compile GVAR(checkPBOsWhitelist)
|
|
|
|
] call FUNC(checkPBOs)
|
|
|
|
}] call FUNC(addEventHandler);
|
|
|
|
|
|
|
|
|
2015-04-18 02:26:27 +00:00
|
|
|
/***************************************************************/
|
|
|
|
/***************************************************************/
|
|
|
|
/***************************************************************/
|
|
|
|
/***************************************************************/
|
|
|
|
/***************************************************************/
|
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
// everything that only player controlled machines need, goes below this
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
2015-01-12 13:12:50 +00:00
|
|
|
call COMPILE_FILE(scripts\assignedItemFix);
|
2015-01-24 18:32:06 +00:00
|
|
|
call COMPILE_FILE(scripts\initScrollWheel);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-04-25 07:49:47 +00:00
|
|
|
DFUNC(mouseZHandler) = {
|
|
|
|
waitUntil {!isNull (findDisplay 46)}; sleep 0.1;
|
|
|
|
findDisplay 46 displayAddEventHandler ["MouseZChanged", QUOTE( _this call GVAR(onScrollWheel) )];
|
|
|
|
[false] call FUNC(disableUserInput);
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
2015-04-25 07:49:47 +00:00
|
|
|
|
2015-04-25 07:52:51 +00:00
|
|
|
addMissionEventHandler ["Loaded", {[] spawn FUNC(mouseZHandler)}];
|
2015-04-25 07:49:47 +00:00
|
|
|
[] spawn FUNC(mouseZHandler);
|
|
|
|
|
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
enableCamShake true;
|
|
|
|
|
2015-01-12 04:02:33 +00:00
|
|
|
// Set the name for the current player
|
2015-01-16 15:14:18 +00:00
|
|
|
["playerChanged", {
|
|
|
|
EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer);
|
2015-04-30 18:49:38 +00:00
|
|
|
|
2015-01-16 15:14:18 +00:00
|
|
|
if (alive _newPlayer) then {
|
|
|
|
[_newPlayer] call FUNC(setName)
|
2015-01-12 21:34:01 +00:00
|
|
|
};
|
2015-01-16 15:14:18 +00:00
|
|
|
if (alive _oldPlayer) then {
|
|
|
|
[_oldPlayer] call FUNC(setName)
|
2015-01-12 21:34:01 +00:00
|
|
|
};
|
2015-01-16 23:21:47 +00:00
|
|
|
|
2015-01-16 15:14:18 +00:00
|
|
|
}] call FUNC(addEventhandler);
|
2015-01-13 23:27:42 +00:00
|
|
|
|
2015-02-10 04:22:10 +00:00
|
|
|
GVAR(OldPlayerInventory) = [ACE_player] call FUNC(getAllGear);
|
2015-01-16 18:39:19 +00:00
|
|
|
GVAR(OldPlayerVisionMode) = currentVisionMode ACE_player;
|
2015-01-16 18:39:38 +00:00
|
|
|
GVAR(OldZeusDisplayIsOpen) = !(isNull findDisplay 312);
|
2015-01-16 20:16:42 +00:00
|
|
|
GVAR(OldCameraView) = cameraView;
|
|
|
|
GVAR(OldPlayerVehicle) = vehicle ACE_player;
|
|
|
|
GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
|
2015-03-18 14:42:33 +00:00
|
|
|
GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
|
2015-01-13 23:27:42 +00:00
|
|
|
|
2015-01-16 18:39:19 +00:00
|
|
|
// PFH to raise varios events
|
2015-01-16 18:28:37 +00:00
|
|
|
[{
|
2015-05-14 22:12:40 +00:00
|
|
|
private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen"];
|
2015-04-04 14:26:32 +00:00
|
|
|
// "playerInventoryChanged" event
|
|
|
|
_newPlayerInventory = [ACE_player] call FUNC(getAllGear);
|
|
|
|
if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then {
|
|
|
|
// Raise ACE event locally
|
|
|
|
GVAR(OldPlayerInventory) = _newPlayerInventory;
|
|
|
|
["playerInventoryChanged", [ACE_player, _newPlayerInventory]] call FUNC(localEvent);
|
|
|
|
};
|
|
|
|
|
|
|
|
// "playerVisionModeChanged" event
|
|
|
|
_newPlayerVisionMode = currentVisionMode ACE_player;
|
|
|
|
if !(_newPlayerVisionMode isEqualTo GVAR(OldPlayerVisionMode)) then {
|
|
|
|
// Raise ACE event locally
|
|
|
|
GVAR(OldPlayerVisionMode) = _newPlayerVisionMode;
|
|
|
|
["playerVisionModeChanged", [ACE_player, _newPlayerVisionMode]] call FUNC(localEvent);
|
2015-01-16 18:39:19 +00:00
|
|
|
};
|
2015-04-04 14:26:32 +00:00
|
|
|
|
|
|
|
// "inventoryDisplayChanged" event
|
|
|
|
_newInventoryDisplayIsOpen = !(isNull findDisplay 602);
|
|
|
|
if !(_newInventoryDisplayIsOpen isEqualTo GVAR(OldInventoryDisplayIsOpen)) then {
|
|
|
|
// Raise ACE event locally
|
|
|
|
GVAR(OldInventoryDisplayIsOpen) = _newInventoryDisplayIsOpen;
|
|
|
|
["inventoryDisplayChanged", [ACE_player, _newInventoryDisplayIsOpen]] call FUNC(localEvent);
|
|
|
|
};
|
|
|
|
|
2015-01-16 18:39:38 +00:00
|
|
|
// "zeusDisplayChanged" event
|
|
|
|
_newZeusDisplayIsOpen = !(isNull findDisplay 312);
|
2015-01-16 19:30:48 +00:00
|
|
|
if !(_newZeusDisplayIsOpen isEqualTo GVAR(OldZeusDisplayIsOpen)) then {
|
2015-01-16 18:39:38 +00:00
|
|
|
// Raise ACE event locally
|
|
|
|
GVAR(OldZeusDisplayIsOpen) = _newZeusDisplayIsOpen;
|
|
|
|
["zeusDisplayChanged", [ACE_player, _newZeusDisplayIsOpen]] call FUNC(localEvent);
|
|
|
|
};
|
2015-04-04 14:26:32 +00:00
|
|
|
|
2015-01-16 20:16:42 +00:00
|
|
|
// "cameraViewChanged" event
|
|
|
|
_newCameraView = cameraView;
|
|
|
|
if !(_newCameraView isEqualTo GVAR(OldCameraView)) then {
|
|
|
|
// Raise ACE event locally
|
|
|
|
GVAR(OldCameraView) = _newCameraView;
|
|
|
|
["cameraViewChanged", [ACE_player, _newCameraView]] call FUNC(localEvent);
|
|
|
|
};
|
2015-04-04 14:26:32 +00:00
|
|
|
|
|
|
|
// "playerVehicleChanged" event
|
|
|
|
_newPlayerVehicle = vehicle ACE_player;
|
|
|
|
if !(_newPlayerVehicle isEqualTo GVAR(OldPlayerVehicle)) then {
|
|
|
|
// Raise ACE event locally
|
|
|
|
GVAR(OldPlayerVehicle) = _newPlayerVehicle;
|
|
|
|
["playerVehicleChanged", [ACE_player, _newPlayerVehicle]] call FUNC(localEvent);
|
|
|
|
};
|
|
|
|
|
|
|
|
// "playerTurretChanged" event
|
|
|
|
_newPlayerTurret = [ACE_player] call FUNC(getTurretIndex);
|
|
|
|
if !(_newPlayerTurret isEqualTo GVAR(OldPlayerTurret)) then {
|
|
|
|
// Raise ACE event locally
|
|
|
|
GVAR(OldPlayerTurret) = _newPlayerTurret;
|
|
|
|
["playerTurretChanged", [ACE_player, _newPlayerTurret]] call FUNC(localEvent);
|
|
|
|
};
|
|
|
|
|
|
|
|
// "playerWeaponChanged" event
|
|
|
|
_newPlayerWeapon = currentWeapon ACE_player;
|
|
|
|
if (_newPlayerWeapon != GVAR(OldPlayerWeapon)) then {
|
|
|
|
// Raise ACE event locally
|
|
|
|
GVAR(OldPlayerWeapon) = _newPlayerWeapon;
|
|
|
|
["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent);
|
|
|
|
};
|
|
|
|
|
2015-08-04 07:34:31 +00:00
|
|
|
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
2015-01-16 23:21:47 +00:00
|
|
|
|
2015-04-18 20:06:42 +00:00
|
|
|
|
|
|
|
// PFH to raise camera created event. Only works on these cams by BI.
|
|
|
|
#define ALL_CAMERAS [ \
|
|
|
|
missionNamespace getVariable ["BIS_DEBUG_CAM", objNull], \
|
|
|
|
missionNamespace getVariable ["BIS_fnc_camera_cam", objNull], \
|
|
|
|
uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull], \
|
|
|
|
uiNamespace getVariable ["BIS_fnc_animViewer_cam", objNull], \
|
|
|
|
missionNamespace getVariable ["BIS_fnc_establishingShot_fakeUAV", objNull] \
|
|
|
|
]
|
|
|
|
|
|
|
|
GVAR(OldIsCamera) = false;
|
|
|
|
|
|
|
|
[{
|
|
|
|
|
|
|
|
// "activeCameraChanged" event
|
2015-05-14 22:12:40 +00:00
|
|
|
private ["_isCamera"];
|
2015-04-18 20:06:42 +00:00
|
|
|
_isCamera = {!isNull _x} count ALL_CAMERAS > 0;
|
|
|
|
if !(_isCamera isEqualTo GVAR(OldIsCamera)) then {
|
|
|
|
// Raise ACE event locally
|
|
|
|
GVAR(OldIsCamera) = _isCamera;
|
|
|
|
["activeCameraChanged", [ACE_player, _isCamera]] call FUNC(localEvent);
|
|
|
|
};
|
|
|
|
|
2015-08-04 07:34:31 +00:00
|
|
|
}, 1, []] call CBA_fnc_addPerFrameHandler; // feel free to decrease the sleep ACE_time if you need it.
|
2015-04-18 20:06:42 +00:00
|
|
|
|
|
|
|
|
2015-01-16 23:21:47 +00:00
|
|
|
[QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable);
|
2015-01-28 20:38:04 +00:00
|
|
|
|
2015-02-24 17:10:40 +00:00
|
|
|
["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler);
|
|
|
|
["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler);
|
2015-04-30 18:49:38 +00:00
|
|
|
["medical_onUnconscious", {if (local (_this select 0) && {!(_this select 1)}) then {[ _this select 0, false, QUOTE(FUNC(loadPerson)), west /* dummy side */] call FUNC(switchToGroupSide);};}] call FUNC(addEventhandler);
|
2015-03-15 08:26:16 +00:00
|
|
|
|
2015-03-15 15:12:37 +00:00
|
|
|
["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition);
|
2015-03-31 21:06:28 +00:00
|
|
|
["isNotInside", {
|
|
|
|
// Players can always interact with himself if not boarded
|
|
|
|
vehicle (_this select 0) == (_this select 0) ||
|
|
|
|
// Players can always interact with his vehicle
|
|
|
|
{vehicle (_this select 0) == (_this select 1)} ||
|
|
|
|
// Players can always interact with passengers of the same vehicle
|
|
|
|
{!((_this select 0) isEqualTo (_this select 1)) && {vehicle (_this select 0) == vehicle (_this select 1)}}
|
|
|
|
}] call FUNC(addCanInteractWithCondition);
|
2015-04-17 23:44:53 +00:00
|
|
|
|
2015-04-18 02:26:27 +00:00
|
|
|
// Lastly, do JIP events
|
2015-04-18 01:23:26 +00:00
|
|
|
// JIP Detection and event trigger. Run this at the very end, just in case anything uses it
|
2015-05-21 16:42:44 +00:00
|
|
|
if(isMultiplayer && { ACE_time > 0 || isNull player } ) then {
|
2015-04-18 01:23:26 +00:00
|
|
|
// We are jipping! Get ready and wait, and throw the event
|
|
|
|
[{
|
2015-04-30 18:49:38 +00:00
|
|
|
if(!(isNull player)) then {
|
2015-04-18 01:23:26 +00:00
|
|
|
["PlayerJip", [player] ] call FUNC(localEvent);
|
2015-04-18 02:26:27 +00:00
|
|
|
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
2015-04-30 18:49:38 +00:00
|
|
|
};
|
2015-08-04 07:34:31 +00:00
|
|
|
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
2015-04-18 01:23:26 +00:00
|
|
|
};
|
2015-05-10 19:59:53 +00:00
|
|
|
|
|
|
|
//Device Handler:
|
|
|
|
GVAR(deviceKeyHandlingArray) = [];
|
|
|
|
GVAR(deviceKeyCurrentIndex) = -1;
|
|
|
|
|
2015-08-07 01:33:38 +00:00
|
|
|
// Register localizations for the Keybinding categories
|
|
|
|
["ACE3 Equipment", localize LSTRING(ACEKeybindCategoryEquipment)] call cba_fnc_registerKeybindModPrettyName;
|
|
|
|
["ACE3 Common", localize LSTRING(ACEKeybindCategoryCommon)] call cba_fnc_registerKeybindModPrettyName;
|
|
|
|
["ACE3 Weapons", localize LSTRING(ACEKeybindCategoryWeapons)] call cba_fnc_registerKeybindModPrettyName;
|
|
|
|
["ACE3 Movement", localize LSTRING(ACEKeybindCategoryMovement)] call cba_fnc_registerKeybindModPrettyName;
|
|
|
|
["ACE3 Scope Adjustment", localize LSTRING(ACEKeybindCategoryScopeAdjustment)] call cba_fnc_registerKeybindModPrettyName;
|
|
|
|
["ACE3 Vehicles", localize LSTRING(ACEKeybindCategoryVehicles)] call cba_fnc_registerKeybindModPrettyName;
|
|
|
|
|
2015-05-10 20:17:50 +00:00
|
|
|
["ACE3 Equipment", QGVAR(openDevice), (localize "STR_ACE_Common_toggleHandheldDevice"),
|
2015-05-10 19:59:53 +00:00
|
|
|
{
|
|
|
|
[] call FUNC(deviceKeyFindValidIndex);
|
|
|
|
if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false};
|
|
|
|
[] call ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 3);
|
2015-05-12 03:48:03 +00:00
|
|
|
true
|
2015-05-10 19:59:53 +00:00
|
|
|
},
|
|
|
|
{false},
|
|
|
|
[0xC7, [false, false, false]], false] call cba_fnc_addKeybind; //Home Key
|
|
|
|
|
2015-05-10 20:17:50 +00:00
|
|
|
["ACE3 Equipment", QGVAR(closeDevice), (localize "STR_ACE_Common_closeHandheldDevice"),
|
2015-05-10 19:59:53 +00:00
|
|
|
{
|
|
|
|
[] call FUNC(deviceKeyFindValidIndex);
|
|
|
|
if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false};
|
|
|
|
[] call ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 4);
|
2015-05-12 03:48:03 +00:00
|
|
|
true
|
2015-05-10 19:59:53 +00:00
|
|
|
},
|
|
|
|
{false},
|
|
|
|
[0xC7, [false, true, false]], false] call cba_fnc_addKeybind; //CTRL + Home Key
|
|
|
|
|
2015-05-10 20:17:50 +00:00
|
|
|
["ACE3 Equipment", QGVAR(cycleDevice), (localize "STR_ACE_Common_cycleHandheldDevices"),
|
2015-05-10 19:59:53 +00:00
|
|
|
{
|
|
|
|
[1] call FUNC(deviceKeyFindValidIndex);
|
|
|
|
if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false};
|
|
|
|
_displayName = ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 0);
|
|
|
|
_iconImage = ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 1);
|
|
|
|
[_displayName, _iconImage] call FUNC(displayTextPicture);
|
2015-05-12 03:48:03 +00:00
|
|
|
true
|
2015-05-10 19:59:53 +00:00
|
|
|
},
|
|
|
|
{false},
|
|
|
|
[0xC7, [true, false, false]], false] call cba_fnc_addKeybind; //SHIFT + Home Key
|
2015-06-05 22:50:04 +00:00
|
|
|
|
2015-06-13 17:30:35 +00:00
|
|
|
|
2015-05-14 23:45:53 +00:00
|
|
|
GVAR(commonPostInited) = true;
|