Merge branch 'master' of https://github.com/acemod/ACE3 into use-proper-undefs

This commit is contained in:
ViperMaul 2016-06-14 08:27:47 -07:00
commit 99d08d988a
923 changed files with 83883 additions and 82053 deletions

View File

@ -1,7 +1,7 @@
root = true
[*]
end_of_line = crlf
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space

4
.gitattributes vendored Normal file
View File

@ -0,0 +1,4 @@
* text=auto
*.png binary
*.jpg binary
*.paa binary

17
.gitignore vendored
View File

@ -1,8 +1,9 @@
release/*
*.cache
*.pbo
texHeaders.bin
*.swp
*.swo
*.biprivatekey
Thumbs.db
release/*
tools/temp
*.cache
*.pbo
texHeaders.bin
*.swp
*.swo
*.biprivatekey
Thumbs.db

View File

@ -88,6 +88,7 @@ Kllrt <kllrtik@gmail.com>
legman <juicemelon@msn.com>
Legolasindar "Viper" <legolasindar@gmail.com>
licht-im-Norden87 <lichtimnorden87@gmail.com>
looter <looter222@gmail.com>
Macusercom <macusercom@gmail.com>
MarcBook
meat <p.humberdroz@gmail.com>

View File

@ -24,7 +24,7 @@ if (!GVAR(extensionAvailable)) exitWith {
if (!hasInterface) exitWith {};
["SettingsInitialized", {
["ace_settingsInitialized", {
//If not enabled, dont't add PFEH
if (!GVAR(enabled)) exitWith {};
@ -32,8 +32,8 @@ if (!hasInterface) exitWith {};
[] call FUNC(initializeTerrainExtension);
// Register fire event handler
["firedPlayer", DFUNC(handleFired)] call EFUNC(common,addEventHandler);
["firedPlayerNonLocal", DFUNC(handleFired)] call EFUNC(common,addEventHandler);
["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
["ace_firedPlayerNonLocal", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
//Add warnings for missing compat PBOs (only if AB is on)
{
@ -50,7 +50,7 @@ if (!hasInterface) exitWith {};
["iansky_opt","ace_compat_sma3_iansky"],
["R3F_Armes","ace_compat_r3f"]
];
}] call EFUNC(common,addEventHandler);
}] call CBA_fnc_addEventHandler;
#ifdef DEBUG_MODE_FULL
call FUNC(diagnoseWeapons);

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -6,8 +6,8 @@ class CfgPatches {
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_main"};
author = "Bohemia Interactive";
url = ECSTRING(main,URL);
author = "Bohemia Interactive";
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};

View File

@ -49,4 +49,4 @@ if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) ==
[] call FUNC(init);
[] call FUNC(restore_user_data);
["RangerfinderData", {_this call FUNC(sord)}] call EFUNC(common,addEventHandler);
[QEGVAR(vector,rangefinderData), {_this call FUNC(sord)}] call CBA_fnc_addEventHandler;

View File

@ -17,3 +17,7 @@ class CfgPatches {
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "RscTitles.hpp"
class ACE_newEvents {
RangerfinderData = QEGVAR(vector,rangefinderData);
};

View File

@ -1,5 +1,5 @@
#include "script_component.hpp"
uiNamespace setVariable ['ATragMX_Display', nil];
GVAR(active) = false;
#include "script_component.hpp"
uiNamespace setVariable ['ATragMX_Display', nil];
GVAR(active) = false;
[GVAR(DialogPFH)] call CBA_fnc_removePerFrameHandler;

View File

@ -3,4 +3,4 @@
if (!hasInterface) exitWith {};
//If attach placing, stop when opening menu:
["interactMenuOpened", {GVAR(placeAction) = 0;}] call EFUNC(common,addEventHandler);
["ace_interactMenuOpened", {GVAR(placeAction) = 0;}] call CBA_fnc_addEventHandler;

View File

@ -18,3 +18,7 @@ class CfgPatches {
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "GUI_VirtualAmmo.hpp"
class ACE_newEvents {
interactMenuOpened = "ace_interactMenuOpened";
};

View File

@ -1,3 +1,3 @@
#include "script_component.hpp"
["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler);
["ace_backpackOpened", {_this call FUNC(backpackOpened)}] call CBA_fnc_addEventHandler;

View File

@ -14,3 +14,7 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
class ACE_newEvents {
backpackOpened = "ace_backpackOpened";
};

View File

@ -24,7 +24,7 @@ private _target = objectParent _backpack;
if (isNull _target) exitWith {false};
// raise event on target unit
["backpackOpened", _target, [_target, _backpack]] call EFUNC(common,targetEvent);
["ace_backpackOpened", [_target, _backpack], _target] call CBA_fnc_targetEvent;
// return false to open inventory as usual
false

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
#include "script_component.hpp"
["SettingsInitialized", {
["ace_settingsInitialized", {
// Hold on a little bit longer to ensure anims will work
[{
GVAR(captivityEnabled) = true;
}, [], 0.05] call CBA_fnc_waitAndExecute;
}] call EFUNC(common,addEventHandler);
}] call CBA_fnc_addEventHandler;
//Handles when someone starts escorting and then disconnects, leaving the captive attached
//This is normaly handled by the PFEH in doEscortCaptive, but that won't be running if they DC
@ -24,15 +24,15 @@ if (isServer) then {
}];
};
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler);
["MoveOutCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler);
["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler;
[QGVAR(moveInCaptive), {_this call FUNC(vehicleCaptiveMoveIn)}] call CBA_fnc_addEventHandler;
[QGVAR(moveOutCaptive), {_this call FUNC(vehicleCaptiveMoveOut)}] call CBA_fnc_addEventHandler;
["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler);
[QGVAR(setHandcuffed), {_this call FUNC(setHandcuffed)}] call CBA_fnc_addEventHandler;
[QGVAR(setSurrendered), {_this call FUNC(setSurrendered)}] call CBA_fnc_addEventHandler;
//Medical Integration Events
["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler);
["ace_unconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call CBA_fnc_addEventHandler;
if (!hasInterface) exitWith {};

View File

@ -18,4 +18,12 @@ class CfgPatches {
#include "CfgMoves.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "CfgEden.hpp"
#include "CfgEden.hpp"
class ACE_newEvents {
SetSurrendered = QGVAR(setSurrendered);
SetHandcuffed = QGVAR(setHandcuffed);
MoveOutCaptive = QGVAR(moveOutCaptive);
MoveInCaptive = QGVAR(moveInCaptive);
CaptiveStatusChanged = "ace_captiveStatusChanged";
};

View File

@ -21,6 +21,6 @@ params ["_unit", "_target"];
playSound3D [QUOTE(PATHTO_R(sounds\cable_tie_zipping.ogg)), objNull, false, (getPosASL _target), 1, 1, 10];
["SetHandcuffed", [_target], [_target, true]] call EFUNC(common,targetEvent);
[QGVAR(setHandcuffed), [_target, true], [_target]] call CBA_fnc_targetEvent;
_unit removeItem "ACE_CableTie";

View File

@ -47,4 +47,4 @@ if (isNull _vehicle) then {
if (isNull _vehicle) exitWith {ERROR("");};
_unit setVariable [QGVAR(isEscorting), false, true];
["MoveInCaptive", [_target], [_target, _vehicle]] call EFUNC(common,targetEvent);
[QGVAR(moveInCaptive), [_target, _vehicle], [_target]] call CBA_fnc_targetEvent;

View File

@ -17,4 +17,4 @@
params ["_unit", "_target"];
["SetHandcuffed", [_target], [_target, false]] call EFUNC(common,targetEvent);
[QGVAR(setHandcuffed), [_target, false], [_target]] call CBA_fnc_targetEvent;

View File

@ -18,4 +18,4 @@
params ["_unit", "_target"];
["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent);
[QGVAR(moveOutCaptive), [_target], [_target]] call CBA_fnc_targetEvent;

View File

@ -1,6 +1,6 @@
/*
* Author: commy2, PabstMirror
* Handles the "medical_onUnconscious" event
* Handles the "ace_unconscious" event
*
* Arguments:
* 0: Unit <OBJECT>

View File

@ -30,7 +30,7 @@ if (!isServer) exitWith {};
params ["_units"];
{
TRACE_2("event",_x,local _x);
["SetHandcuffed", [_x], [_x, true]] call EFUNC(common,targetEvent);
[QGVAR(setHandcuffed), [_x, true], [_x]] call CBA_fnc_targetEvent;
} forEach _units;
}, [_units], 0.05] call CBA_fnc_waitAndExecute;

View File

@ -30,7 +30,7 @@ if (!isServer) exitWith {};
params ["_units"];
{
TRACE_2("event",_x,local _x);
["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent);
[QGVAR(setSurrendered), [_x, true], [_x]] call CBA_fnc_targetEvent;
} forEach _units;
}, [_units], 0.05] call CBA_fnc_waitAndExecute;

View File

@ -124,4 +124,4 @@ if (_state) then {
};
//Global Event after changes:
["CaptiveStatusChanged", [_unit, _state, "SetHandcuffed"]] call EFUNC(common,globalEvent);
["ace_captiveStatusChanged", [_unit, _state, "SetHandcuffed"]] call CBA_fnc_globalEvent;

View File

@ -117,4 +117,4 @@ if (_state) then {
};
//Global Event after changes:
["CaptiveStatusChanged", [_unit, _state, "SetSurrendered"]] call EFUNC(common,globalEvent);
["ace_captiveStatusChanged", [_unit, _state, "SetSurrendered"]] call CBA_fnc_globalEvent;

View File

@ -1,8 +1,8 @@
#include "script_component.hpp"
["AddCargoByClass", {_this call FUNC(addCargoItem)}] call EFUNC(common,addEventHandler);
["ace_addCargoByClass", {_this call FUNC(addCargoItem)}] call CBA_fnc_addEventHandler;
["LoadCargo", {
["ace_loadCargo", {
params ["_item", "_vehicle"];
TRACE_2("LoadCargo EH",_item,_vehicle);
@ -13,15 +13,15 @@
private _itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
private _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
[[_hint, _itemName, _vehicleName], 3.0] call EFUNC(common,displayTextStructured);
if (_loaded) then {
// Invoke listenable event
["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
["ace_cargoLoaded", [_item, _vehicle]] call CBA_fnc_globalEvent;
};
}] call EFUNC(common,addEventHandler);
}] call CBA_fnc_addEventHandler;
["UnloadCargo", {
["ace_unloadCargo", {
params ["_item", "_vehicle", ["_unloader", objNull]];
TRACE_3("UnloadCargo EH",_item,_vehicle,_unloader);
@ -34,19 +34,19 @@
private _itemName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
private _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
[[_hint, _itemName, _vehicleName], 3.0] call EFUNC(common,displayTextStructured);
if (_unloaded) then {
// Invoke listenable event
["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent);
["ace_cargoUnloaded", [_item, _vehicle]] call CBA_fnc_globalEvent;
};
// TOOO maybe drag/carry the unloaded item?
}] call EFUNC(common,addEventHandler);
}] call CBA_fnc_addEventHandler;
["ServerUnloadCargo", {
[QGVAR(serverUnload), {
params ["_item", "_emptyPosAGL"];
_item hideObjectGlobal false;
_item setPosASL (AGLtoASL _emptyPosAGL);
}] call EFUNC(common,addEventHandler);
}] call CBA_fnc_addEventHandler;

View File

@ -17,3 +17,13 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "menu.hpp"
class ACE_newEvents {
LoadCargo = "ace_loadCargo";
cargoUnloaded = "ace_cargoUnloaded";
cargoLoaded = "ace_cargoLoaded";
AddCargoByClass = "ace_addCargoByClass";
ServerUnloadCargo = QGVAR(serverUnload);
UnloadCargo = "ace_unloadCargo";
cargoAddedByClass = "ace_cargoAddedByClass";
};

View File

@ -26,4 +26,4 @@ for "_i" from 1 to _amount do {
};
// Invoke listenable event
["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent);
["ace_cargoAddedByClass", [_itemClass, _vehicle, _amount]] call CBA_fnc_globalEvent;

View File

@ -29,7 +29,7 @@ if (isServer) then {
_cargoClassname = getText (_x >> "type");
_cargoCount = getNumber (_x >> "amount");
TRACE_3("adding ACE_Cargo", (configName _x), _cargoClassname, _cargoCount);
["AddCargoByClass", [_cargoClassname, _vehicle, _cargoCount]] call EFUNC(common,localEvent);
["ace_addCargoByClass", [_cargoClassname, _vehicle, _cargoCount]] call CBA_fnc_localEvent;
};
} count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo"));
};

View File

@ -35,7 +35,7 @@ _vehicle setVariable [QGVAR(space), _space - _itemSize, true];
if (_item isEqualType objNull) then {
detach _item;
_item attachTo [_vehicle,[0,0,-100]];
["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent);
[QEGVAR(common,hideObjectGlobal), [_item, true]] call CBA_fnc_serverEvent;
};
true

View File

@ -40,7 +40,7 @@ if ([_object, _vehicle] call FUNC(canLoadItemIn)) then {
[
5 * _size,
[_object,_vehicle],
{["LoadCargo", _this select 0] call EFUNC(common,localEvent)},
{["ace_loadCargo", _this select 0] call CBA_fnc_localEvent},
{},
localize LSTRING(LoadingItem)
] call EFUNC(common,progressBar);
@ -48,7 +48,7 @@ if ([_object, _vehicle] call FUNC(canLoadItemIn)) then {
} else {
private _displayName = getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName");
["displayTextStructured", [[LSTRING(LoadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent);
[[LSTRING(LoadingFailed), _displayName], 3.0] call EFUNC(common,displayTextStructured);
};
_return

View File

@ -37,7 +37,7 @@ if ([_item, GVAR(interactionVehicle), ACE_player] call FUNC(canUnloadItem)) then
[
5 * _size,
[_item, GVAR(interactionVehicle), ACE_player],
{["UnloadCargo", _this select 0] call EFUNC(common,localEvent)},
{["ace_unloadCargo", _this select 0] call CBA_fnc_localEvent},
{},
localize LSTRING(UnloadingItem),
{true},
@ -47,5 +47,5 @@ if ([_item, GVAR(interactionVehicle), ACE_player] call FUNC(canUnloadItem)) then
private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
private _displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
["displayTextStructured", [[LSTRING(UnloadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent);
[[LSTRING(UnloadingFailed), _displayName], 3.0] call EFUNC(common,displayTextStructured);
};

View File

@ -29,7 +29,7 @@ if ((count _emptyPosAGL) != 3) exitWith {
TRACE_4("Could not find unload pos",_vehicle,getPosASL _vehicle,isTouchingGround _vehicle,speed _vehicle);
if ((!isNull _unloader) && {_unloader == ACE_player}) then {
//display text saying there are no safe places to exit the vehicle
["displayTextStructured", [localize ELSTRING(common,NoRoomToUnload)]] call EFUNC(common,localEvent);
[localize ELSTRING(common,NoRoomToUnload)] call EFUNC(common,displayTextStructured);
};
false
};
@ -52,7 +52,7 @@ if (_item isEqualType objNull) then {
detach _item;
// hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly
// do both on server to ensure they are executed in the correct order
["ServerUnloadCargo", [_item, _emptyPosAGL]] call EFUNC(common,serverEvent);
[QGVAR(serverUnload), [_item, _emptyPosAGL]] call CBA_fnc_serverEvent;
} else {
private _newItem = createVehicle [_item, _emptyPosAGL, [], 0, ""];
_newItem setPosASL (AGLtoASL _emptyPosAGL);

View File

@ -1,111 +1,111 @@
class RscInGameUI {
class RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscUnitInfoNoHUD {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscUnitInfoSoldier: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSoldier', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Soldier')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSoldier', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Soldier')])] call CBA_fnc_localEvent;);
};
class RscUnitInfoTank: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgVehicle', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Vehicle')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgVehicle', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Vehicle')])] call CBA_fnc_localEvent;);
};
class RscUnitInfoAirNoWeapon: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call CBA_fnc_localEvent;);
};
class RscUnitInfoAir: RscUnitInfoAirNoWeapon {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call CBA_fnc_localEvent;);
};
class RscUnitInfo_AH64D_gunner {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent););
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call CBA_fnc_localEvent;);
};
class RscUnitInfoUAV {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgUAV', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'UAV')])] call FUNC(localEvent););
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgUAV', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'UAV')])] call CBA_fnc_localEvent;);
};
class RscUnitInfoSubmarine: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSubmarine', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Submarine')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgSubmarine', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Submarine')])] call CBA_fnc_localEvent;);
};
class RscUnitInfoShip: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgShip', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Ship')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgShip', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Ship')])] call CBA_fnc_localEvent;);
};
class RscWeaponEmpty {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscWeaponRangeFinder {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscWeaponRangeArtillery {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgArtillery', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Artillery')])] call FUNC(localEvent););
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgArtillery', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Artillery')])] call CBA_fnc_localEvent;);
};
class RscWeaponRangeArtilleryAuto {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgArtillery', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Artillery')])] call FUNC(localEvent););
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgArtillery', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Artillery')])] call CBA_fnc_localEvent;);
};
class RscWeaponRangeFinderPAS13 {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscOptics_LaserDesignator {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscWeaponRangeFinderMAAWS {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscWeaponRangeFinderAbramsCom {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscWeaponRangeFinderAbramsGun {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscWeaponRangeFinderStrykerMGSGun {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscOptics_strider_commander {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscOptics_titan {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscOptics_punisher {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscOptics_SDV_periscope {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscUnitInfoParachute: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgParachute', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Parachute')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgParachute', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Parachute')])] call CBA_fnc_localEvent;);
};
class RscUnitVehicle {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscOptics_LaserDesignator_02 {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call CBA_fnc_localEvent;);
};
class RscStaminaBar {
@ -113,6 +113,6 @@ class RscInGameUI {
};
class RscStanceInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStanceInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Stance')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStanceInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Stance')])] call CBA_fnc_localEvent;);
};
};

View File

@ -60,6 +60,7 @@ PREP(getFirstTerrainIntersection);
PREP(getForceWalkStatus);
PREP(getGunner);
PREP(getInPosition);
PREP(getMapData);
PREP(getMapGridData);
PREP(getMapGridFromPos);
PREP(getMapPosFromGrid);
@ -236,7 +237,6 @@ PREP(dumpPerformanceCounters);
PREP(dumpArray);
PREP(globalEvent);
PREP(_handleNetEvent);
PREP(addEventHandler);
PREP(objectEvent);
PREP(targetEvent);

View File

@ -18,29 +18,29 @@
//////////////////////////////////////////////////
//Status Effect EHs:
["setStatusEffect", {_this call FUNC(statusEffect_set)}] call FUNC(addEventHandler);
[QGVAR(setStatusEffect), {_this call FUNC(statusEffect_set)}] call CBA_fnc_addEventHandler;
["forceWalk", false, ["ACE_SwitchUnits", "ACE_Attach", "ACE_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_Sandbag", "ACE_refuel", "ACE_rearm", "ACE_dragging"]] call FUNC(statusEffect_addType);
["blockSprint", false, []] call FUNC(statusEffect_addType);
["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), QEGVAR(medical,unconscious)]] call FUNC(statusEffect_addType);
["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType);
["blockDamage", false, ["fixCollision"]] call FUNC(statusEffect_addType);
["blockEngine", false, ["ACE_Refuel"]] call FUNC(statusEffect_addType);
["forceWalk", {
[QGVAR(forceWalk), {
params ["_object", "_set"];
TRACE_2("forceWalk EH",_object,_set);
_object forceWalk (_set > 0);
}] call FUNC(addEventHandler);
["blockSprint", { //Name reversed from `allowSprint` because we want NOR logic
}] call CBA_fnc_addEventHandler;
[QGVAR(blockSprint), { //Name reversed from `allowSprint` because we want NOR logic
params ["_object", "_set"];
TRACE_2("blockSprint EH",_object,_set);
_object allowSprint (_set == 0);
}] call FUNC(addEventHandler);
["setCaptive", {
}] call CBA_fnc_addEventHandler;
[QGVAR(setCaptive), {
params ["_object", "_set"];
TRACE_2("setCaptive EH",_object,_set);
_object setCaptive (_set > 0);
}] call FUNC(addEventHandler);
["blockDamage", { //Name reversed from `allowDamage` because we want NOR logic
}] call CBA_fnc_addEventHandler;
[QGVAR(blockDamage), { //Name reversed from `allowDamage` because we want NOR logic
params ["_object", "_set"];
if ((_object isKindOf "CAManBase") && {(["ace_medical"] call FUNC(isModLoaded))}) then {
TRACE_2("blockDamage EH (using medical)",_object,_set);
@ -49,12 +49,12 @@
TRACE_2("blockDamage EH (using allowDamage)",_object,_set);
_object allowDamage (_set == 0);
};
}] call FUNC(addEventHandler);
["blockEngine", {
}] call CBA_fnc_addEventHandler;
[QGVAR(blockEngine), {
params ["_vehicle", "_set"];
_vehicle setVariable [QGVAR(blockEngine), _set > 0, true];
_vehicle engineOn false;
}] call FUNC(addEventHandler);
}] call CBA_fnc_addEventHandler;
//Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit
//This variable is used for isPlayer checks
@ -75,7 +75,7 @@ if (isServer) then {
};
// Listens for global "SettingChanged" events, to update the force status locally
["SettingChanged", {
["ace_settingChanged", {
params ["_name", "_value", "_force"];
if (_force) then {
@ -85,54 +85,54 @@ if (isServer) then {
_settingData set [6, _force];
};
}] call FUNC(addEventhandler);
}] call CBA_fnc_addEventHandler;
// Event to log Fix Headbug output
["HeadbugFixUsed", {
[QGVAR(headbugFixUsed), {
params ["_profileName", "_animation"];
ACE_LOGINFO_2("Headbug Used: Name: %1, Animation: %2",_profileName,_animation);
}] call FUNC(addEventHandler);
}] call CBA_fnc_addEventHandler;
["fixCollision", FUNC(fixCollision)] call FUNC(addEventhandler);
["fixFloating", FUNC(fixFloating)] call FUNC(addEventhandler);
["fixPosition", FUNC(fixPosition)] call FUNC(addEventhandler);
[QGVAR(fixCollision), FUNC(fixCollision)] call CBA_fnc_addEventHandler;
[QGVAR(fixFloating), FUNC(fixFloating)] call CBA_fnc_addEventHandler;
[QGVAR(fixPosition), FUNC(fixPosition)] call CBA_fnc_addEventHandler;
["loadPersonEvent", FUNC(loadPersonLocal)] call FUNC(addEventhandler);
["unloadPersonEvent", FUNC(unloadPersonLocal)] call FUNC(addEventhandler);
["ace_loadPersonEvent", FUNC(loadPersonLocal)] call CBA_fnc_addEventHandler;
["ace_unloadPersonEvent", FUNC(unloadPersonLocal)] call CBA_fnc_addEventHandler;
["lockVehicle", {
[QGVAR(lockVehicle), {
_this setVariable [QGVAR(lockStatus), locked _this];
_this lock 2;
}] call FUNC(addEventhandler);
}] call CBA_fnc_addEventHandler;
["unlockVehicle", {
[QGVAR(unlockVehicle), {
_this lock (_this getVariable [QGVAR(lockStatus), locked _this]);
}] call FUNC(addEventhandler);
}] call CBA_fnc_addEventHandler;
["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler);
["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler);
["engineOn", {(_this select 0) engineOn (_this select 1)}] call FUNC(addEventhandler);
["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler);
["selectLeader", {(_this select 0) selectLeader (_this select 1)}] call FUNC(addEventHandler);
["setVelocity", {(_this select 0) setVelocity (_this select 1)}] call FUNC(addEventHandler);
["playMove", {(_this select 0) playMove (_this select 1)}] call FUNC(addEventHandler);
["playMoveNow", {(_this select 0) playMoveNow (_this select 1)}] call FUNC(addEventHandler);
["switchMove", {(_this select 0) switchMove (_this select 1)}] call FUNC(addEventHandler);
["setVectorDirAndUp", {(_this select 0) setVectorDirAndUp (_this select 1)}] call FUNC(addEventHandler);
["setVanillaHitPointDamage", {(_this select 0) setHitPointDamage (_this select 1)}] call FUNC(addEventHandler);
[QGVAR(setDir), {(_this select 0) setDir (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(setFuel), {(_this select 0) setFuel (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(engineOn), {(_this select 0) engineOn (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(setSpeaker), {(_this select 0) setSpeaker (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(selectLeader), {(_this select 0) selectLeader (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(setVelocity), {(_this select 0) setVelocity (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(playMove), {(_this select 0) playMove (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(playMoveNow), {(_this select 0) playMoveNow (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(switchMove), {(_this select 0) switchMove (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(setVectorDirAndUp), {(_this select 0) setVectorDirAndUp (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(setVanillaHitPointDamage), {(_this select 0) setHitPointDamage (_this select 1)}] call CBA_fnc_addEventHandler;
// Request framework
[QGVAR(requestCallback), FUNC(requestCallback)] call FUNC(addEventHandler);
[QGVAR(receiveRequest), FUNC(receiveRequest)] call FUNC(addEventHandler);
[QGVAR(requestCallback), FUNC(requestCallback)] call CBA_fnc_addEventHandler;
[QGVAR(receiveRequest), FUNC(receiveRequest)] call CBA_fnc_addEventHandler;
[QGVAR(systemChatGlobal), {systemChat _this}] call FUNC(addEventHandler);
[QGVAR(systemChatGlobal), {systemChat _this}] call CBA_fnc_addEventHandler;
if (isServer) then {
["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler);
["enableSimulationGlobal", {(_this select 0) enableSimulationGlobal (_this select 1)}] call FUNC(addEventHandler);
["setOwner", {(_this select 0) setOwner (_this select 1)}] call FUNC(addEventHandler);
[QGVAR(serverLog), FUNC(serverLog)] call FUNC(addEventHandler);
[QGVAR(hideObjectGlobal), {(_this select 0) hideObjectGlobal (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(enableSimulationGlobal), {(_this select 0) enableSimulationGlobal (_this select 1)}] call CBA_fnc_addEventHandler;
["ace_setOwner", {(_this select 0) setOwner (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(serverLog), FUNC(serverLog)] call CBA_fnc_addEventHandler;
};
@ -140,23 +140,19 @@ if (isServer) then {
// Set up remote execution
//////////////////////////////////////////////////
// ACE events
"ACEg" addPublicVariableEventHandler {_this call FUNC(_handleNetEvent)};
"ACEc" addPublicVariableEventHandler {_this call FUNC(_handleNetEvent)};
// Synced ACE events
// Handle JIP scenario
if (!isServer) then {
["PlayerJip", {
["ace_playerJIP", {
ACE_LOGINFO("JIP event synchronization initialized");
["SEH_all", [player]] call FUNC(serverEvent);
}] call FUNC(addEventHandler);
["ACEa", [player]] call CBA_fnc_serverEvent;
}] call CBA_fnc_addEventHandler;
} else {
["SEH_all", FUNC(_handleRequestAllSyncedEvents)] call FUNC(addEventHandler);
["ACEa", FUNC(_handleRequestAllSyncedEvents)] call CBA_fnc_addEventHandler;
};
["SEH", FUNC(_handleSyncedEvent)] call FUNC(addEventHandler);
["SEH_s", FUNC(_handleRequestSyncedEvent)] call FUNC(addEventHandler);
["ACEe", FUNC(_handleSyncedEvent)] call CBA_fnc_addEventHandler;
["ACEs", FUNC(_handleRequestSyncedEvent)] call CBA_fnc_addEventHandler;
if (isServer) then {
[FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler;
@ -189,16 +185,16 @@ call FUNC(checkFiles);
//////////////////////////////////////////////////
// Set up SettingsInitialized eventhandler
// Set up ace_settingsInitialized eventhandler
//////////////////////////////////////////////////
["SettingsInitialized", {
["ace_settingsInitialized", {
[
GVAR(checkPBOsAction),
GVAR(checkPBOsCheckAll),
GVAR(checkPBOsWhitelist)
] call FUNC(checkPBOs)
}] call FUNC(addEventHandler);
}] call CBA_fnc_addEventHandler;
// Create a pfh to wait until all postinits are ready and settings are initialized
[{
@ -225,7 +221,7 @@ call FUNC(checkFiles);
[] call FUNC(readSettingsFromParamsArray);
};
// Event so that ACE_Modules have their settings loaded:
["InitSettingsFromModules", []] call FUNC(localEvent);
[QGVAR(initSettingsFromModules), []] call CBA_fnc_localEvent;
if (isServer) then {
// Publish all settings data after all configs and modules are read
@ -241,7 +237,7 @@ call FUNC(checkFiles);
ACE_LOGINFO("Settings initialized.");
//Event that settings are safe to use:
["SettingsInitialized", []] call FUNC(localEvent);
["ace_settingsInitialized", []] call CBA_fnc_localEvent;
//Set init finished and run all delayed functions:
GVAR(settingsInitFinished) = true;
@ -274,12 +270,21 @@ call FUNC(assignedItemFix);
enableCamShake true;
//FUNC(showHud) needs to be refreshed if it was set during mission init
["ace_infoDisplayChanged", {
GVAR(showHudHash) params ["", "_masks"];
if (!(_masks isEqualTo [])) then {
[] call FUNC(showHud);
};
}] call CBA_fnc_addEventHandler;
//////////////////////////////////////////////////
// Eventhandler to set player names
//////////////////////////////////////////////////
// Set the name for the current player
["playerChanged", {
["ace_playerChanged", {
params ["_newPlayer","_oldPlayer"];
if (alive _newPlayer) then {
@ -289,7 +294,7 @@ enableCamShake true;
if (alive _oldPlayer) then {
[_oldPlayer] call FUNC(setName);
};
}] call FUNC(addEventhandler);
}] call CBA_fnc_addEventHandler;
//////////////////////////////////////////////////
@ -321,7 +326,7 @@ GVAR(OldIsCamera) = false;
uiNamespace setVariable ["ACE_player", _data];
// Raise ACE event locally
["playerChanged", [ACE_player, _oldPlayer]] call FUNC(localEvent);
["ace_playerChanged", [ACE_player, _oldPlayer]] call CBA_fnc_localEvent;
};
// "playerVehicleChanged" event
@ -329,7 +334,7 @@ GVAR(OldIsCamera) = false;
if !(_data isEqualTo GVAR(OldPlayerVehicle)) then {
// Raise ACE event locally
GVAR(OldPlayerVehicle) = _data;
["playerVehicleChanged", [ACE_player, _data]] call FUNC(localEvent);
["ace_playerVehicleChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
};
// "playerTurretChanged" event
@ -337,7 +342,7 @@ GVAR(OldIsCamera) = false;
if !(_data isEqualTo GVAR(OldPlayerTurret)) then {
// Raise ACE event locally
GVAR(OldPlayerTurret) = _data;
["playerTurretChanged", [ACE_player, _data]] call FUNC(localEvent);
["ace_playerTurretChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
};
// "playerWeaponChanged" event
@ -345,7 +350,7 @@ GVAR(OldIsCamera) = false;
if (_data != GVAR(OldPlayerWeapon)) then {
// Raise ACE event locally
GVAR(OldPlayerWeapon) = _data;
["playerWeaponChanged", [ACE_player, _data]] call FUNC(localEvent);
["ace_playerWeaponChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
};
// "playerInventoryChanged" event
@ -377,7 +382,7 @@ GVAR(OldIsCamera) = false;
if !(_data isEqualTo GVAR(OldPlayerInventoryNoAmmo)) then {
GVAR(OldPlayerInventoryNoAmmo) = _data;
["playerInventoryChanged", [ACE_player, [ACE_player, false] call FUNC(getAllGear)]] call FUNC(localEvent);
["ace_playerInventoryChanged", [ACE_player, [ACE_player, false] call FUNC(getAllGear)]] call CBA_fnc_localEvent;
};
};
@ -386,7 +391,7 @@ GVAR(OldIsCamera) = false;
if !(_data isEqualTo GVAR(OldPlayerVisionMode)) then {
// Raise ACE event locally
GVAR(OldPlayerVisionMode) = _data;
["playerVisionModeChanged", [ACE_player, _data]] call FUNC(localEvent);
["ace_playerVisionModeChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
};
// "cameraViewChanged" event
@ -394,7 +399,7 @@ GVAR(OldIsCamera) = false;
if !(_data isEqualTo GVAR(OldCameraView)) then {
// Raise ACE event locally
GVAR(OldCameraView) = _data;
["cameraViewChanged", [ACE_player, _data]] call FUNC(localEvent);
["ace_cameraViewChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
};
// "visibleMapChanged" event
@ -402,7 +407,7 @@ GVAR(OldIsCamera) = false;
if (!_data isEqualTo GVAR(OldVisibleMap)) then {
// Raise ACE event locally
GVAR(OldVisibleMap) = _data;
["visibleMapChanged", [ACE_player, _data]] call FUNC(localEvent);
["ace_visibleMapChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
};
// "activeCameraChanged" event
@ -410,7 +415,7 @@ GVAR(OldIsCamera) = false;
if !(_data isEqualTo GVAR(OldIsCamera)) then {
// Raise ACE event locally
GVAR(OldIsCamera) = _data;
["activeCameraChanged", [ACE_player, _data]] call FUNC(localEvent);
["ace_activeCameraChanged", [ACE_player, _data]] call CBA_fnc_localEvent;
};
END_COUNTER(stateChecker);
@ -421,18 +426,18 @@ GVAR(OldIsCamera) = false;
// Eventhandlers for player controlled machines
//////////////////////////////////////////////////
["displayTextStructured", {_this call FUNC(displayTextStructured)}] call FUNC(addEventhandler);
["displayTextPicture", {_this call FUNC(displayTextPicture)}] call FUNC(addEventhandler);
[QGVAR(displayTextStructured), {_this call FUNC(displayTextStructured)}] call CBA_fnc_addEventHandler;
[QGVAR(displayTextPicture), {_this call FUNC(displayTextPicture)}] call CBA_fnc_addEventHandler;
["medical_onUnconscious", {
["ace_unconscious", {
params ["_unit", "_isUnconscious"];
if (local _unit && {!_isUnconscious}) then {
[_unit, false, QFUNC(loadPerson), west /* dummy side */] call FUNC(switchToGroupSide);
};
}] call FUNC(addEventhandler);
}] call CBA_fnc_addEventHandler;
["useItem", DFUNC(useItem)] call FUNC(addEventHandler);
["ace_useItem", DFUNC(useItem)] call CBA_fnc_addEventHandler;
//////////////////////////////////////////////////
@ -470,7 +475,7 @@ if (didJip) then {
// We are jipping! Get ready and wait, and throw the event
[{
if(!isNull player && GVAR(settingsInitFinished)) then {
["PlayerJip", [player]] call FUNC(localEvent);
["ace_playerJIP", [player]] call CBA_fnc_localEvent;
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
}, 0, []] call CBA_fnc_addPerFrameHandler;

View File

@ -5,10 +5,6 @@ ADDON = false;
#include "XEH_PREP.hpp"
//ACE events global variables
GVAR(eventsLocation) = createLocation ["ACE_HashLocation", [-10000,-10000,-10000], 0, 0];
GVAR(eventsLocation) setText QGVAR(eventsLocation);
// backwards comp
DFUNC(canUseWeapon) = {
ACE_DEPRECATED("ace_common_fnc_canUseWeapon","3.7.0","CBA_fnc_canUseWeapon");

View File

@ -13,6 +13,70 @@ class CfgPatches {
};
};
// This class will be deprecated in version 3.8.0
class ACE_newEvents {
// Status effect events
forceWalk = QGVAR(forceWalk);
blockSprint = QGVAR(blockSprint);
setCaptive = QGVAR(setCaptive);
blockDamage = QGVAR(blockDamage);
blockEngine = QGVAR(blockEngine);
// Public listenable events
PlayerJip = "ace_playerJIP";
activeCameraChanged = "ace_activeCameraChanged";
visibleMapChanged = "ace_visibleMapChanged";
cameraViewChanged = "ace_cameraViewChanged";
playerVisionModeChanged = "ace_playerVisionModeChanged";
playerInventoryChanged = "ace_playerInventoryChanged";
playerWeaponChanged = "ace_playerWeaponChanged";
playerTurretChanged = "ace_playerTurretChanged";
playerVehicleChanged = "ace_playerVehicleChanged";
playerChanged = "ace_playerChanged";
SettingsInitialized = "ace_settingsInitialized";
SettingChanged = "ace_settingChanged";
firedNonPlayerVehicle = "ace_firedNonPlayerVehicle";
firedPlayerVehicleNonLocal = "ace_firedPlayerVehicleNonLocal";
firedPlayerVehicle = "ace_firedPlayerVehicle";
firedNonPlayer = "ace_firedNonPlayer";
firedPlayerNonLocal = "ace_firedPlayerNonLocal";
firedPlayer = "ace_firedPlayer";
unloadPersonEvent = "ace_unloadPersonEvent";
loadPersonEvent = "ace_loadPersonEvent";
useItem = "ace_useItem";
infoDisplayChanged = "ace_infoDisplayChanged";
// Internal callable events
setStatusEffect = QGVAR(setStatusEffect);
HeadbugFixUsed = QGVAR(headbugFixUsed);
InitSettingsFromModules = QGVAR(initSettingsFromModules);
enableSimulationGlobal = QGVAR(enableSimulationGlobal);
hideObjectGlobal = QGVAR(hideObjectGlobal);
fixPosition = QGVAR(fixPosition);
fixFloating = QGVAR(fixFloating);
fixCollision = QGVAR(fixCollision);
unlockVehicle = QGVAR(unlockVehicle);
lockVehicle = QGVAR(lockVehicle);
displayTextPicture = QGVAR(displayTextPicture);
displayTextStructured = QGVAR(displayTextStructured);
setVanillaHitPointDamage = QGVAR(setVanillaHitPointDamage);
setVectorDirAndUp = QGVAR(setVectorDirAndUp);
switchMove = QGVAR(switchMove);
playMoveNow = QGVAR(playMoveNow);
playMove = QGVAR(playMove);
setVelocity = QGVAR(setVelocity);
selectLeader = QGVAR(selectLeader);
setSpeaker = QGVAR(setSpeaker);
engineOn = QGVAR(engineOn);
setFuel = QGVAR(setFuel);
setDir = QGVAR(setDir);
// Events framework
SEH_s = "ACEs";
SEH = "ACEe";
SEH_all = "ACEa";
};
#include "CfgEventHandlers.hpp"
#include "CfgLocationTypes.hpp"

View File

@ -1,81 +0,0 @@
/*
* Author: jaynus
* Internal net event handler.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_eventType", "_event"];
if (_eventType == "ACEg") then {
_event params ["_eventName", "_eventArgs"];
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
if (!isNil "_eventFunctions") then {
#ifdef DEBUG_EVENTS
ACE_LOGINFO_1("* Net Event %1",_eventName);
ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif
{
if (!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, FORMAT_2("Net Event %1 ID: %2",_eventName,_forEachIndex));
#ifdef DEBUG_EVENTS_CALLSTACK
ACE_LOGINFO_1(" ID: %1",_forEachIndex);
#endif
};
} forEach _eventFunctions;
};
};
if (_eventType == "ACEc") then {
if (isServer) then {
_event params ["_eventName", "_eventTargets", "_eventArgs"];
private _sentEvents = [];
if (!IS_ARRAY(_eventTargets)) then {
_eventTargets = [_eventTargets];
};
//If not multiplayer, and there are targets, then just run localy
if (!isMultiplayer && {count _eventTargets > 0}) exitWith {
ACEg = [_eventName, _eventArgs];
["ACEg", ACEg] call FUNC(_handleNetEvent);
};
private _serverFlagged = false;
{
private _owner = _x;
if (IS_OBJECT(_x)) then {
_owner = owner _x;
};
if !(_owner in _sentEvents) then {
_sentEvents pushBack _owner;
ACEg = [_eventName, _eventArgs];
if (isDedicated || {_x != ACE_player}) then {
if (isDedicated && {local _x} && {!_serverFlagged}) then {
_serverFlagged = true;
["ACEg", ACEg] call FUNC(_handleNetEvent);
} else {
_owner publicVariableClient "ACEg";
};
} else {
["ACEg", ACEg] call FUNC(_handleNetEvent);
};
};
false
} count _eventTargets;
};
};

View File

@ -1,25 +1,25 @@
/*
* Author: jaynus
* Handles a server-side request for synchronization ALL events on JIP to a client.
*
* Arguments:
* 0: client <OBJECT>
*
* Return Value:
* Event is successed <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_client"];
{
private _eventEntry = HASH_GET(GVAR(syncedEvents),_x);
_eventEntry params ["", "_eventLog"];
["SEH_s", _client, [_x, _eventLog]] call FUNC(targetEvent);
false
} count (GVAR(syncedEvents) select 0);
true
/*
* Author: jaynus
* Handles a server-side request for synchronization ALL events on JIP to a client.
*
* Arguments:
* 0: client <OBJECT>
*
* Return Value:
* Event is successed <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_client"];
{
private _eventEntry = HASH_GET(GVAR(syncedEvents),_x);
_eventEntry params ["", "_eventLog"];
["ACEs", [_x, _eventLog], _client] call CBA_fnc_targetEvent;
false
} count (GVAR(syncedEvents) select 0);
true

View File

@ -1,48 +1,48 @@
/*
* Author: jaynus
* Receives either requests for synchronization from clients, or the synchronization data from the server.
*
* Arguments [Client] :
* 0: eventName <STRING>
* 1: eventLog <ARRAY>
*
* Arguments [Server] :
* 0: eventName <STRING>
* 1: client <OBJECT>
*
* Return Value:
* Event is successed <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
//SEH_s
if (isServer) then {
// Find the event name, and shovel out the events to the client
params ["_eventName", "_client"];
if (!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith {
ACE_LOGERROR_1("Request for synced event - key [%1] not found.", _eventName);
false
};
private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName);
_eventEntry params ["", "_eventLog"];
["SEH_s", _client, [_eventName, _eventLog]] call FUNC(targetEvent);
} else {
params ["_eventName", "_eventLog"];
// This is the client handling the response from the server
// Start running the events
{
_x params ["", "_eventArgs","_ttl"];
[_eventName, _eventArgs, _ttl] call FUNC(_handleSyncedEvent);
false
} count _eventLog;
ACE_LOGINFO_1("[%1] synchronized",_eventName);
};
true
/*
* Author: jaynus
* Receives either requests for synchronization from clients, or the synchronization data from the server.
*
* Arguments [Client] :
* 0: eventName <STRING>
* 1: eventLog <ARRAY>
*
* Arguments [Server] :
* 0: eventName <STRING>
* 1: client <OBJECT>
*
* Return Value:
* Event is successed <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
//SEH_s
if (isServer) then {
// Find the event name, and shovel out the events to the client
params ["_eventName", "_client"];
if (!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith {
ACE_LOGERROR_1("Request for synced event - key [%1] not found.", _eventName);
false
};
private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName);
_eventEntry params ["", "_eventLog"];
["ACEs", [_eventName, _eventLog], _client] call CBA_fnc_targetEvent;
} else {
params ["_eventName", "_eventLog"];
// This is the client handling the response from the server
// Start running the events
{
_x params ["", "_eventArgs","_ttl"];
[_eventName, _eventArgs, _ttl] call FUNC(_handleSyncedEvent);
false
} count _eventLog;
ACE_LOGINFO_1("[%1] synchronized",_eventName);
};
true

View File

@ -1,37 +1,37 @@
/*
* Author: jaynus
* Handles synced events being received. Server will log them, and server/client will execute them.
*
* Arguments [Client] :
* 0: eventName <STRING>
* 1: arguments <ARRAY>
* 2: ttl <NUMBER>
*
* Return Value:
* Boolean of success <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_name", "_args", "_ttl"];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name);
false
};
private _internalData = HASH_GET(GVAR(syncedEvents),_name);
if (isServer) then {
// Server needs to internally log it for synchronization
if (_ttl > -1) then {
_internalData = HASH_GET(GVAR(syncedEvents),_name);
_internalData params ["", "_eventLog"];
_eventLog pushBack [diag_tickTime, _args, _ttl];
};
};
_internalData params ["_eventCode"];
_args call _eventCode;
/*
* Author: jaynus
* Handles synced events being received. Server will log them, and server/client will execute them.
*
* Arguments [Client] :
* 0: eventName <STRING>
* 1: arguments <ARRAY>
* 2: ttl <NUMBER>
*
* Return Value:
* Boolean of success <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_name", "_args", "_ttl"];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name);
false
};
private _internalData = HASH_GET(GVAR(syncedEvents),_name);
if (isServer) then {
// Server needs to internally log it for synchronization
if (_ttl > -1) then {
_internalData = HASH_GET(GVAR(syncedEvents),_name);
_internalData params ["", "_eventLog"];
_eventLog pushBack [diag_tickTime, _args, _ttl];
};
};
_internalData params ["_eventCode"];
_args call _eventCode;

View File

@ -1,25 +1,14 @@
/*
* Author: Nou
* Add an event handler.
*
* Arguments:
* 0: Event name <STRING>
* 1: Event code <CODE>
*
* Return Value:
* Event handler ID number (for use with fnc_removeEventHandler) <NUMBER>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_eventName", "_eventCode"];
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
if (isNil "_eventFunctions") then {
_eventFunctions = [];
GVAR(eventsLocation) setVariable [_eventName, _eventFunctions];
};
_eventFunctions pushBack _eventCode // Return event function count
#define DEBUG_MODE_FULL
#include "script_component.hpp"
params ["_eventName", "_eventCode"];
private _newName = getText (configFile >> "ACE_newEvents" >> _eventName);
if (_newName != "") then {
TRACE_2("Switching Names",_eventName,_newName);
_eventName = _newName;
};
[_eventName, _eventCode] call CBA_fnc_addEventHandler;
ACE_DEPRECATED("ace_common_fnc_addEventHandler","3.8.0","CBA_fnc_addEventHandler");

View File

@ -37,4 +37,4 @@ missionNamespace setVariable [_name, _value];
GVAR(settings) pushBack _this;
// Raise event locally
["SettingChanged", [_name, _value]] call FUNC(localEvent);
["ace_settingChanged", [_name, _value]] call CBA_fnc_localEvent;

View File

@ -1,30 +1,30 @@
/*
* Author: jaynus
* Register an event handler for an ACE synced event
*
* Arguments:
* 0: Name <STRING>
* 1: Handler <CODE>
* 2: TTL (optional: 0) <NUMBER, CODE>
*
* Return Value:
* Boolean of success <BOOL>
*
* Example:
* ["myEvent", {_this call x}, 0] call ace_common_fnc_addSyncedEventHandler
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_name", "_handler", ["_ttl", 0]];
if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR_1("Duplicate synced event [%1] creation.",_name);
false
};
private _eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler);
private _data = [_handler, [], _ttl, _eventId];
HASH_SET(GVAR(syncedEvents),_name,_data);
/*
* Author: jaynus
* Register an event handler for an ACE synced event
*
* Arguments:
* 0: Name <STRING>
* 1: Handler <CODE>
* 2: TTL (optional: 0) <NUMBER, CODE>
*
* Return Value:
* Boolean of success <BOOL>
*
* Example:
* ["myEvent", {_this call x}, 0] call ace_common_fnc_addSyncedEventHandler
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_name", "_handler", ["_ttl", 0]];
if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR_1("Duplicate synced event [%1] creation.",_name);
false
};
private _eventId = [_name, FUNC(_handleSyncedEvent)] call CBA_fnc_addEventHandler;
private _data = [_handler, [], _ttl, _eventId];
HASH_SET(GVAR(syncedEvents),_name,_data);

View File

@ -28,7 +28,7 @@ GVAR(AssignedItemsShownItems) = [
ACE_isGPSEnabled
];
["playerInventoryChanged", {
["ace_playerInventoryChanged", {
params ["_unit"];
private _assignedItems = getUnitLoadout _unit param [9, ["","","","","",""]]; // ["ItemMap","ItemGPS","ItemRadio","ItemCompass","ItemWatch","NVGoggles"]
@ -48,4 +48,4 @@ GVAR(AssignedItemsShownItems) = [
showWatch _showWatch;
showRadio _showRadio;
showGPS (_showGPS || {cameraOn == getConnectedUAV _unit}); //If player is activly controling a UAV, showGPS controls showing the map (m key)
}] call FUNC(addEventHandler);
}] call CBA_fnc_addEventHandler;

View File

@ -46,7 +46,7 @@ if ((_namespace getVariable [_uid, [-99999]]) select 0 < diag_tickTime) then {
} forEach _cacheList;
// Empty the list
missionNamespace setVariable [_varName, []];
}] call FUNC(addEventhandler);
}] call CBA_fnc_addEventHandler;
};
// Add this cache to the list of the event

View File

@ -61,7 +61,7 @@ if (!isServer) then {
_error = _error + "Newer version; ";
};
//[QGVAR(systemChatGlobal), _error] call FUNC(globalEvent);
//[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent;
ACE_LOGERROR(_error);

View File

@ -28,9 +28,9 @@ _target setVariable [QGVAR(owner), _unit, true];
// lock target object
if (_lockTarget) then {
if (!isNull _unit) then {
["lockVehicle", _target, _target] call FUNC(targetEvent);
[QGVAR(lockVehicle), _target, _target] call CBA_fnc_targetEvent;
} else {
["unlockVehicle", _target, _target] call FUNC(targetEvent);
[QGVAR(unlockVehicle), _target, _target] call CBA_fnc_targetEvent;
};
};

View File

@ -44,6 +44,6 @@ if (typeName _text != "TEXT") then {
_text = parseText format ["<t align='center'>%1</t>", _text];
};
_text = composeText [parseText format ["<img size='2' align='center' color='%2' image='%1'/>", _image, _imageColor call BIS_fnc_colorRGBtoHTML], lineBreak, _text];
_text = composeText [parseText format ["<img size='2' align='center' color='%2' image='%1'/>", _image, _imageColor call BIS_fnc_colorRGBtoHTML], lineBreak, _text];
[_text, _size] call FUNC(displayTextStructured);

View File

@ -41,34 +41,34 @@ TRACE_2("",local _unit,vehicle _unit);
switch (_priority) do {
case 0: {
if (_unit == vehicle _unit) then {
["playMove", _unit, [_unit, _animation]] call FUNC(objectEvent);
[QGVAR(playMove), [_unit, _animation], _unit] call CBA_fnc_targetEvent;
} else {
// Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles.
["playMove", [_unit, _animation]] call FUNC(globalEvent);
[QGVAR(playMove), [_unit, _animation]] call CBA_fnc_globalEvent;
};
};
case 1: {
if (_unit == vehicle _unit) then {
["playMoveNow", _unit, [_unit, _animation]] call FUNC(objectEvent);
[QGVAR(playMoveNow), [_unit, _animation], _unit] call CBA_fnc_targetEvent;
} else {
// Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles.
["playMoveNow", [_unit, _animation]] call FUNC(globalEvent);
[QGVAR(playMoveNow), [_unit, _animation]] call CBA_fnc_globalEvent;
};
};
case 2: {
// try playMoveNow first
if (_unit == vehicle _unit) then {
["playMoveNow", _unit, [_unit, _animation]] call FUNC(objectEvent);
[QGVAR(playMoveNow), [_unit, _animation], _unit] call CBA_fnc_targetEvent;
} else {
// Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles.
["playMoveNow", [_unit, _animation]] call FUNC(globalEvent);
[QGVAR(playMoveNow), [_unit, _animation]] call CBA_fnc_globalEvent;
};
// if animation doesn't respond, do switchMove
if (animationState _unit != _animation) then {
TRACE_1("did not respond to playMoveNow",animationState _unit);
// Execute on all machines. SwitchMove has local effects.
["switchMove", [_unit, _animation]] call FUNC(globalEvent);
[QGVAR(switchMove), [_unit, _animation]] call CBA_fnc_globalEvent;
};
};
default {};

View File

@ -1,44 +1,44 @@
/*
* Author: ?
* Dumps an array to the RPT, showing the depth of each element.
*
* Arguments:
* 0: Array to be dumped <ARRAY>
* 1: Depth <NUMBER><OPTIONAL>
*
* Return Value:
* None
*
* Example:
* [[0, [1,2], [[3]]]] call ace_common_fnc_dumpArray
*
* Public: No
*/
#include "script_component.hpp"
params ["_var", ["_depth", 0, [0]]];
private _pad = "";
for "_i" from 0 to _depth do {
_pad = _pad + toString [9];
};
_depth = _depth + 1;
if (IS_ARRAY(_var)) then {
if (_var isEqualTo []) then {
diag_log text format ["%1[],", _pad];
} else {
diag_log text format ["%1[", _pad];
{
[_x, _depth] call FUNC(dumpArray);
false
} count _var;
diag_log text format ["%1],", _pad];
};
} else {
diag_log text format ["%1%2", _pad, _var];
};
/*
* Author: ?
* Dumps an array to the RPT, showing the depth of each element.
*
* Arguments:
* 0: Array to be dumped <ARRAY>
* 1: Depth <NUMBER><OPTIONAL>
*
* Return Value:
* None
*
* Example:
* [[0, [1,2], [[3]]]] call ace_common_fnc_dumpArray
*
* Public: No
*/
#include "script_component.hpp"
params ["_var", ["_depth", 0, [0]]];
private _pad = "";
for "_i" from 0 to _depth do {
_pad = _pad + toString [9];
};
_depth = _depth + 1;
if (IS_ARRAY(_var)) then {
if (_var isEqualTo []) then {
diag_log text format ["%1[],", _pad];
} else {
diag_log text format ["%1[", _pad];
{
[_x, _depth] call FUNC(dumpArray);
false
} count _var;
diag_log text format ["%1],", _pad];
};
} else {
diag_log text format ["%1%2", _pad, _var];
};

View File

@ -1,88 +1,88 @@
/*
* Author: ?
* Dumps performance counter statistics into Logs.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
diag_log text format ["REGISTERED ACE PFH HANDLERS"];
diag_log text format ["-------------------------------------------"];
if (!isNil "ACE_PFH_COUNTER") then {
{
_x params ["_pfh", "_parameters"];
private _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)};
diag_log text format ["Registered PFH: id=%1 [%2, delay %3], %4:%5", _pfh select 0, _isActive, _parameters select 1, _pfh select 1, _pfh select 2];
false
} count ACE_PFH_COUNTER;
};
diag_log text format ["ACE COUNTER RESULTS"];
diag_log text format ["-------------------------------------------"];
{
private _counterEntry = _x;
private _iter = 0;
private _total = 0;
private _count = 0;
private _averageResult = 0;
if (count _counterEntry > 3) then {
// calc
{
if (_iter > 2) then {
_count = _count + 1;
private _delta = (_x select 1) - (_x select 0);
_total = _total + _delta;
};
_iter = _iter + 1;
false
} count _counterEntry;
// results
_averageResult = (_total / _count) * 1000;
// dump results
diag_log text format ["%1: Average: %2s / %3 = %4ms", _counterEntry select 0, _total, _count, _averageResult];
} else {
diag_log text format ["%1: No results", _counterEntry select 0];
};
false
} count ACE_COUNTERS;
/*
// Dump PFH Trackers
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"];
diag_log text format["-------------------------------------------"];
{
private _delay = _x select 2;
//if(_delay > 0) then { _delay = _delay / 1000; };
diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)];
} forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER;
// Dump PFH Trackers
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"];
diag_log text format["-------------------------------------------"];
{
private _delta = _x select 1;
//if(_delta > 0) then { _delta = _delta / 1000; };
diag_log text format[" DELTA: %1s", _delta];
} forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER;
//{
//
//} forEach ACRE_EXCESSIVE_FRAME_TRACKER;
*/
/*
* Author: ?
* Dumps performance counter statistics into Logs.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
diag_log text format ["REGISTERED ACE PFH HANDLERS"];
diag_log text format ["-------------------------------------------"];
if (!isNil "ACE_PFH_COUNTER") then {
{
_x params ["_pfh", "_parameters"];
private _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)};
diag_log text format ["Registered PFH: id=%1 [%2, delay %3], %4:%5", _pfh select 0, _isActive, _parameters select 1, _pfh select 1, _pfh select 2];
false
} count ACE_PFH_COUNTER;
};
diag_log text format ["ACE COUNTER RESULTS"];
diag_log text format ["-------------------------------------------"];
{
private _counterEntry = _x;
private _iter = 0;
private _total = 0;
private _count = 0;
private _averageResult = 0;
if (count _counterEntry > 3) then {
// calc
{
if (_iter > 2) then {
_count = _count + 1;
private _delta = (_x select 1) - (_x select 0);
_total = _total + _delta;
};
_iter = _iter + 1;
false
} count _counterEntry;
// results
_averageResult = (_total / _count) * 1000;
// dump results
diag_log text format ["%1: Average: %2s / %3 = %4ms", _counterEntry select 0, _total, _count, _averageResult];
} else {
diag_log text format ["%1: No results", _counterEntry select 0];
};
false
} count ACE_COUNTERS;
/*
// Dump PFH Trackers
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"];
diag_log text format["-------------------------------------------"];
{
private _delay = _x select 2;
//if(_delay > 0) then { _delay = _delay / 1000; };
diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)];
} forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER;
// Dump PFH Trackers
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"];
diag_log text format["-------------------------------------------"];
{
private _delta = _x select 1;
//if(_delta > 0) then { _delta = _delta / 1000; };
diag_log text format[" DELTA: %1s", _delta];
} forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER;
//{
//
//} forEach ACRE_EXCESSIVE_FRAME_TRACKER;
*/

View File

@ -26,12 +26,12 @@ TRACE_7("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile
if (_unit isKindOf "CAManBase") then {
// The unit it on foot
if (_unit == ACE_player) then {
["firedPlayer", _this] call FUNC(localEvent);
["ace_firedPlayer", _this] call CBA_fnc_localEvent;
} else {
if ([_unit] call EFUNC(common,isPlayer)) then {
["firedPlayerNonLocal", _this] call FUNC(localEvent);
["ace_firedPlayerNonLocal", _this] call CBA_fnc_localEvent;
} else {
["firedNonPlayer", _this] call FUNC(localEvent);
["ace_firedNonPlayer", _this] call CBA_fnc_localEvent;
};
};
} else {
@ -55,12 +55,12 @@ if (_unit isKindOf "CAManBase") then {
};
if (_gunner == ACE_player) then {
["firedPlayerVehicle", _this] call FUNC(localEvent);
["ace_firedPlayerVehicle", _this] call CBA_fnc_localEvent;
} else {
if ([_gunner] call EFUNC(common,isPlayer)) then {
["firedPlayerVehicleNonLocal", _this] call FUNC(localEvent);
["ace_firedPlayerVehicleNonLocal", _this] call CBA_fnc_localEvent;
} else {
["firedNonPlayerVehicle", _this] call FUNC(localEvent);
["ace_firedNonPlayerVehicle", _this] call CBA_fnc_localEvent;
};
};
};

View File

@ -21,7 +21,7 @@ if (!local _object) exitWith {};
if (_object isKindOf "CAManBase") exitWith {};
//We need to manually set allowDamage to true for setHitIndex to function
["blockDamage", [_object, 0]] call FUNC(localEvent);
[QGVAR(blockDamage), [_object, 0]] call CBA_fnc_localEvent;
// save and restore hitpoints, see below why
private _hitPointDamages = getAllHitPointsDamage _object;
@ -41,4 +41,4 @@ _object setDamage damage _object;
//manually re-enable allowDamage to previous setting (ref statusEffect_funcs)
private _effectVarName = format [QGVAR(effect_%1), "blockDamage"];
private _effectNumber = _object getVariable [_effectVarName, 0];
["blockDamage", [_object, _effectNumber]] call FUNC(localEvent);
[QGVAR(blockDamage), [_object, _effectNumber]] call CBA_fnc_localEvent;

View File

@ -22,83 +22,14 @@ private _long = getNumber (configFile >> "CfgWorlds" >> _map >> "longitude");
private _lat = getNumber (configFile >> "CfgWorlds" >> _map >> "latitude");
private _altitude = getNumber (configFile >> "CfgWorlds" >> _map >> "elevationOffset");
_map = toLower _map;
if (_map in ["abbottabad"]) then { _lat = 34; _altitude = 1256; }; //Abbottabad elevation 1256m (Wikipedia)
if (_map in ["abramia"]) then { _lat = 60; _altitude = 0; };
if (_map in ["af_kandahar_province"]) then { _lat = 42; _altitude = 0; };
if (_map in ["altis"]) then { _lat = 40; _altitude = 0; };
if (_map in ["angel"]) then { _lat = 38; _altitude = 0; };
if (_map in ["anim_helvantis_v2"]) then { _lat = 50; _altitude = 0; };
if (_map in ["australia"]) then { _lat = -25; _altitude = 0; };
if (_map in ["bootcamp_acr"]) then { _lat = 50; _altitude = 0; };
if (_map in ["bornholm"]) then { _lat = 55; _altitude = 0; };
if (_map in ["bozcaada"]) then { _lat = 40; _altitude = 0; };
if (_map in ["caribou"]) then { _lat = 68; _altitude = 0; };
if (_map in ["catalina"]) then { _lat = 33; _altitude = 0; };
if (_map in ["chernarus", "chernarus_summer", "chernarus_winter"]) then { _lat = 50; _altitude = 0; };
if (_map in ["chernobylzone", "chernobylzonea2"]) then { _lat = 51; _altitude = 0; };
if (_map in ["clafghan"]) then { _lat = 34; _altitude = 640; };
if (_map in ["dakrong"]) then { _lat = 17; _altitude = 0; }; //Unsung Mod
if (_map in ["desert_e"]) then { _lat = 40; _altitude = 800; };
if (_map in ["dya"]) then { _lat = 34; _altitude = 110; }; //Diyala Iraq - default elevationOffset
if (_map in ["esseker"]) then { _lat = 43; _altitude = 2000; };
if (_map in ["evergreen"]) then { _lat = 41; _altitude = 0; }; //Burgazada, Turkey - default elevationOffset
if (_map in ["fallujah"]) then { _lat = 33; _altitude = 0; };
if (_map in ["fata"]) then { _lat = 33; _altitude = 1347; };
if (_map in ["gorgona"]) then { _lat = 43; _altitude = 0; };
if (_map in ["hellskitchen", "hellskitchens"]) then { _lat = 32; _altitude = 900; }; //Sangin summer, Sangin winter - Sangin elevation 888m (Wikipedia)
if (_map in ["hindukush"]) then { _lat = 36; _altitude = 0; };
if (_map in ["imrali", "imralispring"]) then { _lat = 40; _altitude = 0; };
if (_map in ["intro"]) then { _lat = 40; _altitude = 0; };
if (_map in ["isladuala3"]) then { _lat = -19; _altitude = 0; };
if (_map in ["jacobi"]) then { _lat = 34; _altitude = 2000; }; //default elevationOffset
if (_map in ["kapaulio"]) then { _lat = 0; _altitude = 0; };
if (_map in ["kerama"]) then { _lat = 26; _altitude = 0; }; //Kerama Islands, Japan - default elevationOffset
if (_map in ["kholm"]) then { _lat = 36; _altitude = 0; };
if (_map in ["koplic"]) then { _lat = 42; _altitude = 0; };
if (_map in ["kunduz"]) then { _lat = 37; _altitude = 0; };
if (_map in ["lingor", "lingor3"]) then { _lat = -4; _altitude = 0; };
if (_map in ["lost", "lostw"]) then { _lat = 60; _altitude = 0; };
if (_map in ["mcn_aliabad"]) then { _lat = 36; _altitude = 0; };
if (_map in ["malvinas"]) then { _lat = -52; _altitude = 0; };
if (_map in ["namalsk"]) then { _lat = 65; _altitude = 0; };
if (_map in ["mef_alaska"]) then { _lat = 60; _altitude = 5; };
if (_map in ["mountains_acr"]) then { _lat = 35; _altitude = 2000; };
if (_map in ["napf", "napfwinter"]) then { _lat = 47; _altitude = 0; };
if (_map in ["panthera3"]) then { _lat = 46; _altitude = 0; };
if (_map in ["pianosa_aut"]) then { _lat = 43; _altitude = 0; }; //Pianosa, Italy - default elevationOffset
if (_map in ["pja305"]) then { _lat = 0; _altitude = 0; }; //G.O.S N'Ziwasogo
if (_map in ["pja306"]) then { _lat = 35; _altitude = 0; }; //G.O.S Kalu Khan
if (_map in ["pja307"]) then { _lat = 17; _altitude = 0; }; //F.S.F Daryah
if (_map in ["pja308"]) then { _lat = 36; _altitude = 0; }; //G.O.S Gunkizli
if (_map in ["pja310"]) then { _lat = 36; _altitude = 0; }; //G.O.S Al Rayak
if (_map in ["pja312"]) then { _lat = 16; _altitude = 0; }; //G.O.S Song Bin Tanh
if (_map in ["porquerolles"]) then { _lat = 43; _altitude = 0; };
if (_map in ["porto"]) then { _lat = 40; _altitude = 0; };
if (_map in ["provinggrounds_pmc"]) then { _lat = 35; _altitude = 100; };
if (_map in ["reshmaan"]) then { _lat = 35; _altitude = 2000; };
if (_map in ["sara", "sara_dbe1"]) then { _lat = 40; _altitude = 0; };
if (_map in ["saralite"]) then { _lat = 40; _altitude = 0; };
if (_map in ["sb3"]) then { _lat = 53; _altitude = 25; }; //TrpUebPl Einfelde Nord (Munster North Training Area, Germany) - default elevationOffset
if (_map in ["shapur_baf"]) then { _lat = 35; _altitude = 100; };
if (_map in ["sfp_sturko"]) then { _lat = 56; _altitude = 0; };
if (_map in ["sfp_wamako"]) then { _lat = 14; _altitude = 0; };
if (_map in ["stratis"]) then { _lat = 40; _altitude = 0; };
if (_map in ["sugarlake"]) then { _lat = 29; _altitude = 0; };
if (_map in ["takistan"]) then { _lat = 35; _altitude = 2000; };
if (_map in ["thirsk"]) then { _lat = 65; _altitude = 0; };
if (_map in ["tilos"]) then { _lat = 36; _altitude = 0; };
if (_map in ["utes"]) then { _lat = 50; _altitude = 0; };
if (_map in ["vt5"]) then { _lat = 61; _altitude = 100; }; //Vt5, Suomi Finland - default elevationOffset
if (_map in ["wake"]) then { _lat = 19; _altitude = 0; };
if (_map in ["waziristan"]) then { _lat = 33; _altitude = 0; };
if (_map in ["wintermap"]) then { _lat = 61; _altitude = 0; }; //Nordkvingo - default elevationOffset
if (_map in ["wintertown", "wintertowna3"]) then { _lat = 39; _altitude = 600; }; //U.S. state Kansas mean elevation 610m (Wikipedia)
if (_map in ["woodland_acr"]) then { _lat = 50; _altitude = 0; };
if (_map in ["xcam_prototype"]) then { _lat = 35; _altitude = 0; };
if (_map in ["zargabad"]) then { _lat = 35; _altitude = 2000; };
private _mapData = _map call FUNC(getMapData);
if (!(_mapData isEqualTo [])) then {
_lat = _mapData select 0;
_alt = _mapData select 1;
};
TRACE_2("Latitude and Altitude",_lat,_alt);
private _UTM = [_long,_lat] call BIS_fnc_posDegToUTM;
private _UTM = [_long, _lat] call BIS_fnc_posDegToUTM;
private _easting = _UTM select 0;
private _northing = _UTM select 1;
//private _zone = _UTM select 2;

View File

@ -0,0 +1,98 @@
/*
* Author: VKing, bux
* Gets the current latitude and altitude offset for the map.
*
* Argument:
* 0: Map name (default: worldName) <STRING>
*
* Return Value:
* 0: Latitude <NUMBER>
* 1: Altitude <NUMBER>
*
* Public: No
*/
params ["_map"];
_map = toLower _map;
// [latitude, altitude]
// the more important ones
if (_map in ["tanoa"]) exitWith { [-18, 0] };
if (_map in ["altis"]) exitWith { [40, 0] };
if (_map in ["stratis"]) exitWith { [40, 0] };
if (_map in ["abbottabad"]) exitWith { [34, 1256] }; //Abbottabad elevation 1256m (Wikipedia)
if (_map in ["abramia"]) exitWith { [60, 0] };
if (_map in ["af_kandahar_province"]) exitWith { [42, 0] };
if (_map in ["angel"]) exitWith { [38, 0] };
if (_map in ["anim_helvantis_v2"]) exitWith { [50, 0] };
if (_map in ["australia"]) exitWith { [-25, 0] };
if (_map in ["bootcamp_acr"]) exitWith { [50, 0] };
if (_map in ["bornholm"]) exitWith { [55, 0] };
if (_map in ["bozcaada"]) exitWith { [40, 0] };
if (_map in ["caribou"]) exitWith { [68, 0] };
if (_map in ["catalina"]) exitWith { [33, 0] };
if (_map in ["chernarus", "chernarus_summer", "chernarus_winter"]) exitWith { [50, 0] };
if (_map in ["chernobylzone", "chernobylzonea2"]) exitWith { [51, 0] };
if (_map in ["clafghan"]) exitWith { [34, 640] };
if (_map in ["dakrong"]) exitWith { [17, 0] }; //Unsung Mod
if (_map in ["desert_e"]) exitWith { [40, 800] };
if (_map in ["dya"]) exitWith { [34, 110] }; //Diyala Iraq - default elevationOffset
if (_map in ["esseker"]) exitWith { [43, 2000] };
if (_map in ["evergreen"]) exitWith { [41, 0] }; //Burgazada, Turkey - default elevationOffset
if (_map in ["fallujah"]) exitWith { [33, 0] };
if (_map in ["fata"]) exitWith { [33, 1347] };
if (_map in ["gorgona"]) exitWith { [43, 0] };
if (_map in ["hellskitchen", "hellskitchens"]) exitWith { [32, 900] }; //Sangin summer, Sangin winter - Sangin elevation 888m (Wikipedia)
if (_map in ["hindukush"]) exitWith { [36, 0] };
if (_map in ["imrali", "imralispring"]) exitWith { [40, 0] };
if (_map in ["intro"]) exitWith { [40, 0] };
if (_map in ["isladuala3"]) exitWith { [-19, 0] };
if (_map in ["jacobi"]) exitWith { [34, 2000] }; //default elevationOffset
if (_map in ["kapaulio"]) exitWith { [0, 0] };
if (_map in ["kerama"]) exitWith { [26, 0] }; //Kerama Islands, Japan - default elevationOffset
if (_map in ["kholm"]) exitWith { [36, 0] };
if (_map in ["koplic"]) exitWith { [42, 0] };
if (_map in ["kunduz"]) exitWith { [37, 0] };
if (_map in ["lingor", "lingor3"]) exitWith { [-4, 0] };
if (_map in ["lost", "lostw"]) exitWith { [60, 0] };
if (_map in ["mcn_aliabad"]) exitWith { [36, 0] };
if (_map in ["malvinas"]) exitWith { [-52, 0] };
if (_map in ["namalsk"]) exitWith { [65, 0] };
if (_map in ["mef_alaska"]) exitWith { [60, 5] };
if (_map in ["mountains_acr"]) exitWith { [35, 2000] };
if (_map in ["napf", "napfwinter"]) exitWith { [47, 0] };
if (_map in ["panthera3"]) exitWith { [46, 0] };
if (_map in ["pianosa_aut"]) exitWith { [43, 0] }; //Pianosa, Italy - default elevationOffset
if (_map in ["pja305"]) exitWith { [0, 0] }; //G.O.S N'Ziwasogo
if (_map in ["pja306"]) exitWith { [35, 0] }; //G.O.S Kalu Khan
if (_map in ["pja307"]) exitWith { [17, 0] }; //F.S.F Daryah
if (_map in ["pja308"]) exitWith { [36, 0] }; //G.O.S Gunkizli
if (_map in ["pja310"]) exitWith { [36, 0] }; //G.O.S Al Rayak
if (_map in ["pja312"]) exitWith { [16, 0] }; //G.O.S Song Bin Tanh
if (_map in ["porquerolles"]) exitWith { [43, 0] };
if (_map in ["porto"]) exitWith { [40, 0] };
if (_map in ["provinggrounds_pmc"]) exitWith { [35, 100] };
if (_map in ["reshmaan"]) exitWith { [35, 2000] };
if (_map in ["sara", "sara_dbe1"]) exitWith { [40, 0] };
if (_map in ["saralite"]) exitWith { [40, 0] };
if (_map in ["sb3"]) exitWith { [53, 25] }; //TrpUebPl Einfelde Nord (Munster North Training Area, Germany) - default elevationOffset
if (_map in ["shapur_baf"]) exitWith { [35, 100] };
if (_map in ["sfp_sturko"]) exitWith { [56, 0] };
if (_map in ["sfp_wamako"]) exitWith { [14, 0] };
if (_map in ["sugarlake"]) exitWith { [29, 0] };
if (_map in ["takistan"]) exitWith { [35, 2000] };
if (_map in ["thirsk"]) exitWith { [65, 0] };
if (_map in ["tilos"]) exitWith { [36, 0] };
if (_map in ["utes"]) exitWith { [50, 0] };
if (_map in ["vt5"]) exitWith { [61, 100] }; //Vt5, Suomi Finland - default elevationOffset
if (_map in ["wake"]) exitWith { [19, 0] };
if (_map in ["waziristan"]) exitWith { [33, 0] };
if (_map in ["wintermap"]) exitWith { [61, 0] }; //Nordkvingo - default elevationOffset
if (_map in ["wintertown", "wintertowna3"]) exitWith { [39, 600] }; //U.S. state Kansas mean elevation 610m (Wikipedia)
if (_map in ["woodland_acr"]) exitWith { [50, 0] };
if (_map in ["xcam_prototype"]) exitWith { [35, 0] };
if (_map in ["zargabad"]) exitWith { [35, 2000] };
[] //Return empty array if we have no specific data for the map

View File

@ -1,42 +1,42 @@
/*
* Author: jaynus
* Get the absolute turret direction for FOV/PIP turret.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Turret Position <ARRAY>
*
* Return Value:
* 0: Position ASL <ARRAY>
* 1: Direction <ARRAY>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_vehicle", "_position"];
private _turret = [_vehicle, _position] call CBA_fnc_getTurret;
private _pov = getText (_turret >> "memoryPointGunnerOptics");
private _gunBeg = getText (_turret >> "gunBeg");
private _gunEnd = getText (_turret >> "gunEnd");
TRACE_3("", _pov, _gunBeg, _gunEnd);
// Pull the PIP pov or barrel direction, depending on how the model is set up
private _povPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _pov)); //@todo AGLToASL ?
private _povDir = [0,0,0];
if (_pov == "pip0_pos") then {
private _pipDir = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir"));
_povDir = _pipDir vectorDiff _povPos;
} else {
private _gunBeginPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg));
private _gunEndPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd));
_povDir = _gunBeginPos vectorDiff _gunEndPos;
};
[_povPos, _povDir]
/*
* Author: jaynus
* Get the absolute turret direction for FOV/PIP turret.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Turret Position <ARRAY>
*
* Return Value:
* 0: Position ASL <ARRAY>
* 1: Direction <ARRAY>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_vehicle", "_position"];
private _turret = [_vehicle, _position] call CBA_fnc_getTurret;
private _pov = getText (_turret >> "memoryPointGunnerOptics");
private _gunBeg = getText (_turret >> "gunBeg");
private _gunEnd = getText (_turret >> "gunEnd");
TRACE_3("", _pov, _gunBeg, _gunEnd);
// Pull the PIP pov or barrel direction, depending on how the model is set up
private _povPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _pov)); //@todo AGLToASL ?
private _povDir = [0,0,0];
if (_pov == "pip0_pos") then {
private _pipDir = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir"));
_povDir = _pipDir vectorDiff _povPos;
} else {
private _gunBeginPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg));
private _gunEndPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd));
_povDir = _gunBeginPos vectorDiff _gunEndPos;
};
[_povPos, _povDir]

View File

@ -1,21 +1,14 @@
/*
* Author: Nou
* Execute a global event on all clients, including self.
*
* Arguments:
* 0: Event name <STRING>
* 1: Event args <ANY>
*
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_eventName", "_eventArgs"];
ACEg = [_eventName, _eventArgs];
publicVariable "ACEg";
["ACEg", ACEg] call FUNC(_handleNetEvent);
#define DEBUG_MODE_FULL
#include "script_component.hpp"
params ["_eventName", "_eventArgs"];
private _newName = getText (configFile >> "ACE_newEvents" >> _eventName);
if (_newName != "") then {
TRACE_2("Switching Names",_eventName,_newName);
_eventName = _newName;
};
[_eventName, _eventArgs] call CBA_fnc_globalEvent;
ACE_DEPRECATED("ace_common_fnc_globalEvent","3.8.0","CBA_fnc_globalEvent");

View File

@ -17,8 +17,8 @@
private _unit = ACE_player;
private _anim = animationState _unit;
["HeadbugFixUsed", [profileName, _anim]] call FUNC(serverEvent);
["HeadbugFixUsed", [profileName, _anim]] call FUNC(localEvent);
[QGVAR(headbugFixUsed), [profileName, _anim]] call CBA_fnc_serverEvent;
[QGVAR(headbugFixUsed), [profileName, _anim]] call CBA_fnc_localEvent;
if (_unit != vehicle _unit || {!([_unit, objNull, ["isNotSitting"]] call FUNC(canInteractWith))}) exitWith {false};

View File

@ -28,5 +28,5 @@ if !(_reason in _setHiddenReasons) then {
};
if !(isObjectHidden _unit) then {
["hideObjectGlobal", [_unit, true]] call FUNC(serverEvent);
[QGVAR(hideObjectGlobal), [_unit, true]] call CBA_fnc_serverEvent;
};

View File

@ -32,7 +32,7 @@ private _nearVehicles = nearestObjects [_unit, ["Car", "Air", "Tank", "Ship_F"],
if (!isNull _vehicle) then {
[_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide);
["loadPersonEvent", _unit, [_unit, _vehicle, _caller]] call FUNC(objectEvent);
["ace_loadPersonEvent", [_unit, _vehicle, _caller], _unit] call CBA_fnc_targetEvent;
};
_vehicle

View File

@ -1,36 +1,13 @@
/*
* Author: Nou
* Execute a local event on this client only.
*
* Arguments:
* 0: Event name (string)
* 1: Event args (any)
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_eventName", "_eventArgs"];
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
if (!isNil "_eventFunctions") then {
#ifdef DEBUG_EVENTS
ACE_LOGINFO_1("* Local Event: %1",_eventName);
ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif
{
if (!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x,FORMAT_2("Local Event %1 ID: %2",_eventName,_forEachIndex));
#ifdef DEBUG_EVENTS_CALLSTACK
ACE_LOGINFO_1(" ID: %1",_forEachIndex);
#endif
};
} forEach _eventFunctions;
};
#include "script_component.hpp"
params ["_eventName", "_eventArgs"];
private _newName = getText (configFile >> "ACE_newEvents" >> _eventName);
if (_newName != "") then {
TRACE_2("Switching Names",_eventName,_newName);
_eventName = _newName;
};
[_eventName, _eventArgs] call CBA_fnc_localEvent;
ACE_DEPRECATED("ace_common_fnc_localEvent","3.8.0","CBA_fnc_localEvent");

View File

@ -29,6 +29,6 @@ private _speaker = speaker _unit;
if (_speaker == "ACE_NoVoice") exitWith {};
["setSpeaker", [_unit, "ACE_NoVoice"]] call FUNC(globalEvent);
[QGVAR(setSpeaker), [_unit, "ACE_NoVoice"]] call CBA_fnc_globalEvent;
_unit setVariable ["ACE_OriginalSpeaker", _speaker, true];

View File

@ -16,5 +16,5 @@ params ["_unit"];
// setSpeaker gets overwritten after init on remote units; if unit is muted, setSpeaker again
if (count (_unit getVariable [QGVAR(muteUnitReasons), []]) > 0) then {
["setSpeaker", [_unit, "ACE_NoVoice"]] call FUNC(localEvent);
[QGVAR(setSpeaker), [_unit, "ACE_NoVoice"]] call CBA_fnc_localEvent;
};

View File

@ -18,4 +18,4 @@ params ["_unit"];
_unit setVariable [QGVAR(muteUnitReasons), _unit getVariable [QGVAR(muteUnitReasons), []], true];
// fix mp issues with respawning and the speaker
["setSpeaker", [_unit, speaker _unit]] call FUNC(globalEvent);
[QGVAR(setSpeaker), [_unit, speaker _unit]] call CBA_fnc_globalEvent;

View File

@ -1,34 +1,13 @@
/*
* Author: PabstMirror
* Execute an event where object is local.
* If local there is no network traffic/delay (Unlike targetEvent)
*
* Arguments:
* 0: Event name (STRING)
* 1: Event target <OBJECT>
* 2: Event args <ANY>
*
* Return Value:
* None
*
* Example:
* ["doThing", vehicle player, []] call ace_common_fnc_objectEvent
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_eventName", "_eventTarget", "_eventArgs"];
#ifdef DEBUG_EVENTS
ACE_LOGINFO_2("* Object Event: %1 - %2",_eventName,_eventTarget);
ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif
if (local _eventTarget) then {
[_eventName, _eventArgs] call FUNC(localEvent);
} else {
_this call FUNC(targetEvent);
private _newName = getText (configFile >> "ACE_newEvents" >> _eventName);
if (_newName != "") then {
TRACE_2("Switching Names",_eventName,_newName);
_eventName = _newName;
};
nil
[_eventName, _eventArgs, _eventTargets] call CBA_fnc_targetEvent;
ACE_DEPRECATED("ace_common_fnc_objectEvent","3.8.0","CBA_fnc_targetEvent");

View File

@ -20,7 +20,7 @@ if (!isNil "_info") then {
_info params ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"];
private _replyParams = [_info, _accepted];
[QGVAR(requestCallback), _caller, _replyParams] call FUNC(objectEvent);
[QGVAR(requestCallback), _replyParams, _caller] call CBA_fnc_targetEvent;
_unit setVariable [_id, nil];
};

View File

@ -82,13 +82,13 @@ _ctrlPos set [1, ((0 + 29 * GVAR(settingProgressBarLocation)) * ((((safezoneW /
if (_errorCode == 0) then {
if (_onFinish isEqualType "") then {
[_onFinish, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent);
[_onFinish, [_args, _elapsedTime, _totalTime, _errorCode]] call CBA_fnc_localEvent;
} else {
[_args, _elapsedTime, _totalTime, _errorCode] call _onFinish;
};
} else {
if (_onFail isEqualType "") then {
[_onFail, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent);
[_onFail, [_args, _elapsedTime, _totalTime, _errorCode]] call CBA_fnc_localEvent;
} else {
[_args, _elapsedTime, _totalTime, _errorCode] call _onFail;
};

View File

@ -1,17 +1,14 @@
/*
* Author: Nou
* Remove all events of a certain event type.
*
* Argument:
* 0: Event name <STRING>
*
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_eventName"];
GVAR(eventsLocation) setVariable [_eventName, nil];
#include "script_component.hpp"
params ["_eventName"];
private _newName = getText (configFile >> "ACE_newEvents" >> _eventName);
if (_newName != "") then {
TRACE_2("Switching Names",_eventName,_newName);
_eventName = _newName;
};
CBA_events_eventNamespace setVariable [_eventName,nil];
CBA_events_eventHashes setVariable [_eventName,nil];
ACE_DEPRECATED("ace_common_fnc_removeAllEventHandlers","3.8.0","N/A (remove events individually w/ CBA_fnc_removeEventHandler)");

View File

@ -1,23 +1,13 @@
/*
* Author: Nou
* Remove an event handler.
*
* Argument:
* 0: Event name <STRING>
* 1: Event code <NUMBER>
*
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_eventName", "_eventCodeIndex"];
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
if (isNil "_eventFunctions") exitWith {TRACE_1("eventName not found",_eventName);};
if ((_eventCodeIndex < 0) || {(count _eventFunctions) <= _eventCodeIndex}) exitWith {TRACE_2("index out of bounds",_eventName,_eventCodeIndex);};
_eventFunctions set [_eventCodeIndex, nil];
#include "script_component.hpp"
params ["_eventName", "_eventCode"];
private _newName = getText (configFile >> "ACE_newEvents" >> _eventName);
if (_newName != "") then {
TRACE_2("Switching Names",_eventName,_newName);
_eventName = _newName;
};
[_eventName, _eventCode] call CBA_fnc_removeEventHandler;
ACE_DEPRECATED("ace_common_fnc_removeEventHandler","3.8.0","CBA_fnc_removeEventHandler");

View File

@ -1,26 +1,26 @@
/*
* Author: jaynus
* Remove a synced event handler
*
* Arguments:
* 0: Name <STRING>
*
* Return Value:
* Boolean of success
*
* Public: No
*/
#include "script_component.hpp"
params ["_name"];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name);
false
};
private _data = HASH_GET(GVAR(syncedEvents),_name);
_data params ["", "", "", "_eventId"];
[_eventId] call FUNC(removeEventHandler);
HASH_REM(GVAR(syncedEvents),_name);
/*
* Author: jaynus
* Remove a synced event handler
*
* Arguments:
* 0: Name <STRING>
*
* Return Value:
* Boolean of success
*
* Public: No
*/
#include "script_component.hpp"
params ["_name"];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name);
false
};
private _data = HASH_GET(GVAR(syncedEvents),_name);
_data params ["", "", "", "_eventId"];
[_eventId] call CBA_fnc_removeEventHandler;
HASH_REM(GVAR(syncedEvents),_name);

