diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index 7263970fb1..96aef4a93d 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -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); diff --git a/addons/atragmx/XEH_postInit.sqf b/addons/atragmx/XEH_postInit.sqf index 8d4907523b..82f3c25aeb 100644 --- a/addons/atragmx/XEH_postInit.sqf +++ b/addons/atragmx/XEH_postInit.sqf @@ -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; diff --git a/addons/atragmx/config.cpp b/addons/atragmx/config.cpp index db1b85b761..4bbde93706 100644 --- a/addons/atragmx/config.cpp +++ b/addons/atragmx/config.cpp @@ -17,3 +17,7 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" #include "RscTitles.hpp" + +class ACE_newEvents { + RangerfinderData = QEGVAR(vector,rangefinderData); +}; diff --git a/addons/attach/XEH_clientInit.sqf b/addons/attach/XEH_clientInit.sqf index f7e663c2ae..feb7216e6b 100644 --- a/addons/attach/XEH_clientInit.sqf +++ b/addons/attach/XEH_clientInit.sqf @@ -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; diff --git a/addons/attach/config.cpp b/addons/attach/config.cpp index 4c06adc3eb..59f733f9ea 100644 --- a/addons/attach/config.cpp +++ b/addons/attach/config.cpp @@ -18,3 +18,7 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" #include "GUI_VirtualAmmo.hpp" + +class ACE_newEvents { + interactMenuOpened = "ace_interactMenuOpened"; +}; \ No newline at end of file diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 42bfe44dbc..cf80e74b1c 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -40,7 +40,7 @@ _onAtachText = format [localize LSTRING(Item_Attached), _onAtachText]; if (_unit == _attachToVehicle) then { //Self Attachment _attachedItem = _itemVehClass createVehicle [0,0,0]; - _attachedItem attachTo [_unit, [-0.05, 0, 0.12], "rightshoulder"]; + _attachedItem attachTo [_unit, [0.05, -0.09, 0.1], "leftshoulder"]; if (!_silentScripted) then { _unit removeItem _itemClassname; // Remove item [_onAtachText] call EFUNC(common,displayTextStructured); diff --git a/addons/backpacks/XEH_postInit.sqf b/addons/backpacks/XEH_postInit.sqf index 375fcd5f89..de5ffa4bee 100644 --- a/addons/backpacks/XEH_postInit.sqf +++ b/addons/backpacks/XEH_postInit.sqf @@ -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; diff --git a/addons/backpacks/config.cpp b/addons/backpacks/config.cpp index 278e3ac452..5328a1e4ee 100644 --- a/addons/backpacks/config.cpp +++ b/addons/backpacks/config.cpp @@ -14,3 +14,7 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" + +class ACE_newEvents { + backpackOpened = "ace_backpackOpened"; +}; diff --git a/addons/backpacks/functions/fnc_onOpenInventory.sqf b/addons/backpacks/functions/fnc_onOpenInventory.sqf index d9a99535eb..0857f6b7ab 100644 --- a/addons/backpacks/functions/fnc_onOpenInventory.sqf +++ b/addons/backpacks/functions/fnc_onOpenInventory.sqf @@ -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 diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index 567a107697..9709508fa2 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -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 {}; diff --git a/addons/captives/config.cpp b/addons/captives/config.cpp index a73b604fb2..883fbebe32 100644 --- a/addons/captives/config.cpp +++ b/addons/captives/config.cpp @@ -18,4 +18,12 @@ class CfgPatches { #include "CfgMoves.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" -#include "CfgEden.hpp" \ No newline at end of file +#include "CfgEden.hpp" + +class ACE_newEvents { + SetSurrendered = QGVAR(setSurrendered); + SetHandcuffed = QGVAR(setHandcuffed); + MoveOutCaptive = QGVAR(moveOutCaptive); + MoveInCaptive = QGVAR(moveInCaptive); + CaptiveStatusChanged = "ace_captiveStatusChanged"; +}; diff --git a/addons/captives/functions/fnc_doApplyHandcuffs.sqf b/addons/captives/functions/fnc_doApplyHandcuffs.sqf index 21bfe58747..d80ffc40a1 100644 --- a/addons/captives/functions/fnc_doApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_doApplyHandcuffs.sqf @@ -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"; diff --git a/addons/captives/functions/fnc_doLoadCaptive.sqf b/addons/captives/functions/fnc_doLoadCaptive.sqf index a4d7df8892..2a8bc055ec 100644 --- a/addons/captives/functions/fnc_doLoadCaptive.sqf +++ b/addons/captives/functions/fnc_doLoadCaptive.sqf @@ -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; diff --git a/addons/captives/functions/fnc_doRemoveHandcuffs.sqf b/addons/captives/functions/fnc_doRemoveHandcuffs.sqf index 681b698de3..7f445440ba 100644 --- a/addons/captives/functions/fnc_doRemoveHandcuffs.sqf +++ b/addons/captives/functions/fnc_doRemoveHandcuffs.sqf @@ -17,4 +17,4 @@ params ["_unit", "_target"]; -["SetHandcuffed", [_target], [_target, false]] call EFUNC(common,targetEvent); +[QGVAR(setHandcuffed), [_target, false], [_target]] call CBA_fnc_targetEvent; diff --git a/addons/captives/functions/fnc_doUnloadCaptive.sqf b/addons/captives/functions/fnc_doUnloadCaptive.sqf index 46ba618010..fd4375e4b7 100644 --- a/addons/captives/functions/fnc_doUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_doUnloadCaptive.sqf @@ -18,4 +18,4 @@ params ["_unit", "_target"]; -["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent); +[QGVAR(moveOutCaptive), [_target], [_target]] call CBA_fnc_targetEvent; diff --git a/addons/captives/functions/fnc_handleOnUnconscious.sqf b/addons/captives/functions/fnc_handleOnUnconscious.sqf index ca6362d3da..456161d9de 100644 --- a/addons/captives/functions/fnc_handleOnUnconscious.sqf +++ b/addons/captives/functions/fnc_handleOnUnconscious.sqf @@ -1,6 +1,6 @@ /* * Author: commy2, PabstMirror - * Handles the "medical_onUnconscious" event + * Handles the "ace_unconscious" event * * Arguments: * 0: Unit diff --git a/addons/captives/functions/fnc_moduleHandcuffed.sqf b/addons/captives/functions/fnc_moduleHandcuffed.sqf index 9d3079262a..b2e0b431b3 100644 --- a/addons/captives/functions/fnc_moduleHandcuffed.sqf +++ b/addons/captives/functions/fnc_moduleHandcuffed.sqf @@ -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; diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf index a15d2e4165..c4482ce904 100644 --- a/addons/captives/functions/fnc_moduleSurrender.sqf +++ b/addons/captives/functions/fnc_moduleSurrender.sqf @@ -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; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index 58291d0689..4fbedaef87 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -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; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 6fc4c7b9ab..ba7468da0d 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -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; diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index f3789d641f..eeee387018 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -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; diff --git a/addons/cargo/config.cpp b/addons/cargo/config.cpp index 860eff0d99..1980fe207d 100644 --- a/addons/cargo/config.cpp +++ b/addons/cargo/config.cpp @@ -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"; +}; diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf index 5e01214934..bc179b8912 100644 --- a/addons/cargo/functions/fnc_addCargoItem.sqf +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -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; diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index 7e19b0acd0..64ed4c4273 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -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")); }; diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index 443143ece0..6e9bf4cc9d 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -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 diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index 6fcd3cf62c..86ab85b701 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -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 diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index 46a69e737f..da493e5f96 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -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); }; diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index 8bd18f989e..35c9075614 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -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); diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index e3cb368362..6a4cf5acfb 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -176,6 +176,7 @@ Hacer objeto cargable Rendre l'objet chargeable Vytvořit objekt nakladatelným + Fazer objeto carregável Sets the synced object as loadable by the cargo system. @@ -185,6 +186,7 @@ Sincronizar un objecto para hacerlo cargable. Rend l'objet synchronisé comme chargeable par le système de cargaison. Nastaví synchronizované objekty nakladatelnými za pomocí Nákladního systému. + Seta o objeto sincronizado como carregável Object's Size @@ -194,6 +196,7 @@ Tamaño del objeto Taille de l'objet Velikost objektu + Tamanho do objeto \ No newline at end of file diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp index 32bc0b698f..97d4b325e9 100644 --- a/addons/common/RscInfoType.hpp +++ b/addons/common/RscInfoType.hpp @@ -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;); }; }; diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index 857a754f6a..0af9fa0ab9 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -236,7 +236,6 @@ PREP(dumpPerformanceCounters); PREP(dumpArray); PREP(globalEvent); -PREP(_handleNetEvent); PREP(addEventHandler); PREP(objectEvent); PREP(targetEvent); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index bedec4f3aa..93589bb7f5 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -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,46 +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 CBA_fnc_addEventHandler; +[QGVAR(receiveRequest), FUNC(receiveRequest)] call CBA_fnc_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); + [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; }; @@ -132,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; @@ -181,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 [{ @@ -217,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 @@ -233,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; @@ -266,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 { @@ -281,7 +294,7 @@ enableCamShake true; if (alive _oldPlayer) then { [_oldPlayer] call FUNC(setName); }; -}] call FUNC(addEventhandler); +}] call CBA_fnc_addEventHandler; ////////////////////////////////////////////////// @@ -313,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 @@ -321,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 @@ -329,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 @@ -337,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 @@ -369,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; }; }; @@ -378,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 @@ -386,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 @@ -394,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 @@ -402,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); @@ -413,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; ////////////////////////////////////////////////// @@ -462,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; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 0c2922ea64..0f0657c4ab 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -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"); diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 2cf6dd4ec9..0210634ee8 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -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" diff --git a/addons/common/functions/fnc__handleNetEvent.sqf b/addons/common/functions/fnc__handleNetEvent.sqf deleted file mode 100644 index 89814de12f..0000000000 --- a/addons/common/functions/fnc__handleNetEvent.sqf +++ /dev/null @@ -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; - }; -}; diff --git a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf index dbc4febbbf..14d17ae118 100644 --- a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf +++ b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf @@ -18,7 +18,7 @@ params ["_client"]; private _eventEntry = HASH_GET(GVAR(syncedEvents),_x); _eventEntry params ["", "_eventLog"]; - ["SEH_s", _client, [_x, _eventLog]] call FUNC(targetEvent); + ["ACEs", [_x, _eventLog], _client] call CBA_fnc_targetEvent; false } count (GVAR(syncedEvents) select 0); diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf index 36db271cb2..2b239ea056 100644 --- a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -30,7 +30,7 @@ if (isServer) then { private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName); _eventEntry params ["", "_eventLog"]; - ["SEH_s", _client, [_eventName, _eventLog]] call FUNC(targetEvent); + ["ACEs", [_eventName, _eventLog], _client] call CBA_fnc_targetEvent; } else { params ["_eventName", "_eventLog"]; diff --git a/addons/common/functions/fnc_addEventHandler.sqf b/addons/common/functions/fnc_addEventHandler.sqf index a81b330727..6ded410c87 100644 --- a/addons/common/functions/fnc_addEventHandler.sqf +++ b/addons/common/functions/fnc_addEventHandler.sqf @@ -1,25 +1,14 @@ -/* - * Author: Nou - * Add an event handler. - * - * Arguments: - * 0: Event name - * 1: Event code - * - * Return Value: - * Event handler ID number (for use with fnc_removeEventHandler) - * - * Public: Yes - */ +#define DEBUG_MODE_FULL #include "script_component.hpp" params ["_eventName", "_eventCode"]; -private _eventFunctions = GVAR(eventsLocation) getVariable _eventName; - -if (isNil "_eventFunctions") then { - _eventFunctions = []; - GVAR(eventsLocation) setVariable [_eventName, _eventFunctions]; +private _newName = getText (configFile >> "ACE_newEvents" >> _eventName); +if (_newName != "") then { + TRACE_2("Switching Names",_eventName,_newName); + _eventName = _newName; }; -_eventFunctions pushBack _eventCode // Return event function count +[_eventName, _eventCode] call CBA_fnc_addEventHandler; + +ACE_DEPRECATED("ace_common_fnc_addEventHandler","3.8.0","CBA_fnc_addEventHandler"); diff --git a/addons/common/functions/fnc_addSetting.sqf b/addons/common/functions/fnc_addSetting.sqf index 0cf25b860a..c4b97ddcce 100644 --- a/addons/common/functions/fnc_addSetting.sqf +++ b/addons/common/functions/fnc_addSetting.sqf @@ -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; diff --git a/addons/common/functions/fnc_addSyncedEventHandler.sqf b/addons/common/functions/fnc_addSyncedEventHandler.sqf index 9d8c23de3c..0481f7d11f 100644 --- a/addons/common/functions/fnc_addSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_addSyncedEventHandler.sqf @@ -24,7 +24,7 @@ if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { false }; -private _eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); +private _eventId = [_name, FUNC(_handleSyncedEvent)] call CBA_fnc_addEventHandler; private _data = [_handler, [], _ttl, _eventId]; HASH_SET(GVAR(syncedEvents),_name,_data); diff --git a/addons/common/functions/fnc_assignedItemFix.sqf b/addons/common/functions/fnc_assignedItemFix.sqf index 18dd6b4e0c..4604e1b987 100644 --- a/addons/common/functions/fnc_assignedItemFix.sqf +++ b/addons/common/functions/fnc_assignedItemFix.sqf @@ -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; diff --git a/addons/common/functions/fnc_cachedCall.sqf b/addons/common/functions/fnc_cachedCall.sqf index 6160dfd090..8ff6744a54 100644 --- a/addons/common/functions/fnc_cachedCall.sqf +++ b/addons/common/functions/fnc_cachedCall.sqf @@ -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 diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf index 6d786aebf4..1328624a0c 100644 --- a/addons/common/functions/fnc_checkPBOs.sqf +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -61,7 +61,8 @@ if (!isServer) then { _error = _error + "Newer version; "; }; - //[_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + //[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent; + ACE_LOGERROR(_error); if (_mode < 2) then { diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf index cc514a2a6f..214de6052b 100644 --- a/addons/common/functions/fnc_claim.sqf +++ b/addons/common/functions/fnc_claim.sqf @@ -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; }; }; diff --git a/addons/common/functions/fnc_displayTextPicture.sqf b/addons/common/functions/fnc_displayTextPicture.sqf index a0bcb47e11..9ddbf96164 100644 --- a/addons/common/functions/fnc_displayTextPicture.sqf +++ b/addons/common/functions/fnc_displayTextPicture.sqf @@ -5,17 +5,22 @@ * Arguments: * 0: Text * 1: Image - * 2: Image color (default: [0, 0, 0, 0]) - * 3: Target Unit. Will only display if target is the player controlled object (default: ACE_player) + * 2: Image color (default: [1, 1, 1]) + * 3: Target Unit. Will only display if target is the player controlled object (default: ACE_player) + * 4: Size (default: 2) * * Return Value: * None * + * Example: + * ["text", "image", [1, 1, 1], ACE_player, 2] call ace_common_fnc_displayTextPicture + * ["text", "image", nil, nil, 3] call ace_common_fnc_displayTextPicture + * * Public: Yes */ #include "script_component.hpp" -params ["_text", "_image", ["_imageColor", [1,1,1]], ["_target", ACE_player]]; +params [["_text", ""], ["_image", "", [""]], ["_imageColor", [1,1,1], [[]]], ["_target", ACE_player, [objNull]], ["_size", 2, [0]]]; if (_target != ACE_player) exitWith {}; @@ -39,6 +44,6 @@ if (typeName _text != "TEXT") then { _text = parseText format ["%1", _text]; }; -_text = composeText [parseText format ["", _image, _imageColor call BIS_fnc_colorRGBtoHTML], lineBreak, _text]; +_text = composeText [parseText format ["", _image, _imageColor call BIS_fnc_colorRGBtoHTML], lineBreak, _text]; -[_text, 2] call FUNC(displayTextStructured); +[_text, _size] call FUNC(displayTextStructured); diff --git a/addons/common/functions/fnc_displayTextStructured.sqf b/addons/common/functions/fnc_displayTextStructured.sqf index 9fff7bb056..e952fce9a4 100644 --- a/addons/common/functions/fnc_displayTextStructured.sqf +++ b/addons/common/functions/fnc_displayTextStructured.sqf @@ -4,17 +4,20 @@ * * Arguments: * 0: Text - * 1: Size of the textbox (default: 1.5) - * 2: Target Unit. Will only display if target is the player controlled object (default: ACE_player) + * 1: Size of the textbox (default: 1.5) + * 2: Target Unit. Will only display if target is the player controlled object (default: ACE_player) * * Return Value: * None * + * Example: + * + * * Public: Yes */ #include "script_component.hpp" -params ["_text", ["_size", 1.5], ["_target", ACE_player]]; +params [["_text", ""], ["_size", 1.5, [0]], ["_target", ACE_player, [objNull]]]; if (_target != ACE_player) exitWith {}; diff --git a/addons/common/functions/fnc_doAnimation.sqf b/addons/common/functions/fnc_doAnimation.sqf index bfd50b08b8..720518d003 100644 --- a/addons/common/functions/fnc_doAnimation.sqf +++ b/addons/common/functions/fnc_doAnimation.sqf @@ -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 {}; diff --git a/addons/common/functions/fnc_firedEH.sqf b/addons/common/functions/fnc_firedEH.sqf index d70f0a8650..488766faff 100644 --- a/addons/common/functions/fnc_firedEH.sqf +++ b/addons/common/functions/fnc_firedEH.sqf @@ -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; }; }; }; diff --git a/addons/common/functions/fnc_fixFloating.sqf b/addons/common/functions/fnc_fixFloating.sqf index 1d8da1c8a4..5a00aa3863 100644 --- a/addons/common/functions/fnc_fixFloating.sqf +++ b/addons/common/functions/fnc_fixFloating.sqf @@ -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; diff --git a/addons/common/functions/fnc_globalEvent.sqf b/addons/common/functions/fnc_globalEvent.sqf index 69bfc210b1..b58a0f092c 100644 --- a/addons/common/functions/fnc_globalEvent.sqf +++ b/addons/common/functions/fnc_globalEvent.sqf @@ -1,21 +1,14 @@ -/* - * Author: Nou - * Execute a global event on all clients, including self. - * - * Arguments: - * 0: Event name - * 1: Event args - * - * Return Value: - * None - * - * Public: Yes - */ +#define DEBUG_MODE_FULL #include "script_component.hpp" params ["_eventName", "_eventArgs"]; -ACEg = [_eventName, _eventArgs]; -publicVariable "ACEg"; +private _newName = getText (configFile >> "ACE_newEvents" >> _eventName); +if (_newName != "") then { + TRACE_2("Switching Names",_eventName,_newName); + _eventName = _newName; +}; -["ACEg", ACEg] call FUNC(_handleNetEvent); +[_eventName, _eventArgs] call CBA_fnc_globalEvent; + +ACE_DEPRECATED("ace_common_fnc_globalEvent","3.8.0","CBA_fnc_globalEvent"); diff --git a/addons/common/functions/fnc_goKneeling.sqf b/addons/common/functions/fnc_goKneeling.sqf index 4ee502f929..9e7aed708a 100644 --- a/addons/common/functions/fnc_goKneeling.sqf +++ b/addons/common/functions/fnc_goKneeling.sqf @@ -1,6 +1,6 @@ /* * Author: commy2 - * Move unit to kneeling position. + * Move unit to kneeling position (only if not yet prone). * * Arguments: * 0: Unit @@ -14,7 +14,8 @@ params ["_unit"]; -if (stance _unit == "PRONE") exitWith {}; +// Animation changes even inside vehicle post-1.60 +if (stance _unit == "PRONE" || {vehicle ACE_player != ACE_player}) exitWith {}; [ _unit, diff --git a/addons/common/functions/fnc_headBugFix.sqf b/addons/common/functions/fnc_headBugFix.sqf index dffb28ff4b..07a1652b1b 100644 --- a/addons/common/functions/fnc_headBugFix.sqf +++ b/addons/common/functions/fnc_headBugFix.sqf @@ -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}; diff --git a/addons/common/functions/fnc_hideUnit.sqf b/addons/common/functions/fnc_hideUnit.sqf index 85636a08f7..e0adb201c3 100644 --- a/addons/common/functions/fnc_hideUnit.sqf +++ b/addons/common/functions/fnc_hideUnit.sqf @@ -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; }; diff --git a/addons/common/functions/fnc_loadPerson.sqf b/addons/common/functions/fnc_loadPerson.sqf index 6c728134d1..f8a4456b96 100644 --- a/addons/common/functions/fnc_loadPerson.sqf +++ b/addons/common/functions/fnc_loadPerson.sqf @@ -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 diff --git a/addons/common/functions/fnc_localEvent.sqf b/addons/common/functions/fnc_localEvent.sqf index fa7c721a98..fb473b75b8 100644 --- a/addons/common/functions/fnc_localEvent.sqf +++ b/addons/common/functions/fnc_localEvent.sqf @@ -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; +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"); diff --git a/addons/common/functions/fnc_muteUnit.sqf b/addons/common/functions/fnc_muteUnit.sqf index d4648155b6..11c18aedd7 100644 --- a/addons/common/functions/fnc_muteUnit.sqf +++ b/addons/common/functions/fnc_muteUnit.sqf @@ -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]; diff --git a/addons/common/functions/fnc_muteUnitHandleInitPost.sqf b/addons/common/functions/fnc_muteUnitHandleInitPost.sqf index 8c5967b0d3..53e8d4d5b7 100644 --- a/addons/common/functions/fnc_muteUnitHandleInitPost.sqf +++ b/addons/common/functions/fnc_muteUnitHandleInitPost.sqf @@ -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; }; diff --git a/addons/common/functions/fnc_muteUnitHandleRespawn.sqf b/addons/common/functions/fnc_muteUnitHandleRespawn.sqf index a1a64eada3..ceb0614116 100644 --- a/addons/common/functions/fnc_muteUnitHandleRespawn.sqf +++ b/addons/common/functions/fnc_muteUnitHandleRespawn.sqf @@ -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; diff --git a/addons/common/functions/fnc_objectEvent.sqf b/addons/common/functions/fnc_objectEvent.sqf index 2015ad77dc..21ba60b802 100644 --- a/addons/common/functions/fnc_objectEvent.sqf +++ b/addons/common/functions/fnc_objectEvent.sqf @@ -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 - * 2: Event args - * - * 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"); diff --git a/addons/common/functions/fnc_onAnswerRequest.sqf b/addons/common/functions/fnc_onAnswerRequest.sqf index d88969b059..8c77719256 100644 --- a/addons/common/functions/fnc_onAnswerRequest.sqf +++ b/addons/common/functions/fnc_onAnswerRequest.sqf @@ -20,7 +20,7 @@ if (!isNil "_info") then { _info params ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; private _replyParams = [_info, _accepted]; - [_replyParams, QFUNC(requestCallback), _caller, false] call FUNC(execRemoteFnc); + [QGVAR(requestCallback), _replyParams, _caller] call CBA_fnc_targetEvent; _unit setVariable [_id, nil]; }; diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index d8503f5223..7103dd08e4 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -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; }; diff --git a/addons/common/functions/fnc_removeAllEventHandlers.sqf b/addons/common/functions/fnc_removeAllEventHandlers.sqf index 5266c4554f..958923f808 100644 --- a/addons/common/functions/fnc_removeAllEventHandlers.sqf +++ b/addons/common/functions/fnc_removeAllEventHandlers.sqf @@ -1,17 +1,14 @@ -/* - * Author: Nou - * Remove all events of a certain event type. - * - * Argument: - * 0: Event name - * - * Return Value: - * None - * - * Public: Yes - */ #include "script_component.hpp" params ["_eventName"]; -GVAR(eventsLocation) setVariable [_eventName, nil]; +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)"); diff --git a/addons/common/functions/fnc_removeEventHandler.sqf b/addons/common/functions/fnc_removeEventHandler.sqf index bedb99ed02..ff89571a6e 100644 --- a/addons/common/functions/fnc_removeEventHandler.sqf +++ b/addons/common/functions/fnc_removeEventHandler.sqf @@ -1,23 +1,13 @@ -/* - * Author: Nou - * Remove an event handler. - * - * Argument: - * 0: Event name - * 1: Event code - * - * Return Value: - * None - * - * Public: Yes - */ #include "script_component.hpp" -params ["_eventName", "_eventCodeIndex"]; +params ["_eventName", "_eventCode"]; -private _eventFunctions = GVAR(eventsLocation) getVariable _eventName; +private _newName = getText (configFile >> "ACE_newEvents" >> _eventName); +if (_newName != "") then { + TRACE_2("Switching Names",_eventName,_newName); + _eventName = _newName; +}; -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);}; +[_eventName, _eventCode] call CBA_fnc_removeEventHandler; -_eventFunctions set [_eventCodeIndex, nil]; +ACE_DEPRECATED("ace_common_fnc_removeEventHandler","3.8.0","CBA_fnc_removeEventHandler"); diff --git a/addons/common/functions/fnc_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf index 4190de5e1b..d3d94aa421 100644 --- a/addons/common/functions/fnc_removeSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -22,5 +22,5 @@ if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { private _data = HASH_GET(GVAR(syncedEvents),_name); _data params ["", "", "", "_eventId"]; -[_eventId] call FUNC(removeEventHandler); +[_eventId] call CBA_fnc_removeEventHandler; HASH_REM(GVAR(syncedEvents),_name); diff --git a/addons/common/functions/fnc_requestSyncedEvent.sqf b/addons/common/functions/fnc_requestSyncedEvent.sqf index e7879a909a..e35c1e3645 100644 --- a/addons/common/functions/fnc_requestSyncedEvent.sqf +++ b/addons/common/functions/fnc_requestSyncedEvent.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: eventName - * + * * Return Value: * Boolean of success * @@ -17,4 +17,4 @@ 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); +["ACEs", [_eventName, ACE_player]] call CBA_fnc_serverEvent; diff --git a/addons/common/functions/fnc_sendRequest.sqf b/addons/common/functions/fnc_sendRequest.sqf index c8d2ef7e2b..a0c505c575 100644 --- a/addons/common/functions/fnc_sendRequest.sqf +++ b/addons/common/functions/fnc_sendRequest.sqf @@ -20,7 +20,7 @@ params ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; if (isPlayer _target) then { // Pass request on to target locality for player accept/decline. - [[_caller, _target, _requestID, _requestMessage, _callBack], QFUNC(receiveRequest), _target, false] call FUNC(execRemoteFnc); + [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; diff --git a/addons/common/functions/fnc_serverEvent.sqf b/addons/common/functions/fnc_serverEvent.sqf index b9dccd2c70..5b116e9661 100644 --- a/addons/common/functions/fnc_serverEvent.sqf +++ b/addons/common/functions/fnc_serverEvent.sqf @@ -1,29 +1,13 @@ -/* - * Author: Nou - * Execute a event only on the server. - * - * Argument: - * 0: Event name - * 1: Event args - * - * 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); +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"); diff --git a/addons/common/functions/fnc_serverLog.sqf b/addons/common/functions/fnc_serverLog.sqf index 2525f81c95..af7485c494 100644 --- a/addons/common/functions/fnc_serverLog.sqf +++ b/addons/common/functions/fnc_serverLog.sqf @@ -20,5 +20,5 @@ params [["_msg", "", [""]]]; if (isServer) then { diag_log text _msg; } else { - [_this, QFUNC(serverLog), 1] call FUNC(execRemoteFnc); + [QGVAR(serverLog), _this] call CBA_fnc_serverEvent; }; diff --git a/addons/common/functions/fnc_setSetting.sqf b/addons/common/functions/fnc_setSetting.sqf index a2bd9e700e..5a56b385a7 100644 --- a/addons/common/functions/fnc_setSetting.sqf +++ b/addons/common/functions/fnc_setSetting.sqf @@ -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; }; diff --git a/addons/common/functions/fnc_statusEffect_addType.sqf b/addons/common/functions/fnc_statusEffect_addType.sqf index afd7ff7be7..b5d6c1e879 100644 --- a/addons/common/functions/fnc_statusEffect_addType.sqf +++ b/addons/common/functions/fnc_statusEffect_addType.sqf @@ -3,7 +3,7 @@ * Adds a status effect that will be handled. * * Arguments: - * 0: Status Effect Name, this should match a corisponding event name + * 0: Status Effect Name, this should match a corresponding event name * 1: Send event globaly * 2: Common Effect Reaons to pre-seed durring init * @@ -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]; }; diff --git a/addons/common/functions/fnc_statusEffect_sendEffects.sqf b/addons/common/functions/fnc_statusEffect_sendEffects.sqf index 4291de1ad8..f82ab10427 100644 --- a/addons/common/functions/fnc_statusEffect_sendEffects.sqf +++ b/addons/common/functions/fnc_statusEffect_sendEffects.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Object - * 1: Effect name (or "" or send all) + * 1: Effect name (or "" to send all) * * 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; }; }; }; diff --git a/addons/common/functions/fnc_syncedEvent.sqf b/addons/common/functions/fnc_syncedEvent.sqf index 3ee2668019..e6c7b43361 100644 --- a/addons/common/functions/fnc_syncedEvent.sqf +++ b/addons/common/functions/fnc_syncedEvent.sqf @@ -23,4 +23,4 @@ if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { private _eventData = [_name, _args, _ttl]; -["SEH", _eventData] call FUNC(globalEvent); +["ACEe", _eventData] call CBA_fnc_globalEvent; diff --git a/addons/common/functions/fnc_targetEvent.sqf b/addons/common/functions/fnc_targetEvent.sqf index 85038f8e35..8cce931547 100644 --- a/addons/common/functions/fnc_targetEvent.sqf +++ b/addons/common/functions/fnc_targetEvent.sqf @@ -1,33 +1,13 @@ -/* - * Author: Nou - * Execute a event only on specific clients. - * - * Arguments: - * 0: Event name (STRING) - * 1: Event targets - * 2: Event args - * - * 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); +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"); diff --git a/addons/common/functions/fnc_unhideUnit.sqf b/addons/common/functions/fnc_unhideUnit.sqf index 908dbf3dc8..cb988cde1b 100644 --- a/addons/common/functions/fnc_unhideUnit.sqf +++ b/addons/common/functions/fnc_unhideUnit.sqf @@ -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; }; diff --git a/addons/common/functions/fnc_unloadPerson.sqf b/addons/common/functions/fnc_unloadPerson.sqf index b4c57457af..716f46dc8e 100644 --- a/addons/common/functions/fnc_unloadPerson.sqf +++ b/addons/common/functions/fnc_unloadPerson.sqf @@ -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 diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index 741accb689..517e0aa2ad 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -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 }; diff --git a/addons/common/functions/fnc_unmuteUnit.sqf b/addons/common/functions/fnc_unmuteUnit.sqf index a995eed244..b6d673cfd5 100644 --- a/addons/common/functions/fnc_unmuteUnit.sqf +++ b/addons/common/functions/fnc_unmuteUnit.sqf @@ -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; diff --git a/addons/common/scripts/checkVersionNumber.sqf b/addons/common/scripts/checkVersionNumber.sqf index 07bd443a06..402e5d9f56 100644 --- a/addons/common/scripts/checkVersionNumber.sqf +++ b/addons/common/scripts/checkVersionNumber.sqf @@ -100,7 +100,7 @@ if (!isServer) then { _error = _error call _fnc_cutComma; diag_log text _error; - [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + [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; - [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + [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; - [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + [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; - [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + [QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent; }; ACE_Version_ClientErrors = [_missingAddon, _missingAddonServer, _oldVersionClient, _oldVersionServer]; diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 820712189f..7521b65982 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -803,6 +803,7 @@ No hay espacio para descargar. Pas de place pour décharger Nedostatek místa k vyložení + Sem espaço para descarregar \ No newline at end of file diff --git a/addons/common/tests/script_component.hpp b/addons/common/tests/script_component.hpp deleted file mode 100644 index 6a1bf9154d..0000000000 --- a/addons/common/tests/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\common\script_component.hpp" diff --git a/addons/common/tests/test_eventHandlers.sqf b/addons/common/tests/test_eventHandlers.sqf deleted file mode 100644 index 5a75cb0a06..0000000000 --- a/addons/common/tests/test_eventHandlers.sqf +++ /dev/null @@ -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"); - diff --git a/addons/concertina_wire/XEH_postInit.sqf b/addons/concertina_wire/XEH_postInit.sqf index 58bd1f63c7..7cb8909c81 100644 --- a/addons/concertina_wire/XEH_postInit.sqf +++ b/addons/concertina_wire/XEH_postInit.sqf @@ -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; diff --git a/addons/concertina_wire/config.cpp b/addons/concertina_wire/config.cpp index 5333c83bb5..2091a5ffc6 100644 --- a/addons/concertina_wire/config.cpp +++ b/addons/concertina_wire/config.cpp @@ -14,4 +14,8 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" -#include "CfgVehicles.hpp" \ No newline at end of file +#include "CfgVehicles.hpp" + +class ACE_newEvents { + interactMenuOpened = "ace_interactMenuOpened"; +}; diff --git a/addons/concertina_wire/functions/fnc_handleKilled.sqf b/addons/concertina_wire/functions/fnc_handleKilled.sqf index 1af3f93151..fa03b58972 100644 --- a/addons/concertina_wire/functions/fnc_handleKilled.sqf +++ b/addons/concertina_wire/functions/fnc_handleKilled.sqf @@ -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; diff --git a/addons/dagr/XEH_postInit.sqf b/addons/dagr/XEH_postInit.sqf index 883a73d418..4c3fce167d 100644 --- a/addons/dagr/XEH_postInit.sqf +++ b/addons/dagr/XEH_postInit.sqf @@ -30,4 +30,4 @@ GVAR(vectorConnected) = false; GVAR(noVectorData) = true; GVAR(vectorGrid) = "00000000"; -["RangerfinderData", FUNC(handleRangeFinderData)] call EFUNC(common,addEventHandler); +[QEGVAR(vector,rangefinderData), FUNC(handleRangeFinderData)] call CBA_fnc_addEventHandler; diff --git a/addons/dagr/config.cpp b/addons/dagr/config.cpp index 1f440744f4..97d5300067 100644 --- a/addons/dagr/config.cpp +++ b/addons/dagr/config.cpp @@ -18,3 +18,7 @@ class CfgPatches { #include "CfgWeapons.hpp" #include "Dialog.hpp" #include "RscTitles.hpp" + +class ACE_newEvents { + RangerfinderData = QEGVAR(vector,rangefinderData); +}; diff --git a/addons/disarming/XEH_postInit.sqf b/addons/disarming/XEH_postInit.sqf index ef17e6e96a..6944f8b146 100644 --- a/addons/disarming/XEH_postInit.sqf +++ b/addons/disarming/XEH_postInit.sqf @@ -1,4 +1,4 @@ #include "script_component.hpp" -["DisarmDropItems", FUNC(eventTargetStart)] call EFUNC(common,addEventHandler); -["DisarmDebugCallback", FUNC(eventCallerFinish)] call EFUNC(common,addEventHandler); +[QGVAR(dropItems), FUNC(eventTargetStart)] call CBA_fnc_addEventHandler; +[QGVAR(debugCallback), FUNC(eventCallerFinish)] call CBA_fnc_addEventHandler; diff --git a/addons/disarming/config.cpp b/addons/disarming/config.cpp index 6bf3397106..8ed2f523cf 100644 --- a/addons/disarming/config.cpp +++ b/addons/disarming/config.cpp @@ -18,3 +18,8 @@ class CfgPatches { #include "CfgWeapons.hpp" #include "gui_disarm.hpp" + +class ACE_newEvents { + DisarmDebugCallback = QGVAR(debugCallback); + DisarmDropItems = QGVAR(dropItems); +}; diff --git a/addons/disarming/functions/fnc_eventTargetFinish.sqf b/addons/disarming/functions/fnc_eventTargetFinish.sqf index 9af811adc7..4b7487d47c 100644 --- a/addons/disarming/functions/fnc_eventTargetFinish.sqf +++ b/addons/disarming/functions/fnc_eventTargetFinish.sqf @@ -23,5 +23,5 @@ params ["_caller", "_target", "_errorMsg"]; if (_errorMsg != "") then { ACE_LOGINFO_2("%1 - eventTargetFinish: %2",CBA_missionTime,_this); - ["DisarmDebugCallback", [_caller], [_caller, _target, _errorMsg]] call EFUNC(common,targetEvent); + [QGVAR(debugCallback), [_caller, _target, _errorMsg], [_caller]] call CBA_fnc_targetEvent; }; diff --git a/addons/disarming/functions/fnc_openDisarmDialog.sqf b/addons/disarming/functions/fnc_openDisarmDialog.sqf index 92f98a0756..0883fde2dd 100644 --- a/addons/disarming/functions/fnc_openDisarmDialog.sqf +++ b/addons/disarming/functions/fnc_openDisarmDialog.sqf @@ -42,7 +42,7 @@ GVAR(disarmTarget) = _target; if (isNull GVAR(disarmTarget)) exitWith {ERROR("disarmTarget is null");}; TRACE_2("Debug: Droping %1 from %2",_data,GVAR(disarmTarget)); - ["DisarmDropItems", [GVAR(disarmTarget)], [ACE_player, GVAR(disarmTarget), [_data]]] call EFUNC(common,targetEvent); + [QGVAR(dropItems), [ACE_player, GVAR(disarmTarget), [_data]], [GVAR(disarmTarget)]] call CBA_fnc_targetEvent; false //not sure what this does }]; diff --git a/addons/disposable/XEH_postInit.sqf b/addons/disposable/XEH_postInit.sqf index 94ad62b1cc..9c54456620 100644 --- a/addons/disposable/XEH_postInit.sqf +++ b/addons/disposable/XEH_postInit.sqf @@ -3,13 +3,13 @@ if (!hasInterface) exitWith {}; -["playerInventoryChanged", { +["ace_playerInventoryChanged", { params ["_unit"]; [_unit] call FUNC(takeLoadedATWeapon); [_unit] call FUNC(updateInventoryDisplay); -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // Register fire event handler // Only for the local player and for AI. Non-local players will handle it themselves -["firedPlayer", DFUNC(replaceATWeapon)] call EFUNC(common,addEventHandler); -["firedNonPlayer", DFUNC(replaceATWeapon)] call EFUNC(common,addEventHandler); +["ace_firedPlayer", DFUNC(replaceATWeapon)] call CBA_fnc_addEventHandler; +["ace_firedNonPlayer", DFUNC(replaceATWeapon)] call CBA_fnc_addEventHandler; diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index 9e20d8ee60..c9a1fbea1b 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -20,11 +20,11 @@ if (isNil "ACE_maxWeightCarry") then { ["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition); // release object on player change. This does work when returning to lobby, but not when hard disconnecting. -["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); -["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); -["playerWeaponChanged", {_this call FUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler); +["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; +["ace_playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; +["ace_playerWeaponChanged", {_this call FUNC(handlePlayerWeaponChanged)}] call CBA_fnc_addEventHandler; // handle waking up dragged unit and falling unconscious while dragging -["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); +["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; //@todo Captivity? diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 2624bbf05c..9fb198e02c 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -44,7 +44,7 @@ if (_target isKindOf "CAManBase") then { _target attachTo [_unit, _position]; }; -["setDir", _target, [_target, _direction]] call EFUNC(common,targetEvent); +[QEGVAR(common,setDir), [_target, _direction], _target] call CBA_fnc_targetEvent; _unit setVariable [QGVAR(isCarrying), true, true]; _unit setVariable [QGVAR(carriedObject), _target, true]; diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index 751baccf06..4672aa89c4 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -33,7 +33,7 @@ _position = _position vectorAdd [0, 0, _offset]; // attach object TRACE_3("attaching",_position,_offset,_direction); _target attachTo [_unit, _position]; -["setDir", _target, [_target, _direction]] call EFUNC(common,targetEvent); +[QEGVAR(common,setDir), [_target, _direction], _target] call CBA_fnc_targetEvent; if (_target isKindOf "CAManBase") then { [_target, "AinjPpneMrunSnonWnonDb_still", 0, true] call EFUNC(common,doAnimation); diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 604f6c25b7..c70bf90c38 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -30,8 +30,8 @@ if !(_unit getVariable ["ACE_isUnconscious", false]) then { }; // prevent collision damage -["fixCollision", _unit] call EFUNC(common,localEvent); -["fixCollision", _target, _target] call EFUNC(common,targetEvent); +[QEGVAR(common,fixCollision), _unit] call CBA_fnc_localEvent; +[QEGVAR(common,fixCollision), _target, _target] call CBA_fnc_targetEvent; // release object detach _target; @@ -62,8 +62,8 @@ _unit setVariable [QGVAR(draggedObject), objNull, true]; [objNull, _target, true] call EFUNC(common,claim); if !(_target isKindOf "CAManBase") then { - ["fixPosition", _target, _target] call EFUNC(common,targetEvent); - ["fixFloating", _target, _target] call EFUNC(common,targetEvent); + [QEGVAR(common,fixPosition), _target, _target] call CBA_fnc_targetEvent; + [QEGVAR(common,fixFloating), _target, _target] call CBA_fnc_targetEvent; }; if (_unit getVariable ["ACE_isUnconscious", false]) then { diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index 2002142e2e..c3521bbed0 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -25,8 +25,8 @@ TRACE_2("params",_unit,_target); private _inBuilding = [_unit] call FUNC(isObjectOnObject); // prevent collision damage -["fixCollision", _unit] call EFUNC(common,localEvent); -["fixCollision", _target, _target] call EFUNC(common,targetEvent); +[QEGVAR(common,fixCollision), _unit] call CBA_fnc_localEvent; +[QEGVAR(common,fixCollision), _target, _target] call CBA_fnc_targetEvent; // release object detach _target; @@ -67,8 +67,8 @@ _unit setVariable [QGVAR(carriedObject), objNull, true]; [objNull, _target, true] call EFUNC(common,claim); if !(_target isKindOf "CAManBase") then { - ["fixPosition", _target, _target] call EFUNC(common,targetEvent); - ["fixFloating", _target, _target] call EFUNC(common,targetEvent); + [QEGVAR(common,fixPosition), _target, _target] call CBA_fnc_targetEvent; + [QEGVAR(common,fixFloating), _target, _target] call CBA_fnc_targetEvent; }; // recreate UAV crew diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf index c97284618c..e3a30ea9e0 100644 --- a/addons/dragging/functions/fnc_handleScrollWheel.sqf +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -42,6 +42,6 @@ _carriedItem attachTo [_unit]; //reset the carry direction private _direction = _carriedItem getVariable [QGVAR(carryDirection), 0]; -["setDir", _carriedItem, [_carriedItem, _direction]] call EFUNC(common,targetEvent); +[QEGVAR(common,setDir), [_carriedItem, _direction], _carriedItem] call CBA_fnc_targetEvent; true diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index 68d0ac1427..dcfb01c489 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -44,31 +44,24 @@ class CfgVehicles { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; }; - author = "ACE"; + author = ECSTRING(common,Author); _generalMacro = "ACE_DefuseObject"; displayName = "ACE Defuse Helper"; - mapSize = 0.2; - icon = "iconObject_1x2"; model = "\A3\Weapons_f\dummyweapon.p3d"; scope = 1; - vehicleClass = "Cargo"; + class ACE_Actions { - class ACE_MainActions { - selection = ""; + class ACE_Defuse { distance = 1; - condition = "true"; - class ACE_Defuse { - displayName = CSTRING(Defuse); - condition = QUOTE([ARR_2(_player,_target)] call FUNC(canDefuse)); - statement = QUOTE([ARR_2(_player,_target)] call FUNC(startDefuse);); - exceptions[] = {"isNotSwimming"}; - showDisabled = 0; - icon = QPATHTOF(UI\Defuse_ca.paa); - priority = 0.8; - }; + displayName = CSTRING(Defuse); + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canDefuse)); + statement = QUOTE([ARR_2(_player,_target)] call FUNC(startDefuse);); + exceptions[] = {"isNotSwimming"}; + icon = QPATHTOF(UI\Defuse_ca.paa); }; }; }; + class ACE_Explosives_Place: Items_base_F { class EventHandlers { class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index fe12a88b7f..365e772023 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -16,19 +16,20 @@ #include "script_component.hpp" //Event for setting explosive placement angle/pitch: -[QGVAR(place), {_this call FUNC(setPosition)}] call EFUNC(common,addEventHandler); +[QGVAR(place), {_this call FUNC(setPosition)}] call CBA_fnc_addEventHandler; +[QGVAR(startDefuse), FUNC(startDefuse)] call CBA_fnc_addEventHandler; //When getting knocked out in medical, trigger deadman explosives: //Event is global, only run on server (ref: ace_medical_fnc_setUnconscious) if (isServer) then { - ["medical_onUnconscious", { + ["ace_unconscious", { params ["_unit", "_isUnconscious"]; if (!_isUnconscious) exitWith {}; TRACE_1("Knocked Out, Doing Deadman", _unit); [_unit] call FUNC(onIncapacitated); - }] call EFUNC(common,addEventHandler); + }] call CBA_fnc_addEventHandler; - ["clientRequestsOrientations", { + [QGVAR(clientRequestOrientations), { params ["_logic"]; TRACE_1("clientRequestsOrientations received:",_logic); // Filter the array before sending it @@ -37,8 +38,8 @@ if (isServer) then { (!isNull _explosive && {alive _explosive}) }; TRACE_1("serverSendsOrientations sent:",GVAR(explosivesOrientations)); - ["serverSendsOrientations", _logic, [GVAR(explosivesOrientations)]] call EFUNC(common,targetEvent); - }] call EFUNC(common,addEventHandler); + [QGVAR(serverSendOrientations), [GVAR(explosivesOrientations)], _logic] call CBA_fnc_targetEvent; + }] call CBA_fnc_addEventHandler; }; if (!hasInterface) exitWith {}; @@ -51,7 +52,7 @@ GVAR(CurrentSpeedDial) = 0; // In case we are a JIP client, ask the server for orientation of any previously // placed mine. if (didJIP) then { - ["serverSendsOrientations", { + [QGVAR(serverSendOrientations), { params ["_explosivesOrientations"]; TRACE_1("serverSendsOrientations received:",_explosivesOrientations); { @@ -61,15 +62,15 @@ if (didJIP) then { } forEach _explosivesOrientations; deleteVehicle GVAR(localLogic); GVAR(localLogic) = nil; - }] call EFUNC(common,addEventHandler); + }] call CBA_fnc_addEventHandler; // Create a logic to get the client ID GVAR(localLogic) = ([sideLogic] call CBA_fnc_getSharedGroup) createUnit ["Logic", [0,0,0], [], 0, "NONE"]; TRACE_1("clientRequestsOrientations sent:",GVAR(localLogic)); - ["clientRequestsOrientations", [GVAR(localLogic)]] call EFUNC(common,serverEvent); + [QGVAR(clientRequestOrientations), [GVAR(localLogic)]] call CBA_fnc_serverEvent; }; -["interactMenuOpened", { +["ace_interactMenuOpened", { //Cancel placement if interact menu opened if (GVAR(pfeh_running)) then { GVAR(placeAction) = PLACE_CANCEL; @@ -78,4 +79,4 @@ if (didJIP) then { //Show defuse actions on CfgAmmos (allMines): _this call FUNC(interactEH); -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index 5eb92848c7..83033cbddc 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -43,3 +43,8 @@ class CfgMineTriggers { mineTriggerRange = 1; }; }; + +class ACE_newEvents { + clientRequestsOrientations = QGVAR(clientRequestOrientations); + serverSendsOrientations = QGVAR(serverSendOrientations); +}; diff --git a/addons/explosives/functions/fnc_defuseExplosive.sqf b/addons/explosives/functions/fnc_defuseExplosive.sqf index 147d722987..b98b992f8e 100644 --- a/addons/explosives/functions/fnc_defuseExplosive.sqf +++ b/addons/explosives/functions/fnc_defuseExplosive.sqf @@ -22,8 +22,8 @@ TRACE_2("params",_unit,_explosive); if (GVAR(ExplodeOnDefuse) && {(random 1.0) < (getNumber (ConfigFile >> "CfgAmmo" >> typeOf _explosive >> QGVAR(explodeOnDefuseChance)))}) exitWith { TRACE_1("exploding on defuse",_explosive); [_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive); - [QGVAR(explodeOnDefuse), [_explosive, _unit]] call EFUNC(common,globalEvent); + [QGVAR(explodeOnDefuse), [_explosive, _unit]] call CBA_fnc_globalEvent; }; _unit action ["Deactivate", _unit, _explosive]; -[QGVAR(defuse), [_explosive, _unit]] call EFUNC(common,globalEvent); +[QGVAR(defuse), [_explosive, _unit]] call CBA_fnc_globalEvent; diff --git a/addons/explosives/functions/fnc_placeExplosive.sqf b/addons/explosives/functions/fnc_placeExplosive.sqf index 83cdb2fef8..455b768b97 100644 --- a/addons/explosives/functions/fnc_placeExplosive.sqf +++ b/addons/explosives/functions/fnc_placeExplosive.sqf @@ -95,6 +95,6 @@ if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_tr _pitch = getNumber (_magazineTrigger >> "pitch"); //Globaly set the position and angle: -[QGVAR(place), [_explosive, _dir, _pitch, _unit]] call EFUNC(common,globalEvent); +[QGVAR(place), [_explosive, _dir, _pitch, _unit]] call CBA_fnc_globalEvent; _explosive diff --git a/addons/explosives/functions/fnc_startDefuse.sqf b/addons/explosives/functions/fnc_startDefuse.sqf index 35333ecc17..8e3f071661 100644 --- a/addons/explosives/functions/fnc_startDefuse.sqf +++ b/addons/explosives/functions/fnc_startDefuse.sqf @@ -44,7 +44,7 @@ if (STANCE _unit == "Prone") then { if (ACE_player != _unit) then { // If the unit is a player, call the function on the player. if (isPlayer _unit) then { - [[_unit, _target], QFUNC(startDefuse), _unit] call EFUNC(common,execRemoteFnc); + [QGVAR(startDefuse), [_unit, _target], _unit] call CBA_fnc_targetEvent; } else { _unit playActionNow _actionToPlay; _unit disableAI "MOVE"; diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index c49d09502f..65d19364de 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -46,6 +46,7 @@ Detonuj wszystkie Detona Tutti Tout mettre à feu + Detonar Tudo Explosive code: %1 @@ -649,6 +650,7 @@ Mine M6 SLAM (par le bas) Mina M6 SLAM (base) M6 SLAM (Útok zespoda) + Mina M6 SLAM (Ataque Inferior) M6 SLAM Mine (Side Attack) @@ -665,6 +667,7 @@ Mine M6 SLAM (de flanc) STR_ACE_Explosives_Module_SLAMBottomAttack_DisplayName M6 SLAM Mine (Bottom Attack) Mine M6 SLAM (par le bas) M6-SLAM-Mine (Bodenangriff) Mina M6 SLAM (base) Mina M6 SLAM (atak od dołu) Mina M6 SLAM (Laterale) M6 SLAM (Útok do strany) + Mina M6 SLAM (Ataque Lateral) Large IED (Urban, Pressure Plate) @@ -681,6 +684,7 @@ Grand EEI (Urbain, plaque de pression) IED grande (urbano, a pressione) IED, Velké (Městské, Nášlapné) + IED Grande (Urbano, Placa de pressão) Large IED (Dug-in, Pressure Plate) @@ -697,6 +701,7 @@ Grand EEI (Enterré, plaque de pression) IED grande (interrato, a pressione) IED, Velké (Zakopané, Nášlapné) + IED Grande (Enterrado, Placa de pressão) Small IED (Urban, Pressure Plate) @@ -713,6 +718,7 @@ Petit EEI (Urbain, plaque de pression) IED piccolo (urbano, a pressione) IED, Malé (Městské, Nášlapné) + IED Pequeno(Urbano, Placa de pressão) Small IED (Dug-in, Pressure Plate) @@ -729,6 +735,7 @@ Petit EEI (Enterré, plaque de pression) IED piccolo (interrato, a pressione) IED, Malé (Zakopané, Nášlapné) + IED Pequeno (Enterrado, Placa de pressão) Connect to %1 diff --git a/addons/fastroping/CfgVehicles.hpp b/addons/fastroping/CfgVehicles.hpp index 9d45264853..7434b5c2ea 100644 --- a/addons/fastroping/CfgVehicles.hpp +++ b/addons/fastroping/CfgVehicles.hpp @@ -48,7 +48,7 @@ class CfgVehicles { class ACE_deployRopes { displayName = CSTRING(Interaction_deployRopes); condition = QUOTE([ARR_2(_player, vehicle _player)] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QUOTE(QGVAR(deployRopes)), [vehicle _player])] call EFUNC(common,serverEvent)); + statement = QUOTE([ARR_2(QUOTE(QGVAR(deployRopes)), [vehicle _player])] call CBA_fnc_serverEvent); showDisabled = 0; priority = 1; }; diff --git a/addons/fastroping/XEH_postInit.sqf b/addons/fastroping/XEH_postInit.sqf index ae88feaa76..752ac2f756 100644 --- a/addons/fastroping/XEH_postInit.sqf +++ b/addons/fastroping/XEH_postInit.sqf @@ -2,8 +2,8 @@ [QGVAR(deployRopes), { _this call FUNC(deployRopes); -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; [QGVAR(startFastRope), { [FUNC(fastRopeServerPFH), 0, _this] call CBA_fnc_addPerFrameHandler; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/fastroping/functions/fnc_fastRope.sqf b/addons/fastroping/functions/fnc_fastRope.sqf index e3bd21482f..0db73f4fce 100644 --- a/addons/fastroping/functions/fnc_fastRope.sqf +++ b/addons/fastroping/functions/fnc_fastRope.sqf @@ -35,6 +35,6 @@ _deployedRopes set [_usableRopeIndex, _usableRope]; _vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true]; //Start server PFH asap -[QGVAR(startFastRope), [_unit, _vehicle, _usableRope, _usableRopeIndex, false]] call EFUNC(common,serverEvent); +[QGVAR(startFastRope), [_unit, _vehicle, _usableRope, _usableRopeIndex, false]] call CBA_fnc_serverEvent; moveOut _unit; [FUNC(fastRopeLocalPFH), 0, [_unit, _vehicle, _usableRope, _usableRopeIndex, diag_tickTime]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/fastroping/stringtable.xml b/addons/fastroping/stringtable.xml index 7b0e4ad1f8..6d64fc24f5 100644 --- a/addons/fastroping/stringtable.xml +++ b/addons/fastroping/stringtable.xml @@ -9,6 +9,7 @@ Equipar FRIES Equipaggia la FRIES Vybavit FRIES + Equipar FRIES Equips compatible helicopters with a Fast Rope Insertion Extraction System. @@ -18,6 +19,7 @@ Equipar helicoptero compatible con un Sistema de Inserción Extracción Fast Rope. Equipagga l'elicottero compatibile con il Fast Rope Insertion Exstraction System Vybavit kompatibilní vrtulníky systémem Fast Rope Insertion Extraction (FRIES). + Equipa um helicóptero compatível com o Fast Rope Insertion Exctraction System. Prepare fast roping system @@ -27,6 +29,7 @@ Preparar el sistema fast roping Prepara le corde Připravit systém slaňování + Prepara sistema de descida rápida Deploy ropes @@ -36,6 +39,7 @@ Desplegar cuerdas Srotola le corde Připravit lana + Jogar cordas Fast rope @@ -45,6 +49,7 @@ Descender por la cuerda Scendi sulla corda SLANIT + Descida rápida Cut ropes @@ -54,6 +59,7 @@ Cortar cuerdas Taglia le corde Odříznout lano + Cortar cordas Equip helicopter with FRIES @@ -63,6 +69,7 @@ Equipar helicoptero con FRIES Equipaggia l'elicottero con FRIES Vybavit vrtulník pomocí FRIES + Equipar helicóptero com FRIES Equips the selected helicopter with a Fast Rope Insertion Extraction System @@ -72,11 +79,13 @@ Equipa el helicoptero seleccionado con un Sistema de Inserción Extracción Fast Rope Equipaggia l'elicottero selezionato con il Fast Rope Insertion Extraction System Vybavit vybraný vrtulník systémem Fast Rope Insertion Extraction (FRIES) + Equipa um helicóptero selecionado com um sistema de Fast Rope Insertion Extraction System LET UNITS FAST ROPE EINHEITEN ABSEILEN LASSEN SCENDI DALLE CORDE + Equipa o helicóptero selecionado com o Fast Rope Insertion Extraction System \ No newline at end of file diff --git a/addons/fcs/XEH_postInit.sqf b/addons/fcs/XEH_postInit.sqf index 25fd09ba8c..02c9e72ae5 100644 --- a/addons/fcs/XEH_postInit.sqf +++ b/addons/fcs/XEH_postInit.sqf @@ -8,16 +8,16 @@ if (!hasInterface) exitWith {}; #include "initKeybinds.sqf" -["infoDisplayChanged", { +["ace_infoDisplayChanged", { if (!isNull ((_this select 0) displayCtrl 1713151)) then { uiNamespace setVariable ["ACE_dlgRangefinder", _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0,0,0,0]; }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // Register fire event handler -["firedPlayerVehicle", DFUNC(firedEH)] call EFUNC(common,addEventHandler); -["firedPlayerVehicleNonLocal", DFUNC(firedEH)] call EFUNC(common,addEventHandler); +["ace_firedPlayerVehicle", DFUNC(firedEH)] call CBA_fnc_addEventHandler; +["ace_firedPlayerVehicleNonLocal", DFUNC(firedEH)] call CBA_fnc_addEventHandler; // Register event for global updates -[QGVAR(forceUpdate), {[ACE_player] call FUNC(onForceUpdate)}] call EFUNC(common,addEventHandler); +[QGVAR(forceUpdate), {[ACE_player] call FUNC(onForceUpdate)}] call CBA_fnc_addEventHandler; diff --git a/addons/finger/XEH_postInit.sqf b/addons/finger/XEH_postInit.sqf index 94a22d7224..2b3da6eb64 100644 --- a/addons/finger/XEH_postInit.sqf +++ b/addons/finger/XEH_postInit.sqf @@ -6,11 +6,11 @@ GVAR(lastFPTime) = -1; GVAR(fingersHash) = HASH_CREATE; GVAR(pfeh_id) = -1; -["SettingsInitialized", { +["ace_settingsInitialized", { //If not enabled, dont't bother adding keybind or eventhandler if (!GVAR(enabled)) exitWith {}; - [QGVAR(fingered), {_this call FUNC(incomingFinger)}] call EFUNC(common,addEventHandler); + [QGVAR(fingered), {_this call FUNC(incomingFinger)}] call CBA_fnc_addEventHandler; ["ACE3 Common", QGVAR(finger), @@ -20,4 +20,4 @@ GVAR(pfeh_id) = -1; }, {false}, [41, [true, false, false]], true] call CBA_fnc_addKeybind; // Shift + Tilda (hold) -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/finger/config.cpp b/addons/finger/config.cpp index fa953b4298..12e48da03e 100644 --- a/addons/finger/config.cpp +++ b/addons/finger/config.cpp @@ -1,19 +1,19 @@ -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - units[] = {QGVAR(moduleSettings)}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; - author = ECSTRING(common,ACETeam); - authors[] = {"Drill"}; - url = ECSTRING(main,URL); - VERSION_CONFIG; - }; -}; - - -#include "ACE_Settings.hpp" -#include "CfgEventHandlers.hpp" -#include "CfgVehicles.hpp" +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {QGVAR(moduleSettings)}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author = ECSTRING(common,ACETeam); + authors[] = {"Drill"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + + +#include "ACE_Settings.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/finger/functions/fnc_keyPress.sqf b/addons/finger/functions/fnc_keyPress.sqf index f569331eb7..d0d8bce811 100644 --- a/addons/finger/functions/fnc_keyPress.sqf +++ b/addons/finger/functions/fnc_keyPress.sqf @@ -55,7 +55,7 @@ _nearbyMen = (ACE_player nearObjects ["CAManBase", (GVAR(maxRange) + 2)]); TRACE_1("sending finger to",_sendFingerToPlayers); -[QGVAR(fingered), _sendFingerToPlayers, [ACE_player, _fingerPosPrecise]] call EFUNC(common,targetEvent); +[QGVAR(fingered), [ACE_player, _fingerPosPrecise], _sendFingerToPlayers] call CBA_fnc_targetEvent; ACE_player playActionNow "GestureGo"; diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index f461010d69..02d27434dd 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -6,24 +6,24 @@ if(GVAR(EnableDebugTrace) && !isMultiplayer) then { }; if(isServer) then { - [QGVAR(frag_eh), { _this call FUNC(frago); }] call EFUNC(common,addEventHandler); + [QGVAR(frag_eh), { _this call FUNC(frago); }] call CBA_fnc_addEventHandler; }; -["SettingsInitialized", { +["ace_settingsInitialized", { //If not enabled, exit if (!GVAR(enabled)) exitWith {}; // Register fire event handler - ["firedPlayer", DFUNC(fired)] call EFUNC(common,addEventHandler); - ["firedPlayerNonLocal", DFUNC(fired)] call EFUNC(common,addEventHandler); - ["firedNonPlayer", DFUNC(fired)] call EFUNC(common,addEventHandler); - ["firedPlayerVehicle", DFUNC(fired)] call EFUNC(common,addEventHandler); - ["firedPlayerVehicleNonLocal", DFUNC(fired)] call EFUNC(common,addEventHandler); - ["firedNonPlayerVehicle", DFUNC(fired)] call EFUNC(common,addEventHandler); + ["ace_firedPlayer", DFUNC(fired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerNonLocal", DFUNC(fired)] call CBA_fnc_addEventHandler; + ["ace_firedNonPlayer", DFUNC(fired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerVehicle", DFUNC(fired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerVehicleNonLocal", DFUNC(fired)] call CBA_fnc_addEventHandler; + ["ace_firedNonPlayerVehicle", DFUNC(fired)] call CBA_fnc_addEventHandler; [FUNC(masterPFH), 0, []] call CBA_fnc_addPerFrameHandler; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; //Cache for ammo type configs GVAR(cacheRoundsTypesToTrack) = createLocation ["ACE_HashLocation", [-10000,-10000,-10000], 0, 0]; diff --git a/addons/frag/config.cpp b/addons/frag/config.cpp index 1727570003..5526e5c1bc 100644 --- a/addons/frag/config.cpp +++ b/addons/frag/config.cpp @@ -1,17 +1,17 @@ -#include "script_component.hpp" -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; - author = ECSTRING(common,ACETeam); - authors[] = {"Nou"}; - url = ECSTRING(main,URL); - VERSION_CONFIG; - }; -}; - -#include "CfgEventhandlers.hpp" -#include "CfgAmmo.hpp" -#include "ACE_Settings.hpp" +#include "script_component.hpp" +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author = ECSTRING(common,ACETeam); + authors[] = {"Nou"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgEventhandlers.hpp" +#include "CfgAmmo.hpp" +#include "ACE_Settings.hpp" diff --git a/addons/frag/functions/fnc_pfhRound.sqf b/addons/frag/functions/fnc_pfhRound.sqf index 55dd646a2e..4163549fd3 100644 --- a/addons/frag/functions/fnc_pfhRound.sqf +++ b/addons/frag/functions/fnc_pfhRound.sqf @@ -22,7 +22,7 @@ if (!alive _round) exitWith { if((diag_frameno - _firedFrame) > 1) then { //skip if deleted within a single frame if(_skip == 0) then { if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then { - [QGVAR(frag_eh), _this] call EFUNC(common,serverEvent); + [QGVAR(frag_eh), _this] call CBA_fnc_serverEvent; }; }; }; diff --git a/addons/frag/stringtable.xml b/addons/frag/stringtable.xml index 4191a405d3..c7afb23097 100644 --- a/addons/frag/stringtable.xml +++ b/addons/frag/stringtable.xml @@ -68,6 +68,7 @@ Druckwellensimulation Activar simulación de reflexiones Simulation de la réflection des explosions. + Simulação de reflexo de explosão Enable the ACE Explosion Reflection Simulation @@ -76,6 +77,7 @@ Aktiviere die ACE-Druckwellensimulation Activa la simulación de reflexiones para las explosiones. Activer la simulation de la réfléction des explosions ACE. + Ativa a simulação de reflexo de explosão do ACE Maximum Projectiles Tracked diff --git a/addons/gestures/stringtable.xml b/addons/gestures/stringtable.xml index 56b77e97e9..bd9474f8c1 100644 --- a/addons/gestures/stringtable.xml +++ b/addons/gestures/stringtable.xml @@ -194,6 +194,7 @@ Mostra Gesti su Menù Interazione Mostrar gestos en el menú de interacción Afficher les gestes au menu d'interaction. + Mostrar gestos no menu de interação Show gestures on the self interaction menu, or just use keybinds, or disable completely @@ -203,6 +204,7 @@ Mostra Gesti nel Menù Interazione Personale, o usa solamente Hotkey, o disabilita completamente Muestror los gestos en el menú de interacción propia, utilizar solo combinación de teclas o desactivarlos completamente Afficher les gestes dans le menu d'interaction personnel, ou seulement utiliser les touches, ou desactiver complètement. + Mostra gestos no menu de interação, ou utilize um dos atalhos de teclado ou desative completamente Just Keybinds @@ -212,6 +214,7 @@ Solo Hotkey Solo mediante teclas Seulement les touches + Somente atalhos de teclado Keybinds + Interaction Menu @@ -221,6 +224,7 @@ Hotkey + Menù Interazione Teclas y Menú de Interacción Touches + menu d'interaction + Atalhos + Menu de Interação diff --git a/addons/gforces/XEH_postInit.sqf b/addons/gforces/XEH_postInit.sqf index d1df112606..4401b1f5dd 100644 --- a/addons/gforces/XEH_postInit.sqf +++ b/addons/gforces/XEH_postInit.sqf @@ -4,7 +4,7 @@ if (!hasInterface) exitWith {}; GVAR(pfID) = -1; -["SettingsInitialized", { +["ace_settingsInitialized", { TRACE_1("SettingsInitialized eh",GVAR(enabledFor)); if (GVAR(enabledFor) == 0) exitWith {}; //Module has no effect if enabledFor is "None" @@ -19,7 +19,7 @@ GVAR(pfID) = -1; [] call FUNC(addPFEH); TRACE_1("adding temp PFEH [start in]",GVAR(pfID)); }; - ["playerVehicleChanged", { + ["ace_playerVehicleChanged", { params ["", "_vehicle"]; TRACE_2("playerVehicleChanged",_vehicle,typeOf _vehicle); if (_vehicle isKindOf "Air") then { @@ -35,5 +35,5 @@ GVAR(pfID) = -1; GVAR(pfID) = -1; }; }; - }] call EFUNC(common,addEventHandler); -}] call EFUNC(common,addEventHandler); + }] call CBA_fnc_addEventHandler; +}] call CBA_fnc_addEventHandler; diff --git a/addons/gforces/stringtable.xml b/addons/gforces/stringtable.xml index f5d5f1b12d..921515f560 100644 --- a/addons/gforces/stringtable.xml +++ b/addons/gforces/stringtable.xml @@ -6,12 +6,14 @@ Gforces Effekte Efectos Gforces G Force efekty + Efeitos de ForçaG Only Aircraft Nur Luftfahrzeug Sólo Aeronave Pouze letadla + Somente Aeronave \ No newline at end of file diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 2885f8e4a6..032e1316ac 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -43,19 +43,19 @@ GVAR(surfaceCacheIsDust) = false; // init GlassesChanged eventhandler GVAR(OldGlasses) = ""; -["playerInventoryChanged", { +["ace_playerInventoryChanged", { params ["_unit"]; private _currentGlasses = goggles _unit; if (GVAR(OldGlasses) != _currentGlasses) then { - ["GlassesChanged", [_unit, _currentGlasses]] call EFUNC(common,localEvent); + ["ace_glassesChanged", [_unit, _currentGlasses]] call CBA_fnc_localEvent; GVAR(OldGlasses) = _currentGlasses; }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // add glasses eventhandlers -["GlassesChanged", { +["ace_glassesChanged", { params ["_unit", "_glasses"]; SETGLASSES(_unit,GLASSESDEFAULT); @@ -67,9 +67,9 @@ GVAR(OldGlasses) = ""; } else { call FUNC(removeGlassesEffect); }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; -["GlassesCracked", { +["ace_glassesCracked", { params ["_unit"]; _unit setVariable ["ACE_EyesDamaged", true]; @@ -93,7 +93,7 @@ GVAR(OldGlasses) = ""; }, _unit, 25] call CBA_fnc_waitAndExecute; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // check goggles private _fnc_checkGoggles = { @@ -110,8 +110,8 @@ private _fnc_checkGoggles = { }; }; -["cameraViewChanged", _fnc_checkGoggles] call EFUNC(common,addEventHandler); -["activeCameraChanged", _fnc_checkGoggles] call EFUNC(common,addEventHandler); +["ace_cameraViewChanged", _fnc_checkGoggles] call CBA_fnc_addEventHandler; +["ace_activeCameraChanged", _fnc_checkGoggles] call CBA_fnc_addEventHandler; // goggles effects main PFH [{ @@ -134,4 +134,4 @@ private _fnc_checkGoggles = { }, 0.5, []] call CBA_fnc_addPerFrameHandler; // Register fire event handler -["firedPlayer", DFUNC(handleFired)] call EFUNC(common,addEventHandler); +["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler; diff --git a/addons/goggles/config.cpp b/addons/goggles/config.cpp index 6a20daaee7..062300d4d5 100644 --- a/addons/goggles/config.cpp +++ b/addons/goggles/config.cpp @@ -269,3 +269,8 @@ class CfgCloudlets { destroyOnWaterSurface = 1; }; }; + +class ACE_newEvents { + GlassesChanged = "ace_glassesChanged"; + GlassesCracked = "ace_glassesCracked"; +}; diff --git a/addons/goggles/functions/fnc_handleExplosion.sqf b/addons/goggles/functions/fnc_handleExplosion.sqf index b5c71a3d94..44be6ab6c1 100644 --- a/addons/goggles/functions/fnc_handleExplosion.sqf +++ b/addons/goggles/functions/fnc_handleExplosion.sqf @@ -27,7 +27,7 @@ _config = configFile >> "CfgGlasses" >> goggles _unit; if ((_this select 1) call FUNC(GetExplosionIndex) < getNumber (_config >> "ACE_Resistance")) exitWith {true}; if !([_unit] call FUNC(isGogglesVisible)) exitWith { - ["GlassesCracked", [_unit]] call EFUNC(common,localEvent); + ["ace_glassesCracked", [_unit]] call CBA_fnc_localEvent; true }; @@ -46,5 +46,5 @@ if (getText (_config >> "ACE_OverlayCracked") != "") then { (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText (_config >> "ACE_OverlayCracked"); }; -["GlassesCracked", [_unit]] call EFUNC(common,localEvent); +["ace_glassesCracked", [_unit]] call CBA_fnc_localEvent; true diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index d4cc01f06f..e47734c53e 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" -["flashbangExplosion", {_this call FUNC(flashbangExplosionEH)}] call EFUNC(common,addEventHandler); +["ace_flashbangExploded", {_this call FUNC(flashbangExplosionEH)}] call CBA_fnc_addEventHandler; if (!hasInterface) exitWith {}; @@ -25,6 +25,6 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; // Register fire event handler -["firedPlayer", DFUNC(throwGrenade)] call EFUNC(common,addEventHandler); -["firedPlayerNonLocal", DFUNC(throwGrenade)] call EFUNC(common,addEventHandler); -["firedNonPlayer", DFUNC(throwGrenade)] call EFUNC(common,addEventHandler); +["ace_firedPlayer", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; +["ace_firedPlayerNonLocal", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; +["ace_firedNonPlayer", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; diff --git a/addons/grenades/config.cpp b/addons/grenades/config.cpp index 7d98e13a24..0d5ab09d0b 100644 --- a/addons/grenades/config.cpp +++ b/addons/grenades/config.cpp @@ -20,3 +20,7 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "Effects.hpp" + +class ACE_newEvents { + flashbangExplosion = "ace_flashbangExploded"; +}; diff --git a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf index 73c10997ba..5c05abc9a3 100644 --- a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf +++ b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf @@ -21,5 +21,5 @@ TRACE_1("params",_projectile); if (alive _projectile) then { playSound3D ["A3\Sounds_F\weapons\Explosion\explosion_mine_1.wss", _projectile, false, getPosASL _projectile, 5, 1.2, 400]; - ["flashbangExplosion", [getPosASL _projectile]] call EFUNC(common,globalEvent); + ["ace_flashbangExploded", [getPosASL _projectile]] call CBA_fnc_globalEvent; }; diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index fdd61ccfde..cdf2e6d74b 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -12,7 +12,7 @@ GVAR(time3) = 0; GVAR(damageCoefficent) = 1; GVAR(volumeAttenuation) = 1; -["SettingsInitialized", { +["ace_settingsInitialized", { TRACE_1("settingInit",GVAR(EnableCombatDeafness)); // Only run PFEH and install event handlers if combat deafness is enabled if (!GVAR(EnableCombatDeafness)) exitWith {}; @@ -20,7 +20,7 @@ GVAR(volumeAttenuation) = 1; //Add XEH: ["CAManBase", "FiredNear", FUNC(firedNear)] call CBA_fnc_addClassEventHandler; ["CAManBase", "Explosion", FUNC(explosionNear)] call CBA_fnc_addClassEventHandler; - + // Update hearing protection now: [] call FUNC(updateHearingProtection); @@ -28,18 +28,18 @@ GVAR(volumeAttenuation) = 1; [FUNC(updateVolume), 1, [false]] call CBA_fnc_addPerFrameHandler; // Update veh attunation when player veh changes - ["playerVehicleChanged", {_this call FUNC(updatePlayerVehAttenuation);}] call EFUNC(common,addEventHandler); - ["playerTurretChanged", {_this call FUNC(updatePlayerVehAttenuation);}] call EFUNC(common,addEventHandler); + ["ace_playerVehicleChanged", FUNC(updatePlayerVehAttenuation)] call CBA_fnc_addEventHandler; + ["ace_playerTurretChanged", FUNC(updatePlayerVehAttenuation)] call CBA_fnc_addEventHandler; // Reset deafness on respawn (or remote control player switch) - ["playerChanged", { + ["ace_playerChanged", { GVAR(deafnessDV) = 0; GVAR(deafnessPrior) = 0; ACE_player setVariable [QGVAR(deaf), false]; GVAR(time3) = 0; [] call FUNC(updateHearingProtection); - }] call EFUNC(common,addEventhandler); + }] call CBA_fnc_addEventHandler; // Update protection on possible helmet change - ["playerInventoryChanged", {[] call FUNC(updateHearingProtection);}] call EFUNC(common,addEventhandler); -}] call EFUNC(common,addEventHandler); + ["ace_playerInventoryChanged", {[] call FUNC(updateHearingProtection);}] call CBA_fnc_addEventHandler; +}] call CBA_fnc_addEventHandler; diff --git a/addons/hearing/config.cpp b/addons/hearing/config.cpp index 3a52c369d8..455bc20dd1 100644 --- a/addons/hearing/config.cpp +++ b/addons/hearing/config.cpp @@ -14,13 +14,8 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" - #include "CfgVehicles.hpp" - #include "CfgSounds.hpp" - #include "CfgWeapons.hpp" - #include "CfgAmmo.hpp" - #include "ACE_Settings.hpp" diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index e92229cdd4..f52b0c9812 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -116,6 +116,7 @@ Usuń szum w uszach przy chwilowej utracie słuchu. Enlève les acouphènes quand le joueur prend des dommages auditifs. Quando il giocatore riceve danni all'udito, non fa sentire i fischi nelle orecchie + Remove o efeito de zunido quando o jogador recebe dano na audição Hearing diff --git a/addons/huntir/XEH_postInit.sqf b/addons/huntir/XEH_postInit.sqf index 038cd62051..5ad798a62d 100644 --- a/addons/huntir/XEH_postInit.sqf +++ b/addons/huntir/XEH_postInit.sqf @@ -10,4 +10,4 @@ GVAR(ELEVAT) = 0.01; // Register fire event handler // Don't run for non players, as they are too dumb to launch huntirs anyway -["firedPlayer", DFUNC(handleFired)] call EFUNC(common,addEventHandler); +["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler; diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 50169bf6b4..30277ed877 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -8,22 +8,22 @@ GVAR(cachedBuildingActionPairs) = []; GVAR(ParsedTextCached) = []; -["SettingChanged", { +["ace_settingChanged", { params ["_name"]; if (({_x == _name} count [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) == 1) then { [] call FUNC(setupTextColors); }; -}] call EFUNC(common,addEventhandler); +}] call CBA_fnc_addEventHandler; -["SettingsInitialized", { +["ace_settingsInitialized", { //Setup text/shadow/size/color settings matrix [] call FUNC(setupTextColors); // Install the render EH on the main display addMissionEventHandler ["Draw3D", DFUNC(render)]; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; //Add Actions to Houses: -["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler); +["ace_interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call CBA_fnc_addEventHandler; ["ACE3 Common", QGVAR(InteractKey), (localize LSTRING(InteractKey)), { @@ -41,7 +41,7 @@ GVAR(ParsedTextCached) = []; // Listens for the falling unconscious event, just in case the menu needs to be closed -["medical_onUnconscious", { +["ace_unconscious", { // If no menu is open just quit if (GVAR(openedMenuType) < 0) exitWith {}; @@ -51,17 +51,17 @@ GVAR(ParsedTextCached) = []; GVAR(actionSelected) = false; [GVAR(openedMenuType), false] call FUNC(keyUp); -}] call EFUNC(common,addEventhandler); +}] call CBA_fnc_addEventHandler; // disable firing while the interact menu is is is opened -["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventHandler); +["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; // background options -["interactMenuOpened", { +["ace_interactMenuOpened", { if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), true] call EFUNC(common,blurScreen);}; if (GVAR(menuBackground)==2) then {0 cutRsc[QGVAR(menuBackground), "PLAIN", 1, false];}; -}] call EFUNC(common,addEventHandler); -["interactMenuClosed", { +}] call CBA_fnc_addEventHandler; +["ace_interactMenuClosed", { if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), false] call EFUNC(common,blurScreen);}; if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;}; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index f84fea7ef9..e8731df93c 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -24,3 +24,9 @@ class CfgPatches { class ACE_Extensions { extensions[] += {"ace_break_line", "ace_parse_imagepath"}; }; + +class ACE_newEvents { + interactMenuOpened = "ace_interactMenuOpened"; + clearConditionCaches = QGVAR(clearConditionCaches); + interactMenuClosed = "ace_interactMenuClosed"; +}; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 4d9f0af4db..ab9969a994 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -102,6 +102,6 @@ if (GVAR(openedMenuType) == 0) then { GVAR(startHoverTime) = -1000; }; -["interactMenuOpened", [_menuType]] call EFUNC(common,localEvent); +["ace_interactMenuOpened", [_menuType]] call CBA_fnc_localEvent; true diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index b6eae6f527..969e1f2b08 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -28,7 +28,7 @@ if(GVAR(actionSelected)) then { private _target = GVAR(selectedTarget); // Clear the conditions caches - ["clearConditionCaches", []] call EFUNC(common,localEvent); + [QGVAR(clearConditionCaches), []] call CBA_fnc_localEvent; // exit scope if selecting an action on key release is disabled if (!(GVAR(actionOnKeyRelease)) && !_calledByClicking) exitWith {}; @@ -40,11 +40,11 @@ if(GVAR(actionSelected)) then { [_target, _player, _actionData select 6] call (_actionData select 3); // Clear the conditions caches again if the action was performed - ["clearConditionCaches", []] call EFUNC(common,localEvent); + [QGVAR(clearConditionCaches), []] call CBA_fnc_localEvent; }; }; -["interactMenuClosed", [GVAR(openedMenuType)]] call EFUNC(common,localEvent); +["ace_interactMenuClosed", [GVAR(openedMenuType)]] call CBA_fnc_localEvent; GVAR(keyDown) = false; GVAR(keyDownSelfAction) = false; diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index 00745a406f..a05ad79670 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -97,7 +97,7 @@ if (GVAR(openedMenuType) >= 0) then { private _target = GVAR(selectedTarget); // Clear the conditions caches - ["clearConditionCaches", []] call EFUNC(common,localEvent); + [QGVAR(clearConditionCaches), []] call CBA_fnc_localEvent; // Check the action conditions private _actionData = GVAR(selectedAction) select 0; @@ -106,7 +106,7 @@ if (GVAR(openedMenuType) >= 0) then { [_target, _player, _actionData select 6] call (_actionData select 3); // Clear the conditions caches again if the action was performed - ["clearConditionCaches", []] call EFUNC(common,localEvent); + [QGVAR(clearConditionCaches), []] call CBA_fnc_localEvent; }; }; }; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 66e0cb1341..0bb6e2386a 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -3,36 +3,36 @@ ACE_Modifier = 0; -["pardon", {(_this select 0) addRating -rating (_this select 0)}] call EFUNC(common,addEventHandler); +[QGVAR(pardon), {(_this select 0) addRating -rating (_this select 0)}] call CBA_fnc_addEventHandler; -["getDown", { +[QGVAR(getDown), { params ["_target"]; _target setUnitPos "DOWN"; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; -["sendAway", { +[QGVAR(sendAway), { params ["_unit", "_position"]; _unit setUnitPos "AUTO"; _unit doMove _position; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; -["lampTurnOn", { +[QGVAR(lampTurnOn), { params ["_lamp", "_hitPointsDamage", "_disabledLampDMG"]; {if((_x select 1) == _disabledLampDMG) then {_lamp setHit [_x select 0, 0];};nil} count _hitPointsDamage; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; -["lampTurnOff", { +[QGVAR(lampTurnOff), { params ["_lamp", "_hitPointsDamage", "_disabledLampDMG"]; {_lamp setHit [_x select 0, (_x select 1) max _disabledLampDMG];nil} count _hitPointsDamage; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; if (!hasInterface) exitWith {}; GVAR(isOpeningDoor) = false; -["tapShoulder", { +[QGVAR(tapShoulder), { params ["_unit", "_shoulderNum"]; if (_unit == ACE_player) then { @@ -40,7 +40,7 @@ GVAR(isOpeningDoor) = false; private _message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 1)); [_message] call EFUNC(common,displayTextStructured); }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // add keybinds ["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor), { diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index 5a21e452e3..b984570059 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -18,3 +18,12 @@ class CfgPatches { #include "RscTitles.hpp" #include "ACE_Settings.hpp" #include "ACE_ZeusActions.hpp" + +class ACE_newEvents { + getDown = QGVAR(getDown); + pardon = QGVAR(pardon); + tapShoulder = QGVAR(tapShoulder); + sendAway = QGVAR(sendAway); + lampTurnOff = QGVAR(lampTurnOff); + lampTurnOn = QGVAR(lampTurnOn); +}; diff --git a/addons/interaction/functions/fnc_doBecomeLeader.sqf b/addons/interaction/functions/fnc_doBecomeLeader.sqf index b2a423e0c0..8c8663b03b 100644 --- a/addons/interaction/functions/fnc_doBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_doBecomeLeader.sqf @@ -17,4 +17,4 @@ params ["_unit"]; -["selectLeader", units group _unit, [group _unit, _unit]] call EFUNC(common,targetEvent); +[QEGVAR(common,selectLeader), [group _unit, _unit], units group _unit] call CBA_fnc_targetEvent; diff --git a/addons/interaction/functions/fnc_getDown.sqf b/addons/interaction/functions/fnc_getDown.sqf index 2dc9711e2c..af0a9da38c 100644 --- a/addons/interaction/functions/fnc_getDown.sqf +++ b/addons/interaction/functions/fnc_getDown.sqf @@ -27,7 +27,7 @@ _chance = [0.5, 0.8] select (count weapons _unit > 0); { if (count weapons _x == 0 && {random 1 < _chance}) then { - ["getDown", [_x], [_x]] call EFUNC(common,targetEvent); + [QGVAR(getDown), [_x], [_x]] call CBA_fnc_targetEvent; }; false } count (_target nearEntities ["Civilian", SEND_RADIUS]); diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index 1ada3843c1..dfbb2b9070 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -31,5 +31,5 @@ if (_unit == ACE_player) then { _message = format [localize LSTRING(JoinedTeam), _team]; }; - ["displayTextStructured", _message] call EFUNC(common,localEvent); + [_message] call EFUNC(common,displayTextStructured); }; diff --git a/addons/interaction/functions/fnc_pardon.sqf b/addons/interaction/functions/fnc_pardon.sqf index 00fe2f6d17..e11a92e7db 100644 --- a/addons/interaction/functions/fnc_pardon.sqf +++ b/addons/interaction/functions/fnc_pardon.sqf @@ -15,4 +15,4 @@ params ["", "_target"]; -["pardon", [_target], [_target]] call EFUNC(common,targetEvent); +[QGVAR(pardon), [_target], [_target]] call CBA_fnc_targetEvent; diff --git a/addons/interaction/functions/fnc_passMagazine.sqf b/addons/interaction/functions/fnc_passMagazine.sqf index 7e2f7b9356..5016215c39 100644 --- a/addons/interaction/functions/fnc_passMagazine.sqf +++ b/addons/interaction/functions/fnc_passMagazine.sqf @@ -6,7 +6,7 @@ * 0: Unit that passes the magazine * 1: Unit to pass the magazine to * 2: Weapon classname - * + * * Return Value: * None * @@ -51,4 +51,4 @@ _target addMagazine [_magToPassClassName, _magToPassAmmoCount]; _playerName = [_player] call EFUNC(common,getName); _magToPassDisplayName = getText (configFile >> "CfgMagazines" >> _magToPassClassName >> "displayName"); -["displayTextStructured", [_target], [[LSTRING(PassMagazineHint), _playerName, _magToPassDisplayName], 1.5, _target]] call EFUNC(common,targetEvent); \ No newline at end of file +[QEGVAR(common,displayTextStructured), [[LSTRING(PassMagazineHint), _playerName, _magToPassDisplayName], 1.5, _target], [_target]] call CBA_fnc_targetEvent; diff --git a/addons/interaction/functions/fnc_push.sqf b/addons/interaction/functions/fnc_push.sqf index bdeaf29012..97534e2c68 100644 --- a/addons/interaction/functions/fnc_push.sqf +++ b/addons/interaction/functions/fnc_push.sqf @@ -22,4 +22,4 @@ private _newVelocity = vectorDir _unit; _newVelocity set [2, 0.25]; _newVelocity = _newVelocity vectorMultiply 2; -["setVelocity", [_boat], [_boat, _newVelocity]] call EFUNC(common,targetEvent); +[QEGVAR(common,setVelocity), [_boat, _newVelocity], [_boat]] call CBA_fnc_targetEvent; diff --git a/addons/interaction/functions/fnc_sendAway.sqf b/addons/interaction/functions/fnc_sendAway.sqf index 546ab9ba3f..c200587f2b 100644 --- a/addons/interaction/functions/fnc_sendAway.sqf +++ b/addons/interaction/functions/fnc_sendAway.sqf @@ -31,7 +31,7 @@ _chance = [0.5, 0.8] select (count weapons _unit > 0); _position = getPosASL _unit vectorAdd (eyeDirection _unit vectorMultiply SEND_DISTANCE); _position set [2, 0]; - ["sendAway", [_x], [_x, _position]] call EFUNC(common,targetEvent); + [QGVAR(sendAway), [_x, _position], [_x]] call CBA_fnc_targetEvent; }; false } count (_unit nearEntities ["Civilian", SEND_RADIUS]); diff --git a/addons/interaction/functions/fnc_switchLamp.sqf b/addons/interaction/functions/fnc_switchLamp.sqf index 20a2d45dea..bf386f9ef3 100644 --- a/addons/interaction/functions/fnc_switchLamp.sqf +++ b/addons/interaction/functions/fnc_switchLamp.sqf @@ -29,10 +29,7 @@ private _hitPointsDamage = []; } count _reflectors; //if lamp is on turn it off -private _eventName = ["lampTurnOn", "lampTurnOff"] select _isOn; -if(local _lamp) then { - [_eventName, [_lamp, _hitPointsDamage, DISABLED_LAMP_DMG]] call EFUNC(common,localEvent); -} else { - [_eventName, [_lamp], [_lamp, _hitPointsDamage, DISABLED_LAMP_DMG]] call EFUNC(common,targetEvent); -}; +private _eventName = [QGVAR(lampTurnOn), QGVAR(lampTurnOff)] select _isOn; +[_eventName, [_lamp, _hitPointsDamage, DISABLED_LAMP_DMG], [_lamp]] call CBA_fnc_targetEvent; + _lamp setVariable ["ACE_lampOn", !_isOn, true]; diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index 2061f1806f..d6621d2c07 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -25,4 +25,4 @@ if (_unit == ACE_player) then { _unit playActionNow "PutDown"; -["tapShoulder", [_target], [_target, _shoulderNum]] call EFUNC(common,targetEvent); +[QGVAR(tapShoulder), [_target, _shoulderNum], [_target]] call CBA_fnc_targetEvent; diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 812964bbb7..d9adf095fe 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -357,6 +357,7 @@ Sal del vehículo! Sortez ! Vystupte + Saia Team Management @@ -714,6 +715,7 @@ Allumer Accendi Zapnout + Ligar Turn off @@ -723,6 +725,7 @@ Eteindre Spegni Vypnout + Desligar Pass magazine diff --git a/addons/inventory/stringtable.xml b/addons/inventory/stringtable.xml index 6384c11641..56412a00b3 100644 --- a/addons/inventory/stringtable.xml +++ b/addons/inventory/stringtable.xml @@ -33,6 +33,7 @@ Zaini Mochilas Sacs à dos + Mochilas Headgear @@ -42,6 +43,7 @@ Copricapi Cascos Equipement de tête + Capacetes Glasses @@ -51,6 +53,7 @@ Occhiali Gafas Lunettes + Óculos Uniforms @@ -60,6 +63,7 @@ Uniformi Uniformes Uniformes + Uniformes Vests @@ -69,6 +73,7 @@ Vests Chalecos Gilets + Coletes Grenades @@ -78,6 +83,7 @@ Granate Granadas Grenades + Granadas Medical @@ -87,6 +93,7 @@ Medico Médico Médical + Médico \ No newline at end of file diff --git a/addons/laser/XEH_post_init.sqf b/addons/laser/XEH_post_init.sqf index c3c1f3f3cb..51473ceba6 100644 --- a/addons/laser/XEH_post_init.sqf +++ b/addons/laser/XEH_post_init.sqf @@ -2,6 +2,6 @@ #include "initKeybinds.sqf" -["laser_laserOn", {_this call DFUNC(handleLaserOn)}] call EFUNC(common,addEventHandler); -["laser_laserOff", {_this call DFUNC(handleLaserOff)}] call EFUNC(common,addEventHandler); +["ace_laserOn", {_this call DFUNC(handleLaserOn)}] call CBA_fnc_addEventHandler; +["ace_laserOff", {_this call DFUNC(handleLaserOff)}] call CBA_fnc_addEventHandler; diff --git a/addons/laser/config.cpp b/addons/laser/config.cpp index 1bf19317cf..2681c11294 100644 --- a/addons/laser/config.cpp +++ b/addons/laser/config.cpp @@ -16,3 +16,8 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" #include "RscInGameUI.hpp" + +class ACE_newEvents { + laser_laserOff = "ace_laserOff"; + laser_laserOn = "ace_laserOn"; +}; diff --git a/addons/laser/functions/fnc_laserOff.sqf b/addons/laser/functions/fnc_laserOff.sqf index 32f78bafd5..6ba5d95150 100644 --- a/addons/laser/functions/fnc_laserOff.sqf +++ b/addons/laser/functions/fnc_laserOff.sqf @@ -13,4 +13,4 @@ private ["_uuid"]; _uuid = _this select 0; -["laser_laserOff", [_uuid]] call EFUNC(common,globalEvent); +["ace_laserOff", [_uuid]] call CBA_fnc_globalEvent; diff --git a/addons/laser/functions/fnc_laserOn.sqf b/addons/laser/functions/fnc_laserOn.sqf index 12873b5ed0..b6e3258b90 100644 --- a/addons/laser/functions/fnc_laserOn.sqf +++ b/addons/laser/functions/fnc_laserOn.sqf @@ -19,5 +19,5 @@ private ["_uuid", "_args"]; _uuid = format["%1%2%3", floor diag_tickTime, floor random 1000, floor random 10000]; _args = [_uuid, _this]; -["laser_laserOn", _args] call EFUNC(common,globalEvent); +["ace_laserOn", _args] call CBA_fnc_globalEvent; _uuid; diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index c478fe33fd..9506a91fb5 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" // fixes laser when being captured. Needed, because the selectionPosition of the right hand is used -["SetHandcuffed", {if (_this select 1) then {(_this select 0) action ["GunLightOff", _this select 0]};}] call EFUNC(common,addEventHandler); +[QEGVAR(captives,setHandcuffed), {if (_this select 1) then {(_this select 0) action ["ace_gunLightOff", _this select 0]};}] call CBA_fnc_addEventHandler; if (!hasInterface) exitWith {}; @@ -10,7 +10,7 @@ GVAR(nearUnits) = []; #include "initKeybinds.sqf" -["SettingsInitialized", { +["ace_settingsInitialized", { //If not enabled, dont't add draw eventhandler or PFEH (for performance) if (!GVAR(enabled)) exitWith {}; @@ -32,4 +32,4 @@ GVAR(nearUnits) = []; addMissionEventHandler ["Draw3D", { call FUNC(onDraw); }]; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/laserpointer/config.cpp b/addons/laserpointer/config.cpp index 63ac154471..c727bc6407 100644 --- a/addons/laserpointer/config.cpp +++ b/addons/laserpointer/config.cpp @@ -18,3 +18,8 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" #include "CfgJointRails.hpp" + +class ACE_newEvents { + GunLightOff = "ace_gunLightOff"; + SetHandcuffed = QEGVAR(captives,setHandcuffed); +}; diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf index 25f452882c..65c0932bb7 100644 --- a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -24,7 +24,7 @@ _onFinish = { (_this select 0) params ["_caller", "_target"]; _caller removeItem "ACE_UAVBattery"; playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10]; - ["setFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local + [QEGVAR(common,setFuel), [_target, 1], [_target]] call CBA_fnc_targetEvent; //setFuel is local }; _onFailure = { diff --git a/addons/logistics_wirecutter/XEH_clientInit.sqf b/addons/logistics_wirecutter/XEH_clientInit.sqf index c46cab29f1..45e93bc6bd 100644 --- a/addons/logistics_wirecutter/XEH_clientInit.sqf +++ b/addons/logistics_wirecutter/XEH_clientInit.sqf @@ -2,4 +2,4 @@ if (!hasInterface) exitWith {}; -["interactMenuOpened", {_this call FUNC(interactEH)}] call EFUNC(common,addEventHandler); +["ace_interactMenuOpened", {_this call FUNC(interactEH)}] call CBA_fnc_addEventHandler; diff --git a/addons/logistics_wirecutter/config.cpp b/addons/logistics_wirecutter/config.cpp index 910dcdc9bb..10612568e1 100644 --- a/addons/logistics_wirecutter/config.cpp +++ b/addons/logistics_wirecutter/config.cpp @@ -16,3 +16,7 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgWeapons.hpp" #include "CfgVehicles.hpp" + +class ACE_newEvents { + interactMenuOpened = "ace_interactMenuOpened"; +}; \ No newline at end of file diff --git a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf index fc875c8d2b..88cd0ff275 100644 --- a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf +++ b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf @@ -1,6 +1,6 @@ /* - * Author: PabstMirror,commy2, esteldunedain, Ruthberg - * Gets magazine children for interaciton menu + * Author: PabstMirror, commy2, esteldunedain, Ruthberg + * Gets magazine children for interaciton menu. * * Argument: * 0: Target @@ -16,13 +16,11 @@ */ #include "script_component.hpp" -private ["_unitMagazines", "_unitMagCounts", "_index", "_actions", "_displayName", "_picture", "_action"]; - params ["_target", "_player"]; // get all mags and ammo count -_unitMagazines = []; -_unitMagCounts = []; +private _unitMagazines = []; +private _unitMagCounts = []; { private "_xFullMagazineCount"; _x params ["_xClassname", "_xCount", "_xLoaded", "_xType"]; @@ -31,7 +29,7 @@ _unitMagCounts = []; //for every partial magazine, that is either in inventory or can be moved there if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {_player canAdd _xClassname}}) then { - _index = _unitMagazines find _xClassname; + private _index = _unitMagazines find _xClassname; if (_index == -1) then { _unitMagazines pushBack _xClassname; _unitMagCounts pushBack [_xCount]; @@ -42,13 +40,13 @@ _unitMagCounts = []; } forEach (magazinesAmmoFull _player); //Create the action children for all appropriate magazines -_actions = []; +private _actions = []; { if ((count (_unitMagCounts select _forEachIndex)) >= 2) then {// Ignore invalid magazines types (need 2+ partial mags to do anything) - _displayName = getText (configFile >> "CfgMagazines" >> _x >> "displayName"); - _picture = getText (configFile >> "CfgMagazines" >> _x >> "picture"); + private _displayName = getText (configFile >> "CfgMagazines" >> _x >> "displayName"); + private _picture = getText (configFile >> "CfgMagazines" >> _x >> "picture"); - _action = [_x, _displayName, _picture, {_this call FUNC(startRepackingMagazine)}, {true}, {}, _x] call EFUNC(interact_menu,createAction); + private _action = [_x, _displayName, _picture, {_this call FUNC(startRepackingMagazine)}, {true}, {}, _x] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _player]; }; } forEach _unitMagazines; diff --git a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf index f0fbcf49c1..36544b0084 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf @@ -19,39 +19,36 @@ */ #include "script_component.hpp" -private ["_structuredOutputText", "_picture", "_fullMags", "_partialMags", "_fullMagazineCount"]; - params ["_args", "_elapsedTime", "_totalTime", "_errorCode"]; _args params ["_magazineClassname", "_lastAmmoCount"]; -_fullMagazineCount = getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "count"); +private _fullMagazineCount = getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "count"); -//Don't show anything if player can't interact: +// Don't show anything if player can't interact if (!([ACE_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith))) exitWith {}; -_structuredOutputText = if (_errorCode == 0) then { - format ["%1
", (localize LSTRING(RepackComplete))]; +// Count mags +private _fullMags = 0; +private _partialMags = 0; +{ + _x params ["_classname", "_count"]; + + if (_classname == _magazineClassname && {_count > 0}) then { + if (_count == _fullMagazineCount) then { + _fullMags = _fullMags + 1; + } else { + _partialMags = _partialMags + 1; + }; + }; +} forEach (magazinesAmmoFull ACE_player); + +private _repackedMagsText = format [localize LSTRING(RepackedMagazinesCount), _fullMags, _partialMags]; + +private _structuredOutputText = if (_errorCode == 0) then { + format ["%1
%2", localize LSTRING(RepackComplete), _repackedMagsText]; } else { - format ["%1
", (localize LSTRING(RepackInterrupted))]; + format ["%1
%2", localize LSTRING(RepackInterrupted), _repackedMagsText]; }; -_picture = getText (configFile >> "CfgMagazines" >> _magazineClassname >> "picture"); -_structuredOutputText = _structuredOutputText + format ["
", _picture]; - -//EFUNC(common,displayTextStructured) doesn't have room for this, and I don't think it's nessacary, can fix in the future if wanted: - -// _fullMags = 0; -// _partialMags = 0; -// { - // EXPLODE_2_PVT(_x,_xClassname,_xCount); - // if ((_xClassname == _magazineClassname) && {_xCount > 0}) then { - // if (_xCount == _fullMagazineCount) then { - // _fullMags = _fullMags + 1; - // } else { - // _partialMags = _partialMags + 1; - // }; - // }; -// } forEach (magazinesAmmoFull ACE_player); -// _structuredOutputText = _structuredOutputText + format [("" + (localize LSTRING(RepackedMagazinesCount)) + ""), _fullMags, _partialMags]; - -[parseText _structuredOutputText, 2] call EFUNC(common,displayTextStructured); +private _picture = getText (configFile >> "CfgMagazines" >> _magazineClassname >> "picture"); +[_structuredOutputText, _picture, nil, nil, 2.5] call EFUNC(common,displayTextPicture); diff --git a/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf b/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf index c1bf5ebdab..3808df4cdc 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf @@ -18,19 +18,16 @@ */ #include "script_component.hpp" -private ["_currentAmmoCount", "_addedMagazines", "_missingAmmo", "_index", "_updateMagazinesOnPlayerFnc"]; - params ["_ars", "_elapsedTime", "_totalTime"]; _args params ["_magazineClassname", "_lastAmmoCount", "_simEvents"]; if !((_simEvents select 0) params ["_nextEventTime", "_nextEventIsBullet", "_nextEventMags"]) exitWith { ERROR("No Event"); false }; - if (_nextEventTime > _elapsedTime) exitWith { true };//waiting on next event //Verify we aren't missing any ammo -_currentAmmoCount = []; +private _currentAmmoCount = []; { _x params ["_xClassname", "_xCount"]; if (_xClassname == _magazineClassname) then { @@ -39,11 +36,11 @@ _currentAmmoCount = []; } forEach (magazinesAmmo ACE_player); //only inventory mags //Go through mags we currently have and check off the ones we should have -_addedMagazines = +_currentAmmoCount; -_missingAmmo = false; +private _addedMagazines = +_currentAmmoCount; +private _missingAmmo = false; { if (_x > 0) then { - _index = _addedMagazines find _x; + private _index = _addedMagazines find _x; if (_index != -1) then { _addedMagazines deleteAt _index; } else { @@ -54,7 +51,7 @@ _missingAmmo = false; if (_missingAmmo) exitWith { false }; //something removed ammo that was being repacked (could be other players or scripts) -_updateMagazinesOnPlayerFnc = { +private _updateMagazinesOnPlayerFnc = { ACE_player removeMagazines _magazineClassname; //remove inventory magazines { if (_x > 0) then { diff --git a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf index 230bdefb4f..09c04de26e 100644 --- a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf +++ b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf @@ -19,47 +19,26 @@ */ #include "script_component.hpp" -private ["_fnc_newMag", "_time", "_events", "_fnc_swapAmmo", "_ammoSwaped", "_lowIndex", "_highIndex", "_ammoToTransfer", "_ammoAvailable", "_ammoNeeded", "_swapProgress"]; - params ["_fullMagazineCount", "_arrayOfAmmoCounts", "_isBelt"]; // Sort Ascending - Don't modify original _arrayOfAmmoCounts = +_arrayOfAmmoCounts; _arrayOfAmmoCounts sort true; -_fnc_newMag = { +private _fnc_newMag = { _time = _time + GVAR(TimePerMagazine); _events pushBack [_time, false, +_arrayOfAmmoCounts]; }; -_fnc_swapAmmo = if (_isBelt) then { - { - _time = _time + GVAR(TimePerBeltLink); - _arrayOfAmmoCounts set [_lowIndex, ((_arrayOfAmmoCounts select _lowIndex) - _ammoSwaped)]; - _arrayOfAmmoCounts set [_highIndex, ((_arrayOfAmmoCounts select _highIndex) + _ammoSwaped)]; - _events pushBack [_time, true, +_arrayOfAmmoCounts]; - } -} else { - { - for "_swapProgress" from 0 to (_ammoSwaped - 1) do { - _time = _time + GVAR(TimePerAmmo); - _arrayOfAmmoCounts set [_lowIndex, ((_arrayOfAmmoCounts select _lowIndex) - 1)]; - _arrayOfAmmoCounts set [_highIndex, ((_arrayOfAmmoCounts select _highIndex) + 1)]; - _events pushBack [_time, true, +_arrayOfAmmoCounts]; - }; - } -}; - -_lowIndex = 0; -_highIndex = (count _arrayOfAmmoCounts) - 1; -_ammoToTransfer = 0; -_ammoAvailable = 0; - -_time = 0; -_events = []; +private _lowIndex = 0; +private _highIndex = (count _arrayOfAmmoCounts) - 1; +private _ammoToTransfer = 0; +private _ammoAvailable = 0; +private _time = 0; +private _events = []; while {_lowIndex < _highIndex} do { - _ammoNeeded = _fullMagazineCount - (_arrayOfAmmoCounts select _highIndex); + private _ammoNeeded = _fullMagazineCount - (_arrayOfAmmoCounts select _highIndex); _ammoAvailable = _arrayOfAmmoCounts select _lowIndex; if (_ammoAvailable == 0) then { @@ -70,8 +49,20 @@ while {_lowIndex < _highIndex} do { _highIndex = _highIndex - 1; call _fnc_newMag; } else { - _ammoSwaped = _ammoAvailable min _ammoNeeded; - call _fnc_swapAmmo; + private _ammoSwaped = _ammoAvailable min _ammoNeeded; + if (_isBelt) then { + _time = _time + GVAR(TimePerBeltLink); + _arrayOfAmmoCounts set [_lowIndex, (_arrayOfAmmoCounts select _lowIndex) - _ammoSwaped]; + _arrayOfAmmoCounts set [_highIndex, (_arrayOfAmmoCounts select _highIndex) + _ammoSwaped]; + _events pushBack [_time, true, +_arrayOfAmmoCounts]; + } else { + for "_swapProgress" from 0 to (_ammoSwaped - 1) do { + _time = _time + GVAR(TimePerAmmo); + _arrayOfAmmoCounts set [_lowIndex, (_arrayOfAmmoCounts select _lowIndex) - 1]; + _arrayOfAmmoCounts set [_highIndex, (_arrayOfAmmoCounts select _highIndex) + 1]; + _events pushBack [_time, true, +_arrayOfAmmoCounts]; + }; + }; }; }; }; diff --git a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf index 859bbdfdfa..32ce65d188 100644 --- a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf +++ b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf @@ -13,39 +13,37 @@ * Nothing * * Example: - * ["30Rnd_65x39_caseless_mag"] call ace_magazinerepack_fnc_startRepackingMagazine + * [player, player, "30Rnd_65x39_caseless_mag"] call ace_magazinerepack_fnc_startRepackingMagazine * * Public: No */ #include "script_component.hpp" -private ["_magazineCfg", "_fullMagazineCount", "_isBelt", "_startingAmmoCounts", "_simEvents", "_totalTime"]; - params ["_target", "_player", "_magazineClassname"]; if (isNil "_magazineClassname" || {_magazineClassname == ""}) exitWith {ERROR("Bad Mag Classname");}; -_magazineCfg = configFile >> "CfgMagazines" >> _magazineClassname; +private _magazineCfg = configFile >> "CfgMagazines" >> _magazineClassname; // Calculate actual ammo to transfer during repack -_fullMagazineCount = getNumber (_magazineCfg >> "count"); +private _fullMagazineCount = getNumber (_magazineCfg >> "count"); //Is linked belt magazine: -_isBelt = (isNumber (_magazineCfg >> "ACE_isBelt")) && {(getNumber (_magazineCfg >> "ACE_isBelt")) == 1}; +private _isBelt = isNumber (_magazineCfg >> "ACE_isBelt") && {(getNumber (_magazineCfg >> "ACE_isBelt")) == 1}; //Check canInteractWith: -if (!([_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith))) exitWith {}; +if !([_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {}; [_player] call EFUNC(common,goKneeling); -_startingAmmoCounts = []; +private _startingAmmoCounts = []; { - EXPLODE_4_PVT(_x,_xClassname,_xCount,_xLoaded,_xType); - if ((_xClassname == _magazineClassname) && {(_xCount != _fullMagazineCount) && {_xCount > 0}}) then { + _x params ["_xClassname", "_xCount", "_xLoaded", "_xType"]; + if (_xClassname == _magazineClassname && {_xCount != _fullMagazineCount && {_xCount > 0}}) then { if (_xLoaded) then { //Try to Remove from weapon and add to inventory, otherwise ignore if (_player canAdd _magazineClassname) then { switch (_xType) do { - case (1): {_player removePrimaryWeaponItem _magazineClassname;}; - case (2): {_player removeHandgunItem _magazineClassname;}; - case (4): {_player removeSecondaryWeaponItem _magazineClassname;}; + case (1): {_player removePrimaryWeaponItem _magazineClassname}; + case (2): {_player removeHandgunItem _magazineClassname}; + case (4): {_player removeSecondaryWeaponItem _magazineClassname}; default {ERROR("Loaded Location Invalid");}; }; _player addMagazine [_magazineClassname, _xCount]; @@ -57,10 +55,10 @@ _startingAmmoCounts = []; }; } forEach (magazinesAmmoFull _player); -if ((count _startingAmmoCounts) < 2) exitWith {ERROR("Not Enough Mags to Repack");}; +if (count _startingAmmoCounts < 2) exitWith {ERROR("Not Enough Mags to Repack");}; -_simEvents = [_fullMagazineCount, _startingAmmoCounts, _isBelt] call FUNC(simulateRepackEvents); -_totalTime = (_simEvents select ((count _simEvents) - 1) select 0); +private _simEvents = [_fullMagazineCount, _startingAmmoCounts, _isBelt] call FUNC(simulateRepackEvents); +private _totalTime = _simEvents select (count _simEvents - 1) select 0; [ _totalTime, diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 7ee567cabf..f598266695 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -73,7 +73,7 @@ call FUNC(determineZoom); [_this select 1] call CBA_fnc_removePerFrameHandler; }, 0] call CBA_fnc_addPerFrameHandler; -["SettingsInitialized", { +["ace_settingsInitialized", { if (isMultiplayer && {GVAR(DefaultChannel) != -1}) then { //Set the chat channel once the map has finished loading [{ @@ -100,15 +100,15 @@ call FUNC(determineZoom); GVAR(flashlightInUse) = ""; GVAR(glow) = objNull; - ["playerInventoryChanged", { + ["ace_playerInventoryChanged", { private _flashlights = [ACE_player] call FUNC(getUnitFlashlights); if ((GVAR(flashlightInUse) != "") && !(GVAR(flashlightInUse) in _flashlights)) then { GVAR(flashlightInUse) = ""; }; - }] call EFUNC(common,addEventHandler); + }] call CBA_fnc_addEventHandler; if (GVAR(mapGlow)) then { - ["visibleMapChanged", { + ["ace_visibleMapChanged", { params ["_player", "_mapOn"]; if (_mapOn) then { if (!alive _player && !isNull GVAR(glow)) then { @@ -128,15 +128,15 @@ call FUNC(determineZoom); [""] call FUNC(flashlightGlow); }; }; - }] call EFUNC(common,addEventHandler); + }] call CBA_fnc_addEventHandler; }; }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // hide clock on map if player has no watch GVAR(hasWatch) = true; -["playerInventoryChanged", { +["ace_playerInventoryChanged", { if (isNull (_this select 0)) exitWith { GVAR(hasWatch) = true; }; @@ -145,4 +145,4 @@ GVAR(hasWatch) = true; if (_x isKindOf ["ItemWatch", configFile >> "CfgWeapons"]) exitWith {GVAR(hasWatch) = true;}; false } count (assignedItems ACE_player); -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/map/config.cpp b/addons/map/config.cpp index 78bf2340b7..17e9aae0ab 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -163,4 +163,4 @@ class RscDisplayServerGetReady: RscDisplayGetReady { #include "MapControls.hpp" }; }; -}; \ No newline at end of file +}; diff --git a/addons/map_gestures/XEH_postInit.sqf b/addons/map_gestures/XEH_postInit.sqf index 233ee23c04..185eaf97f0 100644 --- a/addons/map_gestures/XEH_postInit.sqf +++ b/addons/map_gestures/XEH_postInit.sqf @@ -6,7 +6,7 @@ if (["STMapGestures"] call EFUNC(common,isModLoaded)) exitWith { if (!hasInterface) exitWith {}; -["SettingsInitialized", { +["ace_settingsInitialized", { if (!GVAR(enabled)) exitWith {}; [{ if (isNull (findDisplay 12)) exitWith {}; @@ -18,4 +18,4 @@ if (!hasInterface) exitWith {}; [_pfhId] call CBA_fnc_removePerFrameHandler; }, 1, []] call CBA_fnc_addPerFrameHandler; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/map_gestures/XEH_serverPostInit.sqf b/addons/map_gestures/XEH_serverPostInit.sqf index bde1cdc55b..1b70e24149 100644 --- a/addons/map_gestures/XEH_serverPostInit.sqf +++ b/addons/map_gestures/XEH_serverPostInit.sqf @@ -1,3 +1,3 @@ #include "script_component.hpp" -[EVENT_PLAYER_HAS_NO_OWNER_ID, FUNC(assignClientIDOnServer)] call EFUNC(common,addEventHandler); +[QGVAR(noOwnerID), FUNC(assignClientIDOnServer)] call CBA_fnc_addEventHandler; diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf index c9dc487db2..aacff9e679 100644 --- a/addons/map_gestures/functions/fnc_transmit.sqf +++ b/addons/map_gestures/functions/fnc_transmit.sqf @@ -31,7 +31,7 @@ if (!GVAR(EnableTransmit) || !visibleMap) exitWith { { _ownerID = _x getVariable QGVAR(owner_id); if (isNil "_ownerID") then { - [EVENT_PLAYER_HAS_NO_OWNER_ID, [name _x]] call EFUNC(common,serverEvent); + [QGVAR(noOwnerID), [name _x]] call CBA_fnc_serverEvent; } else { _playerOwnerID = ACE_player getVariable QGVAR(owner_id); if (!isNil "_playerOwnerID" && _ownerID != _playerOwnerID) then { diff --git a/addons/map_gestures/script_component.hpp b/addons/map_gestures/script_component.hpp index 2bc9b212d0..bcf6a1a97c 100644 --- a/addons/map_gestures/script_component.hpp +++ b/addons/map_gestures/script_component.hpp @@ -15,5 +15,3 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" - -#define EVENT_PLAYER_HAS_NO_OWNER_ID "PlayerNameHasNoOwnerID" diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index 06cb8eda3d..ec2293b3e2 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -66,7 +66,7 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; 12 call _fnc_installMapEvents; }; -["visibleMapChanged", { +["ace_visibleMapChanged", { params ["", "_mapOn"]; if (_mapOn) then { // Show GPS if required @@ -77,4 +77,4 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; // Cancel drawing call FUNC(cancelDrawing); }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/maptools/XEH_preInit.sqf b/addons/maptools/XEH_preInit.sqf index 3022d53753..76daa4f305 100644 --- a/addons/maptools/XEH_preInit.sqf +++ b/addons/maptools/XEH_preInit.sqf @@ -10,10 +10,10 @@ if (isServer) then { }; //Add Event Handlers: -["drawing_removeLineMarker", FUNC(removeLineMarker) ] call EFUNC(common,addEventHandler); -["drawing_addLineMarker", FUNC(addLineMarker) ] call EFUNC(common,addEventHandler); +[QGVAR(removeLineMarker), FUNC(removeLineMarker)] call CBA_fnc_addEventHandler; +[QGVAR(addLineMarker), FUNC(addLineMarker)] call CBA_fnc_addEventHandler; -["drawing_requestMarkers", FUNC(copyMapRemoteSend) ] call EFUNC(common,addEventHandler); -["drawing_sendbackMarkers", FUNC(copyMapReceiveMarkers) ] call EFUNC(common,addEventHandler); +[QGVAR(requestMarkers), FUNC(copyMapRemoteSend)] call CBA_fnc_addEventHandler; +[QGVAR(sendbackMarkers), FUNC(copyMapReceiveMarkers)] call CBA_fnc_addEventHandler; ADDON = true; diff --git a/addons/maptools/config.cpp b/addons/maptools/config.cpp index 6fedff6302..29a7b87a1e 100644 --- a/addons/maptools/config.cpp +++ b/addons/maptools/config.cpp @@ -67,3 +67,10 @@ class RscDisplayServerGetReady: RscDisplayGetReady { }; }; }; + +class ACE_newEvents { + drawing_sendbackMarkers = QGVAR(sendbackMarkers); + drawing_requestMarkers = QGVAR(requestMarkers); + drawing_addLineMarker = QGVAR(addLineMarker); + drawing_removeLineMarker = QGVAR(removeLineMarker); +}; diff --git a/addons/maptools/functions/fnc_copyMapRemoteSend.sqf b/addons/maptools/functions/fnc_copyMapRemoteSend.sqf index 551019f900..56ea2683e9 100644 --- a/addons/maptools/functions/fnc_copyMapRemoteSend.sqf +++ b/addons/maptools/functions/fnc_copyMapRemoteSend.sqf @@ -14,4 +14,4 @@ params ["_requester"]; -["drawing_sendbackMarkers", _requester, [GVAR(drawing_lineMarkers)]] call EFUNC(common,targetEvent); +[QGVAR(sendbackMarkers), [GVAR(drawing_lineMarkers)], _requester] call CBA_fnc_targetEvent; diff --git a/addons/maptools/functions/fnc_copyMapStart.sqf b/addons/maptools/functions/fnc_copyMapStart.sqf index 7295f6f499..62361447f6 100644 --- a/addons/maptools/functions/fnc_copyMapStart.sqf +++ b/addons/maptools/functions/fnc_copyMapStart.sqf @@ -19,4 +19,4 @@ params ["_player", "_target"]; -["drawing_requestMarkers", _target, [_player]] call EFUNC(common,targetEvent); +[QGVAR(requestMarkers), [_player], _target] call CBA_fnc_targetEvent; diff --git a/addons/maptools/functions/fnc_handleKeyDown.sqf b/addons/maptools/functions/fnc_handleKeyDown.sqf index a83522ac91..c93ce4724c 100644 --- a/addons/maptools/functions/fnc_handleKeyDown.sqf +++ b/addons/maptools/functions/fnc_handleKeyDown.sqf @@ -58,7 +58,7 @@ if (_code == DIK_DELETE) exitWith { if (_lambdaLong >= 0 && _lambdaLong <= _magDiffVector && _lambdaTrasAbs <= 5) exitWith { // Delete the line marker if (GVAR(drawing_syncMarkers)) then { - ["drawing_removeLineMarker", [_x select 0]] call EFUNC(common,globalEvent); + [QGVAR(removeLineMarker), [_x select 0]] call CBA_fnc_globalEvent; } else { deleteMarkerLocal (_x select 0); GVAR(drawing_lineMarkers) = GVAR(drawing_lineMarkers) - [_x]; diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index cb1a4598ad..62debbb55f 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -42,7 +42,7 @@ if (_dir != 1) then { // Already drawing -> Add tempLineMarker to permanent list if (GVAR(drawing_syncMarkers)) then { deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0); - ["drawing_addLineMarker", GVAR(drawing_tempLineMarker)] call EFUNC(common,globalEvent); + [QGVAR(addLineMarker), GVAR(drawing_tempLineMarker)] call CBA_fnc_globalEvent; // Log who drew on the briefing screen [ACE_INFOFORMAT_1("Player %1 drew on the briefing screen", profileName)] call EFUNC(common,serverLog); } else { diff --git a/addons/markers/XEH_postInit.sqf b/addons/markers/XEH_postInit.sqf index 7b5924d680..6e1af95a50 100644 --- a/addons/markers/XEH_postInit.sqf +++ b/addons/markers/XEH_postInit.sqf @@ -2,15 +2,15 @@ #include "script_component.hpp" // recieve remote marker data -[QGVAR(setMarkerNetwork), {_this call DFUNC(setMarkerNetwork)}] call EFUNC(common,addEventHandler); +[QGVAR(setMarkerNetwork), {_this call DFUNC(setMarkerNetwork)}] call CBA_fnc_addEventHandler; // recieve marker data for JIP -[QGVAR(setMarkerJIP), {_this call DFUNC(setMarkerJIP)}] call EFUNC(common,addEventHandler); +[QGVAR(setMarkerJIP), {_this call DFUNC(setMarkerJIP)}] call CBA_fnc_addEventHandler; // request marker data for JIP if (isMultiplayer && {!isServer} && {hasInterface}) then { GVAR(localLogic) = (createGroup sideLogic) createUnit ["Logic", [0,0,0], [], 0, "NONE"]; - [QGVAR(sendMarkersJIP), [GVAR(localLogic)]] call EFUNC(common,serverEvent); + [QGVAR(sendMarkersJIP), [GVAR(localLogic)]] call CBA_fnc_serverEvent; }; GVAR(mapDisplaysWithDrawEHs) = []; diff --git a/addons/markers/XEH_preInit.sqf b/addons/markers/XEH_preInit.sqf index 5308117754..da62205b51 100644 --- a/addons/markers/XEH_preInit.sqf +++ b/addons/markers/XEH_preInit.sqf @@ -50,6 +50,6 @@ if (isNil QGVAR(MarkerColorsCache)) then { }; //Server Sync JIP markers: -[QGVAR(sendMarkersJIP), FUNC(sendMarkersJIP)] call EFUNC(common,addEventHandler); +[QGVAR(sendMarkersJIP), FUNC(sendMarkersJIP)] call CBA_fnc_addEventHandler; ADDON = true; diff --git a/addons/markers/functions/fnc_placeMarker.sqf b/addons/markers/functions/fnc_placeMarker.sqf index d3f52413be..281953e104 100644 --- a/addons/markers/functions/fnc_placeMarker.sqf +++ b/addons/markers/functions/fnc_placeMarker.sqf @@ -30,7 +30,7 @@ if (_closeNum == 1) then { GETGVAR(currentMarkerPosition,[]), GETGVAR(currentMarkerAngle,0) ] - ]] call EFUNC(common,globalEvent); + ]] call CBA_fnc_globalEvent; }, []] call CBA_fnc_execNextFrame; }; diff --git a/addons/markers/functions/fnc_sendMarkersJIP.sqf b/addons/markers/functions/fnc_sendMarkersJIP.sqf index 5b1a779b27..e63a32b843 100644 --- a/addons/markers/functions/fnc_sendMarkersJIP.sqf +++ b/addons/markers/functions/fnc_sendMarkersJIP.sqf @@ -20,6 +20,6 @@ TRACE_1("params",_logic); [ QGVAR(setMarkerJIP), - [_logic], - [GETGVAR(allMapMarkers,[]), GETGVAR(allMapMarkersProperties,[])] -] call EFUNC(common,targetEvent); + [GETGVAR(allMapMarkers,[]), GETGVAR(allMapMarkersProperties,[])], + [_logic] +] call CBA_fnc_targetEvent; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index e26815ec7c..194292de27 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -6,34 +6,32 @@ GVAR(heartBeatSounds_Fast) = ["ACE_heartbeat_fast_1", "ACE_heartbeat_fast_2", "A GVAR(heartBeatSounds_Normal) = ["ACE_heartbeat_norm_1", "ACE_heartbeat_norm_2"]; GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; -["medical_propagateWound", FUNC(onPropagateWound)] call EFUNC(common,addEventHandler); -["medical_woundUpdateRequest", FUNC(onWoundUpdateRequest)] call EFUNC(common,addEventHandler); -["interactMenuClosed", {[objNull, false] call FUNC(displayPatientInformation); }] call EFUNC(common,addEventHandler); +["ace_interactMenuClosed", {[objNull, false] call FUNC(displayPatientInformation); }] call CBA_fnc_addEventHandler; //Treatment EventHandlers: -["actionCheckBloodPressureLocal", DFUNC(actionCheckBloodPressureLocal)] call EFUNC(common,addEventHandler); -["actionCheckPulseLocal", DFUNC(actionCheckPulseLocal)] call EFUNC(common,addEventHandler); -["addToInjuredCollection", DFUNC(addToInjuredCollection)] call EFUNC(common,addEventHandler); -["addToMedicalLog", DFUNC(addToLog)] call EFUNC(common,addEventHandler); -["addToTriageCard", DFUNC(addToTriageCard)] call EFUNC(common,addEventHandler); -["setDead", DFUNC(setDead)] call EFUNC(common,addEventHandler); -["setHitPointDamage", DFUNC(setHitPointDamage)] call EFUNC(common,addEventHandler); -["setUnconscious", DFUNC(setUnconscious)] call EFUNC(common,addEventHandler); -["treatmentAdvanced_bandageLocal", DFUNC(treatmentAdvanced_bandageLocal)] call EFUNC(common,addEventHandler); -["treatmentAdvanced_CPRLocal", DFUNC(treatmentAdvanced_CPRLocal)] call EFUNC(common,addEventHandler); -["treatmentAdvanced_fullHealLocal", DFUNC(treatmentAdvanced_fullHealLocal)] call EFUNC(common,addEventHandler); -["treatmentAdvanced_medicationLocal", DFUNC(treatmentAdvanced_medicationLocal)] call EFUNC(common,addEventHandler); -["treatmentBasic_bandageLocal", DFUNC(treatmentBasic_bandageLocal)] call EFUNC(common,addEventHandler); -["treatmentBasic_bloodbagLocal", DFUNC(treatmentBasic_bloodbagLocal)] call EFUNC(common,addEventHandler); -["treatmentBasic_morphineLocal", DFUNC(treatmentBasic_morphineLocal)] call EFUNC(common,addEventHandler); -["treatmentIVLocal", DFUNC(treatmentIVLocal)] call EFUNC(common,addEventHandler); -["treatmentTourniquetLocal", DFUNC(treatmentTourniquetLocal)] call EFUNC(common,addEventHandler); -["actionPlaceInBodyBag", FUNC(actionPlaceInBodyBag)] call EFUNC(common,addEventHandler); +[QGVAR(actionCheckBloodPressureLocal), DFUNC(actionCheckBloodPressureLocal)] call CBA_fnc_addEventHandler; +[QGVAR(actionCheckPulseLocal), DFUNC(actionCheckPulseLocal)] call CBA_fnc_addEventHandler; +[QGVAR(addVitalLoop), DFUNC(addVitalLoop)] call CBA_fnc_addEventHandler; +[QGVAR(addToMedicalLog), DFUNC(addToLog)] call CBA_fnc_addEventHandler; +[QGVAR(addToTriageCard), DFUNC(addToTriageCard)] call CBA_fnc_addEventHandler; +[QGVAR(setDead), DFUNC(setDead)] call CBA_fnc_addEventHandler; +[QGVAR(setHitPointDamage), DFUNC(setHitPointDamage)] call CBA_fnc_addEventHandler; +[QGVAR(setUnconscious), DFUNC(setUnconscious)] call CBA_fnc_addEventHandler; +[QGVAR(treatmentAdvanced_bandageLocal), DFUNC(treatmentAdvanced_bandageLocal)] call CBA_fnc_addEventHandler; +[QGVAR(treatmentAdvanced_CPRLocal), DFUNC(treatmentAdvanced_CPRLocal)] call CBA_fnc_addEventHandler; +[QGVAR(treatmentAdvanced_fullHealLocal), DFUNC(treatmentAdvanced_fullHealLocal)] call CBA_fnc_addEventHandler; +[QGVAR(treatmentAdvanced_medicationLocal), DFUNC(treatmentAdvanced_medicationLocal)] call CBA_fnc_addEventHandler; +[QGVAR(treatmentBasic_bandageLocal), DFUNC(treatmentBasic_bandageLocal)] call CBA_fnc_addEventHandler; +[QGVAR(treatmentBasic_bloodbagLocal), DFUNC(treatmentBasic_bloodbagLocal)] call CBA_fnc_addEventHandler; +[QGVAR(treatmentBasic_morphineLocal), DFUNC(treatmentBasic_morphineLocal)] call CBA_fnc_addEventHandler; +[QGVAR(treatmentIVLocal), DFUNC(treatmentIVLocal)] call CBA_fnc_addEventHandler; +[QGVAR(treatmentTourniquetLocal), DFUNC(treatmentTourniquetLocal)] call CBA_fnc_addEventHandler; +[QGVAR(actionPlaceInBodyBag), FUNC(actionPlaceInBodyBag)] call CBA_fnc_addEventHandler; //Handle Deleting Bodies on Server: -if (isServer) then {["placedInBodyBag", FUNC(serverRemoveBody)] call EFUNC(common,addEventHandler);}; +if (isServer) then {["ace_placedInBodyBag", FUNC(serverRemoveBody)] call CBA_fnc_addEventHandler;}; -["medical_onUnconscious", { +["ace_unconscious", { params ["_unit", "_status"]; if (local _unit) then { if (_status) then { @@ -48,7 +46,7 @@ if (isServer) then {["placedInBodyBag", FUNC(serverRemoveBody)] call EFUNC(commo _unit setVariable ["acre_sys_core_isDisabled", false, true]; }; }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // Initialize all effects @@ -264,7 +262,7 @@ GVAR(lastHeartBeatSound) = CBA_missionTime; }, 0, []] call CBA_fnc_addPerFrameHandler; }; -["SettingsInitialized", { +["ace_settingsInitialized", { // Networked litter (need to wait for GVAR(litterCleanUpDelay) to be set) [QGVAR(createLitter), FUNC(handleCreateLitter), GVAR(litterCleanUpDelay)] call EFUNC(common,addSyncedEventHandler); @@ -287,18 +285,18 @@ GVAR(lastHeartBeatSound) = CBA_missionTime; {((_this select 0) getVariable [QGVAR(inReviveState), false])}, {((_this select 0) getVariable ["ACE_isDead", false])} ] call FUNC(addUnconsciousCondition); -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // Prevent all types of interaction while unconscious // @todo: probably remove this when CBA keybind hold key works properly ["isNotUnconscious", {!((_this select 0) getVariable ["ACE_isUnconscious", false])}] call EFUNC(common,addCanInteractWithCondition); // Item Event Handler -["playerInventoryChanged", FUNC(itemCheck)] call EFUNC(common,addEventHandler); +["ace_playerInventoryChanged", FUNC(itemCheck)] call CBA_fnc_addEventHandler; if (hasInterface) then { - ["PlayerJip", { + ["ace_playerJIP", { ACE_LOGINFO("JIP Medical init for player."); [player] call FUNC(init); - }] call EFUNC(common,addEventHandler); + }] call CBA_fnc_addEventHandler; }; diff --git a/addons/medical/XEH_respawn.sqf b/addons/medical/XEH_respawn.sqf index 7d48672972..1d1c34d6c7 100644 --- a/addons/medical/XEH_respawn.sqf +++ b/addons/medical/XEH_respawn.sqf @@ -7,7 +7,7 @@ params ["_unit"]; // Reset captive status for respawning unit if (!(_unit getVariable ["ACE_isUnconscious", false])) then { - [_unit, "setCaptive", QGVAR(unconscious), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", "ace_unconscious", false] call EFUNC(common,statusEffect_set); }; // Remove maximum unconsciousness time handler diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp index 911c9bd125..27aacb04e7 100644 --- a/addons/medical/config.cpp +++ b/addons/medical/config.cpp @@ -24,3 +24,32 @@ class CfgPatches { #include "ACE_Settings.hpp" #include "UI\RscTitles.hpp" #include "UI\triagecard.hpp" + +class ACE_newEvents { + medical_onUnconscious = "ace_unconscious"; + medical_treatmentSuccess = "ace_treatmentSuccess"; + medical_onSetDead = "ace_killed"; + Medical_onEnteredCardiacArrest = "ace_enteredCardiacArrest"; + Medical_onItemAddedToTriageCard = "ace_itemAddedToTriageCard"; + medical_onLogEntryAdded = "ace_medicalLogEntryAdded"; + Medical_onHeartRateAdjustmentAdded = "ace_addedHeartRateAdjustment"; + placedInBodyBag = "ace_placedInBodyBag"; + actionPlaceInBodyBag = QGVAR(actionPlaceInBodyBag); + treatmentTourniquetLocal = QGVAR(treatmentTourniquetLocal); + treatmentIVLocal = QGVAR(treatmentIVLocal); + treatmentBasic_morphineLocal = QGVAR(treatmentBasic_morphineLocal); + treatmentBasic_bloodbagLocal = QGVAR(treatmentBasic_bloodbagLocal); + treatmentBasic_bandageLocal = QGVAR(treatmentBasic_bandageLocal); + treatmentAdvanced_medicationLocal = QGVAR(treatmentAdvanced_medicationLocal); + treatmentAdvanced_fullHealLocal = QGVAR(treatmentAdvanced_fullHealLocal); + treatmentAdvanced_CPRLocal = QGVAR(treatmentAdvanced_CPRLocal); + treatmentAdvanced_bandageLocal = QGVAR(treatmentAdvanced_bandageLocal); + setUnconscious = QGVAR(setUnconscious); + setHitPointDamage = QGVAR(setHitPointDamage); + setDead = QGVAR(setDead); + addToTriageCard = QGVAR(addToTriageCard); + addToMedicalLog = QGVAR(addToMedicalLog); + actionCheckPulseLocal = QGVAR(actionCheckPulseLocal); + actionCheckBloodPressureLocal = QGVAR(actionCheckBloodPressureLocal); + addVitalLoop = QGVAR(addVitalLoop); +}; diff --git a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf index 4d821ea6b0..9e66eda263 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf @@ -16,7 +16,7 @@ params ["_caller", "_target", "_selectionName"]; if (local _target) then { - ["actionCheckBloodPressureLocal", [_caller, _target, _selectionName]] call EFUNC(common,localEvent); + [QGVAR(actionCheckBloodPressureLocal), [_caller, _target, _selectionName]] call CBA_fnc_localEvent; } else { - ["actionCheckBloodPressureLocal", _target, [_caller, _target, _selectionName]] call EFUNC(common,targetEvent); + [QGVAR(actionCheckBloodPressureLocal), [_caller, _target, _selectionName], _target] call CBA_fnc_targetEvent; }; diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index 0fd9394f92..23ab4bba82 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -57,7 +57,7 @@ if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC( _logOutPut = ""; }; -["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent); +[QEGVAR(common,displayTextStructured), [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller], [_caller]] call CBA_fnc_targetEvent; if (_logOutPut != "") then { [_target,"activity", LSTRING(Check_Bloodpressure_Log), [[_caller, false, true] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); diff --git a/addons/medical/functions/fnc_actionCheckPulse.sqf b/addons/medical/functions/fnc_actionCheckPulse.sqf index 2c0a46c826..39f196a0a5 100644 --- a/addons/medical/functions/fnc_actionCheckPulse.sqf +++ b/addons/medical/functions/fnc_actionCheckPulse.sqf @@ -16,7 +16,7 @@ params ["_caller","_target", "_selectionName"]; if (local _target) then { - ["actionCheckPulseLocal", [_caller, _target, _selectionName]] call EFUNC(common,localEvent); + [QGVAR(actionCheckPulseLocal), [_caller, _target, _selectionName]] call CBA_fnc_localEvent; } else { - ["actionCheckPulseLocal", _target, [_caller, _target, _selectionName]] call EFUNC(common,targetEvent); + [QGVAR(actionCheckPulseLocal), [_caller, _target, _selectionName], _target] call CBA_fnc_targetEvent; }; diff --git a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf index 83852f8042..ce052079b3 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -49,7 +49,7 @@ if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC( _logOutPut = LSTRING(Check_Pulse_None); }; -["displayTextStructured", [_caller], [[_heartRateOutput, [_unit] call EFUNC(common,getName), round(_heartRate)], 1.5, _caller]] call EFUNC(common,targetEvent); +[QEGVAR(common,displayTextStructured), [[_heartRateOutput, [_unit] call EFUNC(common,getName), round(_heartRate)], 1.5, _caller], [_caller]] call CBA_fnc_targetEvent; if (_logOutPut != "") then { [_unit,"activity", LSTRING(Check_Pulse_Log),[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog); diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index d69fa90c86..c530e533c8 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -19,7 +19,7 @@ params ["_caller", "_target"]; _output = [LSTRING(Check_Response_Unresponsive), LSTRING(Check_Response_Responsive)] select ([_target] call EFUNC(common,isAwake)); -["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName)], 2, _caller]] call EFUNC(common,targetEvent); +[QEGVAR(common,displayTextStructured), [[_output, [_target] call EFUNC(common,getName)], 2, _caller], [_caller]] call CBA_fnc_targetEvent; [_target,"activity",_output, [[_target, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); [_target,"quick_view",_output, [[_target, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); diff --git a/addons/medical/functions/fnc_actionDiagnose.sqf b/addons/medical/functions/fnc_actionDiagnose.sqf index ffb2583a15..65d43b5dd4 100644 --- a/addons/medical/functions/fnc_actionDiagnose.sqf +++ b/addons/medical/functions/fnc_actionDiagnose.sqf @@ -43,4 +43,4 @@ if (alive _target) then { }; }; -["displayTextStructured", [_caller], [_genericMessages, 3.0, _caller]] call EFUNC(common,targetEvent); +[QEGVAR(common,displayTextStructured), [_genericMessages, 3.0, _caller], [_caller]] call CBA_fnc_targetEvent; diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf index 41970e23d2..35ebfefebc 100644 --- a/addons/medical/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -18,7 +18,7 @@ private "_vehicle"; params ["_caller", "_target"]; if ([_target] call EFUNC(common,isAwake)) exitWith { - ["displayTextStructured", [_caller], [[LSTRING(CanNotLoaded), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); + [QEGVAR(common,displayTextStructured), [[LSTRING(CanNotLoaded), [_target] call EFUNC(common,getName)], 1.5, _caller], [_caller]] call CBA_fnc_targetEvent; }; if ([_target] call FUNC(isBeingCarried)) then { [_caller, _target] call EFUNC(dragging,dropObject_carry); diff --git a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf index d7a316cab0..1ae1dfdc6d 100644 --- a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf +++ b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf @@ -22,7 +22,7 @@ TRACE_2("params",_caller,_target); if (!local _target) exitWith { TRACE_1("running where local",local _target); - ["actionPlaceInBodyBag", [_target], [_caller, _target]] call EFUNC(common,targetEvent); + [QGVAR(actionPlaceInBodyBag), [_caller, _target], [_target]] call CBA_fnc_targetEvent; objNull }; @@ -47,6 +47,6 @@ private _bodyBag = createVehicle ["ACE_bodyBagObject", _position, [], 0, ""]; _bodyBag setPosASL _position; _bodyBag setDir _direction; -["placedInBodyBag", [_target, _bodyBag]] call EFUNC(common,globalEvent); //hide and delete body on server +["ace_placedInBodyBag", [_target, _bodyBag]] call CBA_fnc_globalEvent; //hide and delete body on server _bodyBag diff --git a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf index 660c3f9ff7..386b386f73 100644 --- a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf +++ b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf @@ -26,7 +26,7 @@ _tourniquets = _target getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; // Check if there is a tourniquet on this bodypart if ((_tourniquets select _part) == 0) exitWith { _output = LSTRING(noTourniquetOnBodyPart); - ["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent); + [QEGVAR(common,displayTextStructured), [_output, 1.5, _caller], [_caller]] call CBA_fnc_targetEvent; }; // Removing the tourniquet @@ -44,7 +44,7 @@ TRACE_2("meds",_part,_delayedMedications); _x params ["", "", "_medPartNum"]; if (_part == _medPartNum) then { TRACE_1("delayed medication call after tourniquet removeal",_x); - ["treatmentAdvanced_medicationLocal", [_target], _x] call EFUNC(common,targetEvent); + [QGVAR(treatmentAdvanced_medicationLocal), _x, [_target]] call CBA_fnc_targetEvent; _delayedMedications set [_forEachIndex, -1]; _updatedArray = true; }; diff --git a/addons/medical/functions/fnc_actionUnloadUnit.sqf b/addons/medical/functions/fnc_actionUnloadUnit.sqf index 705eeb88f5..75fe76bce9 100644 --- a/addons/medical/functions/fnc_actionUnloadUnit.sqf +++ b/addons/medical/functions/fnc_actionUnloadUnit.sqf @@ -21,4 +21,4 @@ params ["_caller", "_target", ["_drag", false]]; if (vehicle _target == _target) exitWith {}; if (([_target] call EFUNC(common,isAwake))) exitWith {}; -["unloadPersonEvent", _target, [_target, vehicle _target, _caller]] call EFUNC(common,targetEvent); +["ace_unloadPersonEvent", [_target, vehicle _target, _caller], _target] call CBA_fnc_targetEvent; diff --git a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf index cc8c093071..b2470383a2 100644 --- a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf +++ b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf @@ -22,4 +22,4 @@ params [["_unit", objNull, [objNull]], ["_value", 0, [0]], ["_time", 1, [0]], [" _adjustment = _unit getVariable [QGVAR(heartRateAdjustments), []]; _adjustment pushBack [_value, _time, _callBack]; _unit setVariable [QGVAR(heartRateAdjustments), _adjustment ]; -["Medical_onHeartRateAdjustmentAdded", [_unit, _value, _time]] call EFUNC(common,localEvent); +["ace_addedHeartRateAdjustment", [_unit, _value, _time]] call CBA_fnc_localEvent; diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index 88c463d1eb..787596faa2 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -20,7 +20,7 @@ private ["_moment", "_logVarName", "_log","_newLog", "_logs"]; params ["_unit", "_type", "_message", "_arguments"]; if (!local _unit) exitWith { - ["addToMedicalLog", _unit, _this] call EFUNC(common,targetEvent); + [QGVAR(addToMedicalLog), _this, _unit] call CBA_fnc_targetEvent; }; date params ["", "", "", "_hour", "_minute"]; @@ -43,7 +43,7 @@ if (count _log >= 8) then { _log pushBack [_message, _moment, _type, _arguments]; _unit setVariable [_logVarName, _log, true]; -["medical_onLogEntryAdded", [_unit, _type, _message, _arguments]] call EFUNC(common,localEvent); +["ace_medicalLogEntryAdded", [_unit, _type, _message, _arguments]] call CBA_fnc_localEvent; _logs = _unit getVariable [QGVAR(allLogs), []]; if !(_logVarName in _logs) then { diff --git a/addons/medical/functions/fnc_addToTriageCard.sqf b/addons/medical/functions/fnc_addToTriageCard.sqf index 4fce53e0ab..940cf554c5 100644 --- a/addons/medical/functions/fnc_addToTriageCard.sqf +++ b/addons/medical/functions/fnc_addToTriageCard.sqf @@ -18,7 +18,7 @@ private ["_log", "_inList", "_amount"]; params ["_unit", "_newItem"]; if (!local _unit) exitWith { - ["addToTriageCard", _unit, _this] call EFUNC(common,targetEvent); + [QGVAR(addToTriageCard), _this, _unit] call CBA_fnc_targetEvent; }; _log = _unit getVariable [QGVAR(triageCard), []]; @@ -41,4 +41,4 @@ if (!_inList) then { _log pushBack [_newItem, 1, CBA_missionTime]; }; _unit setVariable [QGVAR(triageCard), _log, true]; -["Medical_onItemAddedToTriageCard", [_unit, _newItem, _amount]] call EFUNC(common,localEvent); +["ace_itemAddedToTriageCard", [_unit, _newItem, _amount]] call CBA_fnc_localEvent; diff --git a/addons/medical/functions/fnc_addVitalLoop.sqf b/addons/medical/functions/fnc_addVitalLoop.sqf index e0730322af..aa3d6608d0 100644 --- a/addons/medical/functions/fnc_addVitalLoop.sqf +++ b/addons/medical/functions/fnc_addVitalLoop.sqf @@ -18,7 +18,7 @@ params ["_unit", ["_force", false]]; if !([_unit] call FUNC(hasMedicalEnabled) || _force) exitWith {}; if !(local _unit) exitWith { - ["addVitalLoop", _unit, [_unit, _force]] call EFUNC(common,targetEvent); + [QGVAR(addVitalLoop), [_unit, _force], _unit] call CBA_fnc_targetEvent; }; // Quit if the unit already has a vital loop, or is dead, unless it's forced diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 1e1816d5f5..9a79e1de53 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -42,7 +42,7 @@ if (_show) then { if (ACE_player distance _target > MAX_DISTANCE) exitwith { ("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; [_idPFH] call CBA_fnc_removePerFrameHandler; - ["displayTextStructured", [ACE_player], [[LSTRING(DistanceToFar), [_target] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent); + [QEGVAR(common,displayTextStructured), [[LSTRING(DistanceToFar), [_target] call EFUNC(common,getName)], 1.75, ACE_player], [ACE_player]] call CBA_fnc_targetEvent; }; disableSerialization; diff --git a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf index dff59fb2cf..e0a28dfd18 100644 --- a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf +++ b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf @@ -19,6 +19,6 @@ params ["_unit", "_originOfrequest"]; if (local _unit && !(local _originOfrequest)) then { _openWounds = _unit getVariable [QGVAR(openWounds), []]; { - ["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent); + ["ace_medical_propagateWound", [_unit, _x], [_originOfrequest]] call CBA_fnc_targetEvent; } forEach _openWounds; }; diff --git a/addons/medical/functions/fnc_requestWoundSync.sqf b/addons/medical/functions/fnc_requestWoundSync.sqf index 1d7d6de53f..9f72c0b322 100644 --- a/addons/medical/functions/fnc_requestWoundSync.sqf +++ b/addons/medical/functions/fnc_requestWoundSync.sqf @@ -19,4 +19,4 @@ params [ "_target", "_caller"]; if (local _target || GVAR(level) < 2) exitWith {}; // if the target is local, we already got the most update to date information if (_target getVariable [QGVAR(isWoundSynced), false]) exitWith {}; _target setVariable [QGVAR(isWoundSynced), true]; -["medical_woundUpdateRequest", [_target], [_target, _caller]] call EFUNC(common,targetEvent); +["ace_medical_woundUpdateRequest", [_target, _caller], [_target]] call CBA_fnc_targetEvent; diff --git a/addons/medical/functions/fnc_serverRemoveBody.sqf b/addons/medical/functions/fnc_serverRemoveBody.sqf index 311199b1b8..42e755f003 100644 --- a/addons/medical/functions/fnc_serverRemoveBody.sqf +++ b/addons/medical/functions/fnc_serverRemoveBody.sqf @@ -21,7 +21,7 @@ params ["_target"]; TRACE_2("",_target,isPlayer _target); //Hide the body globaly -["hideObjectGlobal", [_target, true]] call EFUNC(common,serverEvent); +[QEGVAR(common,hideObjectGlobal), [_target, true]] call CBA_fnc_serverEvent; if (isNil QGVAR(bodiesToDelete)) then {GVAR(bodiesToDelete) = [];}; GVAR(bodiesToDelete) pushBack _target; diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index 70e7d5c253..925ff4cc03 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -21,7 +21,7 @@ if (_unit getVariable [QGVAR(inCardiacArrest),false]) exitWith {}; _unit setVariable [QGVAR(inCardiacArrest), true,true]; _unit setVariable [QGVAR(heartRate), 0]; -["Medical_onEnteredCardiacArrest", [_unit]] call EFUNC(common,localEvent); +["ace_enteredCardiacArrest", [_unit]] call CBA_fnc_localEvent; [_unit, true] call FUNC(setUnconscious); _timeInCardiacArrest = 120 + round(random(600)); diff --git a/addons/medical/functions/fnc_setDead.sqf b/addons/medical/functions/fnc_setDead.sqf index d68ba0e41f..0e5fd884f4 100644 --- a/addons/medical/functions/fnc_setDead.sqf +++ b/addons/medical/functions/fnc_setDead.sqf @@ -20,7 +20,7 @@ params ["_unit", ["_force", false], ["_delaySetDamage", false]]; if ((!alive _unit) || {_unit getVariable ["ACE_isDead", false]}) exitWith {true}; if (!local _unit) exitwith { - ["setDead", _unit, [_unit, _force]] call EFUNC(common,targetEvent); + [QGVAR(setDead), [_unit, _force], _unit] call CBA_fnc_targetEvent; false; }; @@ -51,7 +51,7 @@ if (isPLayer _unit) then { _unit setVariable ["isDeadPlayer", true, true]; }; -["medical_onSetDead", [_unit]] call EFUNC(common,localEvent); +["ace_killed", [_unit]] call CBA_fnc_localEvent; //Delay a frame before killing the unit via scripted damage //to avoid triggering the "Killed" Event twice (and having the wrong killer) diff --git a/addons/medical/functions/fnc_setHitPointDamage.sqf b/addons/medical/functions/fnc_setHitPointDamage.sqf index 9abce575cd..b1dfe59d29 100644 --- a/addons/medical/functions/fnc_setHitPointDamage.sqf +++ b/addons/medical/functions/fnc_setHitPointDamage.sqf @@ -26,7 +26,7 @@ params ["_unit", "_selection", "_damage", ["_disabled", false]]; // Unit isn't local, give function to machine where it is. if !(local _unit) exitWith { - ["setHitPointDamage", _unit, _this] call EFUNC(common,targetEvent); + [QGVAR(setHitPointDamage), _this, _unit] call CBA_fnc_targetEvent; }; // Check if overall damage adjustment is disabled diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index dbeecce939..41c02dd553 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -39,7 +39,7 @@ if !(_set) exitWith { if !(!(isNull _unit) && {(_unit isKindOf "CAManBase") && ([_unit] call EFUNC(common,isAwake))}) exitWith{}; if (!local _unit) exitWith { - ["setUnconscious", _unit, [_unit, _set, _minWaitingTime, _force]] call EFUNC(common,targetEvent); + [QGVAR(setUnconscious), [_unit, _set, _minWaitingTime, _force], _unit] call CBA_fnc_targetEvent; }; _unit setVariable ["ACE_isUnconscious", true, true]; @@ -96,12 +96,12 @@ if (GVAR(moveUnitsFromGroupOnUnconscious)) then { }; // Delay Unconscious so the AI dont instant stop shooting on the unit #3121 if (GVAR(delayUnconCaptive) == 0) then { - [_unit, "setCaptive", QGVAR(unconscious), true] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", "ace_unconscious", true] call EFUNC(common,statusEffect_set); } else { [{ params ["_unit"]; if (_unit getVariable ["ACE_isUnconscious", false]) then { - [_unit, "setCaptive", QGVAR(unconscious), true] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", "ace_unconscious", true] call EFUNC(common,statusEffect_set); }; },[_unit], GVAR(delayUnconCaptive)] call CBA_fnc_waitAndExecute; }; @@ -122,4 +122,4 @@ _startingTime = CBA_missionTime; // unconscious can't talk [_unit, "isUnconscious"] call EFUNC(common,muteUnit); -["medical_onUnconscious", [_unit, true]] call EFUNC(common,globalEvent); +["ace_unconscious", [_unit, true]] call CBA_fnc_globalEvent; diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index dfb0584e9f..b733649935 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -239,7 +239,7 @@ if (_target != _caller) then { }; if (_displayText != "") then { - ["displayTextStructured", [_caller], [[_displayText, [_caller] call EFUNC(common,getName), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); + [QEGVAR(common,displayTextStructured), [[_displayText, [_caller] call EFUNC(common,getName), [_target] call EFUNC(common,getName)], 1.5, _caller], [_caller]] call CBA_fnc_targetEvent; }; true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf index 7d34a278f1..0ce1f7d4d9 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf @@ -22,9 +22,9 @@ if (alive _target && {(_target getVariable [QGVAR(inCardiacArrest), false] || _t [_target, "activity_view", LSTRING(Activity_cpr), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); if (local _target) then { - ["treatmentAdvanced_CPRLocal", [_caller, _target]] call EFUNC(common,localEvent); + [QGVAR(treatmentAdvanced_CPRLocal), [_caller, _target]] call CBA_fnc_localEvent; } else { - ["treatmentAdvanced_CPRLocal", _target, [_caller, _target]] call EFUNC(common,targetEvent); + [QGVAR(treatmentAdvanced_CPRLocal), [_caller, _target], _target] call CBA_fnc_targetEvent; }; }; true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index 98881e1a28..67606ddd7e 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -27,9 +27,9 @@ if !([_target] call FUNC(hasMedicalEnabled)) exitWith { }; if (local _target) then { - ["treatmentAdvanced_bandageLocal", [_target, _className, _selectionName, _specificSpot]] call EFUNC(common,localEvent); + [QGVAR(treatmentAdvanced_bandageLocal), [_target, _className, _selectionName, _specificSpot]] call CBA_fnc_localEvent; } else { - ["treatmentAdvanced_bandageLocal", _target, [_target, _className, _selectionName, _specificSpot]] call EFUNC(common,targetEvent); + [QGVAR(treatmentAdvanced_bandageLocal), [_target, _className, _selectionName, _specificSpot], _target] call CBA_fnc_targetEvent; }; /* { diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 5cfe73ab8d..eeeeb431bb 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -90,7 +90,7 @@ _openWounds set [_mostEffectiveSpot, _mostEffectiveInjury]; _target setVariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; if (USE_WOUND_EVENT_SYNC) then { - ["medical_propagateWound", [_target, _mostEffectiveInjury]] call EFUNC(common,globalEvent); + ["ace_medical_propagateWound", [_target, _mostEffectiveInjury]] call CBA_fnc_globalEvent; }; // Handle the reopening of bandaged wounds if (_impact > 0 && {GVAR(enableAdvancedWounds)}) then { diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf index a5332df107..18bd0468d2 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHeal.sqf @@ -13,9 +13,9 @@ params ["_caller", "_target", "_selectionName", "_className", "_items"]; if (local _target) then { - ["treatmentAdvanced_fullHealLocal", [_caller, _target]] call EFUNC(common,localEvent); + [QGVAR(treatmentAdvanced_fullHealLocal), [_caller, _target]] call CBA_fnc_localEvent; } else { - ["treatmentAdvanced_fullHealLocal", _target, [_caller, _target]] call EFUNC(common,targetEvent); + [QGVAR(treatmentAdvanced_fullHealLocal), [_caller, _target], _target] call CBA_fnc_targetEvent; }; true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf index 185853b677..ceb788f571 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf @@ -22,7 +22,7 @@ TRACE_5("params",_caller,_target,_selectionName,_className,_items); private _part = [_selectionName] call FUNC(selectionNameToNumber); -["treatmentAdvanced_medicationLocal", [_target], [_target, _className, _part]] call EFUNC(common,targetEvent); +[QGVAR(treatmentAdvanced_medicationLocal), [_target, _className, _part], [_target]] call CBA_fnc_targetEvent; { if (_x != "") then { diff --git a/addons/medical/functions/fnc_treatmentBasic_bandage.sqf b/addons/medical/functions/fnc_treatmentBasic_bandage.sqf index 3e04ad3bd8..c0411c09e4 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bandage.sqf @@ -21,7 +21,7 @@ private ["_hitSelections", "_hitPoints", "_point", "_damage"]; params ["_caller", "_target", "_selection", "_className"]; if (local _target) then { - ["treatmentBasic_bandageLocal", [_target, _selection]] call EFUNC(common,localEvent); + [QGVAR(treatmentBasic_bandageLocal), [_target, _selection]] call CBA_fnc_localEvent; } else { - ["treatmentBasic_bandageLocal", _target, [_target, _selection]] call EFUNC(common,targetEvent); + [QGVAR(treatmentBasic_bandageLocal), [_target, _selection], _target] call CBA_fnc_targetEvent; }; diff --git a/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf b/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf index f28b634038..6989ac14b8 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf @@ -19,7 +19,7 @@ params ["_caller", "_target", "_treatmentClassname"]; if (local _target) then { - ["treatmentBasic_bloodbagLocal", [_target, _treatmentClassname]] call EFUNC(common,localEvent); + [QGVAR(treatmentBasic_bloodbagLocal), [_target, _treatmentClassname]] call CBA_fnc_localEvent; } else { - ["treatmentBasic_bloodbagLocal", _target, [_target, _treatmentClassname]] call EFUNC(common,targetEvent); + [QGVAR(treatmentBasic_bloodbagLocal), [_target, _treatmentClassname], _target] call CBA_fnc_targetEvent; }; diff --git a/addons/medical/functions/fnc_treatmentBasic_morphine.sqf b/addons/medical/functions/fnc_treatmentBasic_morphine.sqf index d2f7de45a9..f704a67042 100644 --- a/addons/medical/functions/fnc_treatmentBasic_morphine.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_morphine.sqf @@ -20,7 +20,7 @@ params ["_caller", "_target"]; if (local _target) then { - ["treatmentBasic_morphineLocal", [_target]] call EFUNC(common,localEvent); + [QGVAR(treatmentBasic_morphineLocal), [_target]] call CBA_fnc_localEvent; } else { - ["treatmentBasic_morphineLocal", _target, [_target]] call EFUNC(common,targetEvent); + [QGVAR(treatmentBasic_morphineLocal), [_target], _target] call CBA_fnc_targetEvent; }; diff --git a/addons/medical/functions/fnc_treatmentIV.sqf b/addons/medical/functions/fnc_treatmentIV.sqf index 29173fe23b..456c415362 100644 --- a/addons/medical/functions/fnc_treatmentIV.sqf +++ b/addons/medical/functions/fnc_treatmentIV.sqf @@ -23,9 +23,9 @@ if (count _items == 0) exitWith {false}; _removeItem = _items select 0; if (local _target) then { - ["treatmentIVLocal", [_target, _className]] call EFUNC(common,localEvent); + [QGVAR(treatmentIVLocal), [_target, _className]] call CBA_fnc_localEvent; } else { - ["treatmentIVLocal", _target, [_target, _className]] call EFUNC(common,targetEvent); + [QGVAR(treatmentIVLocal), [_target, _className], _target] call CBA_fnc_targetEvent; }; [_target, _removeItem] call FUNC(addToTriageCard); diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index b410a899a4..3c9cbb2206 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -28,22 +28,22 @@ if (count _items == 0) exitWith {false}; _part = [_selectionName] call FUNC(selectionNameToNumber); if (_part == 0 || _part == 1) exitWith { - // ["displayTextStructured", [_caller], ["You cannot apply a CAT on this body part!"]] call EFUNC(common,targetEvent); + // [QEGVAR(common,displayTextStructured), ["You cannot apply a CAT on this body part!"], [_caller]] call CBA_fnc_targetEvent; false; }; _tourniquets = _target getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; if ((_tourniquets select _part) > 0) exitWith { _output = "There is already a tourniquet on this body part!"; // TODO localization - ["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent); + [QEGVAR(common,displayTextStructured), [_output, 1.5, _caller], [_caller]] call CBA_fnc_targetEvent; false; }; _removeItem = _items select 0; if (local _target) then { - ["treatmentTourniquetLocal", [_target, _removeItem, _selectionName]] call EFUNC(common,localEvent); + [QGVAR(treatmentTourniquetLocal), [_target, _removeItem, _selectionName]] call CBA_fnc_localEvent; } else { - ["treatmentTourniquetLocal", _target, [_target, _removeItem, _selectionName]] call EFUNC(common,targetEvent); + [QGVAR(treatmentTourniquetLocal), [_target, _removeItem, _selectionName], _target] call CBA_fnc_targetEvent; }; [_target, _removeItem] call FUNC(addToTriageCard); diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index a9ef534346..98befeab04 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -95,4 +95,4 @@ if (!(_target getVariable [QGVAR(addedToUnitLoop),false])) then { [_target] call FUNC(addVitalLoop); }; -["medical_treatmentSuccess", [_caller, _target, _selectionName, _className]] call EFUNC(common,localEvent); +["ace_treatmentSuccess", [_caller, _target, _selectionName, _className]] call CBA_fnc_localEvent; diff --git a/addons/medical/functions/fnc_unconsciousPFH.sqf b/addons/medical/functions/fnc_unconsciousPFH.sqf index 055753a0f3..edf2e871fd 100644 --- a/addons/medical/functions/fnc_unconsciousPFH.sqf +++ b/addons/medical/functions/fnc_unconsciousPFH.sqf @@ -33,15 +33,15 @@ if (!alive _unit) exitWith { if (GVAR(moveUnitsFromGroupOnUnconscious)) then { [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); }; - [_unit, "setCaptive", QGVAR(unconscious), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", "ace_unconscious", false] call EFUNC(common,statusEffect_set); [_unit, false] call EFUNC(common,disableAI); //_unit setUnitPos _originalPos; _unit setUnconscious false; [_unit, "isUnconscious"] call EFUNC(common,unmuteUnit); - ["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent); + ["ace_unconscious", [_unit, false]] call CBA_fnc_globalEvent; - TRACE_3("ACE_DEBUG_Unconscious_Exit",_unit, (!alive _unit) , QGVAR(unconscious)); + TRACE_3("ACE_DEBUG_Unconscious_Exit",_unit, (!alive _unit) , "ace_unconscious"); [_idPFH] call CBA_fnc_removePerFrameHandler; }; @@ -96,13 +96,13 @@ if !(_unit getVariable ["ACE_isUnconscious",false]) exitWith { }; _unit setVariable [QGVAR(vehicleAwakeAnim), nil]; - ["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent); + ["ace_unconscious", [_unit, false]] call CBA_fnc_globalEvent; // EXIT PFH [_idPFH] call CBA_fnc_removePerFrameHandler; }; if (!_hasMovedOut) then { // Reset the unit back to the previous captive state. - [_unit, "setCaptive", QGVAR(unconscious), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", "ace_unconscious", false] call EFUNC(common,statusEffect_set); // Swhich the unit back to its original group //Unconscious units shouldn't be put in another group #527: diff --git a/addons/medical/functions/fnc_useItem.sqf b/addons/medical/functions/fnc_useItem.sqf index 71b5304c67..8ab8b3cb3d 100644 --- a/addons/medical/functions/fnc_useItem.sqf +++ b/addons/medical/functions/fnc_useItem.sqf @@ -25,18 +25,18 @@ if (isNil QGVAR(setting_allowSharedEquipment)) then { if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitWith { if (local _patient) then { - ["useItem", [_patient, _item]] call EFUNC(common,localEvent); + ["ace_useItem", [_patient, _item]] call CBA_fnc_localEvent; } else { - ["useItem", _patient, [_patient, _item]] call EFUNC(common,targetEvent); + ["ace_useItem", [_patient, _item], _patient] call CBA_fnc_targetEvent; }; [true, _patient]; }; if ([_medic, _item] call EFUNC(common,hasItem)) exitWith { if (local _medic) then { - ["useItem", [_medic, _item]] call EFUNC(common,localEvent); + ["ace_useItem", [_medic, _item]] call CBA_fnc_localEvent; } else { - ["useItem", _medic, [_medic, _item]] call EFUNC(common,targetEvent); + ["ace_useItem", [_medic, _item], _medic] call CBA_fnc_targetEvent; }; [true, _medic]; }; @@ -48,9 +48,9 @@ if ([vehicle _medic] call FUNC(isMedicalVehicle) && {vehicle _medic != _medic}) if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitWith { _return = [true, _x]; if (local _x) then { - ["useItem", [_x, _item]] call EFUNC(common,localEvent); + ["ace_useItem", [_x, _item]] call CBA_fnc_localEvent; } else { - ["useItem", _x, [_x, _item]] call EFUNC(common,targetEvent); + ["ace_useItem", [_x, _item], _x] call CBA_fnc_targetEvent; }; }; } forEach _crew; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index ef0ccc68a2..34172b6b09 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -57,6 +57,7 @@ Injecter de l'adénosine Inietta andenosina Aplikovat adenosine + Injetar Adenosina Inject Atropine @@ -258,6 +259,7 @@ Injection d'adénosine... Inietto l'andenosina Aplikuji adenosine... + Injetando Adenosina... Injecting Atropine... @@ -975,6 +977,7 @@ Auto-injécteur d'adénosine Autoiniettore di adenosina Auto-adenosine + Auto-injetor de Adenosina Used to counter effects of Epinephrine @@ -984,6 +987,7 @@ Utilisé pour contrer les effets de l'adrénaline Usato per contrastare l'effetto dell'epinefrina Slouží jako protiváha Adrenalinu + Usado para combater os efeitos da Epinefrina A drug used to counter the effects of Epinephrine @@ -993,6 +997,7 @@ Un composé utilisé pour contrer les effets de l'adrénaline Medicamento usato per contrastare l'effetto dell'epinefrina Droga používaná k tlumení efektu Adrenalinu + Uma droga usada para combater os efeitos da Epinefrina Atropine autoinjector @@ -2906,6 +2911,7 @@ Örtliche Trainingssteigerung Ubicación mejora entrenamiento. Miejsca zwiększają wyszkolenie + Localização melhora treinamento Boost medic rating in medical vehicles or near medical facilities [untrained becomes medic, medic becomes doctor] @@ -2914,6 +2920,7 @@ Steigert die medizinische Einstufung eines Soldaten in Sanitätsfarhzeugen oder in der Nähe von Sanitätseinrichtungen [untrainiert wird zu Sanitäter, Sanitäter zu Doktor] Mejora el entrenamiento médico dentro de vehículos médicos o cerca de instalaciones médicas (no entrenados se convierten en médicos, médicos se convierten en doctores) Zwiększa poziom wyszkolenia medyków wewnątrz pojazdów medycznych lub w pobliżu budynków medycznych [niedoświadczony zostaje medykiem, medyk zostaje doktorem] + Aumenta a classificação do médico dentro de veículos médicos ou perto de instalações médicas [sem treinamento vira médico, médico vira doutor] Disable medics @@ -3211,6 +3218,7 @@ Réglages du système médical basic [ACE] Impostazioni Mediche Di Base [ACE] Základní zdravotnické nastavení [ACE] + Ajustes médicos básicos [ACE] Advanced Medical Settings [ACE] @@ -3328,6 +3336,7 @@ Autoriser l'adrénaline Permette epinefrina Povolit adrenalin + Permitir Epinefrina Who can use Epinephrine for full heal? (Basic medical only) @@ -3337,6 +3346,7 @@ Qui peut utiliser l'adrénaline pour les soins complets ? (Médical basique seulement) Chi può usare l'epinefrina per la cura completa? (solo per sistema medico di base) Kdo může použít adrenalin k úplnému vyléčení? (Pouze základní zdravotní systém) + Quem pode usar Epinefrina para cura completa? (Somente sistema médico básico) Allow PAK @@ -3430,6 +3440,7 @@ Position des adrénalines Ubicazione epinefrina Oblast k použití adrenalinu + Localizações de Epinefrina Where can the Epinephrine be used? (Basic Medical) @@ -3439,6 +3450,7 @@ Où peuvent être utilisées les adrénalines ? (Médical basique) Dove si può usare l'epinefrina? (Sistema medico di base) Kde může být použit adrenalin? (Pouze základní zdravotní systém) + Onde pode-se usar a Epinefrina? (Somente sistema médico básico) Locations PAK @@ -3685,6 +3697,7 @@ Skonfiguruj ustawienia leczenia podstawowego systemu medycznego ACE Configure les réglages de traitement dans ACE médical basique Configura le impostazioni trattamenti per ACE Medical di base + Configura as opções de tratamento do sistema médico básico do ACE Configure the treatment settings from ACE Advanced Medical @@ -4135,6 +4148,7 @@ Entrenamiento médico Entraînement médical Lékařský výcvik + Treino médico Whether or not the object will be a medical vehicle. @@ -4143,12 +4157,14 @@ Legt fest, ob das Objekt ein Sanitätsfahrzeug ist. Es un vehículo médico? Définit si le véhicule est un véhicule médical ou non. + Se o objeto será ou não um veículo médico Delay cease fire of AI while player is unconscious for medical reasons. Verzögert das Ende des KI-Beschusses auf einen Spieler, wenn dieser aus medizinischen Gründen bewustlos wird. Ritarda il cessate il fuoco dell'IA quando il giocatore è svenuto per motivi medici. Prodleva zastavení palby pro AI, pokud je hráč v bezvědomí ze zdravotních důvodů. + Atraso durante cessar fogo da AI durante inconsciência médica Delay cease fire of AI for unconsciousness @@ -4157,6 +4173,7 @@ Opóźnij status captive u nieprzytomnych osób Ritarda il cessate il fuoco dell'IA quando si è svenuti Prodleva zastavení palby AI na bezvědomé + Atraso durante cessar fogo da AI durante inconsciência \ No newline at end of file diff --git a/addons/medical_menu/XEH_postInit.sqf b/addons/medical_menu/XEH_postInit.sqf index deddb4b3d8..e7b7ec40cb 100644 --- a/addons/medical_menu/XEH_postInit.sqf +++ b/addons/medical_menu/XEH_postInit.sqf @@ -6,16 +6,14 @@ GVAR(MenuPFHID) = -1; GVAR(lastOpenedOn) = -1; GVAR(pendingReopen) = false; -["medical_treatmentSuccess", { - +["ace_treatmentSuccess", { if (GVAR(openAfterTreatment) && {GVAR(pendingReopen)}) then { GVAR(pendingReopen) = false; [{ [GVAR(INTERACTION_TARGET)] call FUNC(openMenu); }, []] call CBA_fnc_execNextFrame; }; -}] call EFUNC(common,addEventhandler); - +}] call CBA_fnc_addEventHandler; ["ACE3 Common", QGVAR(displayMenuKeyPressed), localize LSTRING(DisplayMenuKey), { @@ -37,4 +35,3 @@ GVAR(pendingReopen) = false; false }, [35, [false, false, false]], false, 0] call CBA_fnc_addKeybind; - diff --git a/addons/medical_menu/config.cpp b/addons/medical_menu/config.cpp index bdc9bf1f25..67d3966771 100644 --- a/addons/medical_menu/config.cpp +++ b/addons/medical_menu/config.cpp @@ -17,3 +17,7 @@ class CfgPatches { #include "ui\menu.hpp" #include "ACE_Settings.hpp" #include "CfgVehicles.hpp" + +class ACE_newEvents { + Medical_onMenuOpen = "ace_medicalMenuOpened"; +}; diff --git a/addons/medical_menu/functions/fnc_onMenuOpen.sqf b/addons/medical_menu/functions/fnc_onMenuOpen.sqf index d8d1fde35a..004fe9f49f 100644 --- a/addons/medical_menu/functions/fnc_onMenuOpen.sqf +++ b/addons/medical_menu/functions/fnc_onMenuOpen.sqf @@ -81,10 +81,10 @@ GVAR(MenuPFHID) = [{ closeDialog 314412; //If we failed because of distance check, show UI message: if ((ACE_player distance GVAR(INTERACTION_TARGET)) > GVAR(maxRange)) then { - ["displayTextStructured", [[ELSTRING(medical,DistanceToFar), [GVAR(INTERACTION_TARGET)] call EFUNC(common,getName)], 2, ACE_player]] call EFUNC(common,localEvent); + [[ELSTRING(medical,DistanceToFar), [GVAR(INTERACTION_TARGET)] call EFUNC(common,getName)], 2] call EFUNC(common,displayTextStructured); }; }; }, 0, [_display]] call CBA_fnc_addPerFrameHandler; -["Medical_onMenuOpen", [ACE_player, _target]] call EFUNC(common,localEvent); +["ace_medicalMenuOpened", [ACE_player, _target]] call CBA_fnc_localEvent; diff --git a/addons/microdagr/XEH_clientInit.sqf b/addons/microdagr/XEH_clientInit.sqf index c11019cafb..46003b9cb1 100644 --- a/addons/microdagr/XEH_clientInit.sqf +++ b/addons/microdagr/XEH_clientInit.sqf @@ -20,7 +20,7 @@ _closeCode = { //Add Eventhandler: -["RangerfinderData", {_this call FUNC(recieveRangefinderData)}] call EFUNC(common,addEventHandler); +[QEGVAR(vector,rangefinderData), {_this call FUNC(recieveRangefinderData)}] call CBA_fnc_addEventHandler; //Global Variables to default: GVAR(gpsPositionASL) = [0,0,0]; diff --git a/addons/microdagr/config.cpp b/addons/microdagr/config.cpp index d8823d0dc0..9da8434fe7 100644 --- a/addons/microdagr/config.cpp +++ b/addons/microdagr/config.cpp @@ -18,3 +18,7 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "gui.hpp" #include "ACE_Settings.hpp" + +class ACE_newEvents { + RangerfinderData = QEGVAR(vector,rangefinderData); +}; diff --git a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf index 25f5bc92fd..92d647f348 100644 --- a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf +++ b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf @@ -27,7 +27,7 @@ if (GVAR(currentApplicationPage) == 1) then { _theMap ctrlMapAnimAdd [0, DUMMY_ZOOM, DUMMY_POS]; ctrlMapAnimCommit _theMap; _size = 412 * _mapSize; - _theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ACE_player)), '', 0 ]; + _theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (([ACE_player] call CBA_fnc_headDir) select 0)), '', 0 ]; _theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [0.533,0.769,0.76,1], DUMMY_POS, _size, _size, 0, '', 0 ]; if (GVAR(currentWaypoint) != -1) then { @@ -56,7 +56,7 @@ if (GVAR(currentApplicationPage) == 1) then { ctrlMapAnimCommit _theMap; }; _size = 48 * _mapSize; - _theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ACE_player), _size, _size, (getDir ACE_player), '', 0 ]; + _theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ACE_player), _size, _size, (([ACE_player] call CBA_fnc_headDir) select 0), '', 0 ]; if (GVAR(settingShowAllWaypointsOnMap)) then { _size = 32 * _mapSize; diff --git a/addons/microdagr/functions/fnc_showApplicationPage.sqf b/addons/microdagr/functions/fnc_showApplicationPage.sqf index 9b461d6b64..903680e896 100644 --- a/addons/microdagr/functions/fnc_showApplicationPage.sqf +++ b/addons/microdagr/functions/fnc_showApplicationPage.sqf @@ -38,7 +38,7 @@ if (GVAR(currentApplicationPage) == APP_MODE_INFODISPLAY) then { (_display displayCtrl IDC_MODEDISPLAY_MODEPOSTIMECG) ctrlShow false; (_display displayCtrl IDC_MODEDISPLAY_MODEPOSTARGETCG) ctrlShow true; if (GVAR(currentWaypoint) == -2) then { - (_display displayCtrl IDC_MODEDISPLAY_TARGETICON) ctrlSetText "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa" + (_display displayCtrl IDC_MODEDISPLAY_TARGETICON) ctrlSetText QUOTE(PATHTOF(images\icon_menuLaser.paa)); } else { (_display displayCtrl IDC_MODEDISPLAY_TARGETICON) ctrlSetText QPATHTOF(images\icon_menuMark.paa); }; diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 5042cbac97..7ba92e55ef 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -47,9 +47,9 @@ case (APP_MODE_INFODISPLAY): { //Heading: _compassAngleText = if (GVAR(settingUseMils)) then { - [(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber; + [(floor ((6400 / 360) * (([ACE_player] call CBA_fnc_headDir) select 0))), 4, 0] call CBA_fnc_formatNumber; } else { - ([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 + ([(floor (([ACE_player] call CBA_fnc_headDir) select 0)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; (_display displayCtrl IDC_MODEDISPLAY_HEADINGNUM) ctrlSetText _compassAngleText; @@ -107,9 +107,9 @@ case (APP_MODE_INFODISPLAY): { case (APP_MODE_COMPASS): { //Heading: _compassAngleText = if (GVAR(settingUseMils)) then { - [(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber; + [(floor ((6400 / 360) * (([ACE_player] call CBA_fnc_headDir) select 0))), 4, 0] call CBA_fnc_formatNumber; } else { - ([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 + ([(floor (([ACE_player] call CBA_fnc_headDir) select 0)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; (_display displayCtrl IDC_MODECOMPASS_HEADING) ctrlSetText _compassAngleText; diff --git a/addons/microdagr/gui_controls.hpp b/addons/microdagr/gui_controls.hpp index c60201b34e..4fd194e1ab 100644 --- a/addons/microdagr/gui_controls.hpp +++ b/addons/microdagr/gui_controls.hpp @@ -18,7 +18,7 @@ class controlsBackground { }; class RangefinderConnectedIcon: RscPicture { idc = IDC_RANGEFINDERCONNECTEDICON; - text = "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa"; + text = QUOTE(PATHTOF(images\icon_menuLaser.paa)); x = X_PART(6.35); y = Y_PART(0.1); w = W_PART(2.7); @@ -486,7 +486,7 @@ class controls { onbuttonclick = QUOTE([5] call FUNC(saveCurrentAndSetNewMode)); }; class ButtonBL: ButtonTL { - text = "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa"; + text = QUOTE(PATHTOF(images\icon_menuLaser.paa)); x = W_PART(3); y = H_PART(10.5); onbuttonclick = QUOTE(_this call FUNC(appMenuButtonConnectRangefinder)); diff --git a/addons/microdagr/images/button_pushedDown.paa b/addons/microdagr/images/button_pushedDown.paa index fc519a3235..30ac306c5b 100644 Binary files a/addons/microdagr/images/button_pushedDown.paa and b/addons/microdagr/images/button_pushedDown.paa differ diff --git a/addons/microdagr/images/button_pushedUp.paa b/addons/microdagr/images/button_pushedUp.paa index 5aa18986be..cc6981e82a 100644 Binary files a/addons/microdagr/images/button_pushedUp.paa and b/addons/microdagr/images/button_pushedUp.paa differ diff --git a/addons/microdagr/images/icon_compass.paa b/addons/microdagr/images/icon_compass.paa index 777eaffde4..4449ce17bc 100644 Binary files a/addons/microdagr/images/icon_compass.paa and b/addons/microdagr/images/icon_compass.paa differ diff --git a/addons/microdagr/images/icon_info.paa b/addons/microdagr/images/icon_info.paa index 5dc94a444c..00247b8267 100644 Binary files a/addons/microdagr/images/icon_info.paa and b/addons/microdagr/images/icon_info.paa differ diff --git a/addons/microdagr/images/icon_infoClock.paa b/addons/microdagr/images/icon_infoClock.paa index 292cf29afb..5d9b1eeda3 100644 Binary files a/addons/microdagr/images/icon_infoClock.paa and b/addons/microdagr/images/icon_infoClock.paa differ diff --git a/addons/microdagr/images/icon_infoCompass.paa b/addons/microdagr/images/icon_infoCompass.paa index 8390a24509..927940740c 100644 Binary files a/addons/microdagr/images/icon_infoCompass.paa and b/addons/microdagr/images/icon_infoCompass.paa differ diff --git a/addons/microdagr/images/icon_map.paa b/addons/microdagr/images/icon_map.paa index 52c3931c68..7fe52c455b 100644 Binary files a/addons/microdagr/images/icon_map.paa and b/addons/microdagr/images/icon_map.paa differ diff --git a/addons/microdagr/images/icon_menuLaser.paa b/addons/microdagr/images/icon_menuLaser.paa new file mode 100644 index 0000000000..43b546b88d Binary files /dev/null and b/addons/microdagr/images/icon_menuLaser.paa differ diff --git a/addons/microdagr/images/icon_menuMark.paa b/addons/microdagr/images/icon_menuMark.paa index 2c77aac04b..44e62af43d 100644 Binary files a/addons/microdagr/images/icon_menuMark.paa and b/addons/microdagr/images/icon_menuMark.paa differ diff --git a/addons/microdagr/images/icon_menuSettings.paa b/addons/microdagr/images/icon_menuSettings.paa index cfb340247e..f8e307ff55 100644 Binary files a/addons/microdagr/images/icon_menuSettings.paa and b/addons/microdagr/images/icon_menuSettings.paa differ diff --git a/addons/microdagr/images/icon_menuWaypoints.paa b/addons/microdagr/images/icon_menuWaypoints.paa index 74ca3a59c1..92ebdb17ad 100644 Binary files a/addons/microdagr/images/icon_menuWaypoints.paa and b/addons/microdagr/images/icon_menuWaypoints.paa differ diff --git a/addons/microdagr/images/microDAGR_topBar.paa b/addons/microdagr/images/microDAGR_topBar.paa index c4c28307f0..317279a266 100644 Binary files a/addons/microdagr/images/microDAGR_topBar.paa and b/addons/microdagr/images/microDAGR_topBar.paa differ diff --git a/addons/missileguidance/XEH_post_init.sqf b/addons/missileguidance/XEH_post_init.sqf index d6d82e875d..282aac5503 100644 --- a/addons/missileguidance/XEH_post_init.sqf +++ b/addons/missileguidance/XEH_post_init.sqf @@ -1,3 +1,3 @@ #include "script_component.hpp" -[QGVAR(handoff), {_this call FUNC(handleHandoff)}] call EFUNC(common,addEventHandler); +[QGVAR(handoff), {_this call FUNC(handleHandoff)}] call CBA_fnc_addEventHandler; diff --git a/addons/missileguidance/functions/fnc_doHandoff.sqf b/addons/missileguidance/functions/fnc_doHandoff.sqf index efed4e9340..011c3d52d1 100644 --- a/addons/missileguidance/functions/fnc_doHandoff.sqf +++ b/addons/missileguidance/functions/fnc_doHandoff.sqf @@ -1,4 +1,4 @@ #include "script_component.hpp" PARAMS_2(_target,_args); -[QGVAR(handoff), [_target, _args]] call EFUNC(common,globalEvent); \ No newline at end of file +[QGVAR(handoff), [_target, _args]] call CBA_fnc_globalEvent; \ No newline at end of file diff --git a/addons/mk6mortar/RscInGameUI.hpp b/addons/mk6mortar/RscInGameUI.hpp index a114896044..7d32512827 100644 --- a/addons/mk6mortar/RscInGameUI.hpp +++ b/addons/mk6mortar/RscInGameUI.hpp @@ -3,7 +3,7 @@ class RscInGameUI { class CA_IGUI_elements_group: RscControlsGroup {}; }; class ACE_Mk6_RscWeaponRangeArtillery: RscWeaponRangeArtillery { - onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_Mk6_RscWeaponRangeArtillery', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Mk6Mortar')])] call EFUNC(common,localEvent);); + onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_Mk6_RscWeaponRangeArtillery', _this select 0)]; [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Mk6Mortar')])] call CBA_fnc_localEvent;); controls[] = {"ACE_ChargeDisplay", "ACE_MILS_GROUP", "CA_IGUI_elements_group","CA_RangeElements_group"}; class ACE_ChargeDisplay: RscStructuredText { idc = 80085; diff --git a/addons/mk6mortar/XEH_postInit.sqf b/addons/mk6mortar/XEH_postInit.sqf index 9c098b8cdd..594b0cc231 100644 --- a/addons/mk6mortar/XEH_postInit.sqf +++ b/addons/mk6mortar/XEH_postInit.sqf @@ -3,21 +3,21 @@ [QGVAR(addMagazine), { params ["_static", "_magazine"]; _static addMagazineTurret [_magazine,[0]]; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; [QGVAR(removeMagazine), { params ["_static", "_magazine"]; _static removeMagazineTurret [_magazine,[0]]; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; [QGVAR(setAmmo), { params ["_static", "_magazine","_ammoCount"]; _static setMagazineTurretAmmo [_magazine, _ammoCount, [0]]; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; -["initMortar", {_this call FUNC(mortarInit);}] call EFUNC(common,addEventHandler); +["ace_initMortar", {_this call FUNC(mortarInit);}] call CBA_fnc_addEventHandler; if (!hasInterface) exitWith {}; -["playerVehicleChanged", {_this call FUNC(handlePlayerVehicleChanged);}] call EFUNC(common,addEventHandler); -["infoDisplayChanged", {_this call FUNC(turretDisplayLoaded);}] call EFUNC(common,addEventHandler); +["ace_playerVehicleChanged", FUNC(handlePlayerVehicleChanged)] call CBA_fnc_addEventHandler; +["ace_infoDisplayChanged", FUNC(turretDisplayLoaded)] call CBA_fnc_addEventHandler; diff --git a/addons/mk6mortar/config.cpp b/addons/mk6mortar/config.cpp index c445bd0a32..929f28b4d5 100644 --- a/addons/mk6mortar/config.cpp +++ b/addons/mk6mortar/config.cpp @@ -33,3 +33,7 @@ class RscStructuredText; #include "RscInGameUI.hpp" #include "RscRangeTable.hpp" + +class ACE_newEvents { + initMortar = "ace_initMortar"; +}; diff --git a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf index c3956d48a9..8c8760bc15 100644 --- a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf +++ b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf @@ -29,7 +29,7 @@ if (!(_newVehicle getVariable [QGVAR(initialized),false]) && !(_newVehicle getVa if (GVAR(useAmmoHandling) && {!(_mortar getVariable [QGVAR(initialized),false]) && !(_mortar getVariable [QGVAR(exclude),false])}) then { //wait for proper turret locality change [{ - ["initMortar", [_this], [_this]] call EFUNC(common,globalEvent); + ["ace_initMortar", [_this], [_this]] call CBA_fnc_globalEvent; }, _mortar, 0.05] call CBA_fnc_waitAndExecute; }; }, _newVehicle] call EFUNC(common,runAfterSettingsInit); diff --git a/addons/mk6mortar/functions/fnc_loadMagazine.sqf b/addons/mk6mortar/functions/fnc_loadMagazine.sqf index 41b0162151..37fa2f4db4 100644 --- a/addons/mk6mortar/functions/fnc_loadMagazine.sqf +++ b/addons/mk6mortar/functions/fnc_loadMagazine.sqf @@ -24,7 +24,7 @@ private ["_weapon","_currentMagazine","_count","_magazines","_magazineDetails"," //If function has been called with an optional classname hten add that magazine to the static weapon. Otherwise add the compatible magazine if(_magazineClassOptional != "") then { _unit removeMagazine _magazineClassOptional; - [QGVAR(addMagazine), [_static, _magazineClassOptional]] call EFUNC(common,globalEvent); + [QGVAR(addMagazine), [_static, _magazineClassOptional]] call CBA_fnc_globalEvent; } else { //Get weapon & magazine information of static weapon _weapon = (_static weaponsTurret [0]) select 0; @@ -49,7 +49,7 @@ if(_magazineClassOptional != "") then { } forEach _magazines; //If the static weapon already has an empty magazine then remove it if (_count == 0) then { - [QGVAR(removeMagazine), [_static, _currentMagazineClass]] call EFUNC(common,globalEvent); + [QGVAR(removeMagazine), [_static, _currentMagazineClass]] call CBA_fnc_globalEvent; }; //Find out the ammo count of the compatible magazine found if (_magazineClassDetails != "") then{ @@ -60,6 +60,6 @@ if(_magazineClassOptional != "") then { }; _unit removeMagazine _magazineClass; - [QGVAR(addMagazine), [_static, _magazineClass]] call EFUNC(common,globalEvent); - [QGVAR(setAmmo), _static, [_static, _magazineClass,_roundsLeft]] call EFUNC(common,targetEvent); + [QGVAR(addMagazine), [_static, _magazineClass]] call CBA_fnc_globalEvent; + [QGVAR(setAmmo), [_static, _magazineClass,_roundsLeft], _static] call CBA_fnc_targetEvent; }; diff --git a/addons/mk6mortar/functions/fnc_unloadMagazine.sqf b/addons/mk6mortar/functions/fnc_unloadMagazine.sqf index 537cc931d8..c485a39a3a 100644 --- a/addons/mk6mortar/functions/fnc_unloadMagazine.sqf +++ b/addons/mk6mortar/functions/fnc_unloadMagazine.sqf @@ -35,5 +35,5 @@ if (_ammoCount > 0) then { _unit addMagazineAmmoCargo [_currentMagazineClass, 1, _ammoCount]; _unit setPosATL _pos; }; - [QGVAR(removeMagazine), [_static, _currentMagazineClass]] call EFUNC(common,globalEvent); + [QGVAR(removeMagazine), [_static, _currentMagazineClass]] call CBA_fnc_globalEvent; }; diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index 1de69ece38..ba13c57627 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -151,6 +151,7 @@ Aktywuj obsługę amunicji Utiliser la gestion des munitions Utilizza la gestione delle munizioni + Usar manejo de munição Removes mortar magazines, requiring individual rounds to be loaded by the gunner or loader. Does not affect AI mortars. @@ -159,6 +160,7 @@ Usuwa magazynki moździerza, wymagając ładowania pojedynczych pocisków przez strzelca lub ładowniczego. Nie dotyczy moździerzy AI. Enlever les chargeurs de mortier, requiert des obus individuels qui doivent être chargés par le tireur ou le servant. N'affect pas les mortiers IA. Toglie i proiettili dal mortaio. I colpi singoli devono essere caricati dall'operatore. Non cambia quado l'IA spara. + Elimina os carregadores do morteiro, requerendo que o atirador ou carregador utilize de forma individual a munição. Não afeta os morteiros controlados pela IA. Remove Round @@ -168,6 +170,7 @@ Enlever l'obus Togli proiettile Odstranit náboj + Remover munição Load Mortar @@ -177,6 +180,7 @@ Charger le mortier Carica mortaio Nabít minomet + Carregar morteiro Unloading Round @@ -185,6 +189,7 @@ Rozładowywanie moździerza Déchargement de l'obus Scarica proiettile + Descarregar munição Preparing Round @@ -194,6 +199,7 @@ Praparation de l'obus Prepara il proiettile Připavuji náboj + Preparar munição Load HE @@ -203,6 +209,7 @@ Charger HE Carica proiettile esplosivo ad alto potenziale (HE) Nabít HE + Carregar HE Load Smoke @@ -212,6 +219,7 @@ Charger Fumigène Carica fumogeno Nabít Dýmovnici + Carregar Fumaça Load Illumination @@ -221,6 +229,7 @@ Charger Eclairante Carica illuminante Nabít Světlici + Carregar Iluminação Load Guided HE @@ -230,6 +239,7 @@ Charger HE guidé Carica HE guidata Nabít HE (Naváděné) + Carregar HE Guiada Load Laser Guided HE @@ -239,6 +249,7 @@ Charger HE guidé au laser Carica HE a guida laser Nabít HE (Naváděné laserem) + Carregar HE Guiada por Laser 82mm HE Round @@ -248,6 +259,7 @@ Obus de 82mm HE Proiettile da 82mm HE 82mm HE náboj + Munição 82mm HE 82mm Smoke Round @@ -257,6 +269,7 @@ Obus de 82mm fumigène Proiettile Fumogeno da 82mm 82mm Kouřový náboj + Munição 82mm Fumaça 82mm Illumination Round @@ -266,6 +279,7 @@ Obus de 82mm éclairant Proiettile illuminante da 82mm 82mm Osvětlovací náboj + Munição 82mm Iluminação 82mm Guided HE Round @@ -275,6 +289,7 @@ Obus de 82mm HE guidé Proiettile HE guidato 82mm HE náboj (naváděný) + Munição 82mm HE Guiada 82mm Laser Guided HE Round @@ -284,6 +299,7 @@ Obus de 82mm HE guidé au laser Proiettile HE a guida laser 82mm HE náboj (naváděný laserem) + Munição 82mm HE Guiada por Laser Used in Mk6 mortar @@ -293,6 +309,7 @@ Utilisé dans le mortier Mk6 Usato nel mortaio Mk6 Používá se u minometu Mk6 + Usada no Morteiro MK6 [ACE] 82mm HE Rounds Box @@ -302,6 +319,7 @@ [ACE] Obus de 82mm HE [ACE] Scatola proiettili espolisvi ad alto potenziale (HE) da 82mm [ACE] Bedna s municí (82mm HE) + [ACE] Caixa de Munição 82mm HE [ACE] 82mm Smoke Rounds Box @@ -311,6 +329,7 @@ [ACE] Obus de 82mm fumigène [ACE] Scatola fumogeni da 82mm [ACE] Bedna s municí (82mm Dýmovnice) + [ACE] Caixa de Munição 82mm Fumaça [ACE] 82mm Illumination Rounds Box @@ -320,6 +339,7 @@ [ACE] Obus de 82mm éclairants [ACE] Scatola illuminanti da 82mm [ACE] Bedna s municí (82mm Světlice) + [ACE] Caixa de Munição 82mm Iluminação [ACE] 82mm Default Loadout Box @@ -329,6 +349,7 @@ [ACE] Obus de 82mm par défaut [ACE] Scatola proiettili 82mm standard [ACE] Bedna se standardní 82mm municí + [ACE] Caixa de Munição 82mm Padrão \ No newline at end of file diff --git a/addons/modules/XEH_postInit.sqf b/addons/modules/XEH_postInit.sqf index 8f0c430db2..293b946897 100644 --- a/addons/modules/XEH_postInit.sqf +++ b/addons/modules/XEH_postInit.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" -["InitSettingsFromModules", { +[QEGVAR(common,initSettingsFromModules), { // TODO This is a basic and limited implementation that mimics some of the functionality from the A3 module framework, but not all of it. // We have to execute this in the postInit XEH because on object init, the parameters of the modules are not yet available. They are if we execute it at the start of postInit execution. @@ -49,4 +49,4 @@ GVAR(serverModulesRead) = true; publicVariable QGVAR(serverModulesRead); }; -}] call EFUNC(common,addEventhandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/modules/config.cpp b/addons/modules/config.cpp index aeb097fdff..543bbe2551 100644 --- a/addons/modules/config.cpp +++ b/addons/modules/config.cpp @@ -26,4 +26,4 @@ class CfgVehicles { }; }; -#include "CfgEventHandlers.hpp" \ No newline at end of file +#include "CfgEventHandlers.hpp" diff --git a/addons/movement/CfgInventoryGlobalVariable.hpp b/addons/movement/CfgInventoryGlobalVariable.hpp deleted file mode 100644 index cf25595254..0000000000 --- a/addons/movement/CfgInventoryGlobalVariable.hpp +++ /dev/null @@ -1,3 +0,0 @@ -class CfgInventoryGlobalVariable { - maxSoldierLoad = 1200; -}; diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index d9179a912a..b0db0d3681 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -3,11 +3,10 @@ if (!hasInterface) exitWith {}; -["playerChanged", FUNC(handleVirtualMass)] call FUNC(addEventHandler); -["playerInventoryChanged", FUNC(handleVirtualMass)] call FUNC(addEventHandler); +["ace_playerChanged", FUNC(handleVirtualMass)] call CBA_fnc_addEventHandler; +["ace_playerInventoryChanged", FUNC(handleVirtualMass)] call CBA_fnc_addEventHandler; -["ACE3 Movement", QGVAR(climb), localize LSTRING(Climb), -{ +["ACE3 Movement", QGVAR(climb), localize LSTRING(Climb), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific diff --git a/addons/movement/config.cpp b/addons/movement/config.cpp index a1d9b25be4..247d686978 100644 --- a/addons/movement/config.cpp +++ b/addons/movement/config.cpp @@ -15,7 +15,6 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgFatigue.hpp" -//#include "CfgInventoryGlobalVariable.hpp" #include "CfgMoves.hpp" #include "CfgVehicles.hpp" #include "ACE_Settings.hpp" diff --git a/addons/movement/functions/fnc_canClimb.sqf b/addons/movement/functions/fnc_canClimb.sqf index ec4202dbd5..260f76105b 100644 --- a/addons/movement/functions/fnc_canClimb.sqf +++ b/addons/movement/functions/fnc_canClimb.sqf @@ -40,14 +40,29 @@ private _checkPos4end = _checkPos4beg vectorAdd (_dir vectorMultiply 1.3); private _checkPos5beg = _pos vectorAdd [-0.2 * (_dir select 1), -0.2 * -(_dir select 0), 1.5]; private _checkPos5end = _checkPos5beg vectorAdd (_dir vectorMultiply 1.3); -/* -drawLine3D [ASLToATL _checkPos0beg, ASLToATL _checkPos0end, [0,1,0,1]]; -drawLine3D [ASLToATL _checkPos1beg, ASLToATL _checkPos1end, [1,0,0,1]]; -drawLine3D [ASLToATL _checkPos2beg, ASLToATL _checkPos2end, [1,0.5,0.5,1]]; -drawLine3D [ASLToATL _checkPos3beg, ASLToATL _checkPos3end, [1,0.5,0.5,1]]; -drawLine3D [ASLToATL _checkPos4beg, ASLToATL _checkPos4end, [1,0.5,0.5,1]]; -drawLine3D [ASLToATL _checkPos5beg, ASLToATL _checkPos5end, [1,0.5,0.5,1]]; -*/ +#ifdef DEBUG_MODE_FULL + [{ + params ["_args", "_idPFH"]; + + if (diag_tickTime > (_args select 0) + 5) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + + drawLine3D [ASLToATL (_args select 1), ASLToATL (_args select 2), [0,1,0,1]]; + drawLine3D [ASLToATL (_args select 3), ASLToATL (_args select 4), [1,0,0,1]]; + drawLine3D [ASLToATL (_args select 5), ASLToATL (_args select 6), [1,0.5,0.5,1]]; + drawLine3D [ASLToATL (_args select 7), ASLToATL (_args select 8), [1,0.5,0.5,1]]; + drawLine3D [ASLToATL (_args select 9), ASLToATL (_args select 10), [1,0.5,0.5,1]]; + drawLine3D [ASLToATL (_args select 11), ASLToATL (_args select 12), [1,0.5,0.5,1]]; + }, 0, [ diag_tickTime, + _checkPos0beg, _checkPos0end, + _checkPos1beg, _checkPos1end, + _checkPos2beg, _checkPos2end, + _checkPos3beg, _checkPos3end, + _checkPos4beg, _checkPos4end, + _checkPos5beg, _checkPos5end + ]] call CBA_fnc_addPerFrameHandler; +#endif lineIntersects [_checkPos0beg, _checkPos0end] && {!(lineIntersects [_checkPos1beg, _checkPos1end])} diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index 0ef4fde96b..bebe840b47 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -23,15 +23,15 @@ GVAR(showNamesTime) = -10; [29, [false, false, false]], false] call CBA_fnc_addKeybind; //LeftControl Key // Wait until the colors are defined before starting to draw the nametags -["SettingsInitialized", { +["ace_settingsInitialized", { // Draw handle call FUNC(updateSettings); -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // Change settings accordingly when they are changed -["SettingChanged", { +["ace_settingChanged", { params ["_name"]; if (_name == QGVAR(showPlayerNames)) then { call FUNC(updateSettings); }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/nametags/functions/fnc_initIsSpeaking.sqf b/addons/nametags/functions/fnc_initIsSpeaking.sqf index 7f9ced67f7..1e6484c7fa 100644 --- a/addons/nametags/functions/fnc_initIsSpeaking.sqf +++ b/addons/nametags/functions/fnc_initIsSpeaking.sqf @@ -28,13 +28,13 @@ if (isServer) then { if (!hasInterface) exitWith {}; -["playerChanged", { +["ace_playerChanged", { //When player changes, make sure to reset old unit's variable params ["", "_oldUnit"]; if ((!isNull _oldUnit) && {_oldUnit getVariable [QGVAR(isSpeakingInGame), false]}) then { _oldUnit setVariable [QGVAR(isSpeakingInGame), false, true]; }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; if (isClass (configFile >> "CfgPatches" >> "acre_api")) then { diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 96badd59af..186412cdde 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -29,18 +29,18 @@ GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; // Setup the event handlers -["playerInventoryChanged", FUNC(updatePPEffects)] call EFUNC(common,addEventHandler); -["playerVisionModeChanged", { +["ace_playerInventoryChanged", FUNC(updatePPEffects)] call CBA_fnc_addEventHandler; +["ace_playerVisionModeChanged", { _this call FUNC(updatePPEffects); _this call FUNC(onVisionModeChanged); -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; -["cameraViewChanged", { +["ace_cameraViewChanged", { _this call FUNC(updatePPEffects); _this call FUNC(onCameraViewChanged); -}] call EFUNC(common,addEventHandler); -["playerVehicleChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); -["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; +["ace_playerVehicleChanged", {_this call FUNC(updatePPEffects)}] call CBA_fnc_addEventHandler; +["ace_playerTurretChanged", {_this call FUNC(updatePPEffects)}] call CBA_fnc_addEventHandler; // Add keybinds ["ACE3 Equipment", QGVAR(IncreaseNVGBrightness), localize LSTRING(IncreaseNVGBrightness), @@ -72,5 +72,5 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; [209, [false, false, true]], false] call CBA_fnc_addKeybind; //PageDown + ALT // Register fire event handler -["firedPlayer", DFUNC(blending)] call EFUNC(common,addEventHandler); -["firedPlayerVehicle", DFUNC(blending)] call EFUNC(common,addEventHandler); +["ace_firedPlayer", DFUNC(blending)] call CBA_fnc_addEventHandler; +["ace_firedPlayerVehicle", DFUNC(blending)] call CBA_fnc_addEventHandler; diff --git a/addons/nightvision/functions/fnc_blending.sqf b/addons/nightvision/functions/fnc_blending.sqf index b34584a5d0..2616cb83f5 100644 --- a/addons/nightvision/functions/fnc_blending.sqf +++ b/addons/nightvision/functions/fnc_blending.sqf @@ -18,44 +18,33 @@ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); -private "_player"; -_player = ACE_player; +private _player = ACE_player; -//If our vehicle didn't shoot, or we're not in NVG mode, exit -if ((currentVisionMode _player) != 1) exitWith {}; +//If we're not in NVG mode, or it's a grenade, exit +if (currentVisionMode _player != 1 || {toLower _weapon in ["throw", "put"]}) exitWith {}; -private["_darkness", "_nvgBrightnessCoef", "_silencer", "_visibleFire", "_visibleFireCoef", "_visibleFireTime", "_visibleFireTimeCoef"]; +private _silencer = _player weaponAccessories _weapon select 0; -_silencer = switch (_weapon) do { - case (primaryWeapon _player): {(primaryWeaponItems _player) select 0}; - case (secondaryWeapon _player): {(secondaryWeaponItems _player) select 0}; - case (handgunWeapon _player): {(handgunItems _player) select 0}; - default {""}; -}; +private _visibleFireCoef = 1; +private _visibleFireTimeCoef = 1; -_visibleFireCoef = 1; -_visibleFireTimeCoef = 1; if (_silencer != "") then { _visibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFire"); _visibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFireTime"); }; -_visibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFire"); -_visibleFireTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFireTime"); - -_nvgBrightnessCoef = 1 + (_player getVariable [QGVAR(NVGBrightness), 0]) / 4; - -_fnc_isTracer = { - private ["_indexShot", "_lastRoundsTracer", "_tracersEvery"]; +private _visibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFire"); +private _visibleFireTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFireTime"); +private _fnc_isTracer = { if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "nvgOnly") > 0) exitWith {false}; - _indexShot = (_player ammo _weapon) + 1; + private _indexShot = (_player ammo _weapon) + 1; - _lastRoundsTracer = getNumber (configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer"); + private _lastRoundsTracer = getNumber (configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer"); if (_indexShot <= _lastRoundsTracer) exitWith {true}; - _tracersEvery = getNumber (configFile >> "CfgMagazines" >> _magazine >> "tracersEvery"); + private _tracersEvery = getNumber (configFile >> "CfgMagazines" >> _magazine >> "tracersEvery"); if (_tracersEvery == 0) exitWith {false}; (_indexShot - _lastRoundsTracer) % _tracersEvery == 0 @@ -66,7 +55,8 @@ if (call _fnc_isTracer) then { _visibleFireTime = _visibleFireTime + 2; }; -_darkness = 1 - (call EFUNC(common,ambientBrightness)); +private _darkness = 1 - (call EFUNC(common,ambientBrightness)); +private _nvgBrightnessCoef = 1 + (_player getVariable [QGVAR(NVGBrightness), 0]) / 4; _visibleFire = _darkness * _visibleFireCoef * _visibleFire * _nvgBrightnessCoef / 10 min 1; _visibleFireTime = _darkness * _visibleFireTimeCoef * _visibleFireTime * _nvgBrightnessCoef / 10 min 0.5; diff --git a/addons/noradio/XEH_postInit.sqf b/addons/noradio/XEH_postInit.sqf index 4aeccffd62..1606c674a9 100644 --- a/addons/noradio/XEH_postInit.sqf +++ b/addons/noradio/XEH_postInit.sqf @@ -11,7 +11,7 @@ if (isServer) then { if (!hasInterface) exitWith {}; // mutes/unmutes units when the player changes -["playerChanged", { +["ace_playerChanged", { params ["_newPlayer", "_oldPlayer"]; // mute the new player @@ -21,4 +21,4 @@ if (!hasInterface) exitWith {}; if (alive _oldPlayer) then { [_oldPlayer, "isPlayer"] call EFUNC(common,unmuteUnit); }; -}] call EFUNC(common,addEventhandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index c9667f3931..44e59a4074 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -28,14 +28,14 @@ GVAR(camera) = objNull; }; // save control for fired EH -["infoDisplayChanged", { +["ace_infoDisplayChanged", { if (!isNull ((_this select 0) displayCtrl 1713001)) then { uiNamespace setVariable [QGVAR(RscWeaponInfo2D), _this select 0]; }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // camera has to be re-created every time another camera is created. Otherwise r2t is either black or transparent. @todo Add popular custom cameras to the event in ACE_common. -["activeCameraChanged", { +["ace_activeCameraChanged", { if !(_this select 1) then { GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; camDestroy GVAR(camera); @@ -49,7 +49,7 @@ GVAR(camera) = objNull; "ace_optics_rendertarget0" setPiPEffect [0]; GVAR(camera) cameraEffect ["INTERNAL", "BACK", "ace_optics_rendertarget0"]; }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // Register fire event handler -["firedPlayer", DFUNC(handleFired)] call EFUNC(common,addEventHandler); +["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler; diff --git a/addons/optionsmenu/XEH_postInit.sqf b/addons/optionsmenu/XEH_postInit.sqf index 4736d72623..2ef332446a 100644 --- a/addons/optionsmenu/XEH_postInit.sqf +++ b/addons/optionsmenu/XEH_postInit.sqf @@ -1,11 +1,11 @@ #include "script_component.hpp" -["SettingsInitialized", { +["ace_settingsInitialized", { GVAR(categories) pushBack ""; //Ensure All Catagories is at top { if !(_x select 8 in GVAR(categories)) then { GVAR(categories) pushBack (_x select 8); }; }forEach EGVAR(common,settings); -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index e4935b8831..f5a162e075 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -19,7 +19,7 @@ if (hasInterface) then { [19, [true, false, false]], false] call CBA_fnc_addKeybind; //SHIFT + R Key }; -["SettingsInitialized", { +["ace_settingsInitialized", { TRACE_1("SettingsInitialized eh", GVAR(enabled)); if (!GVAR(enabled)) exitWith {}; @@ -35,8 +35,8 @@ if (hasInterface) then { GVAR(storedSpareBarrels) = [] call CBA_fnc_hashCreate; // Install event handlers for spare barrels - ["spareBarrelsSendTemperatureHint", FUNC(sendSpareBarrelsTemperaturesHint)] call EFUNC(common,addEventHandler); - ["spareBarrelsLoadCoolest", FUNC(loadCoolestSpareBarrel)] call EFUNC(common,addEventHandler); + [QGVAR(spareBarrelsSendTemperatureHint), FUNC(sendSpareBarrelsTemperaturesHint)] call CBA_fnc_addEventHandler; + [QGVAR(spareBarrelsLoadCoolest), FUNC(loadCoolestSpareBarrel)] call CBA_fnc_addEventHandler; // Schedule cool down calculation of stored spare barrels [] call FUNC(updateSpareBarrelsTemperaturesThread); @@ -52,18 +52,18 @@ if (hasInterface) then { ["CAManBase", "Take", {_this call FUNC(handleTakeEH);}] call CBA_fnc_addClassEventHandler; // Register fire event handler - ["firedPlayer", DFUNC(firedEH)] call EFUNC(common,addEventHandler); + ["ace_firedPlayer", DFUNC(firedEH)] call CBA_fnc_addEventHandler; // Only add eh to non local players if dispersion is enabled if (GVAR(overheatingDispersion)) then { - ["firedPlayerNonLocal", DFUNC(firedEH)] call EFUNC(common,addEventHandler); + ["ace_firedPlayerNonLocal", DFUNC(firedEH)] call CBA_fnc_addEventHandler; }; // Schedule cool down calculation of player weapons at (infrequent) regular intervals [] call FUNC(updateTemperatureThread); // Install event handler to display temp when a barrel was swapped - ["showWeaponTemperature", DFUNC(displayTemperature)] call EFUNC(common,addEventHandler); + [QGVAR(showWeaponTemperature), DFUNC(displayTemperature)] call CBA_fnc_addEventHandler; // Install event handler to initiate an assisted barrel swap - ["initiateSwapBarrelAssisted", DFUNC(swapBarrel)] call EFUNC(common,addEventHandler); + [QGVAR(initiateSwapBarrelAssisted), DFUNC(swapBarrel)] call CBA_fnc_addEventHandler; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/overheating/config.cpp b/addons/overheating/config.cpp index 2c48191810..576ee1e190 100644 --- a/addons/overheating/config.cpp +++ b/addons/overheating/config.cpp @@ -50,4 +50,11 @@ class CfgGesturesMale { speed = 0.3; }; }; -}; \ No newline at end of file +}; +class ACE_newEvents { + initiateSwapBarrelAssisted = QGVAR(initiateSwapBarrelAssisted); + showWeaponTemperature = QGVAR(showWeaponTemperature); + spareBarrelsLoadCoolest = QGVAR(spareBarrelsLoadCoolest); + spareBarrelsSendTemperatureHint = QGVAR(spareBarrelsSendTemperatureHint); + weaponJammed = "ace_weaponJammed"; +}; diff --git a/addons/overheating/functions/fnc_checkSpareBarrelsTemperatures.sqf b/addons/overheating/functions/fnc_checkSpareBarrelsTemperatures.sqf index e8dbaabec0..be2e1ae1a5 100644 --- a/addons/overheating/functions/fnc_checkSpareBarrelsTemperatures.sqf +++ b/addons/overheating/functions/fnc_checkSpareBarrelsTemperatures.sqf @@ -29,7 +29,7 @@ if (!([_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canI params ["_args", "_elapsedTime", "_totalTime", "_errorCode"]; _args params ["_player"]; // Time has enlapsed, ask the server to send the hint - ['spareBarrelsSendTemperatureHint', [_player, _player]] call EFUNC(common,serverEvent); + [QGVAR(spareBarrelsSendTemperatureHint), [_player, _player]] call CBA_fnc_serverEvent; }, {}, (localize LSTRING(CheckingSpareBarrelsTemperatures)), diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf index 4e42f769f7..f41262c4e9 100644 --- a/addons/overheating/functions/fnc_jamWeapon.sqf +++ b/addons/overheating/functions/fnc_jamWeapon.sqf @@ -43,7 +43,7 @@ if (_ammo > 0) then { // only display the hint once, after you try to shoot an already jammed weapon GVAR(knowAboutJam) = false; -["weaponJammed", [_unit,_weapon]] call EFUNC(common,localEvent); +["ace_weaponJammed", [_unit,_weapon]] call CBA_fnc_localEvent; if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then { diff --git a/addons/overheating/functions/fnc_loadCoolestSpareBarrel.sqf b/addons/overheating/functions/fnc_loadCoolestSpareBarrel.sqf index 7887a87ce6..098ad70fcc 100644 --- a/addons/overheating/functions/fnc_loadCoolestSpareBarrel.sqf +++ b/addons/overheating/functions/fnc_loadCoolestSpareBarrel.sqf @@ -50,4 +50,4 @@ _gunner setVariable [format [QGVAR(%1_temp), _weapon], _coolestTemp, true]; [GVAR(storedSpareBarrels), _coolestMag, [_weaponTemp, CBA_missionTime, _barrelMass]] call CBA_fnc_hashSet; // Send an event so the machines of the assistant and gunner can show the hint -["showWeaponTemperature", [_assistant, _gunner], [_gunner, _weapon]] call EFUNC(common,targetEvent); +[QGVAR(showWeaponTemperature), _gunner], [_gunner, _weapon], [_assistant] call CBA_fnc_targetEvent; diff --git a/addons/overheating/functions/fnc_sendSpareBarrelsTemperaturesHint.sqf b/addons/overheating/functions/fnc_sendSpareBarrelsTemperaturesHint.sqf index 2ff248016d..f377d0ba12 100644 --- a/addons/overheating/functions/fnc_sendSpareBarrelsTemperaturesHint.sqf +++ b/addons/overheating/functions/fnc_sendSpareBarrelsTemperaturesHint.sqf @@ -73,4 +73,4 @@ if (_countExtremelyHot > 0) then { }; TRACE_1("_output",_output); -["displayTextStructured", [_player], [_output, _size, _player]] call EFUNC(common,targetEvent); +[QEGVAR(common,displayTextStructured), [_output, _size, _player], [_player]] call CBA_fnc_targetEvent; diff --git a/addons/overheating/functions/fnc_swapBarrelAssistant.sqf b/addons/overheating/functions/fnc_swapBarrelAssistant.sqf index 5e3c31fc5e..dd6d51d109 100644 --- a/addons/overheating/functions/fnc_swapBarrelAssistant.sqf +++ b/addons/overheating/functions/fnc_swapBarrelAssistant.sqf @@ -30,4 +30,4 @@ playSound "ACE_BarrelSwap"; [3, [_assistant, _gunner, _weapon], {}, {}, (localize LSTRING(SwappingBarrel))] call EFUNC(common,progressBar); -["initiateSwapBarrelAssisted", _gunner, [_assistant, _gunner, _weapon]] call EFUNC(common,objectEvent); +[QGVAR(initiateSwapBarrelAssisted), [_assistant, _gunner, _weapon], _gunner] call CBA_fnc_targetEvent; diff --git a/addons/overheating/functions/fnc_swapBarrelCallback.sqf b/addons/overheating/functions/fnc_swapBarrelCallback.sqf index df80981705..a0c3248aea 100644 --- a/addons/overheating/functions/fnc_swapBarrelCallback.sqf +++ b/addons/overheating/functions/fnc_swapBarrelCallback.sqf @@ -37,7 +37,7 @@ private _barrelMass = 0.50 * (getNumber (configFile >> "CfgWeapons" >> _weapon > // store the removed barrel with the former weapon temperature. The server // also updates the current weapon temperature to match that of the new // loaded barrel. -["spareBarrelsLoadCoolest", [_assistant, _gunner, _weapon, _temp, _barrelMass]] call EFUNC(common,serverEvent); - +[QGVAR(spareBarrelsLoadCoolest), [_assistant, _gunner, _weapon, _temp, _barrelMass]] call CBA_fnc_serverEvent; + // Store the update time _gunner setVariable [format [QGVAR(%1_time), _weapon], CBA_missionTime]; diff --git a/addons/overheating/stringtable.xml b/addons/overheating/stringtable.xml index e49ad433fc..07fdedd681 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -33,6 +33,7 @@ Efectos de partículas Effet de surchauffe Částicové efekty přehřívání + Efeito de parícula de superaquecimento Show particle effects when weapon overheats @@ -41,6 +42,7 @@ Mostra effetti particellari quando l'arma si surriscalda Muestra efectos de partículas cuando el arma del jugador se sobreacalienta Montrer les effets lorsque l'arme surchauffe. + Mostra efeitos de párticula quando a arma superaquece Overheating Particle Effects for everyone @@ -50,6 +52,7 @@ Efectos de partículas para todos Effets de surchauffe pour tout le monde. Částicové efekty přehřívání pro všechny + Efeito de partícula de superaquecimento para todos Show particle effects when other players weapon overheats @@ -58,6 +61,7 @@ Mostra effetti particellari quando l'arma di altri giocatori si surriscalda Muestra efectos de partículas cuando el arma de jugadores cercanos se sobreacalienta Montrer les effets de surchauffe des autres joueurs. + Mostra efeito de partículas quando a arma de outros jogadores superaquece Overheating Dispersion @@ -66,6 +70,7 @@ Dispersione Surriscaldamento Dispersión Disperssion dûe à la surchauffe + Disperção de superaquecimento Overheated weapons will be less accurate and have decreased muzzle velocity. Applys for all players. @@ -74,6 +79,7 @@ Armi surriscaldate saranno meno precise ed avranno una ridotta velocità alla volata. Applica per tutti i giocatori. Las armas sobrecalentadas pierden precisión y tienen una velocidad de disparo reducida. Se aplica a todos los jugadores. Les armes en surchauffe seront moins précises et auront une vitesse en sortie de bouche plus faible. S'applique pour tous les joueurs. + Armas superaquecidas irão ser menos precisas e ter velocidade de disparo reduzidas. Aplica a todos os jogadores. Unjam weapon on reload @@ -83,6 +89,7 @@ Des-enrayer l'arme au rechargement. Disinceppa l'arma quando si ricarica Uvolnit zbraň při přebití + Desemperrar arma no recarregamento Reloading clears a weapon jam. @@ -92,6 +99,7 @@ Recharger vide la chambre de l'arme L'arma si disinceppa quando si ricarica Přebití uvolní zaseknutou zbraň. + Recarregar desemperra arma. Chance of unjam failing @@ -101,6 +109,7 @@ Chance de rater le des-enrayement Probabilità di sbagliare a disinceppare l'arma Šance, že uvolnění zbraně selže + Chance de falha de desemperramento Probability that an unjam action might fail, requiring to be repeated. @@ -109,6 +118,7 @@ Szansa na to, że przy przeładowaniu broni zacięcie nie zostanie usunięte, przez co czynność będzie musiała zostać powtórzona ponownie. Probabilité qu'une action de des-enrayement échoue, nécessitant de recommencer. Probabilità che si possa sbagliare a caso a disinceppare l'arma. Richiede di ripetere. + Probabilidade que uma ação de desemperramento falhe, tendo que ser repetida Spare barrel @@ -178,6 +188,7 @@ Toujours enrayé ! Non si è disinceppata! Zbrań se nepodařilo uvolnit + Falha no desemperramento Swap barrel @@ -253,9 +264,11 @@ Check spare barrels temperatures + Verifica temperatura de canos reservas Checking spare barrels temperatures... + Verificando temperatura de canos reservas Temperature @@ -271,26 +284,33 @@ Cool Spare Barrel/s + Cano/s reserva/s frio/s Warm Spare Barrel/s + Cano/s reserva/s morno/s Hot Spare Barrel/s + Cano/s reserva/s quente/s Very Hot Spare Barrel/s + Cano/s reserva/s muito quente/s Extremely Hot Spare Barrel/s + Cano/s reserva/s extremamente quente/s Overheating Enabled Überhitzen Aktiviert Activada Sobrecalentamiento + Superaquecimento ativado Master enable for the overheating/jamming module + Chave mestra para o módulo de superaquecimento/emperramento \ No newline at end of file diff --git a/addons/overpressure/XEH_postInit.sqf b/addons/overpressure/XEH_postInit.sqf index f7f0bc2ace..dd74ec5c3a 100644 --- a/addons/overpressure/XEH_postInit.sqf +++ b/addons/overpressure/XEH_postInit.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" -["overpressure", FUNC(overpressureDamage)] call EFUNC(common,addEventHandler); +["ace_overpressure", FUNC(overpressureDamage)] call CBA_fnc_addEventHandler; // Register fire event handler -["firedPlayer", DFUNC(firedEHBB)] call EFUNC(common,addEventHandler); -["firedPlayerVehicle", DFUNC(firedEHOP)] call EFUNC(common,addEventHandler); +["ace_firedPlayer", DFUNC(firedEHBB)] call CBA_fnc_addEventHandler; +["ace_firedPlayerVehicle", DFUNC(firedEHOP)] call CBA_fnc_addEventHandler; diff --git a/addons/overpressure/config.cpp b/addons/overpressure/config.cpp index 1839dc3ee1..f4b5fdf951 100644 --- a/addons/overpressure/config.cpp +++ b/addons/overpressure/config.cpp @@ -15,3 +15,7 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgWeapons.hpp" + +class ACE_newEvents { + overpressure = "ace_overpressure"; +}; diff --git a/addons/overpressure/functions/fnc_firedEHBB.sqf b/addons/overpressure/functions/fnc_firedEHBB.sqf index 8dc15e0f0a..aa2997d0e7 100644 --- a/addons/overpressure/functions/fnc_firedEHBB.sqf +++ b/addons/overpressure/functions/fnc_firedEHBB.sqf @@ -37,7 +37,7 @@ private _direction = [0, 0, 0] vectorDiff (vectorDir _projectile); private _affected = (ASLtoAGL _position) nearEntities ["CAManBase", _backblastRange]; // Let each client handle their own affected units -["overpressure", _affected, [_unit, _position, _direction, _weapon, _magazine, _ammo]] call EFUNC(common,targetEvent); +["ace_overpressure", [_unit, _position, _direction, _weapon, _magazine, _ammo], _affected] call CBA_fnc_targetEvent; // Damage to the firer private _distance = 2 * ([_position, _direction, _backblastRange, _unit] call FUNC(getDistance)); diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index dff9215a52..b8c47a826b 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -40,7 +40,7 @@ private _direction = vectorDir _projectile; private _affected = (ASLtoAGL _position) nearEntities ["CAManBase", _dangerZoneRange]; // Let each client handle their own affected units -["overpressure", _affected, [_unit, _position, _direction, _weapon, _magazine, _ammo]] call EFUNC(common,targetEvent); +["ace_overpressure", [_unit, _position, _direction, _weapon, _magazine, _ammo], _affected] call CBA_fnc_targetEvent; // Draw debug lines #ifdef DEBUG_MODE_FULL diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index ad4044e6e5..799acf92b6 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -33,14 +33,14 @@ if (!hasInterface) exitWith {}; [24, [false, false, false]], false] call CBA_fnc_addKeybind; GVAR(PFH) = false; -["playerVehicleChanged",{ +["ace_playerVehicleChanged",{ if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then { GVAR(PFH) = true; [FUNC(onEachFrame), 0.1, []] call CALLSTACK(CBA_fnc_addPerFrameHandler); }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // don't show speed and height when in expert mode -["infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call EFUNC(common,addEventHandler); +["ace_infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call CBA_fnc_addEventHandler; -["playerInventoryChanged", FUNC(storeParachute)] call EFUNC(common,addEventHandler); +["ace_playerInventoryChanged", FUNC(storeParachute)] call CBA_fnc_addEventHandler; diff --git a/addons/rearm/XEH_postInit.sqf b/addons/rearm/XEH_postInit.sqf index c22b84ffb4..a3038494da 100644 --- a/addons/rearm/XEH_postInit.sqf +++ b/addons/rearm/XEH_postInit.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" -["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventHandler); -["playerVehicleChanged", {params ["_unit"]; [_unit] call FUNC(dropAmmo)}] call EFUNC(common,addEventHandler); +["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; +["ace_playerVehicleChanged", {params ["_unit"]; [_unit] call FUNC(dropAmmo)}] call CBA_fnc_addEventHandler; if (isServer) then { addMissionEventHandler ["HandleDisconnect", {params ["_unit"]; [_unit] call FUNC(dropAmmo)}]; diff --git a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf index 1789767cfd..44761d3d17 100644 --- a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf +++ b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf @@ -40,15 +40,23 @@ if (_maxMagazines == 1) then { if (GVAR(level) == 1) then { // Fill magazine completely _target setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath]; - ["displayTextStructured", [_unit], [[LSTRING(Hint_RearmedTriple), _rounds, + [QEGVAR(common,displayTextStructured), + [ + [LSTRING(Hint_RearmedTriple), _rounds, getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), - getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit]] call EFUNC(common,targetEvent); + getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit + ], + [_unit]] call CBA_fnc_targetEvent; } else { // Fill only at most _numRounds _target setMagazineTurretAmmo [_magazineClass, ((_target magazineTurretAmmo [_magazineClass, _turretPath]) + _numRounds) min _rounds, _turretPath]; - ["displayTextStructured", [_unit], [[LSTRING(Hint_RearmedTriple), _numRounds, + [QEGVAR(common,displayTextStructured), + [ + [LSTRING(Hint_RearmedTriple), _numRounds, getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), - getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit]] call EFUNC(common,targetEvent); + getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit + ], + [_unit]] call CBA_fnc_targetEvent; }; } else { for "_idx" from 1 to (_maxMagazines+1) do { @@ -69,9 +77,13 @@ if (_maxMagazines == 1) then { } else { _target setMagazineTurretAmmo [_magazineClass, _currentRounds + _numRounds, _turretPath]; }; - ["displayTextStructured", [_unit], [[LSTRING(Hint_RearmedTriple), _numRounds, + [QEGVAR(common,displayTextStructured), + [ + [LSTRING(Hint_RearmedTriple), _numRounds, getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), - getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit]] call EFUNC(common,targetEvent); + getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit + ], + [_unit]] call CBA_fnc_targetEvent; } else { // Fill current magazine completely and fill next magazine partially _target setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath]; @@ -79,9 +91,13 @@ if (_maxMagazines == 1) then { _target addMagazineTurret [_magazineClass, _turretPath]; _target setMagazineTurretAmmo [_magazineClass, _currentRounds, _turretPath]; }; - ["displayTextStructured", [_unit], [[LSTRING(Hint_RearmedTriple), _rounds, + [QEGVAR(common,displayTextStructured), + [ + [LSTRING(Hint_RearmedTriple), _rounds, getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), - getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit]] call EFUNC(common,targetEvent); + getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit + ], + [_unit]] call CBA_fnc_targetEvent; }; }; _target removeMagazineTurret [_magazineClass, _turretPath]; diff --git a/addons/recoil/XEH_postInit.sqf b/addons/recoil/XEH_postInit.sqf index e6b694646f..29e5464612 100644 --- a/addons/recoil/XEH_postInit.sqf +++ b/addons/recoil/XEH_postInit.sqf @@ -1,4 +1,4 @@ #include "script_component.hpp" // Register fire event handler -["firedPlayer", DFUNC(camShake)] call EFUNC(common,addEventHandler); +["ace_firedPlayer", DFUNC(camShake)] call CBA_fnc_addEventHandler; diff --git a/addons/refuel/XEH_postInit.sqf b/addons/refuel/XEH_postInit.sqf index 5078d808a2..8c28464287 100644 --- a/addons/refuel/XEH_postInit.sqf +++ b/addons/refuel/XEH_postInit.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventHandler); +["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; if (isServer) then { addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleDisconnect)}]; @@ -8,4 +8,4 @@ if (isServer) then { [QGVAR(resetLocal), { _this call FUNC(resetLocal); -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/refuel/functions/fnc_checkFuel.sqf b/addons/refuel/functions/fnc_checkFuel.sqf index 140021419d..49d62b1e44 100644 --- a/addons/refuel/functions/fnc_checkFuel.sqf +++ b/addons/refuel/functions/fnc_checkFuel.sqf @@ -27,9 +27,9 @@ private _fuel = [_target] call FUNC(getFuel); params ["_args"]; _args params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_fuel", 0, [0]]]; if (_fuel > 0 ) then { - ["displayTextStructured", _unit, [[LSTRING(Hint_RemainingFuel), _fuel], 2, _unit]] call EFUNC(common,objectEvent); + [QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RemainingFuel), _fuel], 2, _unit], _unit] call CBA_fnc_targetEvent; } else { - ["displayTextStructured", _unit, [LSTRING(Hint_Empty), 2, _unit]] call EFUNC(common,objectEvent); + [QEGVAR(common,displayTextStructured), [LSTRING(Hint_Empty), 2, _unit], _unit] call CBA_fnc_targetEvent; }; true }, diff --git a/addons/refuel/functions/fnc_connectNozzleAction.sqf b/addons/refuel/functions/fnc_connectNozzleAction.sqf index 1df5f1e208..250da51e21 100644 --- a/addons/refuel/functions/fnc_connectNozzleAction.sqf +++ b/addons/refuel/functions/fnc_connectNozzleAction.sqf @@ -119,7 +119,7 @@ _endPosTestOffset set [2, (_startingOffset select 2)]; }; }; }; - ["setVectorDirAndUp", _nozzle, [_nozzle, _dirAndUp]] call EFUNC(common,objectEvent); + [QEGVAR(common,setVectorDirAndUp), [_nozzle, _dirAndUp], _nozzle] call CBA_fnc_targetEvent; _nozzle setVariable [QGVAR(sink), _target, true]; _nozzle setVariable [QGVAR(isConnected), true, true]; _target setVariable [QGVAR(nozzle), _nozzle, true]; diff --git a/addons/refuel/functions/fnc_refuel.sqf b/addons/refuel/functions/fnc_refuel.sqf index 62a006cda9..2f7131bd9f 100644 --- a/addons/refuel/functions/fnc_refuel.sqf +++ b/addons/refuel/functions/fnc_refuel.sqf @@ -79,7 +79,7 @@ private _maxFuel = getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> }; _unit setVariable [QGVAR(tempFuel), _fuelInSink]; - ["setFuel", _sink, [_sink, _fuelInSink]] call EFUNC(common,objectEvent); + [QEGVAR(common,setFuel), [_sink, _fuelInSink], _sink] call CBA_fnc_targetEvent; [_source, _fuelInSource] call FUNC(setFuel); } else { _unit setVariable [QGVAR(tempFuel), fuel _sink]; diff --git a/addons/refuel/functions/fnc_reset.sqf b/addons/refuel/functions/fnc_reset.sqf index 767e4b6c88..d58f0a48ad 100644 --- a/addons/refuel/functions/fnc_reset.sqf +++ b/addons/refuel/functions/fnc_reset.sqf @@ -33,7 +33,7 @@ if !(isNil "_nozzle") then { }; { - [QGVAR(resetLocal), _x, [_x, _nozzle]] call EFUNC(common,objectEvent); + [QGVAR(resetLocal), [_x, _nozzle], _x] call CBA_fnc_targetEvent; } count allPlayers; deleteVehicle _nozzle; }; diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index 16f3d9b40e..193fdaf79b 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -18,16 +18,16 @@ if (!hasInterface) exitWith {}; {false}, [19, [false, true, false]], false] call CBA_fnc_addKeybind; -["setAmmoSync", { +[QGVAR(syncAmmo), { //To propagate the setAmmo change, do it on all clients params ["_unit", "_weapon", "_ammo"]; - TRACE_3("setAmmoSync EH",_unit,_weapon,_ammo); + TRACE_3("syncAmmo EH",_unit,_weapon,_ammo); _unit setAmmo [_weapon, _ammo]; -}] call EFUNC(common,addEventhandler); +}] call CBA_fnc_addEventHandler; // Listen for attempts to link ammo -["linkedAmmo", { +[QGVAR(linkedAmmo), { params ["_receiver", "_giver", "_magazine"]; private _magazineType = currentMagazine _receiver; @@ -35,7 +35,7 @@ if (!hasInterface) exitWith {}; // Return the magazine if it's the wrong type if (_magazineType != (_magazine select 0)) exitWith { - ["returnedAmmo", [_giver], [_giver,_receiver,_magazine]] call EFUNC(common,targetEvent); + [QGVAR(returnedAmmo), [_giver,_receiver,_magazine], [_giver]] call CBA_fnc_targetEvent; }; private _ammoCount = _receiver ammo currentWeapon _receiver; @@ -43,22 +43,22 @@ if (!hasInterface) exitWith {}; // Return the magazine if the belt is full or empty if ((_ammoCount == 0) || _ammoMissing == 0) exitWith { - ["returnedAmmo", [_giver], [_giver,_receiver,_magazine]] call EFUNC(common,targetEvent); + [QGVAR(returnedAmmo), [_giver,_receiver,_magazine], [_giver]] call CBA_fnc_targetEvent; }; // Add the ammo private _ammoAdded = _ammoMissing min (_magazine select 1); - ["setAmmoSync", [_receiver, currentWeapon _receiver, _ammoCount + _ammoAdded]] call EFUNC(common,globalEvent); + [QGVAR(syncAmmo), [_receiver, currentWeapon _receiver, _ammoCount + _ammoAdded]] call CBA_fnc_globalEvent; if ((_magazine select 1) - _ammoAdded > 0) then { - ["returnedAmmo", [_giver], [_giver, _receiver, [_magazineType, (_magazine select 1) - _ammoAdded]]] call EFUNC(common,targetEvent); + [QGVAR(returnedAmmo), [_giver, _receiver, [_magazineType, (_magazine select 1) - _ammoAdded]], [_giver]] call CBA_fnc_targetEvent; }; -}] call EFUNC(common,addEventhandler); +}] call CBA_fnc_addEventHandler; // Listen for returned magazines -["returnedAmmo", { +[QGVAR(returnedAmmo), { params ["_receiver", "", "_magazine"]; TRACE_2("returnedAmmo EH",_receiver,_magazine); _receiver addMagazine _magazine; -}] call EFUNC(common,addEventhandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp index 1e97fa70f1..d3015f9dfa 100644 --- a/addons/reload/config.cpp +++ b/addons/reload/config.cpp @@ -19,3 +19,9 @@ class CfgPatches { #include "CfgActions.hpp" #include "ACE_Settings.hpp" #include "ACE_UI.hpp" + +class ACE_newEvents { + setAmmoSync = QGVAR(syncAmmo); + returnedAmmo = QGVAR(returnedAmmo); + linkedAmmo = QGVAR(linkedAmmo); +}; diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index 5924e1b4e1..8b8768dbba 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -46,7 +46,7 @@ private _onFinish = { (_this select 0) params ["_player", "_target", "_magazine"]; // Raise event on remote unit - ["linkedAmmo", [_target], [_target, _player, _magazine]] call EFUNC(common,targetEvent); + [QGVAR(linkedAmmo), [_target, _player, _magazine], [_target]] call CBA_fnc_targetEvent; }; private _onFailure = { diff --git a/addons/reloadlaunchers/XEH_postInit.sqf b/addons/reloadlaunchers/XEH_postInit.sqf index 437927602a..8c18d430c4 100644 --- a/addons/reloadlaunchers/XEH_postInit.sqf +++ b/addons/reloadlaunchers/XEH_postInit.sqf @@ -1,4 +1,4 @@ // by commy2 #include "script_component.hpp" -["reloadLauncher", {_this call DFUNC(reloadLauncher)}] call EFUNC(common,addEventhandler); +[QGVAR(reloadLauncher), {_this call DFUNC(reloadLauncher)}] call CBA_fnc_addEventHandler; diff --git a/addons/reloadlaunchers/config.cpp b/addons/reloadlaunchers/config.cpp index 0ff68c0c9c..ff4c00bb22 100644 --- a/addons/reloadlaunchers/config.cpp +++ b/addons/reloadlaunchers/config.cpp @@ -17,3 +17,7 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" + +class ACE_newEvents { + reloadLauncher = QGVAR(reloadLauncher); +}; diff --git a/addons/reloadlaunchers/functions/fnc_load.sqf b/addons/reloadlaunchers/functions/fnc_load.sqf index db18e7edaa..863d1e9189 100644 --- a/addons/reloadlaunchers/functions/fnc_load.sqf +++ b/addons/reloadlaunchers/functions/fnc_load.sqf @@ -32,7 +32,7 @@ private ["_onSuccess", "_onFailure", "_condition"]; _onSuccess = { (_this select 0 select 0) removeMagazine (_this select 0 select 3); - ["reloadLauncher", _this select 0 select 1, _this select 0] call DEFUNC(common,targetEvent); + [QGVAR(reloadLauncher), _this select 0, _this select 0 select 1] call CBA_fnc_targetEvent; [localize LSTRING(LauncherLoaded)] call DEFUNC(common,displayTextStructured); }; diff --git a/addons/repair/XEH_postInit.sqf b/addons/repair/XEH_postInit.sqf index 44ca157b0c..2f0bbe7869 100644 --- a/addons/repair/XEH_postInit.sqf +++ b/addons/repair/XEH_postInit.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" -["setVehicleDamage", {_this call FUNC(setDamage)}] call EFUNC(common,addEventHandler); -["setVehicleHitPointDamage", {_this call FUNC(setHitPointDamage)}] call EFUNC(common,addEventHandler); +[QGVAR(setVehicleDamage), {_this call FUNC(setDamage)}] call CBA_fnc_addEventHandler; +[QGVAR(setVehicleHitPointDamage), {_this call FUNC(setHitPointDamage)}] call CBA_fnc_addEventHandler; // wheels -["setWheelHitPointDamage", {(_this select 0) setHitPointDamage [_this select 1, _this select 2]}] call EFUNC(common,addEventHandler); +[QGVAR(setWheelHitPointDamage), {(_this select 0) setHitPointDamage [_this select 1, _this select 2]}] call CBA_fnc_addEventHandler; diff --git a/addons/repair/config.cpp b/addons/repair/config.cpp index e23eeeaea0..56465ba1f5 100644 --- a/addons/repair/config.cpp +++ b/addons/repair/config.cpp @@ -19,3 +19,10 @@ class CfgPatches { #include "CfgActions.hpp" #include "CfgVehicles.hpp" #include "CfgEden.hpp" + +class ACE_newEvents { + setWheelHitPointDamage = QGVAR(setWheelHitPointDamage); + setVehicleHitPointDamage = QGVAR(setVehicleHitPointDamage); + setVehicleDamage = QGVAR(setVehicleDamage); + AddCargoByClass = "ace_addCargoByClass"; +}; diff --git a/addons/repair/functions/fnc_addSpareParts.sqf b/addons/repair/functions/fnc_addSpareParts.sqf index 3d7247fcaa..2d133da3c1 100644 --- a/addons/repair/functions/fnc_addSpareParts.sqf +++ b/addons/repair/functions/fnc_addSpareParts.sqf @@ -33,4 +33,4 @@ if (!EGVAR(common,settingsInitFinished)) exitWith { if (!_force && !GVAR(addSpareParts)) exitWith {}; // Load -["AddCargoByClass", [_part, _vehicle, _amount]] call EFUNC(common,localEvent); +["ace_addCargoByClass", [_part, _vehicle, _amount]] call CBA_fnc_localEvent; diff --git a/addons/repair/functions/fnc_doRemoveTrack.sqf b/addons/repair/functions/fnc_doRemoveTrack.sqf index d36407b197..ca6ac58ffd 100644 --- a/addons/repair/functions/fnc_doRemoveTrack.sqf +++ b/addons/repair/functions/fnc_doRemoveTrack.sqf @@ -27,14 +27,14 @@ private _hitPointDamage = _vehicle getHitPointDamage _hitPoint; if (_hitPointDamage >= 1) exitWith {}; // don't die by spawning / moving the wheel -["fixCollision", _unit] call EFUNC(common,localEvent); +[QEGVAR(common,fixCollision), _unit] call CBA_fnc_localEvent; // spawn track private _newTrack = ["ACE_Track", getPosASL _unit, _hitPointDamage] call FUNC(spawnObject); TRACE_2("new track created",_newTrack,damage _newTrack); // raise event to set the new hitpoint damage -["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, 1]] call EFUNC(common,targetEvent); +[QGVAR(setWheelHitPointDamage), [_vehicle, _hitPoint, 1], _vehicle] call CBA_fnc_targetEvent; // display text message if enabled if (GVAR(DisplayTextOnRepair)) then { diff --git a/addons/repair/functions/fnc_doRemoveWheel.sqf b/addons/repair/functions/fnc_doRemoveWheel.sqf index 21a152c597..dafe603a18 100644 --- a/addons/repair/functions/fnc_doRemoveWheel.sqf +++ b/addons/repair/functions/fnc_doRemoveWheel.sqf @@ -27,14 +27,14 @@ private _hitPointDamage = _vehicle getHitPointDamage _hitPoint; if (_hitPointDamage >= 1) exitWith {}; // don't die by spawning / moving the wheel -["fixCollision", _unit] call EFUNC(common,localEvent); +[QEGVAR(common,fixCollision), _unit] call CBA_fnc_localEvent; // spawn wheel private _newWheel = ["ACE_Wheel", getPosASL _unit, _hitPointDamage] call FUNC(spawnObject); TRACE_2("new wheel created",_newWheel,damage _newWheel); // raise event to set the new hitpoint damage -["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, 1]] call EFUNC(common,targetEvent); +[QGVAR(setWheelHitPointDamage), [_vehicle, _hitPoint, 1], _vehicle] call CBA_fnc_targetEvent; // display text message if enabled if (GVAR(DisplayTextOnRepair)) then { diff --git a/addons/repair/functions/fnc_doRepair.sqf b/addons/repair/functions/fnc_doRepair.sqf index 4c063c6c73..ede096a1fb 100644 --- a/addons/repair/functions/fnc_doRepair.sqf +++ b/addons/repair/functions/fnc_doRepair.sqf @@ -34,7 +34,7 @@ private _hitPointNewDamage = (_hitPointCurDamage - 0.5) max _postRepairDamageMin if (_hitPointNewDamage < _hitPointCurDamage) then { // raise event to set the new hitpoint damage TRACE_3("repairing main point", _vehicle, _hitPointIndex, _hitPointNewDamage); - ["setVehicleHitPointDamage", _vehicle, [_vehicle, _hitPointIndex, _hitPointNewDamage]] call EFUNC(common,targetEvent); + [QGVAR(setVehicleHitPointDamage), [_vehicle, _hitPointIndex, _hitPointNewDamage], _vehicle] call CBA_fnc_targetEvent; _hitPointCurDamage = _hitPointNewDamage; }; @@ -55,7 +55,7 @@ if (isArray _hitpointGroupConfig) then { private _subPointNewDamage = (_subPointCurDamage - 0.5) max _postRepairDamageMin; if (_subPointNewDamage < _subPointCurDamage) then { TRACE_3("repairing sub point", _vehicle, _subHitIndex, _subPointNewDamage); - ["setVehicleHitPointDamage", _vehicle, [_vehicle, _subHitIndex, _subPointNewDamage]] call EFUNC(common,targetEvent); + [QGVAR(setVehicleHitPointDamage), [_vehicle, _subHitIndex, _subPointNewDamage], _vehicle] call CBA_fnc_targetEvent; }; }; } forEach _subHitArray; diff --git a/addons/repair/functions/fnc_doRepairTrack.sqf b/addons/repair/functions/fnc_doRepairTrack.sqf index 46c94c29f9..34f29506a3 100644 --- a/addons/repair/functions/fnc_doRepairTrack.sqf +++ b/addons/repair/functions/fnc_doRepairTrack.sqf @@ -41,7 +41,7 @@ _hitPointDamage = (_hitPointDamage - _damageRepaired) min 0; deleteVehicle _track; // raise event to set the new hitpoint damage -["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent); +[QGVAR(setWheelHitPointDamage), [_vehicle, _hitPoint, _hitPointDamage], _vehicle] call CBA_fnc_targetEvent; // display text message if enabled if (GVAR(DisplayTextOnRepair)) then { diff --git a/addons/repair/functions/fnc_doReplaceTrack.sqf b/addons/repair/functions/fnc_doReplaceTrack.sqf index 9eafe68c9e..b0b71e5b61 100644 --- a/addons/repair/functions/fnc_doReplaceTrack.sqf +++ b/addons/repair/functions/fnc_doReplaceTrack.sqf @@ -44,7 +44,7 @@ if (_newHitPointDamage >= 1) exitWith {}; deleteVehicle _track; // raise event to set the new hitpoint damage -["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, _newHitPointDamage]] call EFUNC(common,targetEvent); +[QGVAR(setWheelHitPointDamage), [_vehicle, _hitPoint, _newHitPointDamage], _vehicle] call CBA_fnc_targetEvent; // display text message if enabled if (GVAR(DisplayTextOnRepair)) then { diff --git a/addons/repair/functions/fnc_doReplaceWheel.sqf b/addons/repair/functions/fnc_doReplaceWheel.sqf index ce5e9220dd..24b995a45f 100644 --- a/addons/repair/functions/fnc_doReplaceWheel.sqf +++ b/addons/repair/functions/fnc_doReplaceWheel.sqf @@ -44,7 +44,7 @@ if (_newHitPointDamage >= 1) exitWith {}; deleteVehicle _wheel; // raise event to set the new hitpoint damage -["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, _newHitPointDamage]] call EFUNC(common,targetEvent); +[QGVAR(setWheelHitPointDamage), [_vehicle, _hitPoint, _newHitPointDamage], _vehicle] call CBA_fnc_targetEvent; // display text message if enabled if (GVAR(DisplayTextOnRepair)) then { diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index f5b7d8cbfc..5577057241 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -38,10 +38,10 @@ _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitWith {false}; if ((isEngineOn _target) && {GVAR(autoShutOffEngineWhenStartingRepair)}) then { - ["engineOn", _target, [_target, false]] call EFUNC(common,objectEvent); + [QEGVAR(common,engineOn), [_target, false], _target] call CBA_fnc_targetEvent; }; if ((isEngineOn _target) && {!GVAR(autoShutOffEngineWhenStartingRepair)}) exitWith { - ["displayTextStructured", [LSTRING(shutOffEngineWarning), 1.5, _caller]] call EFUNC(common,localEvent); + [LSTRING(shutOffEngineWarning), 1.5, _caller] call EFUNC(common,displayTextStructured); false }; @@ -235,7 +235,7 @@ if (_target != _caller) then { }; if (_displayText != "") then { - ["displayTextStructured", [_caller], [[_displayText, [_caller] call EFUNC(common,getName), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); + [QEGVAR(common,displayTextStructured), [[_displayText, [_caller] call EFUNC(common,getName), [_target] call EFUNC(common,getName)], 1.5, _caller], [_caller]] call CBA_fnc_targetEvent; }; true; diff --git a/addons/repair/functions/fnc_setHitPointDamage.sqf b/addons/repair/functions/fnc_setHitPointDamage.sqf index ba04cdb7eb..0f809b345c 100644 --- a/addons/repair/functions/fnc_setHitPointDamage.sqf +++ b/addons/repair/functions/fnc_setHitPointDamage.sqf @@ -1,7 +1,7 @@ /* * Author: commy2 * Set the hitpoint damage and change the structural damage acordingly, requires local vehicle. - * Handles the "setVehicleHitPointDamage" event + * Handles the "ace_repair_setVehicleHitPointDamage" event * * Arguments: * 0: Local Vehicle to Damage diff --git a/addons/repair/functions/fnc_spawnObject.sqf b/addons/repair/functions/fnc_spawnObject.sqf index 86d0b563ac..e927a19651 100644 --- a/addons/repair/functions/fnc_spawnObject.sqf +++ b/addons/repair/functions/fnc_spawnObject.sqf @@ -28,7 +28,7 @@ _newObject setPosASL _position; _newObject setDamage _damage; -["fixCollision", _newObject] call EFUNC(common,localEvent); -["fixPosition", _newObject] call EFUNC(common,localEvent); +[QEGVAR(common,fixCollision), _newObject] call CBA_fnc_localEvent; +[QEGVAR(common,fixPosition), _newObject] call CBA_fnc_localEvent; _newObject diff --git a/addons/repair/functions/fnc_useItem.sqf b/addons/repair/functions/fnc_useItem.sqf index 24554ba4eb..b4fe9484d5 100644 --- a/addons/repair/functions/fnc_useItem.sqf +++ b/addons/repair/functions/fnc_useItem.sqf @@ -20,8 +20,8 @@ params ["_unit", "_item"]; TRACE_2("params",_unit,_item); if ([_unit, _item] call EFUNC(common,hasItem)) exitWith { - [[_unit, _item], QEFUNC(common,useItem), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ - [true, _unit]; + ["ace_useItem", [_unit, _item], _unit] call CBA_fnc_targetEvent; + [true, _unit]; }; [false, objNull]; diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index 0bce5cd685..48a647290f 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -765,6 +765,7 @@ Reaktivpanzerung ERA ERA + ERA Repair Settings @@ -1321,6 +1322,7 @@ Motor muss ausgeschaltet zu reparieren sein El motor necesita desactivado para la reparación Pro opravu je zapotřebí vypnout motor + O motor deve estar desligado para manutenção \ No newline at end of file diff --git a/addons/respawn/XEH_postInit.sqf b/addons/respawn/XEH_postInit.sqf index 22be7b86ac..f589d5abac 100644 --- a/addons/respawn/XEH_postInit.sqf +++ b/addons/respawn/XEH_postInit.sqf @@ -1,5 +1,7 @@ // by commy2 #include "script_component.hpp" -["rallypointMoved", {_this call FUNC(updateRallypoint)}] call EFUNC(common,addEventhandler); -["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); // hide enemy rallypoint markers +["ace_rallypointMoved", {_this call FUNC(updateRallypoint)}] call CBA_fnc_addEventHandler; +["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; // hide enemy rallypoint markers + +[QGVAR(showFriendlyFireMessageEvent), DFUNC(showFriendlyFireMessage)] call CBA_fnc_addEventHandler; diff --git a/addons/respawn/XEH_serverPostInit.sqf b/addons/respawn/XEH_serverPostInit.sqf index 8ff14e209a..727b04d68d 100644 --- a/addons/respawn/XEH_serverPostInit.sqf +++ b/addons/respawn/XEH_serverPostInit.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -["SettingsInitialized", { +["ace_settingsInitialized", { if (GVAR(RemoveDeadBodiesDisconnected)) then { addMissionEventHandler ["HandleDisconnect", { [{ @@ -14,4 +14,4 @@ false }]; }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/respawn/config.cpp b/addons/respawn/config.cpp index 5305232543..3a887b48b2 100644 --- a/addons/respawn/config.cpp +++ b/addons/respawn/config.cpp @@ -18,3 +18,8 @@ class CfgPatches { #include "CfgVehicleClasses.hpp" #include "CfgVehicles.hpp" #include "ACE_Settings.hpp" + +class ACE_newEvents { + rallypointMoved = "ace_rallypointMoved"; + killedByFriendly = "ace_killedByFriendly"; +}; diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index 2b9509f39d..6ca816e8a4 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -25,5 +25,5 @@ if (ACE_player == _unit && {GVAR(SavePreDeathGear)}) then { }; if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then { - [_this, QUOTE(DFUNC(showFriendlyFireMessage)), 2] call EFUNC(common,execRemoteFnc); + [QGVAR(showFriendlyFireMessageEvent), _this] call CBA_fnc_globalEvent; }; diff --git a/addons/respawn/functions/fnc_initRallypoint.sqf b/addons/respawn/functions/fnc_initRallypoint.sqf index ce4e9c9d79..b012344379 100644 --- a/addons/respawn/functions/fnc_initRallypoint.sqf +++ b/addons/respawn/functions/fnc_initRallypoint.sqf @@ -31,7 +31,7 @@ if (isNil _name) then { createMarker [_respawnMarker, _rallypoint]; }; - ["rallypointMoved", [_rallypoint, _side]] call EFUNC(common,globalEvent); + ["ace_rallypointMoved", [_rallypoint, _side]] call CBA_fnc_globalEvent; }; } else { deleteVehicle _rallypoint; diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index f004a1e844..353d90e56a 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -48,7 +48,7 @@ _position set [2, 0]; _rallypoint setVariable [QGVAR(markerDate), [dayTime, "HH:MM"] call BIS_fnc_timeToString, true]; - ["rallypointMoved", [_rallypoint, _side, _position]] call EFUNC(common,globalEvent); + ["ace_rallypointMoved", [_rallypoint, _side, _position]] call CBA_fnc_globalEvent; [localize LSTRING(Deployed)] call EFUNC(common,displayTextStructured); }, [_rallypoint, _unit, _position], 5] call CBA_fnc_waitAndExecute; diff --git a/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf b/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf index 1079ef6e6d..388302150d 100644 --- a/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf +++ b/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf @@ -22,5 +22,5 @@ if (_unit != _killer && {side group _unit in [side group ACE_player, civilian]} systemChat format ["%1 was killed by %2", [_unit, false, true] call EFUNC(common,getName), [_killer, false, true] call EFUNC(common,getName)]; // Raise ACE globalEvent - ["killedByFriendly", [_unit, _killer]] call EFUNC(common,globalEvent); + ["ace_killedByFriendly", [_unit, _killer]] call CBA_fnc_globalEvent; }; diff --git a/addons/sandbag/XEH_postInit.sqf b/addons/sandbag/XEH_postInit.sqf index d6e4c0aadc..0bc5b6d2b1 100644 --- a/addons/sandbag/XEH_postInit.sqf +++ b/addons/sandbag/XEH_postInit.sqf @@ -12,14 +12,14 @@ GVAR(deployPFH) = -1; GVAR(deployDirection) = 0; // Cancel deploy sandbag if interact menu opened -["interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call EFUNC(common,addEventHandler); +["ace_interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call CBA_fnc_addEventHandler; // Cancel deploy on player change. This does work when returning to lobby, but not when hard disconnecting. -["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); -["playerInventoryChanged", {_this call FUNC(handlePlayerInventoryChanged)}] call EFUNC(common,addEventhandler); -["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; +["ace_playerInventoryChanged", {_this call FUNC(handlePlayerInventoryChanged)}] call CBA_fnc_addEventHandler; +["ace_playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; // handle waking up dragged unit and falling unconscious while dragging -["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); +["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; //@todo Captivity? diff --git a/addons/sandbag/config.cpp b/addons/sandbag/config.cpp index 18f09c3970..cb8884ac7e 100644 --- a/addons/sandbag/config.cpp +++ b/addons/sandbag/config.cpp @@ -15,4 +15,8 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" \ No newline at end of file +#include "CfgWeapons.hpp" + +class ACE_newEvents { + interactMenuOpened = "ace_interactMenuOpened"; +}; diff --git a/addons/sandbag/functions/fnc_deploy.sqf b/addons/sandbag/functions/fnc_deploy.sqf index 735a736bbb..0cbe0c5012 100644 --- a/addons/sandbag/functions/fnc_deploy.sqf +++ b/addons/sandbag/functions/fnc_deploy.sqf @@ -27,7 +27,7 @@ _sandBag = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; GVAR(sandBag) = _sandBag; // prevent collisions with sandbag -["enableSimulationGlobal", [_sandBag, false]] call EFUNC(common,serverEvent); +[QEGVAR(common,enableSimulationGlobal), [_sandBag, false]] call CBA_fnc_serverEvent; GVAR(deployDirection) = 0; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 1763bb7a32..4ebfe39bf3 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -10,10 +10,10 @@ if (!hasInterface) exitWith {}; // Check inventory when it changes -["playerInventoryChanged", FUNC(inventoryCheck)] call EFUNC(common,addEventhandler); +["ace_playerInventoryChanged", FUNC(inventoryCheck)] call CBA_fnc_addEventHandler; // Instantly hide knobs when scoping in -["cameraViewChanged", { +["ace_cameraViewChanged", { EXPLODE_2_PVT(_this,_player,_newCameraView); if (_newCameraView == "GUNNER") then { private "_layer"; @@ -26,7 +26,7 @@ if (!hasInterface) exitWith {}; GVAR(fadePFH) = nil; }; }; -}] call EFUNC(common,addEventhandler); +}] call CBA_fnc_addEventHandler; // Add keybinds @@ -152,5 +152,5 @@ if (!hasInterface) exitWith {}; // Register fire event handler -["firedPlayer", DFUNC(firedEH)] call EFUNC(common,addEventHandler); -["firedPlayerNonLocal", DFUNC(firedEH)] call EFUNC(common,addEventHandler); +["ace_firedPlayer", DFUNC(firedEH)] call CBA_fnc_addEventHandler; +["ace_firedPlayerNonLocal", DFUNC(firedEH)] call CBA_fnc_addEventHandler; diff --git a/addons/scopes/config.cpp b/addons/scopes/config.cpp index fb1f0274ca..c9ff1feb20 100644 --- a/addons/scopes/config.cpp +++ b/addons/scopes/config.cpp @@ -14,11 +14,7 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" - #include "CfgSounds.hpp" - #include "CfgVehicles.hpp" - #include "CfgWeapons.hpp" - #include "RscTitles.hpp" diff --git a/addons/sitting/XEH_clientInit.sqf b/addons/sitting/XEH_clientInit.sqf index 7efb38d41e..3b6b0ba6c8 100644 --- a/addons/sitting/XEH_clientInit.sqf +++ b/addons/sitting/XEH_clientInit.sqf @@ -3,7 +3,7 @@ // Exit on Headless if (!hasInterface) exitWith {}; -["SettingsInitialized", { +["ace_settingsInitialized", { if ([[QUOTE(ADDON), QGVAR(enable)], ["acex_sitting", "acex_sitting_enable"], "3.8.0"] call EFUNC(common,deprecateComponent)) exitwith {}; //If not enabled, then do not add CanInteractWith Condition or event handlers: if (!GVAR(enable)) exitWith {}; @@ -12,6 +12,6 @@ if (!hasInterface) exitWith {}; ["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(isSitting)}}] call EFUNC(common,addCanInteractWithCondition); // Handle interruptions - ["medical_onUnconscious", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler); - ["SetHandcuffed", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler); -}] call EFUNC(common,addEventHandler); + ["ace_unconscious", {_this call DFUNC(handleInterrupt)}] call CBA_fnc_addEventHandler; + [QEGVAR(captives,setHandcuffed), {_this call DFUNC(handleInterrupt)}] call CBA_fnc_addEventHandler; +}] call CBA_fnc_addEventHandler; diff --git a/addons/sitting/config.cpp b/addons/sitting/config.cpp index bf38435f22..e6a730c492 100644 --- a/addons/sitting/config.cpp +++ b/addons/sitting/config.cpp @@ -17,3 +17,7 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgMoves.hpp" #include "CfgVehicles.hpp" + +class ACE_newEvents { + SetHandcuffed = QEGVAR(captives,setHandcuffed); +}; diff --git a/addons/spectator/XEH_postInit.sqf b/addons/spectator/XEH_postInit.sqf index 43c812d1a2..72c53a2af0 100644 --- a/addons/spectator/XEH_postInit.sqf +++ b/addons/spectator/XEH_postInit.sqf @@ -4,10 +4,10 @@ // Add interaction menu exception ["isNotSpectating", {!(GETVAR((_this select 0),GVAR(isStaged),false))}] call EFUNC(common,addCanInteractWithCondition); -["SettingsInitialized", { +["ace_settingsInitialized", { GVAR(availableModes) = [[0,1,2], [1,2], [0], [1], [2]] select GVAR(restrictModes); GVAR(availableVisions) = [[-2,-1,0,1], [-2,-1], [-2,0,1], [-2]] select GVAR(restrictVisions); -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; // Create a radio channel for any spectators to text chat in if (isServer) then { @@ -18,7 +18,7 @@ if (isServer) then { // Should prevent unending spectator on mission end if (isServer) then { addMissionEventHandler ["Ended", { - [QGVAR(endMission), []] call EFUNC(common,globalEvent); + [QGVAR(endMission), []] call CBA_fnc_globalEvent; }]; }; @@ -26,4 +26,6 @@ if (isServer) then { if (GVAR(isSet)) then { [false] call FUNC(setSpectator); }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; + +[QGVAR(stageSpectator), FUNC(stageSpectator)] call CBA_fnc_addEventHandler; diff --git a/addons/spectator/config.cpp b/addons/spectator/config.cpp index 5907e7c3e1..7e9937a70b 100644 --- a/addons/spectator/config.cpp +++ b/addons/spectator/config.cpp @@ -24,3 +24,8 @@ class CfgRespawnTemplates { onPlayerRespawn = QFUNC(respawnTemplate); }; }; + +class ACE_newEvents { + spectatorStaged = "ace_spectatorStaged"; + spectatorSet = "ace_spectatorSet"; +}; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_respawnTemplate.sqf b/addons/spectator/functions/fnc_respawnTemplate.sqf index 4584a1fc3c..dc83bf7458 100644 --- a/addons/spectator/functions/fnc_respawnTemplate.sqf +++ b/addons/spectator/functions/fnc_respawnTemplate.sqf @@ -21,11 +21,6 @@ params [["_unit",objNull,[objNull]], ["_killer",objNull,[objNull]], ["_respawn",0,[0]], ["_respawnDelay",0,[0]]]; private ["_vision","_pos"]; -// When all are dead with respawn type "None" the mission should end -if ((_respawn == 0) && {{alive _x} count allPlayers <= 0}) exitWith { - [["endDeath",false],"BIS_fnc_endMission"] call EFUNC(common,execRemoteFnc); -}; - // Some environment information can be used for the initial camera attributes if (isNull _killer) then {_killer = _unit}; _vision = [-2,-1] select (sunOrMoon < 1); diff --git a/addons/spectator/functions/fnc_setSpectator.sqf b/addons/spectator/functions/fnc_setSpectator.sqf index 83ed864219..45bb15df42 100644 --- a/addons/spectator/functions/fnc_setSpectator.sqf +++ b/addons/spectator/functions/fnc_setSpectator.sqf @@ -170,4 +170,4 @@ GVAR(interrupts) = []; // Mark spectator state for reference GVAR(isSet) = _set; -["spectatorSet",[_set]] call EFUNC(common,localEvent); +["ace_spectatorSet", [_set]] call CBA_fnc_localEvent; diff --git a/addons/spectator/functions/fnc_stageSpectator.sqf b/addons/spectator/functions/fnc_stageSpectator.sqf index 4c6b22160d..8e6c32f568 100644 --- a/addons/spectator/functions/fnc_stageSpectator.sqf +++ b/addons/spectator/functions/fnc_stageSpectator.sqf @@ -27,7 +27,7 @@ params [["_unit",player,[objNull]], ["_set",true,[true]]]; if !(_set || (GETVAR(_unit,GVAR(isStaged),false))) exitWith {}; if !(local _unit) exitWith { - [[_unit, _set], QFUNC(stageSpectator), _unit] call EFUNC(common,execRemoteFnc); + [QGVAR(stageSpectator), [_unit, _set], _unit] call CBA_fnc_targetEvent; }; // Prevent unit falling into water @@ -64,7 +64,7 @@ if !(_set isEqualTo (GETVAR(_unit,GVAR(isStaged),false))) then { // Mark spectator state for reference _unit setVariable [QGVAR(isStaged), _set, true]; - ["spectatorStaged",[_set]] call EFUNC(common,localEvent); + ["ace_spectatorStaged", [_set]] call CBA_fnc_localEvent; }; //BandAid for #2677 - if player in unitList weird before being staged, weird things can happen diff --git a/addons/spottingscope/CfgEventHandlers.hpp b/addons/spottingscope/CfgEventHandlers.hpp index 13d369b097..b34b3ac099 100644 --- a/addons/spottingscope/CfgEventHandlers.hpp +++ b/addons/spottingscope/CfgEventHandlers.hpp @@ -7,13 +7,13 @@ class Extended_PreStart_EventHandlers { class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; diff --git a/addons/spottingscope/CfgVehicles.hpp b/addons/spottingscope/CfgVehicles.hpp index ef5f1e1c3e..6ea8562936 100644 --- a/addons/spottingscope/CfgVehicles.hpp +++ b/addons/spottingscope/CfgVehicles.hpp @@ -1,5 +1,5 @@ -class CBA_Extended_EventHandlers; +class CBA_Extended_EventHandlers_base; class CfgVehicles { class Man; @@ -18,6 +18,140 @@ class CfgVehicles { }; }; + class LandVehicle; + class StaticWeapon: LandVehicle { + class Turrets; + class ACE_Actions { + class ACE_MainActions; + }; + }; + + class StaticATWeapon: StaticWeapon { + class Turrets: Turrets { + class MainTurret; + }; + + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions {}; + }; + }; + + class ACE_SpottingScopeObject: StaticATWeapon { + EGVAR(dragging,canDrag) = 1; + EGVAR(dragging,dragPosition)[] = {0,1,0}; + EGVAR(dragging,dragDirection) = 0; + + class ACE_Actions: ACE_Actions{ + class ACE_MainActions: ACE_MainActions { + selection = "main_gun"; + class ACE_Pickup { + selection = ""; + displayName = CSTRING(PickUp); + distance = 5; + condition = QUOTE((alive _target) && (count (crew _target) == 0)); + statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + icon = QPATHTOF(UI\w_spottingscope_ca.paa); + }; + }; + }; + + class EventHandlers { + class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers_base {}; + }; + + author = ECSTRING(common,ACETeam); + scope = 1; + side = 1; + typicalCargo[] = {"Soldier"}; + displayName = CSTRING(DisplayName); + model = QPATHTOF(data\ace_spottingscope.p3d); + mapSize = 0.5; + transportSoldier = 0; + getInAction = "GetInLow"; + getOutAction = "GetOutLow"; + editorSubcategory = "EdSubcat_Turrets"; + + class Turrets: Turrets { + class MainTurret: MainTurret { + minTurn = -45; + maxTurn = 45; + initTurn = 0; + minElev = -10; + maxElev = 40; + initElev = 0; + + class ViewGunner { + initAngleX = 5; + minAngleX = -30; + maxAngleX = 30; + initAngleY = 0; + minAngleY = -100; + maxAngleY = 100; + initFov = 0.75; + minFov = 0.25; + maxFov = 1.25; + }; + + class ViewOptics { + initAngleX = 0; + minAngleX = -30; + maxAngleX = 30; + initAngleY = 0; + minAngleY = -100; + maxAngleY = 100; + minFov = 0.0025; + maxFov = 0.05; + initFov= 0.05; + }; + + weapons[] = {}; + magazines[] = {}; + gunnerOpticsColor[] = {1,1,1,1}; + gunnerOpticsModel = "\A3\Weapons_F\empty"; //QPATHTOF(data\m144_optic.p3d); + gunnerOpticsEffect[] = {"OpticsCHAbera1","OpticsBlur2"}; + gunnerOutOpticsShowCursor = 0; + gunnerOpticsShowCursor = 0; + gunnerAction = "ACE_SpottingScope"; + gunnerGetInAction = "GetInLow"; + gunnerGetOutAction = "GetOutLow"; + gunnerForceOptics = 0; + ejectDeadGunner = 0; + turretInfoType = QGVAR(RscUnitInfo); + opticsDisablePeripherialVision = 1; + }; + }; + }; + + class ACE_B_SpottingScope: ACE_SpottingScopeObject { + author = ECSTRING(common,ACETeam); + _generalMacro = "ACE_B_SpottingScope"; + scope = 2; + side = 1; + faction = "BLU_F"; + crew = "B_spotter_F"; + }; + + class ACE_O_SpottingScope: ACE_SpottingScopeObject { + author = ECSTRING(common,ACETeam); + _generalMacro = "ACE_O_SpottingScope"; + scope = 2; + side = 0; + faction = "OPF_F"; + crew = "O_spotter_F"; + }; + + class ACE_I_SpottingScope: ACE_SpottingScopeObject { + author = ECSTRING(common,ACETeam); + _generalMacro = "ACE_I_SpottingScope"; + scope = 2; + side = 2; + faction = "IND_F"; + crew = "I_spotter_F"; + }; + class Item_Base_F; class ACE_Item_SpottingScope: Item_Base_F { author[] = {"Rocko", "Scubaman3D"}; @@ -33,102 +167,7 @@ class CfgVehicles { class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { - MACRO_ADDITEM(ACE_Item_SpottingScope,2); - }; - }; - - class LandVehicle; - class StaticWeapon: LandVehicle { - class Turrets; - class ACE_Actions { - class ACE_MainActions {}; - }; - }; - class StaticATWeapon: StaticWeapon { - class Turrets: Turrets { - class MainTurret; - }; - class ACE_Actions: ACE_Actions{ - class ACE_MainActions: ACE_MainActions {}; - }; - }; - class ACE_SpottingScopeObject: StaticATWeapon { - class EventHandlers { - class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {}; - }; - - scope = 1; - side = 1; - typicalCargo[] = {"Soldier"}; - displayName = CSTRING(DisplayName); - model = QPATHTOF(data\ace_spottingscope.p3d); - mapSize = 0.5; - transportSoldier = 0; - getInAction = "GetInLow"; - getOutAction = "GetOutLow"; - class Turrets: Turrets { - class MainTurret: MainTurret { - minTurn = -45; - maxTurn = 45; - initTurn = 0; - minElev = -10; - maxElev = 40; - initElev = 0; - - weapons[] = {}; - magazines[] = {}; - gunnerOpticsColor[] = {1,1,1,1}; - gunnerOpticsmodel = QPATHTOF(data\m144_optic.p3d); - gunnerOpticsEffect[] = {"OpticsCHAbera1","OpticsBlur2"}; - gunnerOutOpticsShowCursor = 0; - gunnerOpticsShowCursor = 0; - gunnerAction = "ACE_SpottingScope"; - gunnerGetInAction = "GetInLow"; - gunnerGetOutAction = "GetOutLow"; - gunnerForceOptics = 0; - ejectDeadGunner = 0; - class ViewGunner { - initAngleX = 5; - minAngleX = -30; - maxAngleX = 30; - initAngleY = 0; - minAngleY = -100; - maxAngleY = 100; - initFov = 0.75; - minFov = 0.25; - maxFov = 1.25; - }; - class ViewOptics { - initAngleX = 0; - minAngleX = -30; - maxAngleX = 30; - initAngleY = 0; - minAngleY = -100; - maxAngleY = 100; - minFov = 0.0025; - maxFov = 0.05; - initFov= 0.05; - }; - }; - }; - EGVAR(dragging,canDrag) = 1; - EGVAR(dragging,dragPosition)[] = {0,1,0}; - EGVAR(dragging,dragDirection) = 0; - class ACE_Actions: ACE_Actions{ - class ACE_MainActions: ACE_MainActions { - selection = "osaveze"; - class ACE_Pickup { - selection = ""; - displayName = CSTRING(PickUp); - distance = 5; - condition = QUOTE((alive _target) && (count (crew _target) == 0)); - statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup)); - showDisabled = 0; - exceptions[] = {}; - priority = 5; - icon = QPATHTOF(UI\w_spottingscope_ca.paa); - }; - }; + MACRO_ADDITEM(ACE_SpottingScope,2); }; }; }; diff --git a/addons/spottingscope/RscInGameUI.hpp b/addons/spottingscope/RscInGameUI.hpp new file mode 100644 index 0000000000..bf4f086dd7 --- /dev/null +++ b/addons/spottingscope/RscInGameUI.hpp @@ -0,0 +1,56 @@ + +class RscOpticsValue; +class RscMapControl; +class RscText; +class RscPicture; + +class RscInGameUI { + class RscUnitInfo; + class GVAR(RscUnitInfo): RscUnitInfo { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); {((_this select 0) displayCtrl _x) ctrlShow false} forEach [ARR_4(IDC_RETICLE,IDC_BODY,IDC_BLACK_LEFT,IDC_BLACK_RIGHT)]); + controls[] = {"CA_FOVMode","ScriptedReticleHelper","trippleHeadLeft","trippleHeadRight","Reticle","Body"}; // don't change this order + + class CA_FOVMode: RscOpticsValue { // idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used + idc = 154; + w = 0; + h = 0; + }; + + class ScriptedReticleHelper: RscMapControl { + onDraw = QUOTE(ctrlParent (_this select 0) call FUNC(animateReticle)); + idc = -1; + w = 0; + h = 0; + }; + + class Reticle: RscPicture { + idc = IDC_RETICLE; + text = QPATHTOF(rsc\spotting_scope_reticle_co.paa); + x = POS_X; + y = POS_Y; + w = POS_W; + h = POS_H; + }; + + class Body: Reticle { + idc = IDC_BODY; + text = QPATHTOF(rsc\spotting_scope_body_co.paa); + }; + + //These are just black side panels to cover the areas that the optics p3d doesn't cover + //It will ONLY effect tripple head users as (safezoneX == safeZoneXAbs) for everyone else + class trippleHeadLeft: RscText { + idc = IDC_BLACK_LEFT; + x = "safeZoneXAbs"; + Y = "safezoneY"; + w = QUOTE(POS_X_BASE(SIZEX) - safeZoneXAbs); + h = "safeZoneH"; + colorBackground[] = {0,0,0,1}; + }; + + class trippleHeadRight: trippleHeadLeft { + idc = IDC_BLACK_RIGHT; + x = QUOTE(safeZoneXAbs + safeZoneWAbs - (POS_X_BASE(SIZEX) - safeZoneXABS)); + }; + }; +}; diff --git a/addons/spottingscope/XEH_PREP.hpp b/addons/spottingscope/XEH_PREP.hpp index ebb99df96b..9839872360 100644 --- a/addons/spottingscope/XEH_PREP.hpp +++ b/addons/spottingscope/XEH_PREP.hpp @@ -1,3 +1,4 @@ PREP(pickup); PREP(place); +PREP(animateReticle); diff --git a/addons/spottingscope/config.cpp b/addons/spottingscope/config.cpp index a92f91ec50..3849382690 100644 --- a/addons/spottingscope/config.cpp +++ b/addons/spottingscope/config.cpp @@ -2,7 +2,8 @@ class CfgPatches { class ADDON { - units[] = {"ACE_Item_SpottingScope"}; + name = CSTRING(component); + units[] = {"ACE_B_SpottingScope", "ACE_O_SpottingScope", "ACE_I_SpottingScope", "ACE_Item_SpottingScope"}; weapons[] = {"ACE_SpottingScope"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_apl", "ace_interaction"}; @@ -17,3 +18,5 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" #include "CfgMoves.hpp" + +#include "RscInGameUI.hpp" diff --git a/addons/spottingscope/data/PSO_ring.paa b/addons/spottingscope/data/PSO_ring.paa deleted file mode 100644 index e1502aa5e2..0000000000 Binary files a/addons/spottingscope/data/PSO_ring.paa and /dev/null differ diff --git a/addons/spottingscope/data/ace_spottingscope.p3d b/addons/spottingscope/data/ace_spottingscope.p3d index fc6bc45354..0afe9952cf 100644 Binary files a/addons/spottingscope/data/ace_spottingscope.p3d and b/addons/spottingscope/data/ace_spottingscope.p3d differ diff --git a/addons/spottingscope/data/scopering.paa b/addons/spottingscope/data/scopering.paa deleted file mode 100644 index ecf236b025..0000000000 Binary files a/addons/spottingscope/data/scopering.paa and /dev/null differ diff --git a/addons/spottingscope/data/sniper_peri.rvmat b/addons/spottingscope/data/sniper_peri.rvmat deleted file mode 100644 index 35069be267..0000000000 --- a/addons/spottingscope/data/sniper_peri.rvmat +++ /dev/null @@ -1,78 +0,0 @@ -ambient[] = {1.0, 1.0, 1.0, 1.0}; -diffuse[] = {1.0, 1.0, 1.0, 1.0}; -forcedDiffuse[] = {0.0, 0.0, 0.0, 0.0}; -emmisive[] = {0.0, 0.0, 0.0, 1.0}; -specular[] = {0.0, 0.0, 0.0, 0.0}; -specularPower = 0.0; -PixelShaderID = "Super"; -VertexShaderID = "Super"; -class Stage1 { - texture = "z\ace\addons\spottingscope\data\sniper_peri_nohq.paa"; - uvSource="tex"; - class uvTransform { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; -}; -class Stage2 { - texture = "z\ace\addons\apl\data\metal4_weapons_vehicles_int_512_dt.paa"; - uvSource = "tex"; - class uvTransform { - aside[] = {6.0, 0.0, 0.0}; - up[] = {0.0, 6.0, 0.0}; - dir[] = {0.0, 0.0, 0.0}; - pos[] = {0.0, 0.0, 0.0}; - }; -}; -class Stage3 { - texture = "#(argb,8,8,3)color(0,0,0,0)"; - uvSource = "tex"; - class uvTransform { - aside[] = {1,0,0}; - up[] = {0,1,0}; - dir[] = {0,0,0}; - pos[] = {0,0,0}; - }; -}; -class Stage4 { - texture = "#(argb,8,8,3)color(0,1,1,1)"; - uvSource = "tex"; - class uvTransform { - aside[] = {1.0, 0.0, 0.0}; - up[] = {0.0, 1.0, 0.0}; - dir[] = {0.0, 0.0, 0.0}; - pos[] = {0.0, 0.0, 0.0}; - }; -}; -class Stage5 { - texture = "z\ace\addons\spottingscope\data\sniper_peri_smdi.paa"; - uvSource="tex"; - class uvTransform { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; -}; -class Stage6 { - texture = "#(ai,32,128,1)fresnel(1.58,0.01)"; - uvSource = "tex"; - class uvTransform { - aside[] = {1.0, 0.0, 0.0}; - up[] = {0.0, 1.0, 0.0}; - dir[] = {0.0, 0.0, 0.0}; - pos[] = {0.0, 0.0, 0.0}; - }; -}; -class Stage7 { - texture = "a3\data_f\env_land_co.paa"; - uvSource = "tex"; - class uvTransform { - aside[] = {1.0, 0.0, 0.0}; - up[] = {0.0, 1.0, 0.0}; - dir[] = {0.0, 0.0, 0.0}; - pos[] = {0.0, 0.0, 0.0}; - }; -}; diff --git a/addons/spottingscope/data/sniper_peri_co.paa b/addons/spottingscope/data/sniper_peri_co.paa deleted file mode 100644 index 6466dc6d82..0000000000 Binary files a/addons/spottingscope/data/sniper_peri_co.paa and /dev/null differ diff --git a/addons/spottingscope/data/sniper_peri_nohq.paa b/addons/spottingscope/data/sniper_peri_nohq.paa deleted file mode 100644 index cc84eab64d..0000000000 Binary files a/addons/spottingscope/data/sniper_peri_nohq.paa and /dev/null differ diff --git a/addons/spottingscope/data/sniper_peri_smdi.paa b/addons/spottingscope/data/sniper_peri_smdi.paa deleted file mode 100644 index 4cb94ce7d1..0000000000 Binary files a/addons/spottingscope/data/sniper_peri_smdi.paa and /dev/null differ diff --git a/addons/spottingscope/data/spot_scope.rvmat b/addons/spottingscope/data/spot_scope.rvmat deleted file mode 100644 index 294d3a75b2..0000000000 --- a/addons/spottingscope/data/spot_scope.rvmat +++ /dev/null @@ -1,78 +0,0 @@ -ambient[] = {1.0, 1.0, 1.0, 1.0}; -diffuse[] = {1.0, 1.0, 1.0, 1.0}; -forcedDiffuse[] = {0.0, 0.0, 0.0, 0.0}; -emmisive[] = {0.0, 0.0, 0.0, 1.0}; -specular[] = {0.0, 0.0, 0.0, 0.0}; -specularPower = 0.0; -PixelShaderID = "Super"; -VertexShaderID = "Super"; -class Stage1 { - texture = "z\ace\addons\spottingscope\data\spot_scope_nohq.paa"; - uvSource="tex"; - class uvTransform { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; -}; -class Stage2 { - texture = "z\ace\addons\apl\data\plastic_512_dt.paa"; - uvSource = "tex"; - class uvTransform { - aside[] = {6.0, 0.0, 0.0}; - up[] = {0.0, 6.0, 0.0}; - dir[] = {0.0, 0.0, 0.0}; - pos[] = {0.0, 0.0, 0.0}; - }; -}; -class Stage3 { - texture = "#(argb,8,8,3)color(0,0,0,0)"; - uvSource = "tex"; - class uvTransform { - aside[] = {1,0,0}; - up[] = {0,1,0}; - dir[] = {0,0,0}; - pos[] = {0,0,0}; - }; -}; -class Stage4 { - texture = "#(argb,8,8,3)color(0,1,1,1)"; - uvSource = "tex"; - class uvTransform { - aside[] = {1.0, 0.0, 0.0}; - up[] = {0.0, 1.0, 0.0}; - dir[] = {0.0, 0.0, 0.0}; - pos[] = {0.0, 0.0, 0.0}; - }; -}; -class Stage5 { - texture = "z\ace\addons\spottingscope\data\spot_scope_smdi.paa"; - uvSource="tex"; - class uvTransform { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; -}; -class Stage6 { - texture = "#(ai,32,128,1)fresnel(1.58,0.01)"; - uvSource = "tex"; - class uvTransform { - aside[] = {1.0, 0.0, 0.0}; - up[] = {0.0, 1.0, 0.0}; - dir[] = {0.0, 0.0, 0.0}; - pos[] = {0.0, 0.0, 0.0}; - }; -}; -class Stage7 { - texture = "a3\data_f\env_land_co.paa"; - uvSource = "tex"; - class uvTransform { - aside[] = {1.0, 0.0, 0.0}; - up[] = {0.0, 1.0, 0.0}; - dir[] = {0.0, 0.0, 0.0}; - pos[] = {0.0, 0.0, 0.0}; - }; -}; diff --git a/addons/spottingscope/data/spot_scope_co.paa b/addons/spottingscope/data/spot_scope_co.paa deleted file mode 100644 index c0168053a3..0000000000 Binary files a/addons/spottingscope/data/spot_scope_co.paa and /dev/null differ diff --git a/addons/spottingscope/data/spot_scope_nohq.paa b/addons/spottingscope/data/spot_scope_nohq.paa deleted file mode 100644 index 674ad1d0ec..0000000000 Binary files a/addons/spottingscope/data/spot_scope_nohq.paa and /dev/null differ diff --git a/addons/spottingscope/data/spot_scope_smdi.paa b/addons/spottingscope/data/spot_scope_smdi.paa deleted file mode 100644 index b6e2d763fe..0000000000 Binary files a/addons/spottingscope/data/spot_scope_smdi.paa and /dev/null differ diff --git a/addons/spottingscope/data/spot_scope_tripod.rvmat b/addons/spottingscope/data/spot_scope_tripod.rvmat deleted file mode 100644 index 0403471e5a..0000000000 --- a/addons/spottingscope/data/spot_scope_tripod.rvmat +++ /dev/null @@ -1,79 +0,0 @@ -ambient[] = {1.0, 1.0, 1.0, 1.0}; -diffuse[] = {1.0, 1.0, 1.0, 1.0}; -forcedDiffuse[] = {0.0, 0.0, 0.0, 0.0}; -emmisive[] = {0.0, 0.0, 0.0, 1.0}; -specular[] = {0.0, 0.0, 0.0, 0.0}; -specularPower = 0.0; -PixelShaderID = "Super"; -VertexShaderID = "Super"; -class Stage1 { - texture = "z\ace\addons\spottingscope\data\spot_scope_nohq.paa"; - uvSource="tex"; - class uvTransform { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; -}; -class Stage2 { - texture = "z\ace\addons\apl\data\metal4_weapons_vehicles_int_512_dt.paa"; - uvSource = "tex"; - class uvTransform { - aside[] = {6.0, 0.0, 0.0}; - up[] = {0.0, 6.0, 0.0}; - dir[] = {0.0, 0.0, 0.0}; - pos[] = {0.0, 0.0, 0.0}; - }; -}; -class Stage3 { - texture = "#(argb,8,8,3)color(0,0,0,0)"; - uvSource = "tex"; - class uvTransform { - aside[] = {1,0,0}; - up[] = {0,1,0}; - dir[] = {0,0,0}; - pos[] = {0,0,0}; - }; -}; -class Stage4 { - texture = "#(argb,8,8,3)color(0,1,1,1)"; - uvSource = "tex"; - class uvTransform { - aside[] = {1.0, 0.0, 0.0}; - up[] = {0.0, 1.0, 0.0}; - dir[] = {0.0, 0.0, 0.0}; - pos[] = {0.0, 0.0, 0.0}; - }; -}; -class Stage5 { - texture = "z\ace\addons\spottingscope\data\spot_scope_smdi.paa"; - uvSource="tex"; - class uvTransform { - aside[]={1,0,0}; - up[]={0,1,0}; - dir[]={0,0,0}; - pos[]={0,0,0}; - }; -}; -class Stage6 { - texture = "#(ai,32,128,1)fresnel(1.58,0.01)"; - uvSource = "tex"; - class uvTransform { - aside[] = {1.0, 0.0, 0.0}; - up[] = {0.0, 1.0, 0.0}; - dir[] = {0.0, 0.0, 0.0}; - pos[] = {0.0, 0.0, 0.0}; - }; -}; - -class Stage7 { - texture = "a3\data_f\env_land_co.paa"; - uvSource = "tex"; - class uvTransform { - aside[] = {1.0, 0.0, 0.0}; - up[] = {0.0, 1.0, 0.0}; - dir[] = {0.0, 0.0, 0.0}; - pos[] = {0.0, 0.0, 0.0}; - }; -}; diff --git a/addons/spottingscope/data/spottingscope.p3d b/addons/spottingscope/data/spottingscope.p3d deleted file mode 100644 index fba9d66b91..0000000000 Binary files a/addons/spottingscope/data/spottingscope.p3d and /dev/null differ diff --git a/addons/spottingscope/functions/fnc_animateReticle.sqf b/addons/spottingscope/functions/fnc_animateReticle.sqf new file mode 100644 index 0000000000..109d81a2b9 --- /dev/null +++ b/addons/spottingscope/functions/fnc_animateReticle.sqf @@ -0,0 +1,44 @@ +/* + * Author: commy2 + * Animate scripted reticle of spotting scope. + * + * Arguments: + * 0: Reticles RSC info display + * + * Return value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +disableSerialization; + +params ["_display"]; +uinamespace setVariable [QGVAR(dlgSpottingScope), _display]; + +private _ctrlReticle = _display displayCtrl IDC_RETICLE; +private _ctrlBody = _display displayCtrl IDC_BODY; +private _ctrlBlackLeft = _display displayCtrl IDC_BLACK_LEFT; +private _ctrlBlackRight = _display displayCtrl IDC_BLACK_RIGHT; + +// check if optics are used +// hide all controls otherwise +private _isUsingOptic = ctrlShown (_display displayCtrl 154); + +_ctrlReticle ctrlShow _isUsingOptic; +_ctrlBody ctrlShow _isUsingOptic; +_ctrlBlackLeft ctrlShow _isUsingOptic; +_ctrlBlackRight ctrlShow _isUsingOptic; + +// animate reticle +private _zoom = ([] call EFUNC(common,getZoom)) * MAGIC_SCOPE_NUMBER; + +_ctrlReticle ctrlSetPosition [ + POS_X_BASE(_zoom), + POS_Y_BASE(_zoom), + POS_W_BASE(_zoom), + POS_H_BASE(_zoom) +]; + +_ctrlReticle ctrlCommit 0; diff --git a/addons/spottingscope/rsc/spotting_scope_body_co.paa b/addons/spottingscope/rsc/spotting_scope_body_co.paa new file mode 100644 index 0000000000..71e1984c6e Binary files /dev/null and b/addons/spottingscope/rsc/spotting_scope_body_co.paa differ diff --git a/addons/spottingscope/rsc/spotting_scope_reticle_co.paa b/addons/spottingscope/rsc/spotting_scope_reticle_co.paa new file mode 100644 index 0000000000..a2d299d937 Binary files /dev/null and b/addons/spottingscope/rsc/spotting_scope_reticle_co.paa differ diff --git a/addons/spottingscope/script_component.hpp b/addons/spottingscope/script_component.hpp index 48f14b7398..0a730e13d6 100644 --- a/addons/spottingscope/script_component.hpp +++ b/addons/spottingscope/script_component.hpp @@ -15,3 +15,23 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + +#define IDC_RETICLE 10000 +#define IDC_BODY 10001 +#define IDC_BLACK_LEFT 10002 +#define IDC_BLACK_RIGHT 10003 + +#define MAGIC_SCOPE_NUMBER 0.0235 +//#define MAGIC_SCOPE_NUMBER (uiNamespace getVariable ['magic', 1]) + +#define POS_X_BASE(size) safezoneX + 0.5 * safezoneW - 0.5 * (size) / (getResolution select 5) +#define POS_Y_BASE(size) safezoneY + 0.5 * safezoneH - 0.5 * (size) / (getResolution select 5) * 4/3 +#define POS_W_BASE(size) (size) / (getResolution select 5) +#define POS_H_BASE(size) (size) / (getResolution select 5) * 4/3 + +#define SIZEX 1.05 + +#define POS_X QUOTE(POS_X_BASE(SIZEX)) +#define POS_Y QUOTE(POS_Y_BASE(SIZEX)) +#define POS_W QUOTE(POS_W_BASE(SIZEX)) +#define POS_H QUOTE(POS_H_BASE(SIZEX)) diff --git a/addons/spottingscope/stringtable.xml b/addons/spottingscope/stringtable.xml index 3a0b89b857..3df7c05ec5 100644 --- a/addons/spottingscope/stringtable.xml +++ b/addons/spottingscope/stringtable.xml @@ -1,6 +1,18 @@  + + Advanced Combat Environment 3 - Spotting Scope + Advanced Combat Environment 3 - Teleskop + Advanced Combat Environment 3 - Зрительная труба + Advanced Combat Environment 3 - Teleskop + Advanced Combat Environment 3 - Telescopio + Advanced Combat Environment 3 - Téléscope de visée + Advanced Combat Environment 3 - Zaměřovací dalekohled + Advanced Combat Environment 3 - Spotting Scope + Advanced Combat Environment 3 - Megfigyelő távcső + Advanced Combat Environment 3 - Luneta de observador + Spotting Scope Teleskop diff --git a/addons/switchunits/XEH_postInit.sqf b/addons/switchunits/XEH_postInit.sqf index 5928804d7b..dc143bc6ac 100644 --- a/addons/switchunits/XEH_postInit.sqf +++ b/addons/switchunits/XEH_postInit.sqf @@ -20,10 +20,18 @@ if (missionNamespace getVariable [QGVAR(EnableSwitchUnits), false]) then { [player] call FUNC(startSwitchUnits); } else { - ["SettingChanged", { + ["ace_settingChanged", { PARAMS_2(_name,_value); if ((_name == QGVAR(EnableSwitchUnits)) && {_value}) then { [player] call FUNC(startSwitchUnits); }; - }] call EFUNC(common,addEventhandler); + }] call CBA_fnc_addEventHandler; +}; + +if (isServer) then { + [QGVAR(switchLocality), { + params ["_unit", "_player"]; + _unit setVariable [QGVAR(OriginalOwner), owner _unit, true]; + _unit setOwner (owner _player); + }] call CBA_fnc_addEventHandler; }; diff --git a/addons/switchunits/functions/fnc_switchUnit.sqf b/addons/switchunits/functions/fnc_switchUnit.sqf index a26b2d474a..84b766de4d 100644 --- a/addons/switchunits/functions/fnc_switchUnit.sqf +++ b/addons/switchunits/functions/fnc_switchUnit.sqf @@ -40,14 +40,7 @@ if (_leave) exitWith { // should switch locality // This doesn't work anymore, because one's now able to switch to units from a different side //[_unit] joinSilent group player; -[ - [_unit, player], - QUOTE({ - (_this select 0) setVariable [ARR_3(QUOTE(QGVAR(OriginalOwner)), owner (_this select 0), true)]; - (_this select 0) setOwner owner (_this select 1) - }), - 1 -] call EFUNC(common,execRemoteFnc); +[QGVAR(switchLocality), [_unit, player]] call CBA_fnc_serverEvent; [{ params ["_args", "_pfhId"]; @@ -79,12 +72,7 @@ if (_leave) exitWith { // set owner back to original owner private _oldOwner = _oldUnit getVariable[QGVAR(OriginalOwner), -1]; if (_oldOwner > -1) then { - [ - [_oldUnit, _oldOwner], - QUOTE({ - (_this select 0) setOwner (_this select 1) - }), 1 - ] call EFUNC(common,execRemoteFnc); + ["ace_setOwner", [_oldUnit, _oldOwner]] call CBA_fnc_serverEvent; }; [localize LSTRING(SwitchedUnit)] call EFUNC(common,displayTextStructured); diff --git a/addons/switchunits/stringtable.xml b/addons/switchunits/stringtable.xml index 60d7fb0ecd..b1635cfae6 100644 --- a/addons/switchunits/stringtable.xml +++ b/addons/switchunits/stringtable.xml @@ -21,6 +21,7 @@ Sto provando a cambiare Intentando cambiar Essaye de basculer + Tentando trocar This unit is too close to the enemy. diff --git a/addons/tacticalladder/CfgVehicles.hpp b/addons/tacticalladder/CfgVehicles.hpp index e6525d8edd..564a034614 100644 --- a/addons/tacticalladder/CfgVehicles.hpp +++ b/addons/tacticalladder/CfgVehicles.hpp @@ -5,13 +5,15 @@ class CfgVehicles { class Man; class CAManBase: Man { class ACE_SelfActions { - class ACE_TacticalLadders { - displayName = CSTRING(Deploy); - condition = QUOTE(backpack _player == 'ACE_TacticalLadder_Pack'); - statement = QUOTE([_player] call FUNC(deployTL)); - exceptions[] = {}; - showDisabled = 1; - priority = 4; + class ACE_Equipment { + class ACE_TacticalLadders { + displayName = CSTRING(Deploy); + condition = QUOTE(backpack _player == 'ACE_TacticalLadder_Pack'); + statement = QUOTE([_player] call FUNC(deployTL)); + exceptions[] = {}; + showDisabled = 1; + priority = 4; + }; }; }; }; diff --git a/addons/tacticalladder/XEH_postInit.sqf b/addons/tacticalladder/XEH_postInit.sqf index ae59629a5a..723c5b1421 100644 --- a/addons/tacticalladder/XEH_postInit.sqf +++ b/addons/tacticalladder/XEH_postInit.sqf @@ -7,20 +7,20 @@ GVAR(cancelTime) = 0; GVAR(currentStep) = 3; GVAR(currentAngle) = 0; -/*["interactMenuOpened", { +/*["ace_interactMenuOpened", { if ((CBA_missionTime > GVAR(cancelTime)) && !isNull GVAR(ladder)) then { GVAR(ladder) call FUNC(cancelTLdeploy); }; -}] call EFUNC(common,addEventHandler);*/ +}] call CBA_fnc_addEventHandler;*/ // Cancel adjustment if interact menu opens -["interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call EFUNC(common,addEventHandler); +["ace_interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call CBA_fnc_addEventHandler; // Cancel adjusting on player change. -["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); -["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; +["ace_playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; // handle falling unconscious -["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); +["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; // @todo captivity? diff --git a/addons/tacticalladder/config.cpp b/addons/tacticalladder/config.cpp index 11f15ac934..53ce7384f6 100644 --- a/addons/tacticalladder/config.cpp +++ b/addons/tacticalladder/config.cpp @@ -15,3 +15,7 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" + +class ACE_newEvents { + interactMenuOpened = "ace_interactMenuOpened"; +}; diff --git a/addons/tagging/XEH_postInit.sqf b/addons/tagging/XEH_postInit.sqf index 31fd73d913..055cb59cfd 100644 --- a/addons/tagging/XEH_postInit.sqf +++ b/addons/tagging/XEH_postInit.sqf @@ -44,4 +44,4 @@ if (!isServer) exitWith {}; GVAR(testingThread) = false; GVAR(tagsToTest) = []; -["createTag", DFUNC(createTag)] call EFUNC(common,addEventHandler); +[QGVAR(createTag), DFUNC(createTag)] call CBA_fnc_addEventHandler; diff --git a/addons/tagging/config.cpp b/addons/tagging/config.cpp index a4161c1862..7e495892e9 100644 --- a/addons/tagging/config.cpp +++ b/addons/tagging/config.cpp @@ -16,3 +16,8 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" + +class ACE_newEvents { + createTag = QGVAR(createTag); + tagCreated = "ace_tagCreated"; +}; diff --git a/addons/tagging/functions/fnc_createTag.sqf b/addons/tagging/functions/fnc_createTag.sqf index 4f83196524..20ca33bd2e 100644 --- a/addons/tagging/functions/fnc_createTag.sqf +++ b/addons/tagging/functions/fnc_createTag.sqf @@ -34,7 +34,7 @@ _tag setPosASL _tagPosASL; _tag setVectorDirAndUp _vectorDirAndUp; // Throw a global event for mision makers -["tagCreated", [_tag, _texture, _object, _unit]] call EFUNC(common,globalEvent); +["ace_tagCreated", [_tag, _texture, _object, _unit]] call CBA_fnc_globalEvent; if (isNull _object) exitWith {true}; diff --git a/addons/tagging/functions/fnc_tag.sqf b/addons/tagging/functions/fnc_tag.sqf index c2b4a6601a..d14e65ae7f 100644 --- a/addons/tagging/functions/fnc_tag.sqf +++ b/addons/tagging/functions/fnc_tag.sqf @@ -109,7 +109,7 @@ _unit playActionNow "PutDown"; playSound3D [QUOTE(PATHTO_R(sounds\spray.ogg)), _unit, false, (eyePos _unit), 10, 1, 15]; // Tell the server to create the tag and handle its destruction - ["createTag", _this] call EFUNC(common,serverEvent); + [QGVAR(createTag), _this] call CBA_fnc_serverEvent; }, [_touchingPoint vectorAdd (_surfaceNormal vectorMultiply 0.06), _vectorDirAndUp, _texture, _object, _unit], 0.6] call CBA_fnc_waitAndExecute; true diff --git a/addons/tagging/stringtable.xml b/addons/tagging/stringtable.xml index bf4056df49..43f6a1e2d4 100644 --- a/addons/tagging/stringtable.xml +++ b/addons/tagging/stringtable.xml @@ -9,6 +9,7 @@ Tag noir Marca nero Označit černě + Marcar em preto Tag red @@ -18,6 +19,7 @@ Tag rouge Marca rosso Označit červeně + Marcar em vermelho Tag green @@ -27,6 +29,7 @@ Tag vert Marca verde Označit zeleně + Marcar em verde Tag blue @@ -36,6 +39,7 @@ Tag bleu Marca blu Označit modře + Marcar em azul Black spray paint @@ -45,6 +49,7 @@ Peinture pulvérisée noire Bomboletta spray nera Černý sprej + Spray de tinta preta Red spray paint @@ -54,6 +59,7 @@ Peinture pulvérisée rouge Bomboletta spray rossa Červený sprej + Spray de tinta vermelha Green spray paint @@ -63,6 +69,7 @@ Peinture pulvérisée verte Bomboletta spray verde Zelený sprej + Spray de tinta verde Blue spray paint @@ -72,6 +79,7 @@ Peinture pulvérisée bleue Bomboletta spray blu Modrý sprej + Spray de tinta azul A can of spray paint for tagging walls. @@ -81,6 +89,7 @@ Un spray de peinture pour taguer les murs. Una bomboletta di spay per contrassegnare i muri. Plechovka se sprejem k vytváření značek. + Uma lata de tinta spray para marcar paredes. \ No newline at end of file diff --git a/addons/trenches/XEH_postInit.sqf b/addons/trenches/XEH_postInit.sqf index ba84123009..af6038d992 100644 --- a/addons/trenches/XEH_postInit.sqf +++ b/addons/trenches/XEH_postInit.sqf @@ -13,14 +13,14 @@ GVAR(digPFH) = -1; GVAR(digDirection) = 0; // Cancel dig sandbag if interact menu opened -["interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call EFUNC(common,addEventHandler); +["ace_interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call CBA_fnc_addEventHandler; // Cancel dig on player change. This does work when returning to lobby, but not when hard disconnecting. -["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); -["playerInventoryChanged", {_this call FUNC(handlePlayerInventoryChanged)}] call EFUNC(common,addEventhandler); -["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; +["ace_playerInventoryChanged", {_this call FUNC(handlePlayerInventoryChanged)}] call CBA_fnc_addEventHandler; +["ace_playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; // handle waking up dragged unit and falling unconscious while dragging -["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); +["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; //@todo Captivity? diff --git a/addons/trenches/config.cpp b/addons/trenches/config.cpp index d6afd2f9d1..f090a3ecf4 100644 --- a/addons/trenches/config.cpp +++ b/addons/trenches/config.cpp @@ -16,3 +16,7 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" + +class ACE_newEvents { + interactMenuOpened = "ace_interactMenuOpened"; +}; diff --git a/addons/trenches/functions/fnc_placeTrench.sqf b/addons/trenches/functions/fnc_placeTrench.sqf index 35a6706d30..f7a643d882 100644 --- a/addons/trenches/functions/fnc_placeTrench.sqf +++ b/addons/trenches/functions/fnc_placeTrench.sqf @@ -36,7 +36,7 @@ _trench = createVehicle [_noGeoModel, [0, 0, 0], [], 0, "NONE"]; GVAR(trench) = _trench; // prevent collisions with trench -["enableSimulationGlobal", [_trench, false]] call EFUNC(common,serverEvent); +[QEGVAR(common,enableSimulationGlobal), [_trench, false]] call CBA_fnc_serverEvent; GVAR(digDirection) = 0; diff --git a/addons/trenches/stringtable.xml b/addons/trenches/stringtable.xml index dc9bee1815..77b845c2db 100644 --- a/addons/trenches/stringtable.xml +++ b/addons/trenches/stringtable.xml @@ -9,6 +9,7 @@ Pala para trincheras Outil de tranchée Polní lopatka + Ferramenta de trincheira Entrenching Tool @@ -18,6 +19,7 @@ Pala para trincheras Outil de tranchée Polní lopatky se používají k zákopovým a jiným pracem. + Ferramenta de trincheira Envelope - Small @@ -26,6 +28,7 @@ Fascia - Piccola Trinchera pequeña Envelope - petite + Trincheira - Pequena Small Personal Trench @@ -35,6 +38,7 @@ Trinchera personal pequeña Petite tranchée personelle Malý zákop pro jednoho + Trincheira pessoal pequena Dig Small Trench @@ -44,6 +48,7 @@ Cavar trinchera pequeña Creuser une petite tranchée Vykopat malý zákop + Cavar trincheira pequena Envelope - Big @@ -52,6 +57,7 @@ Fascia - Grande Trinchera grande Enveloppe - grande + Trincheira - Grande Large Personal Trench @@ -61,6 +67,7 @@ Trinchera personal grande Grande tranchée personelle Velký zákop pro jednoho + Trincheira pessoal grande Dig Big Trench @@ -70,6 +77,7 @@ Cavar trinchera grande Creuser une grande tranchée Vykopat velký zákop + Cavar trincheira grande Confirm Dig @@ -79,6 +87,7 @@ Confirmar cavado Confirmer la creusée Potvrdit kopání + Confirmar excavação Cancel Dig @@ -88,6 +97,7 @@ Cancelar cavado Annuler la creusée Zrušit kopání + Cancelar excavação Rotate @@ -109,18 +119,22 @@ Cavando trinchera Creuse la tranchée Vykopat zákop + Cavando trincheira Continue Digging Trench Wzów kopanie wnęki + Continuar cavando trincheira Remove Trench Usuń wnękę + Remover trincheira Removing Trench Usuwanie wnęki + Removendo tricnheira \ No newline at end of file diff --git a/addons/tripod/CfgVehicles.hpp b/addons/tripod/CfgVehicles.hpp index b30500ab00..b1d804e393 100644 --- a/addons/tripod/CfgVehicles.hpp +++ b/addons/tripod/CfgVehicles.hpp @@ -5,13 +5,15 @@ class CfgVehicles { class Man; class CAManBase: Man { class ACE_SelfActions { - class GVAR(place) { - displayName = CSTRING(Placedown); - condition = QUOTE([ARR_2(_player,'ACE_Tripod')] call EFUNC(common,hasItem)); - statement = QUOTE([ARR_2(_player,'ACE_Tripod')] call FUNC(place)); - showDisabled = 0; - priority = 2; - icon = QPATHTOF(UI\w_sniper_tripod_ca.paa); + class ACE_Equipment { + class GVAR(place) { + displayName = CSTRING(Placedown); + condition = QUOTE([ARR_2(_player,'ACE_Tripod')] call EFUNC(common,hasItem)); + statement = QUOTE([ARR_2(_player,'ACE_Tripod')] call FUNC(place)); + showDisabled = 0; + priority = 2; + icon = QPATHTOF(UI\w_sniper_tripod_ca.paa); + }; }; }; }; diff --git a/addons/tripod/XEH_postInit.sqf b/addons/tripod/XEH_postInit.sqf index 79aa7a69f2..df62d653ab 100644 --- a/addons/tripod/XEH_postInit.sqf +++ b/addons/tripod/XEH_postInit.sqf @@ -7,13 +7,13 @@ GVAR(adjustPFH) = -1; GVAR(height) = 0; // Cancel adjustment if interact menu opens -["interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call EFUNC(common,addEventHandler); +["ace_interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call CBA_fnc_addEventHandler; // Cancel adjusting on player change. -["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); -["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; +["ace_playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; // handle falling unconscious -["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); +["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; // @todo captivity? diff --git a/addons/tripod/config.cpp b/addons/tripod/config.cpp index 1ee297e0e0..3891a59d57 100644 --- a/addons/tripod/config.cpp +++ b/addons/tripod/config.cpp @@ -15,4 +15,8 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" \ No newline at end of file +#include "CfgWeapons.hpp" + +class ACE_newEvents { + interactMenuOpened = "ace_interactMenuOpened"; +}; diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index 72a754a28e..8ab7f35ab2 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -3,12 +3,12 @@ // Exit on Headless if (!hasInterface) exitWith {}; -["SettingsInitialized", { +["ace_settingsInitialized", { // Initial settings [true] call FUNC(setElements); // On load and entering/exiting a vehicle - ["infoDisplayChanged", { + ["ace_infoDisplayChanged", { // Selective UI Advanced // Defaults must be set in this EH to make sure controls are activated and advanced settings can be modified private _force = [true, false] select (GVAR(allowSelectiveUI)); @@ -20,20 +20,22 @@ if (!hasInterface) exitWith {}; // Execute local event for when it's safe to modify UI through this API // infoDisplayChanged can execute multiple times, make sure it only happens once if (!GVAR(interfaceInitialized)) then { - ["InterfaceInitialized", []] call EFUNC(common,localEvent); + [QGVAR(InterfaceInitialized), []] call CBA_fnc_localEvent; GVAR(interfaceInitialized) = true; }; - }] call EFUNC(common,addEventHandler); + }] call CBA_fnc_addEventHandler; // On changing settings - ["SettingChanged", { + ["ace_settingChanged", { params ["_name"]; if (_name in ELEMENTS_BASIC) then { [false] call FUNC(setElements); } else { - [_name select [7], missionNamespace getVariable _name, true] call FUNC(setAdvancedElement); + if (isClass (configFile >> "ACE_UI" >> _name select [7])) then { + [_name select [7], missionNamespace getVariable _name, true] call FUNC(setAdvancedElement); + }; }; - }] call EFUNC(common,addEventHandler); + }] call CBA_fnc_addEventHandler; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf index 3f087d8974..956dc3db5b 100644 --- a/addons/ui/functions/fnc_setAdvancedElement.sqf +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -29,8 +29,8 @@ private _config = configFile >> "ACE_UI" >> _element; // Exit if main vehicle type condition not fitting private _location = getNumber (_config >> "location"); // (0-both, 1-ground, 2-vehicle) -private _currentLocation = ACE_player == vehicle ACE_player; -if ((_currentLocation && _location == 2) || (!_currentLocation && _location == 1)) exitWith {false}; +private _canUseWeapon = ACE_player call CBA_fnc_canUseWeapon; +if ((_canUseWeapon && _location == 2) || (!_canUseWeapon && _location == 1)) exitWith {false}; private _idd = getNumber (_config >> "idd"); private _elements = getArray (_config >> "elements"); diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index 61dcc18ee7..a3d5cbbd25 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -4,157 +4,199 @@ User Interface Uživatelské rozhraní + Interface do usuário User Interface Uživatelské rozhraní + Interface do usuário This module allows toggling visible user interface parts. + Este módulo permite ligar ou desligar partes da interface do usuário Allow Selective UI Povolit selektivní UI + Permitir IU Selecionável Allow client to modify their UI. Povolit klientovi měnit jeho UI + Permite o cliente modificar sua IU. Soldier/Vehicle/Weapon Information Informace o Vojákovi/Vozidlu/Zbrani + Informação de Soldado/Veículo/Armamento Vehicle Radar Radar vozidla + Radar de Veículo Vehicle Compass Kompas vozidla + Bússola de Veículo Command Menu Menu rozkazů + Menu de Comando Group Bar Panel skupiny + Barra de Grupo Weapon Name Název zbraně + Nome do Armamento Weapon Name Background Název zbraně v pozadí + Fundo do Nome do Armamento Firing Mode Režim palby + Modo de Disparo Ammo Type Typ munice + Tipo de Munição Ammo Count Počet munice + Quantidade de Munição Magazine Count Počet zásobníků + Quantidade de Carregadores Throwable Type Typ granátů apod. + Tipo de Arremessável Throwable Count Počet granátů apod. + Quantidade de Arremessável Zeroing Náměr + Zerar a mira Weapon Lower Info Background + Informações na parte de baixo do fundo do Armamento Stance Postoj + Postura Stamina Bar Panel výdrže + Barra de Energia Gunner Weapon Name + Nome da arma do fuzileiro Gunner Weapon Name Background + Fundo do nome da arma do fuzileiro Gunner Firing Mode + Modo de disparo do fuzileiro Gunner Ammo Type + Tipo de Munição do fuzileiro Gunner Ammo Count + Quantidade de Munição do fuzileiro Gunner Magazine Count + Quantidade de Carregadores do fuzileiro Gunner Launchable Type + Tipo de Arremessável do fuzileiro Gunner Launchable Count + Quantidade de Arremessável do fuzileiro Gunner Zeroing + Zerar a mira do fuzileiro Gunner Weapon Lower Info Background + Informações na parte de baixo do fundo do Armamento do fuzileiro Vehicle Name Název vozidla + Nome do Veículo Vehicle Name Background Název vozidla v pozadí + Fundo do Nome do Veículo Vehicle Fuel Bar Ukazatel paliva + Barra de Combustível do Veículo Vehicle Speed Rychlost vozidla + Velocidade do Veículo Vehicle Altitude Výška vozidla + Altitude do Veículo Vehicle Damage Poškození vozidla + Dano do Veículo Vehicle Info Background Info o vozidle v pozadí + Fundo das informações do veículo Requires Soldier/Vehicle/Weapon Information. Vyžaduje informace o Vojákovi/Vozidlu/Zbrani + Requer informações de Soldado/Veículo/Armamento Modifying User Interface is disabled. Změna uživatelského rozhraní je zakázána. + A modificação da interface do usuário está desabilitada. Cannot modify a forced User Interface element. + Não é possível modificar um elemento forçado da interface do usuário. - + \ No newline at end of file diff --git a/addons/vector/config.cpp b/addons/vector/config.cpp index 66b2a5c7ea..8c1dd84ddb 100644 --- a/addons/vector/config.cpp +++ b/addons/vector/config.cpp @@ -19,3 +19,7 @@ class CfgPatches { #include "CfgWeapons.hpp" #include "RscInGameUI.hpp" + +class ACE_newEvents { + RangerfinderData = QGVAR(rangefinderData); +}; diff --git a/addons/vector/functions/fnc_dataTransfer.sqf b/addons/vector/functions/fnc_dataTransfer.sqf index 25403b82ee..f99490f04c 100644 --- a/addons/vector/functions/fnc_dataTransfer.sqf +++ b/addons/vector/functions/fnc_dataTransfer.sqf @@ -22,4 +22,4 @@ _direction = call FUNC(getDirection); _azimuth = _direction select 0; _inclination = _direction select 1; //Send Data to connected GPS -["RangerfinderData", [_distance, _azimuth, _inclination]] call EFUNC(common,localEvent); \ No newline at end of file +[QGVAR(rangefinderData), [_distance, _azimuth, _inclination]] call CBA_fnc_localEvent; diff --git a/addons/vehiclelock/CfgVehicles.hpp b/addons/vehiclelock/CfgVehicles.hpp index 5906f05f79..bf4231f426 100644 --- a/addons/vehiclelock/CfgVehicles.hpp +++ b/addons/vehiclelock/CfgVehicles.hpp @@ -3,14 +3,14 @@ class ACE_unlockVehicle { \ displayName = CSTRING(Action_UnLock); \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \ - statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,false)])] call EFUNC(common,targetEvent)); \ + statement = QUOTE([ARR_3(QUOTE(QGVAR(setVehicleLock)), [ARR_2(_target,false)], [_target])] call CBA_fnc_targetEvent); \ priority = 0.3; \ icon = QPATHTOF(UI\key_menuIcon_ca.paa); \ }; \ class ACE_lockVehicle { \ displayName = CSTRING(Action_Lock); \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \ - statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,true)])] call EFUNC(common,targetEvent)); \ + statement = QUOTE([ARR_3(QUOTE(QGVAR(setVehicleLock)), [ARR_2(_target,true)], [_target])] call CBA_fnc_targetEvent); \ priority = 0.2; \ icon = QPATHTOF(UI\key_menuIcon_ca.paa); \ }; \ @@ -27,7 +27,7 @@ displayName = CSTRING(Action_UnLock); \ distance = 4; \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \ - statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,false)])] call EFUNC(common,targetEvent)); \ + statement = QUOTE([ARR_3(QUOTE(QGVAR(setVehicleLock)), [ARR_2(_target,false)], [_target])] call CBA_fnc_targetEvent); \ priority = 0.3; \ icon = QPATHTOF(UI\key_menuIcon_ca.paa); \ }; \ @@ -35,7 +35,7 @@ displayName = CSTRING(Action_Lock); \ distance = 4; \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \ - statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,true)])] call EFUNC(common,targetEvent)); \ + statement = QUOTE([ARR_3(QUOTE(QGVAR(setVehicleLock)), [ARR_2(_target,true)], [_target])] call CBA_fnc_targetEvent); \ priority = 0.2; \ icon = QPATHTOF(UI\key_menuIcon_ca.paa); \ }; \ diff --git a/addons/vehiclelock/XEH_postInit.sqf b/addons/vehiclelock/XEH_postInit.sqf index 93d8bd6426..3888a6e87a 100644 --- a/addons/vehiclelock/XEH_postInit.sqf +++ b/addons/vehiclelock/XEH_postInit.sqf @@ -1,15 +1,15 @@ #include "script_component.hpp" //Add Event Handlers -["VehicleLock_SetupCustomKey", {_this call FUNC(serverSetupCustomKeyEH)}] call EFUNC(common,addEventHandler); -["VehicleLock_SetVehicleLock", {_this call FUNC(setVehicleLockEH)}] call EFUNC(common,addEventHandler); +[QGVAR(setupCustomKey), {_this call FUNC(serverSetupCustomKeyEH)}] call CBA_fnc_addEventHandler; +[QGVAR(setVehicleLock), {_this call FUNC(setVehicleLockEH)}] call CBA_fnc_addEventHandler; if (!hasInterface) exitwith {}; -["SettingsInitialized", { +["ace_settingsInitialized", { TRACE_1("SettingsInitialized eh",GVAR(LockVehicleInventory)); if (GVAR(LockVehicleInventory)) then { ["CAManBase", "InventoryOpened", {_this call FUNC(onOpenInventory);}] call CBA_fnc_addClassEventHandler; }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/vehiclelock/config.cpp b/addons/vehiclelock/config.cpp index 942c3959f2..cb67bca1c3 100644 --- a/addons/vehiclelock/config.cpp +++ b/addons/vehiclelock/config.cpp @@ -19,3 +19,8 @@ class CfgPatches { #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" + +class ACE_newEvents { + VehicleLock_SetVehicleLock = QGVAR(setVehicleLock); + VehicleLock_SetupCustomKey = QGVAR(setupCustomKey); +}; diff --git a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf index 073054648e..b45bf150f3 100644 --- a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf @@ -36,7 +36,7 @@ if (_useCustom) then { _keyMagazine = _newMags select 0; TRACE_2("setting up key on server",_veh,_keyMagazine); //Have the server run add the key to the vehicle's key array: - ["VehicleLock_SetupCustomKey", [_veh, _keyMagazine]] call EFUNC(common,serverEvent); + [QGVAR(setupCustomKey), [_veh, _keyMagazine]] call CBA_fnc_serverEvent; } else { _keyName = [_veh] call FUNC(getVehicleSideKey); _unit addItem _keyName; //addItem has global effects diff --git a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf index 7cc7cac5f7..b0835a6272 100644 --- a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf +++ b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf @@ -38,7 +38,7 @@ TRACE_1("params",_vehicle); }; if ((_lock && {(locked _vehicle) != 2}) || {!_lock && {(locked _vehicle) != 0}}) then { TRACE_3("Setting Lock State",_lock,(typeOf _vehicle),_vehicle); - ["VehicleLock_SetVehicleLock", [_vehicle], [_vehicle, _lock]] call EFUNC(common,targetEvent); + [QGVAR(SetVehicleLock), [_vehicle, _lock], [_vehicle]] call CBA_fnc_targetEvent; }; }; //Delay call until mission start (so everyone has the eventHandler's installed) diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index 3435af24bf..bf15a6eadd 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -55,7 +55,7 @@ switch (_funcType) do { [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize LSTRING(Action_LockpickInUse)), _condition] call EFUNC(common,progressBar); }; case "finishLockpick": { - ["VehicleLock_SetVehicleLock", [_veh], [_veh, false]] call EFUNC(common,targetEvent); + [QGVAR(setVehicleLock), [_veh, false], [_veh]] call CBA_fnc_targetEvent; }; default { ERROR("bad function type"); diff --git a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf index d2290ef732..9382de408e 100644 --- a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf +++ b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf @@ -1,6 +1,6 @@ /* * Author: PabstMirror - * Sets a vehicle lock state because of a "VehicleLock_SetVehicleLock" event + * Sets a vehicle lock state because of a "ace_vehiclelock_setVehicleLock" event * * Arguments: * 0: Vehicle diff --git a/addons/viewdistance/XEH_clientInit.sqf b/addons/viewdistance/XEH_clientInit.sqf index dfcfd7e405..2572931935 100644 --- a/addons/viewdistance/XEH_clientInit.sqf +++ b/addons/viewdistance/XEH_clientInit.sqf @@ -2,7 +2,7 @@ if (!hasInterface) exitWith {}; -["SettingsInitialized", { +["ace_settingsInitialized", { // if not enabled, then bugger off. if !(GVAR(enabled)) exitWith {}; @@ -10,7 +10,7 @@ if (!hasInterface) exitWith {}; [false] call FUNC(adaptViewDistance); // Set the EH which waits for any of the view distance settings to be changed, so that the effect is show immediately - ["SettingChanged",{ + ["ace_settingChanged",{ params ["_name"]; if ((_name == QGVAR(viewDistanceOnFoot)) || (_name == QGVAR(viewDistanceLandVehicle)) || @@ -19,11 +19,11 @@ if (!hasInterface) exitWith {}; [true] call FUNC(adaptViewDistance); }; - }] call EFUNC(common,addEventHandler); + }] call CBA_fnc_addEventHandler; // Set the EH which waits for a vehicle change to automatically swap between On Foot/In Land Vehicle/In Air Vehicle // Also run when SettingsInitialized runs (not guaranteed) - ["playerVehicleChanged",{ + ["ace_playerVehicleChanged",{ [false] call FUNC(adaptViewDistance); - }] call EFUNC(common,addEventHandler); -}] call EFUNC(common,addEventHandler); + }] call CBA_fnc_addEventHandler; +}] call CBA_fnc_addEventHandler; diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index 2e03982fec..f9d1cf1d78 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -198,4 +198,4 @@ if (!hasInterface) exitWith {}; // Register fire event handler -["firedPlayer", DFUNC(throwGrenade)] call EFUNC(common,addEventHandler); +["ace_firedPlayer", DFUNC(throwGrenade)] call CBA_fnc_addEventHandler; diff --git a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf index ef9397ba57..288531df2c 100644 --- a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf +++ b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf @@ -26,4 +26,4 @@ private _name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNa private _text = [format ["%1 x%2", _name, _numberofGrenades], _color] call EFUNC(common,stringToColoredText); private _picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); -["displayTextPicture", [_text, _picture]] call EFUNC(common,localEvent); +[_text, _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/weather/XEH_postInit.sqf b/addons/weather/XEH_postInit.sqf index f085217c56..569dd87dc4 100644 --- a/addons/weather/XEH_postInit.sqf +++ b/addons/weather/XEH_postInit.sqf @@ -29,7 +29,7 @@ GVAR(ACE_rain) = rain; }; GVAR(WindInfo) = false; -["ACE3 Common", QGVAR(WindInfoKey), localize LSTRING(WindInfoKey), +["ACE3 Common", QGVAR(WindInfoKey), localize LSTRING(WindInfoKeyToggle), { // Conditions: canInteract if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -39,7 +39,8 @@ GVAR(WindInfo) = false; }, {false}, [37, [true, false, false]], false, 0] call CBA_fnc_addKeybind; // (SHIFT + K) -["ACE3 Common", QGVAR(WindInfoKey_hold), localize LSTRING(WindInfoKey_hold), + +["ACE3 Common", QGVAR(WindInfoKey_hold), localize LSTRING(WindInfoKeyHold), { // Conditions: canInteract if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -58,8 +59,8 @@ simulWeatherSync; -["SettingsInitialized",{ - TRACE_1("SettingsInitialized",GVAR(syncRain)); +["ace_settingsInitialized",{ + TRACE_1("ace_settingsInitialized eh",GVAR(syncRain)); //Create a 0 sec delay PFEH to update rain every frame: if (GVAR(syncRain)) then { @@ -91,4 +92,4 @@ simulWeatherSync; END_COUNTER(weatherPFEH); }, 1, []] call CBA_fnc_addPerFrameHandler; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/weather/XEH_postServerInit.sqf b/addons/weather/XEH_postServerInit.sqf index f7b830b11d..cd1fca2c4c 100644 --- a/addons/weather/XEH_postServerInit.sqf +++ b/addons/weather/XEH_postServerInit.sqf @@ -9,10 +9,10 @@ GVAR(rain_current_range) = -1+(random 2); // Wind call FUNC(initWind); -["SettingsInitialized", { - TRACE_2("SettingsInitialized",GVAR(enableServerController),GVAR(serverUpdateInterval)); +["ace_settingsInitialized", { + TRACE_2("ace_settingsInitialized eh",GVAR(enableServerController),GVAR(serverUpdateInterval)); if (GVAR(enableServerController)) then { [FUNC(serverController), GVAR(serverUpdateInterval)] call CBA_fnc_addPerFrameHandler; }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/weather/config.cpp b/addons/weather/config.cpp index d2d8764ead..2444064f41 100644 --- a/addons/weather/config.cpp +++ b/addons/weather/config.cpp @@ -17,4 +17,4 @@ class CfgPatches { #include "CfgWorlds.hpp" #include "RscTitles.hpp" #include "CfgVehicles.hpp" -#include "ACE_Settings.hpp" \ No newline at end of file +#include "ACE_Settings.hpp" diff --git a/addons/weather/stringtable.xml b/addons/weather/stringtable.xml index 571fa9c25a..908e73ea3d 100644 --- a/addons/weather/stringtable.xml +++ b/addons/weather/stringtable.xml @@ -1,7 +1,7 @@  - + Show Wind Info Pokaż inf. o wietrze Показать информацию о ветре @@ -13,7 +13,7 @@ Zobrazit údaje o větru Mostrar informação do vento - + Show Wind Info (Toggle) Pokaż inf. o wietrze (przełącz) Показать информацию о ветре (перекл.) @@ -194,4 +194,4 @@ Definisce l'intervallo (in secondi) tra aggiornamenti del meteo - \ No newline at end of file + diff --git a/addons/winddeflection/XEH_postInit.sqf b/addons/winddeflection/XEH_postInit.sqf index 14b4db1def..fe454cb00d 100644 --- a/addons/winddeflection/XEH_postInit.sqf +++ b/addons/winddeflection/XEH_postInit.sqf @@ -4,19 +4,19 @@ if (!hasInterface) exitWith {}; GVAR(trackedBullets) = []; -["SettingsInitialized", { +["ace_settingsInitialized", { //If not enabled, dont't add PFEH if (!GVAR(enabled)) exitWith {}; // 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; if (GVAR(vehicleEnabled)) then { - ["firedPlayerVehicle", DFUNC(handleFired)] call EFUNC(common,addEventHandler); - ["firedPlayerVehicleNonLocal", DFUNC(handleFired)] call EFUNC(common,addEventHandler); + ["ace_firedPlayerVehicle", DFUNC(handleFired)] call CBA_fnc_addEventHandler; + ["ace_firedPlayerVehicleNonLocal", DFUNC(handleFired)] call CBA_fnc_addEventHandler; }; [] call FUNC(updateTrajectoryPFH); -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; diff --git a/addons/zeus/XEH_preInit.sqf b/addons/zeus/XEH_preInit.sqf index 0d03673e46..b39f4c0e04 100644 --- a/addons/zeus/XEH_preInit.sqf +++ b/addons/zeus/XEH_preInit.sqf @@ -5,7 +5,7 @@ ADDON = false; #include "XEH_PREP.hpp" if (isServer) then { - ["zeusUnitAssigned", FUNC(handleZeusUnitAssigned)] call EFUNC(common,addEventHandler); + [QGVAR(zeusUnitAssigned), FUNC(handleZeusUnitAssigned)] call CBA_fnc_addEventHandler; }; ADDON = true; diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 6b066c8efb..62b4738761 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -43,3 +43,10 @@ class ACE_Curator { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "ACE_Settings.hpp" + +class ACE_newEvents { + zeusUnitAssigned = QGVAR(zeusUnitAssigned); + SetSurrendered = QEGVAR(captives,setSurrendered); + SetHandcuffed = QEGVAR(captives,setHandcuffed); + AddCargoByClass = "ace_addCargoByClass"; +}; diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 2909aceba5..1acb75b93b 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -175,7 +175,7 @@ if (_activated) then { [_logic,"curatorUnitAssigned",[_logic,_player]] call bis_fnc_callscriptedeventhandler; // Added by ace_zeus - ["zeusUnitAssigned", [_logic,_player]] call EFUNC(common,globalEvent); + [QGVAR(zeusUnitAssigned), [_logic,_player]] call CBA_fnc_globalEvent; //--- Forced interface //if (_forced) then { diff --git a/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf b/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf index 3acb024476..492914eb1c 100644 --- a/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf +++ b/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf @@ -32,7 +32,7 @@ if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(c if (getNumber (configFile >> "CfgVehicles" >> "ACE_Track" >> QEGVAR(cargo,size)) > [_mouseOverUnit] call EFUNC(cargo,getCargoSpaceLeft)) then { [LSTRING(OnlyEnoughCargoSpace)] call EFUNC(common,displayTextStructured); } else { - ["AddCargoByClass", ["ACE_Track", _mouseOverUnit, 1, true]] call EFUNC(common,localEvent); + ["ace_addCargoByClass", ["ACE_Track", _mouseOverUnit, 1, true]] call CBA_fnc_localEvent; }; }; }; diff --git a/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf b/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf index c353af189b..105acb2b83 100644 --- a/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf +++ b/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf @@ -32,7 +32,7 @@ if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(c if (getNumber (configFile >> "CfgVehicles" >> "ACE_Wheel" >> QEGVAR(cargo,size)) > [_mouseOverUnit] call EFUNC(cargo,getCargoSpaceLeft)) then { [LSTRING(OnlyEnoughCargoSpace)] call EFUNC(common,displayTextStructured); } else { - ["AddCargoByClass", ["ACE_Wheel", _mouseOverUnit, 1, true]] call EFUNC(common,localEvent); + ["ace_addCargoByClass", ["ACE_Wheel", _mouseOverUnit, 1, true]] call CBA_fnc_localEvent; }; }; }; diff --git a/addons/zeus/functions/fnc_moduleCaptive.sqf b/addons/zeus/functions/fnc_moduleCaptive.sqf index 8273c8ba6f..7d1c46f873 100644 --- a/addons/zeus/functions/fnc_moduleCaptive.sqf +++ b/addons/zeus/functions/fnc_moduleCaptive.sqf @@ -38,7 +38,7 @@ if (isNil QEFUNC(captives,setHandcuffed)) then { } else { _captive = GETVAR(_unit,EGVAR(captives,isHandcuffed),false); // Event initalized by ACE_Captives - ["SetHandcuffed", _unit, [_unit, !_captive]] call EFUNC(common,targetEvent); + [QEGVAR(captives,setHandcuffed), [_unit, !_captive], _unit] call CBA_fnc_targetEvent; }; }; }; diff --git a/addons/zeus/functions/fnc_moduleSurrender.sqf b/addons/zeus/functions/fnc_moduleSurrender.sqf index 95f35593a5..e14501feb0 100644 --- a/addons/zeus/functions/fnc_moduleSurrender.sqf +++ b/addons/zeus/functions/fnc_moduleSurrender.sqf @@ -41,7 +41,7 @@ if (isNil QEFUNC(captives,setSurrendered)) then { } else { _surrendering = GETVAR(_unit,EGVAR(captives,isSurrendering),false); // Event initalized by ACE_Captives - ["SetSurrendered", _unit, [_unit, !_surrendering]] call EFUNC(common,targetEvent); + [QEGVAR(captives,setSurrendered), [_unit, !_surrendering], _unit] call CBA_fnc_targetEvent; }; }; }; diff --git a/tools/event_rename.py b/tools/event_rename.py new file mode 100644 index 0000000000..99dd261a02 --- /dev/null +++ b/tools/event_rename.py @@ -0,0 +1,115 @@ +import os +import sys +import re + +un_capitalize = lambda s: s[:1].lower() + s[1:] if s else '' + +def add_to_config(old, new): + with open(add_to_config.file, "r+") as file: + contents = file.read() + + events_class = re.search(r"class\s+ACE_newEvents\s+{\n",contents,re.I) + + if events_class: + newline_index = events_class.end() + insert = " {0} = \"{1}\";\n".format(old,new) + else: + newline_index = len(contents) + insert = "\nclass ACE_newEvents {{\n {0} = \"{1}\";\n}};".format(old,new) + + contents = contents[:newline_index] + insert + contents[newline_index:] + + file.seek(0) + file.write(contents) + file.truncate() + +def event_replace(match): + event = un_capitalize(match.group(1)) + add_to_config(match.group(1), "ace_" + event) + + return "[\"ace_{0}\", {1}] call CBA_fnc_{2}".format(event,match.group(2),match.group(3)) + +def process_directory(dir, config=""): + if not config: + config = os.path.join(dir,"config.cpp") + if os.path.isfile(config): + add_to_config.file = config + + for p in os.listdir(dir): + path = os.path.join(dir, p) + if os.path.isdir(path): + process_directory(path, config) + continue + + ext = os.path.splitext(path)[1] + if ext not in [".sqf",".hpp",".cpp"]: + continue + + with open(path, "r+") as file: + contents = file.read() + + # Simple single-line substitutions + find = r"\[\s*\"(?!ace_)(\w+)\"\s*,\s*(.+?)\s*\]\s+call\s+CBA_fnc_((add|remove|local|global|target|server)Event(Handler)?)" + contents, subbed = re.subn(find,event_replace,contents,0,re.I) + + # Handle multi-line code blocks + for match in re.finditer(r"\[\s*\"(?!ace_)(\w+)\"\s*,\s*({.+?})\s*\]\s+call\s*CBA_fnc_(add|remove)EventHandler",contents,re.I|re.S): + pair = 0 + for i, c in enumerate(contents[match.start(2):]): + if c == "{": + pair += 1 + elif c == "}": + pair -= 1 + if pair == 0: + pair = i + break + if re.match(r"\s*\]\s+call\s+CBA_fnc_(add|remove)EventHandler",contents[pair+match.start(2)+1:],re.I): + event = un_capitalize(match.group(1)) + add_to_config(match.group(1), "ace_" + event) + + contents = contents[:match.start(1)] + "ace_" + event + contents[match.end(1):] + subbed += 1 + + # Handle multi-line argument arrays + for match in re.finditer(r"\[\s*\"(?!ace_)(\w+)\"\s*,\s*(\[.+?\])\s*\]\s+call\s*CBA_fnc_(local|global|server)Event",contents,re.I|re.S): + pair = 0 + for i, c in enumerate(contents[match.start(2):]): + if c == "[": + pair += 1 + elif c == "]": + pair -= 1 + if pair == 0: + pair = i + break + if re.match(r"\s*\]\s+call\s+CBA_fnc_(local|global|server)Event",contents[pair+match.start(2)+1:],re.I): + event = un_capitalize(match.group(1)) + add_to_config(match.group(1), "ace_" + event) + + contents = contents[:match.start(1)] + "ace_" + event + contents[match.end(1):] + subbed += 1 + + if subbed > 0: + print("Making {0} substitutions: {1}".format(subbed,path)) + + file.seek(0) + file.write(contents) + file.truncate() + +def main(): + scriptpath = os.path.realpath(sys.argv[0]) + projectpath = os.path.dirname(os.path.dirname(scriptpath)) + addonspath = os.path.join(projectpath, "addons") + + os.chdir(addonspath) + + for p in os.listdir(addonspath): + path = os.path.join(addonspath, p) + if not os.path.isdir(path): + continue + if p[0] == ".": + continue + + process_directory(path) + +if __name__ == "__main__": + sys.exit(main())