View File

@ -1,20 +1,20 @@
/*
* Author: jaynus
* Send a request to synchronize an event name from the client->server. Execute on client only.
*
* Arguments:
* 0: eventName <STRING>
*
* Return Value:
* Boolean of success
*
* Public: No
*/
#include "script_component.hpp"
params ["_eventName"];
// Only JIP machines on initialization send this off, requesting sync on events with the serverCommand
if (isServer) exitWith {false};
["SEH_s", [_eventName, ACE_player] ] call FUNC(serverEvent);
/*
* Author: jaynus
* Send a request to synchronize an event name from the client->server. Execute on client only.
*
* Arguments:
* 0: eventName <STRING>
*
* Return Value:
* Boolean of success
*
* Public: No
*/
#include "script_component.hpp"
params ["_eventName"];
// Only JIP machines on initialization send this off, requesting sync on events with the serverCommand
if (isServer) exitWith {false};
["ACEs", [_eventName, ACE_player]] call CBA_fnc_serverEvent;

View File

@ -20,7 +20,7 @@ params ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"];
if (isPlayer _target) then {
// Pass request on to target locality for player accept/decline.
[QGVAR(receiveRequest), _target, [_caller, _target, _requestID, _requestMessage, _callBack]] call FUNC(objectEvent);
[QGVAR(receiveRequest), [_caller, _target, _requestID, _requestMessage, _callBack], _target] call CBA_fnc_targetEvent;
} else {
// accept it, since it's an AI.
[_caller, _target, true] call compile _callBack;

View File

@ -1,29 +1,13 @@
/*
* Author: Nou
* Execute a event only on the server.
*
* Argument:
* 0: Event name <STRING>
* 1: Event args <ANY>
*
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_eventName", "_eventArgs"];
#ifdef DEBUG_EVENTS
ACE_LOGINFO_1("* Server Event: %1",_eventName);
ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif
ACEg = [_eventName, _eventArgs];
if (!isServer) then {
publicVariableServer "ACEg";
} else {
["ACEg", ACEg] call FUNC(_handleNetEvent);
};
#include "script_component.hpp"
params ["_eventName", "_eventArgs"];
private _newName = getText (configFile >> "ACE_newEvents" >> _eventName);
if (_newName != "") then {
TRACE_2("Switching Names",_eventName,_newName);
_eventName = _newName;
};
[_eventName, _eventArgs] call CBA_fnc_serverEvent;
ACE_DEPRECATED("ace_common_fnc_serverEvent","3.8.0","CBA_fnc_serverEvent");

View File

@ -20,5 +20,5 @@ params [["_msg", "", [""]]];
if (isServer) then {
diag_log text _msg;
} else {
[QGVAR(serverLog), _this] call FUNC(serverEvent);
[QGVAR(serverLog), _this] call CBA_fnc_serverEvent;
};

View File

@ -78,8 +78,8 @@ if (isServer && {_broadcastChanges}) then {
publicVariable _name;
// Raise event globally, this publicizes eventual changes in _force status so clients can update it locally
["SettingChanged", [_name, _value, _force]] call FUNC(globalEvent);
["ace_settingChanged", [_name, _value, _force]] call CBA_fnc_globalEvent;
} else {
// Raise event locally
["SettingChanged", [_name, _value, _force]] call FUNC(localEvent);
["ace_settingChanged", [_name, _value, _force]] call CBA_fnc_localEvent;
};

View File

@ -3,7 +3,7 @@
* Adds a status effect that will be handled.
*
* Arguments:
* 0: Status Effect Name, this should match a corisponding event name <STRING>
* 0: Status Effect Name, this should match a corresponding event name <STRING>
* 1: Send event globaly <BOOL>
* 2: Common Effect Reaons to pre-seed durring init <ARRAY>
*
@ -30,8 +30,6 @@ GVAR(statusEffect_isGlobal) pushBack _isGlobal;
//We add reasons at any time, but more efficenet to add all common ones at one time during init
if (isServer && {!(_commonReasonsArray isEqualTo [])}) then {
//Switch case to lower:
{
_commonReasonsArray set [_forEachIndex, toLower _x];
} forEach _commonReasonsArray;
_commonReasonsArray = _commonReasonsArray apply { toLower _x };
missionNamespace setVariable [(format [QGVAR(statusEffects_%1), _name]), _commonReasonsArray, true];
};

View File

@ -4,7 +4,7 @@
*
* Arguments:
* 0: Object <OBJECT>
* 1: Effect name (or "" or send all) <STRING>
* 1: Effect name (or "" to send all) <STRING>
*
* Return Value:
* Nothing
@ -30,18 +30,13 @@ if (isNull _object) exitWith {};
//We only do anything if the effect has been defined at some point in the game for this unit
TRACE_2("checking if event is nil",_x,_effectNumber);
if (_effectNumber != -1) then {
private _eventName = format [QGVAR(%1), _x];
if (GVAR(statusEffect_isGlobal) select _forEachIndex) then {
TRACE_2("Sending Global Event", _object, _effectNumber);
[_x, [_object, _effectNumber]] call FUNC(globalEvent);
[_eventName, [_object, _effectNumber]] call CBA_fnc_globalEvent;
} else {
if (local _object) then {
//If local, send directly to bypass network delay of targetEvent call
TRACE_2("Sending Target Local Event", _object, _effectNumber);
[_x, [_object, _effectNumber]] call FUNC(localEvent);
} else {
TRACE_2("Sending Target Non-Local Event", _object, _effectNumber);
[_x, [_object], [_object, _effectNumber]] call FUNC(targetEvent);
};
TRACE_2("Sending Target Event", _object, _effectNumber);
[_eventName, [_object, _effectNumber], _object] call CBA_fnc_targetEvent;
};
};
};

View File

@ -1,26 +1,26 @@
/*
* Author: jaynus
* Call and propegate a synced event
*
* Arguments:
* 0: Name <STRING>
* 1: Arguments <ARRAY>
* 2: TTL <NUMBER, CODE> [Optional] for this specific event call
*
* Return Value:
* Boolean of success <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_name", "_args", ["_ttl", 0]];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (syncedEvent).", _name);
false
};
private _eventData = [_name, _args, _ttl];
["SEH", _eventData] call FUNC(globalEvent);
/*
* Author: jaynus
* Call and propegate a synced event
*
* Arguments:
* 0: Name <STRING>
* 1: Arguments <ARRAY>
* 2: TTL <NUMBER, CODE> [Optional] for this specific event call
*
* Return Value:
* Boolean of success <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_name", "_args", ["_ttl", 0]];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (syncedEvent).", _name);
false
};
private _eventData = [_name, _args, _ttl];
["ACEe", _eventData] call CBA_fnc_globalEvent;

View File

@ -1,62 +1,62 @@
/*
* Author: ?
*
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
if (!isServer) exitWith {false};
// Walk through the local synced events and clean up anything thats already EOL
// @TODO: This should be iteration limited to prevent FPS lag
{
private _name = _x;
private _data = HASH_GET(GVAR(syncedEvents),_name);
_data params ["_eventTime", "_eventLog", "_globalEventTTL"];
private _newEventLog = [];
// @TODO: This should be iteration limited to prevent FPS lag
{
private _eventEntry = _x;
private _ttlReturn = true;
if (_globalEventTTL isEqualType {}) then {
_ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL;
} else {
_ttlReturn = call {_globalEventTTL < 1 || {diag_tickTime < (_eventEntry select 0) + _globalEventTTL}};
};
if (_ttlReturn) then {
// Do event based TTL check
_eventEntry params ["_time", "", "_eventTTL"];
if (_eventTTL isEqualType {}) then {
_ttlReturn = [_eventTime, _eventEntry] call _eventTTL;
} else {
_ttlReturn = call {_eventTTL < 1 || {diag_tickTime < _time + _eventTTL}};
};
};
// Finally drop it if the TTL check fails
if (_ttlReturn) then {
_newEventLog pushBack _x;
};
false
} count _eventLog;
_data set [1, _newEventLog];
false
} count (GVAR(syncedEvents) select 0);
// @TODO: Next, detect if we had a new request from a JIP player, and we need to continue syncing events
/*
* Author: ?
*
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
if (!isServer) exitWith {false};
// Walk through the local synced events and clean up anything thats already EOL
// @TODO: This should be iteration limited to prevent FPS lag
{
private _name = _x;
private _data = HASH_GET(GVAR(syncedEvents),_name);
_data params ["_eventTime", "_eventLog", "_globalEventTTL"];
private _newEventLog = [];
// @TODO: This should be iteration limited to prevent FPS lag
{
private _eventEntry = _x;
private _ttlReturn = true;
if (_globalEventTTL isEqualType {}) then {
_ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL;
} else {
_ttlReturn = call {_globalEventTTL < 1 || {diag_tickTime < (_eventEntry select 0) + _globalEventTTL}};
};
if (_ttlReturn) then {
// Do event based TTL check
_eventEntry params ["_time", "", "_eventTTL"];
if (_eventTTL isEqualType {}) then {
_ttlReturn = [_eventTime, _eventEntry] call _eventTTL;
} else {
_ttlReturn = call {_eventTTL < 1 || {diag_tickTime < _time + _eventTTL}};
};
};
// Finally drop it if the TTL check fails
if (_ttlReturn) then {
_newEventLog pushBack _x;
};
false
} count _eventLog;
_data set [1, _newEventLog];
false
} count (GVAR(syncedEvents) select 0);
// @TODO: Next, detect if we had a new request from a JIP player, and we need to continue syncing events

View File

@ -1,33 +1,13 @@
/*
* Author: Nou
* Execute a event only on specific clients.
*
* Arguments:
* 0: Event name (STRING)
* 1: Event targets <OBJECT, ARRAY>
* 2: Event args <ANY>
*
* Note: If local executor is in list of targets, event will execute with
* network delay, and not immediatly.
*
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_eventName", "_eventTargets", "_eventArgs"];
#ifdef DEBUG_EVENTS
ACE_LOGINFO_2("* Target Event: %1 - %2",_eventName,_eventTargets);
ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif
ACEc = [_eventName, _eventTargets, _eventArgs];
if (!isServer) then {
publicVariableServer "ACEc";
} else {
["ACEc", ACEc] call FUNC(_handleNetEvent);
};
#include "script_component.hpp"
params ["_eventName", "_eventTargets", "_eventArgs"];
private _newName = getText (configFile >> "ACE_newEvents" >> _eventName);
if (_newName != "") then {
TRACE_2("Switching Names",_eventName,_newName);
_eventName = _newName;
};
[_eventName,_eventArgs,_eventTargets] call CBA_fnc_targetEvent;
ACE_DEPRECATED("ace_common_fnc_targetEvent","3.8.0","CBA_fnc_targetEvent");

View File

@ -1,23 +1,23 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_object", "_matrix", "_offset"];
private _origin = getPosASL _object;
_matrix params ["_xVec", "_yVec", "_zVec"];
_offset params ["_x", "_y", "_z"];
(_xVec vectorMultiply _x) vectorAdd (_yVec vectorMultiply _y) vectorAdd (_zVec vectorMultiply _z) vectorAdd _origin // return
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_object", "_matrix", "_offset"];
private _origin = getPosASL _object;
_matrix params ["_xVec", "_yVec", "_zVec"];
_offset params ["_x", "_y", "_z"];
(_xVec vectorMultiply _x) vectorAdd (_yVec vectorMultiply _y) vectorAdd (_zVec vectorMultiply _z) vectorAdd _origin // return

View File

@ -1,29 +1,29 @@
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_object", "_matrix", "_offset"];
private _origin = getPosASL _object;
_matrix params ["_xVec", "_yVec", "_zVec"];
_offset = _offset vectorDiff _origin;
_offset params ["_x", "_y", "_z"];
[
((_xVec select 0) * _x) + ((_xVec select 1) * _y) + ((_xVec select 2) * _z),
((_yVec select 0) * _x) + ((_yVec select 1) * _y) + ((_yVec select 2) * _z),
((_zVec select 0) * _x) + ((_zVec select 1) * _y) + ((_zVec select 2) * _z)
] // return
/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_object", "_matrix", "_offset"];
private _origin = getPosASL _object;
_matrix params ["_xVec", "_yVec", "_zVec"];
_offset = _offset vectorDiff _origin;
_offset params ["_x", "_y", "_z"];
[
((_xVec select 0) * _x) + ((_xVec select 1) * _y) + ((_xVec select 2) * _z),
((_yVec select 0) * _x) + ((_yVec select 1) * _y) + ((_yVec select 2) * _z),
((_zVec select 0) * _x) + ((_zVec select 1) * _y) + ((_zVec select 2) * _z)
] // return

View File

@ -28,5 +28,5 @@ if (_reason in _setHiddenReasons) then {
};
if (_setHiddenReasons isEqualTo []) then {
["hideObjectGlobal",[_unit,false]] call FUNC(serverEvent);
[QGVAR(hideObjectGlobal), [_unit,false]] call CBA_fnc_serverEvent;
};

View File

@ -26,7 +26,7 @@ if (_vehicle == _unit) exitWith {false};
if (speed _vehicle > 1 || {((getPos _vehicle) select 2) > 2}) exitWith {false};
if (!isNull _vehicle) then {
["unloadPersonEvent", [_unit], [_unit, _vehicle]] call EFUNC(common,targetEvent);
["ace_unloadPersonEvent", [_unit, _vehicle], [_unit]] call CBA_fnc_targetEvent;
};
true

View File

@ -27,7 +27,7 @@ if (count _emptyPos != 3) exitwith {
ACE_LOGWARNING_4("Could not find unload pos %1-ASL: %2 isTouchingGround: %3 Speed: %4",_vehicle, getPosASL _vehicle, isTouchingGround _vehicle, speed _vehicle);
if ((!isNull _unloader) && {[_unloader] call FUNC(isPlayer)}) then {
//display text saying there are no safe places to exit the vehicle
["displayTextStructured", [_unloader], [localize LSTRING(NoRoomToUnload)]] call FUNC(targetEvent);
[QGVAR(displayTextStructured), [localize LSTRING(NoRoomToUnload)], [_unloader]] call CBA_fnc_targetEvent;
};
false
};

View File

@ -32,4 +32,4 @@ private _speaker = _unit getVariable ["ACE_OriginalSpeaker", ""];
if (_speaker == "") exitWith {};
["setSpeaker", _unit, [_unit, _speaker]] call FUNC(targetEvent);
[QGVAR(setSpeaker), [_unit, _speaker], _unit] call CBA_fnc_targetEvent;

View File

@ -1,24 +1,24 @@
/*
* Author: jaynus
* Gets the wave height at a specific location. Uses a logic, so may be performance iffy
*
* Arguments:
* 0: Position ASL to get height at
*
* Return Value:
* Wave height in meters
*
*
* Public: No
*/
#include "script_component.hpp"
params ["_position"];
if (isNil QGVAR(waveHeightLogic)) then {
GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0];
};
GVAR(waveHeightLogic) setPosASL _position;
(getPosASLW GVAR(waveHeightLogic) select 2) - (getPosASL GVAR(waveHeightLogic) select 2)
/*
* Author: jaynus
* Gets the wave height at a specific location. Uses a logic, so may be performance iffy
*
* Arguments:
* 0: Position ASL to get height at
*
* Return Value:
* Wave height in meters
*
*
* Public: No
*/
#include "script_component.hpp"
params ["_position"];
if (isNil QGVAR(waveHeightLogic)) then {
GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0];
};
GVAR(waveHeightLogic) setPosASL _position;
(getPosASLW GVAR(waveHeightLogic) select 2) - (getPosASL GVAR(waveHeightLogic) select 2)

View File

@ -1,74 +1,74 @@
/*
* Author: zGuba 2011
* Function helper for framing objects on screen.
*
* Arguments:
* 0: object <OBJECT>
* 1: margins 3D <ARRAY>
* 0: X <NUMBER>
* 1: Y <NUMBER>
* 2: Z <NUMBER>
* 2: offset 3D <ARRAY>
* 0: X <NUMBER>
* 1: Y <NUMBER>
* 2: Z <NUMBER>
*
* Return Value:
* 0: Minimal X <NUMMBER>
* 1: Minimal Y <NUMMBER>
* 2: Maximal X <NUMMBER>
* 3: Maximal Y <NUMMBER>
*
* Public: No
*/
#include "script_component.hpp"
params ["_object", "_margins", "_offsets"];
private _minX = 10;
private _minY = 10;
private _maxX = -10;
private _maxY = -10;
private _bounds = boundingBox _object;
_margins params ["_marginsX", "_marginsY", "_marginsZ"];
_offsets params ["_offsetsX", "_offsetsY", "_offsetsZ"];
_bounds params ["_boundsMin", "_boundsMax"];
_boundsMin params ["_boundsMinX", "_boundsMinY", "_boundsMinZ"];
_boundsMax params ["_boundsMaxX", "_boundsMaxY", "_boundsMaxZ"];
_boundsMinX = _boundsMinX - _marginsX + _offsetsX;
_boundsMinY = _boundsMinY - _marginsY + _offsetsY;
_boundsMinZ = _boundsMinZ - _marginsZ + _offsetsZ;
_boundsMaxX = _boundsMaxX + _marginsX + _offsetsX;
_boundsMaxY = _boundsMaxY + _marginsY + _offsetsY;
_boundsMaxZ = _boundsMaxZ + _marginsZ + _offsetsZ;
private _boundsCorners = [
[_boundsMinX, _boundsMinY, _boundsMinZ],
[_boundsMinX, _boundsMinY, _boundsMaxZ],
[_boundsMinX, _boundsMaxY, _boundsMinZ],
[_boundsMinX, _boundsMaxY, _boundsMaxZ],
[_boundsMaxX, _boundsMinY, _boundsMinZ],
[_boundsMaxX, _boundsMinY, _boundsMaxZ],
[_boundsMaxX, _boundsMaxY, _boundsMinZ],
[_boundsMaxX, _boundsMaxY, _boundsMaxZ]
];
{
private _ppos = worldToScreen (_object modelToWorld _x);
if (count _ppos >= 2) then {
_ppos params ["_pposX", "_pposY"];
if (_pposX < _minX) then {_minX = _pposX};
if (_pposX > _maxX) then {_maxX = _pposX};
if (_pposY < _minY) then {_minY = _pposY};
if (_pposY > _maxY) then {_maxY = _pposY};
}; //else - what to do if it is offscreen?
false
} count _boundsCorners;
[_minX, _minY, _maxX, _maxY]
/*
* Author: zGuba 2011
* Function helper for framing objects on screen.
*
* Arguments:
* 0: object <OBJECT>
* 1: margins 3D <ARRAY>
* 0: X <NUMBER>
* 1: Y <NUMBER>
* 2: Z <NUMBER>
* 2: offset 3D <ARRAY>
* 0: X <NUMBER>
* 1: Y <NUMBER>
* 2: Z <NUMBER>
*
* Return Value:
* 0: Minimal X <NUMMBER>
* 1: Minimal Y <NUMMBER>
* 2: Maximal X <NUMMBER>
* 3: Maximal Y <NUMMBER>
*
* Public: No
*/
#include "script_component.hpp"
params ["_object", "_margins", "_offsets"];
private _minX = 10;
private _minY = 10;
private _maxX = -10;
private _maxY = -10;
private _bounds = boundingBox _object;
_margins params ["_marginsX", "_marginsY", "_marginsZ"];
_offsets params ["_offsetsX", "_offsetsY", "_offsetsZ"];
_bounds params ["_boundsMin", "_boundsMax"];
_boundsMin params ["_boundsMinX", "_boundsMinY", "_boundsMinZ"];
_boundsMax params ["_boundsMaxX", "_boundsMaxY", "_boundsMaxZ"];
_boundsMinX = _boundsMinX - _marginsX + _offsetsX;
_boundsMinY = _boundsMinY - _marginsY + _offsetsY;
_boundsMinZ = _boundsMinZ - _marginsZ + _offsetsZ;
_boundsMaxX = _boundsMaxX + _marginsX + _offsetsX;
_boundsMaxY = _boundsMaxY + _marginsY + _offsetsY;
_boundsMaxZ = _boundsMaxZ + _marginsZ + _offsetsZ;
private _boundsCorners = [
[_boundsMinX, _boundsMinY, _boundsMinZ],
[_boundsMinX, _boundsMinY, _boundsMaxZ],
[_boundsMinX, _boundsMaxY, _boundsMinZ],
[_boundsMinX, _boundsMaxY, _boundsMaxZ],
[_boundsMaxX, _boundsMinY, _boundsMinZ],
[_boundsMaxX, _boundsMinY, _boundsMaxZ],
[_boundsMaxX, _boundsMaxY, _boundsMinZ],
[_boundsMaxX, _boundsMaxY, _boundsMaxZ]
];
{
private _ppos = worldToScreen (_object modelToWorld _x);
if (count _ppos >= 2) then {
_ppos params ["_pposX", "_pposY"];
if (_pposX < _minX) then {_minX = _pposX};
if (_pposX > _maxX) then {_maxX = _pposX};
if (_pposY < _minY) then {_minY = _pposY};
if (_pposY > _maxY) then {_maxY = _pposY};
}; //else - what to do if it is offscreen?
false
} count _boundsCorners;
[_minX, _minY, _maxX, _maxY]

View File

@ -1,13 +1,13 @@
#include "\z\ace\addons\common\script_component.hpp"
#define VALIDHASH(hash) (IS_ARRAY(hash) && {(count hash) >= 2} && {IS_ARRAY(hash select 0)} && {IS_ARRAY(hash select 1)})
#define ERROR(msg) throw msg + format[" @ %1:%2", _callFrom, _lineNo]
#define HANDLECATCH diag_log text _exception; assert(exception=="")
#define ERRORDATA(c) private ["_callFrom", "_lineNo"];\
_callFrom = "";\
_lineNo = -1;\
if((count _this) > c) then {\
_callFrom = _this select c;\
_lineNo = _this select c+1;\
};
#include "\z\ace\addons\common\script_component.hpp"
#define VALIDHASH(hash) (IS_ARRAY(hash) && {(count hash) >= 2} && {IS_ARRAY(hash select 0)} && {IS_ARRAY(hash select 1)})
#define ERROR(msg) throw msg + format[" @ %1:%2", _callFrom, _lineNo]
#define HANDLECATCH diag_log text _exception; assert(exception=="")
#define ERRORDATA(c) private ["_callFrom", "_lineNo"];\
_callFrom = "";\
_lineNo = -1;\
if((count _this) > c) then {\
_callFrom = _this select c;\
_lineNo = _this select c+1;\
};

View File

@ -100,7 +100,7 @@ if (!isServer) then {
_error = _error call _fnc_cutComma;
diag_log text _error;
[QGVAR(systemChatGlobal), _error] call FUNC(globalEvent);
[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent;
};
_missingAddonServer = false;
@ -117,7 +117,7 @@ if (!isServer) then {
_error = _error call _fnc_cutComma;
diag_log text _error;
[QGVAR(systemChatGlobal), _error] call FUNC(globalEvent);
[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent;
};
_oldVersionClient = false;
@ -134,7 +134,7 @@ if (!isServer) then {
_error = _error call _fnc_cutComma;
diag_log text _error;
[QGVAR(systemChatGlobal), _error] call FUNC(globalEvent);
[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent;
};
_oldVersionServer = false;
@ -151,7 +151,7 @@ if (!isServer) then {
_error = _error call _fnc_cutComma;
diag_log text _error;
[QGVAR(systemChatGlobal), _error] call FUNC(globalEvent);
[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent;
};
ACE_Version_ClientErrors = [_missingAddon, _missingAddonServer, _oldVersionClient, _oldVersionServer];

View File

@ -1 +0,0 @@
#include "\z\ace\addons\common\script_component.hpp"

View File

@ -1,78 +0,0 @@
// ----------------------------------------------------------------------------
#define DEBUG_MODE_FULL
#include "script_component.hpp"
#ifndef TEST_DEFINED_AND_OP
if (true) exitWith {};
#endif
// ----------------------------------------------------------------------------
LOG('Testing EventHandlers');
TEST_DEFINED(QFUNC(_handleNetEvent),"");
TEST_DEFINED(QFUNC(addEventHandler),"");
TEST_DEFINED(QFUNC(localEvent),"");
TEST_DEFINED(QFUNC(targetEvent),"");
TEST_DEFINED(QFUNC(globalEvent),"");
TEST_DEFINED(QFUNC(serverEvent),"");
TEST_DEFINED(QFUNC(removeAllEventHandlers),"");
TEST_DEFINED(QFUNC(removeEventHandler),"");
private _result = ["A", {}] call ace_common_fnc_addEventHandler;
private _expected = 0;
TEST_DEFINED_AND_OP(_result,==,_expected,"Adding first A EH");
_result = ["A", {GVAR(test_A2) = _this}] call ace_common_fnc_addEventHandler;
_expected = 1;
TEST_DEFINED_AND_OP(_result,==,_expected,"Adding second A EH");
_result = ["A", {GVAR(test_A3) = _this}] call ace_common_fnc_addEventHandler;
_expected = 2;
TEST_DEFINED_AND_OP(_result,==,_expected,"Adding third A EH");
GVAR(test_A2) = -1;
["A", 11] call FUNC(localEvent);
_expected = 11;
_result = GVAR(test_A2);
TEST_DEFINED_AND_OP(_result,==,_expected,"Test Local Event");
//Remove 2nd EH
["A", 1] call FUNC(removeEventHandler);
GVAR(test_A2) = -1;
GVAR(test_A3) = -1;
["A", 22] call FUNC(localEvent);
_expected = -1;
_result = GVAR(test_A2);
TEST_DEFINED_AND_OP(_result,==,_expected,"Test 2nd (removed) EH");
_expected = 22;
_result = GVAR(test_A3);
TEST_DEFINED_AND_OP(_result,==,_expected,"Test 3rd Event");
//Remove All EH:
["A"] call FUNC(removeAllEventHandlers);
GVAR(test_A3) = -1;
["A", 77] call FUNC(localEvent);
_expected = -1;
_result = GVAR(test_A3);
TEST_DEFINED_AND_OP(_result,==,_expected,"Test 3rd is removed after removeAll");
//Much harder to test network events
TRACE_2("testing network events",isServer,isDedicated);
["B", {GVAR(test_B) = _this}] call ace_common_fnc_addEventHandler;
GVAR(test_B) = -1;
["B", 33] call FUNC(globalEvent);
_expected = 33;
_result = GVAR(test_B);
TEST_DEFINED_AND_OP(_result,==,_expected,"Test globalEvent");
GVAR(test_B) = -1;
["B", 44] call FUNC(serverEvent);
_expected = if (isServer) then {44} else {-1};
_result = GVAR(test_B);
TEST_DEFINED_AND_OP(_result,==,_expected,"Test serverEvent");

View File

@ -4,10 +4,10 @@ GVAR(placer) = objNull;
GVAR(deployPFH) = -1;
// Deploy concertina wire if interact menu is opened
["interactMenuOpened", {
["ace_interactMenuOpened", {
if (GVAR(deployPFH) != -1) then {
GVAR(placer) setVariable [QGVAR(wireDeployed), true];
};
}] call EFUNC(common,addEventHandler);
}] call CBA_fnc_addEventHandler;
[QGVAR(vehicleDamage), {_this call FUNC(vehicleDamage)}] call EFUNC(common,addEventHandler);
[QGVAR(vehicleDamage), {_this call FUNC(vehicleDamage)}] call CBA_fnc_addEventHandler;

View File

@ -14,4 +14,8 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "CfgVehicles.hpp"
class ACE_newEvents {
interactMenuOpened = "ace_interactMenuOpened";
};

View File

@ -34,4 +34,4 @@ if (_distance > 14 || {_distance < 2}) exitWith {}; // Fix if shooting wire
_vehicle = vehicle _killer;
[QGVAR(vehicleDamage), [_vehicle], [_wire, _vehicle]] call EFUNC(common,targetEvent);
[QGVAR(vehicleDamage), [_wire, _vehicle], [_vehicle]] call CBA_fnc_targetEvent;

Some files were not shown because too many files have changed in this diff Show More