diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index 9709508fa2..c5a8a38ed3 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -24,15 +24,15 @@ if (isServer) then { }]; }; -["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; +["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; +[QGVAR(moveInCaptive), FUNC(vehicleCaptiveMoveIn)] call CBA_fnc_addEventHandler; +[QGVAR(moveOutCaptive), FUNC(vehicleCaptiveMoveOut)] call CBA_fnc_addEventHandler; -[QGVAR(setHandcuffed), {_this call FUNC(setHandcuffed)}] call CBA_fnc_addEventHandler; -[QGVAR(setSurrendered), {_this call FUNC(setSurrendered)}] call CBA_fnc_addEventHandler; +[QGVAR(setHandcuffed), FUNC(setHandcuffed)] call CBA_fnc_addEventHandler; +[QGVAR(setSurrendered), FUNC(setSurrendered)] call CBA_fnc_addEventHandler; //Medical Integration Events -["ace_unconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call CBA_fnc_addEventHandler; +["ace_unconscious", FUNC(handleOnUnconscious)] call CBA_fnc_addEventHandler; if (!hasInterface) exitWith {}; diff --git a/addons/common/functions/fnc_assignedItemFix.sqf b/addons/common/functions/fnc_assignedItemFix.sqf index 4604e1b987..9a4ac5bf47 100644 --- a/addons/common/functions/fnc_assignedItemFix.sqf +++ b/addons/common/functions/fnc_assignedItemFix.sqf @@ -28,7 +28,7 @@ GVAR(AssignedItemsShownItems) = [ ACE_isGPSEnabled ]; -["ace_playerInventoryChanged", { +["loadout", { 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 CBA_fnc_addEventHandler; +}] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/disposable/XEH_postInit.sqf b/addons/disposable/XEH_postInit.sqf index 9c54456620..4b395c6a64 100644 --- a/addons/disposable/XEH_postInit.sqf +++ b/addons/disposable/XEH_postInit.sqf @@ -3,11 +3,11 @@ if (!hasInterface) exitWith {}; -["ace_playerInventoryChanged", { +["loadout", { params ["_unit"]; [_unit] call FUNC(takeLoadedATWeapon); [_unit] call FUNC(updateInventoryDisplay); -}] call CBA_fnc_addEventHandler; +}] call CBA_fnc_addPlayerEventHandler; // Register fire event handler // Only for the local player and for AI. Non-local players will handle it themselves diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index c9a1fbea1b..6b2fd02dde 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -20,9 +20,9 @@ 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. -["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; +["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addEventHandler; +["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; +["weapon", FUNC(handlePlayerWeaponChanged)] call CBA_fnc_addEventHandler; // handle waking up dragged unit and falling unconscious while dragging ["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; diff --git a/addons/gforces/XEH_postInit.sqf b/addons/gforces/XEH_postInit.sqf index 4401b1f5dd..9eb049c9f5 100644 --- a/addons/gforces/XEH_postInit.sqf +++ b/addons/gforces/XEH_postInit.sqf @@ -19,7 +19,7 @@ GVAR(pfID) = -1; [] call FUNC(addPFEH); TRACE_1("adding temp PFEH [start in]",GVAR(pfID)); }; - ["ace_playerVehicleChanged", { + ["vehicle", { params ["", "_vehicle"]; TRACE_2("playerVehicleChanged",_vehicle,typeOf _vehicle); if (_vehicle isKindOf "Air") then { @@ -35,5 +35,5 @@ GVAR(pfID) = -1; GVAR(pfID) = -1; }; }; - }] call CBA_fnc_addEventHandler; + }] call CBA_fnc_addPlayerEventHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 032e1316ac..ea610afff0 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -43,7 +43,7 @@ GVAR(surfaceCacheIsDust) = false; // init GlassesChanged eventhandler GVAR(OldGlasses) = ""; -["ace_playerInventoryChanged", { +["loadout", { params ["_unit"]; private _currentGlasses = goggles _unit; @@ -52,7 +52,7 @@ GVAR(OldGlasses) = ""; ["ace_glassesChanged", [_unit, _currentGlasses]] call CBA_fnc_localEvent; GVAR(OldGlasses) = _currentGlasses; }; -}] call CBA_fnc_addEventHandler; +}] call CBA_fnc_addPlayerEventHandler; // add glasses eventhandlers ["ace_glassesChanged", { @@ -110,7 +110,7 @@ private _fnc_checkGoggles = { }; }; -["ace_cameraViewChanged", _fnc_checkGoggles] call CBA_fnc_addEventHandler; +["cameraView", _fnc_checkGoggles] call CBA_fnc_addPlayerEventHandler; ["ace_activeCameraChanged", _fnc_checkGoggles] call CBA_fnc_addEventHandler; // goggles effects main PFH diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index cdf2e6d74b..34664525da 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -28,18 +28,18 @@ GVAR(volumeAttenuation) = 1; [FUNC(updateVolume), 1, [false]] call CBA_fnc_addPerFrameHandler; // Update veh attunation when player veh changes - ["ace_playerVehicleChanged", FUNC(updatePlayerVehAttenuation)] call CBA_fnc_addEventHandler; - ["ace_playerTurretChanged", FUNC(updatePlayerVehAttenuation)] call CBA_fnc_addEventHandler; + ["vehicle", FUNC(updatePlayerVehAttenuation)] call CBA_fnc_addPlayerEventHandler; + ["turret", FUNC(updatePlayerVehAttenuation)] call CBA_fnc_addPlayerEventHandler; // Reset deafness on respawn (or remote control player switch) - ["ace_playerChanged", { + ["unit", { GVAR(deafnessDV) = 0; GVAR(deafnessPrior) = 0; ACE_player setVariable [QGVAR(deaf), false]; GVAR(time3) = 0; [] call FUNC(updateHearingProtection); - }] call CBA_fnc_addEventHandler; + }] call CBA_fnc_addPlayerEventHandler; // Update protection on possible helmet change - ["ace_playerInventoryChanged", {[] call FUNC(updateHearingProtection);}] call CBA_fnc_addEventHandler; + ["loadout", FUNC(updateHearingProtection)] call CBA_fnc_addPlayerEventHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 30277ed877..e4b7655efc 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -54,7 +54,7 @@ GVAR(ParsedTextCached) = []; }] call CBA_fnc_addEventHandler; // disable firing while the interact menu is is is opened -["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; +["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; // background options ["ace_interactMenuOpened", { diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index f598266695..3d8525f20d 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -100,12 +100,12 @@ call FUNC(determineZoom); GVAR(flashlightInUse) = ""; GVAR(glow) = objNull; - ["ace_playerInventoryChanged", { + ["loadout", { private _flashlights = [ACE_player] call FUNC(getUnitFlashlights); if ((GVAR(flashlightInUse) != "") && !(GVAR(flashlightInUse) in _flashlights)) then { GVAR(flashlightInUse) = ""; }; - }] call CBA_fnc_addEventHandler; + }] call CBA_fnc_addPlayerEventHandler; if (GVAR(mapGlow)) then { ["ace_visibleMapChanged", { @@ -136,7 +136,7 @@ call FUNC(determineZoom); // hide clock on map if player has no watch GVAR(hasWatch) = true; -["ace_playerInventoryChanged", { +["loadout", { 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 CBA_fnc_addEventHandler; +}] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index c362640bd7..1c0c93d93c 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -297,7 +297,7 @@ GVAR(lastHeartBeatSound) = CBA_missionTime; ["isNotUnconscious", {!((_this select 0) getVariable ["ACE_isUnconscious", false])}] call EFUNC(common,addCanInteractWithCondition); // Item Event Handler -["ace_playerInventoryChanged", FUNC(itemCheck)] call CBA_fnc_addEventHandler; +["loadout", FUNC(itemCheck)] call CBA_fnc_addPlayerEventHandler; if (hasInterface) then { ["ace_playerJIP", { diff --git a/addons/mk6mortar/XEH_postInit.sqf b/addons/mk6mortar/XEH_postInit.sqf index 594b0cc231..aceb721d70 100644 --- a/addons/mk6mortar/XEH_postInit.sqf +++ b/addons/mk6mortar/XEH_postInit.sqf @@ -19,5 +19,5 @@ if (!hasInterface) exitWith {}; -["ace_playerVehicleChanged", FUNC(handlePlayerVehicleChanged)] call CBA_fnc_addEventHandler; +["vehicle", FUNC(handlePlayerVehicleChanged)] call CBA_fnc_addPlayerEventHandler; ["ace_infoDisplayChanged", FUNC(turretDisplayLoaded)] call CBA_fnc_addEventHandler; diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index b0db0d3681..f64b92603b 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -3,8 +3,8 @@ if (!hasInterface) exitWith {}; -["ace_playerChanged", FUNC(handleVirtualMass)] call CBA_fnc_addEventHandler; -["ace_playerInventoryChanged", FUNC(handleVirtualMass)] call CBA_fnc_addEventHandler; +["unit", FUNC(handleVirtualMass)] call CBA_fnc_addPlayerEventHandler; +["loadout", FUNC(handleVirtualMass)] call CBA_fnc_addPlayerEventHandler; ["ACE3 Movement", QGVAR(climb), localize LSTRING(Climb), { // Conditions: canInteract diff --git a/addons/nametags/functions/fnc_initIsSpeaking.sqf b/addons/nametags/functions/fnc_initIsSpeaking.sqf index 1e6484c7fa..08a72e57b3 100644 --- a/addons/nametags/functions/fnc_initIsSpeaking.sqf +++ b/addons/nametags/functions/fnc_initIsSpeaking.sqf @@ -28,14 +28,13 @@ if (isServer) then { if (!hasInterface) exitWith {}; -["ace_playerChanged", { +["unit", { //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 CBA_fnc_addEventHandler; - +}] call CBA_fnc_addPlayerEventHandler; if (isClass (configFile >> "CfgPatches" >> "acre_api")) then { ACE_LOGINFO("ACRE Detected."); diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 186412cdde..de0b629d76 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -29,22 +29,16 @@ GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; // Setup the event handlers -["ace_playerInventoryChanged", FUNC(updatePPEffects)] call CBA_fnc_addEventHandler; -["ace_playerVisionModeChanged", { - _this call FUNC(updatePPEffects); - _this call FUNC(onVisionModeChanged); -}] call CBA_fnc_addEventHandler; - -["ace_cameraViewChanged", { - _this call FUNC(updatePPEffects); - _this call FUNC(onCameraViewChanged); -}] call CBA_fnc_addEventHandler; -["ace_playerVehicleChanged", {_this call FUNC(updatePPEffects)}] call CBA_fnc_addEventHandler; -["ace_playerTurretChanged", {_this call FUNC(updatePPEffects)}] call CBA_fnc_addEventHandler; +["loadout", FUNC(updatePPEffects)] call CBA_fnc_addPlayerEventHandler; +["visionMode", FUNC(updatePPEffects)] call CBA_fnc_addPlayerEventHandler; +["visionMode", FUNC(onVisionModeChanged)] call CBA_fnc_addPlayerEventHandler; +["cameraView", FUNC(updatePPEffects)] call CBA_fnc_addPlayerEventHandler; +["cameraView", FUNC(onCameraViewChanged)] call CBA_fnc_addPlayerEventHandler; +["vehicle", FUNC(updatePPEffects)] call CBA_fnc_addPlayerEventHandler; +["turret", FUNC(updatePPEffects)] call CBA_fnc_addPlayerEventHandler; // Add keybinds -["ACE3 Equipment", QGVAR(IncreaseNVGBrightness), localize LSTRING(IncreaseNVGBrightness), -{ +["ACE3 Equipment", QGVAR(IncreaseNVGBrightness), localize LSTRING(IncreaseNVGBrightness), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -53,12 +47,9 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; // Statement [ACE_player, 1] call FUNC(changeNVGBrightness); true -}, -{false}, -[201, [false, false, true]], false] call CBA_fnc_addKeybind; //PageUp + ALT +}, {false}, [201, [false, false, true]], false] call CBA_fnc_addKeybind; //PageUp + ALT -["ACE3 Equipment", QGVAR(DecreaseNVGBrightness), localize LSTRING(DecreaseNVGBrightness), -{ +["ACE3 Equipment", QGVAR(DecreaseNVGBrightness), localize LSTRING(DecreaseNVGBrightness), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -67,9 +58,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; // Statement [ACE_player, -1] call FUNC(changeNVGBrightness); true -}, -{false}, -[209, [false, false, true]], false] call CBA_fnc_addKeybind; //PageDown + ALT +}, {false}, [209, [false, false, true]], false] call CBA_fnc_addKeybind; //PageDown + ALT // Register fire event handler ["ace_firedPlayer", DFUNC(blending)] call CBA_fnc_addEventHandler; diff --git a/addons/noradio/XEH_postInit.sqf b/addons/noradio/XEH_postInit.sqf index 1606c674a9..e3b98f1a3a 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 -["ace_playerChanged", { +["unit", { 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 CBA_fnc_addEventHandler; +}] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index 799acf92b6..1570d3cd98 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -17,8 +17,7 @@ if (!hasInterface) exitWith {}; -["ACE3 Equipment", QGVAR(showAltimeter), localize LSTRING(showAltimeter), -{ +["ACE3 Equipment", QGVAR(showAltimeter), localize LSTRING(showAltimeter), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false}; @@ -28,19 +27,17 @@ if (!hasInterface) exitWith {}; call FUNC(hideAltimeter); }; true -}, -{false}, -[24, [false, false, false]], false] call CBA_fnc_addKeybind; +}, {false}, [24, [false, false, false]], false] call CBA_fnc_addKeybind; GVAR(PFH) = false; -["ace_playerVehicleChanged",{ +["vehicle",{ if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then { GVAR(PFH) = true; [FUNC(onEachFrame), 0.1, []] call CALLSTACK(CBA_fnc_addPerFrameHandler); }; -}] call CBA_fnc_addEventHandler; +}] call CBA_fnc_addPlayerEventHandler; // don't show speed and height when in expert mode ["ace_infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call CBA_fnc_addEventHandler; -["ace_playerInventoryChanged", FUNC(storeParachute)] call CBA_fnc_addEventHandler; +["loadout", FUNC(storeParachute)] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/rearm/XEH_postInit.sqf b/addons/rearm/XEH_postInit.sqf index acf8d2156b..cfbbdf9d4d 100644 --- a/addons/rearm/XEH_postInit.sqf +++ b/addons/rearm/XEH_postInit.sqf @@ -1,7 +1,10 @@ #include "script_component.hpp" ["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; -["ace_playerVehicleChanged", {params ["_unit"]; [_unit] call FUNC(dropAmmo)}] call CBA_fnc_addEventHandler; +["vehicle", { + params ["_unit"]; + [_unit] call FUNC(dropAmmo); +}] call CBA_fnc_addPlayerEventHandler; if (isServer) then { addMissionEventHandler ["HandleDisconnect", {params ["_unit"]; [_unit] call FUNC(dropAmmo)}]; diff --git a/addons/respawn/XEH_postInit.sqf b/addons/respawn/XEH_postInit.sqf index f589d5abac..6c1b1e9961 100644 --- a/addons/respawn/XEH_postInit.sqf +++ b/addons/respawn/XEH_postInit.sqf @@ -1,7 +1,7 @@ // by commy2 #include "script_component.hpp" -["ace_rallypointMoved", {_this call FUNC(updateRallypoint)}] call CBA_fnc_addEventHandler; -["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; // hide enemy rallypoint markers +["ace_rallypointMoved", FUNC(updateRallypoint)] call CBA_fnc_addEventHandler; +["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; // hide enemy rallypoint markers -[QGVAR(showFriendlyFireMessageEvent), DFUNC(showFriendlyFireMessage)] call CBA_fnc_addEventHandler; +[QGVAR(showFriendlyFireMessageEvent), FUNC(showFriendlyFireMessage)] call CBA_fnc_addEventHandler; diff --git a/addons/sandbag/XEH_postInit.sqf b/addons/sandbag/XEH_postInit.sqf index 0bc5b6d2b1..a03f6076a1 100644 --- a/addons/sandbag/XEH_postInit.sqf +++ b/addons/sandbag/XEH_postInit.sqf @@ -15,9 +15,9 @@ GVAR(deployDirection) = 0; ["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. -["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; +["unit", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addPlayerEventHandler; +["loadout", {_this call FUNC(handlePlayerInventoryChanged)}] call CBA_fnc_addPlayerEventHandler; +["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addPlayerEventHandler; // handle waking up dragged unit and falling unconscious while dragging ["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 4ebfe39bf3..bef16a0bc1 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -10,28 +10,25 @@ if (!hasInterface) exitWith {}; // Check inventory when it changes -["ace_playerInventoryChanged", FUNC(inventoryCheck)] call CBA_fnc_addEventHandler; +["loadout", FUNC(inventoryCheck)] call CBA_fnc_addPlayerEventHandler; // Instantly hide knobs when scoping in -["ace_cameraViewChanged", { - EXPLODE_2_PVT(_this,_player,_newCameraView); - if (_newCameraView == "GUNNER") then { - private "_layer"; - _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; - _layer cutText ["", "PLAIN", 0]; +["cameraView", { + params ["_player", "_newCameraView"]; + if (_newCameraView == "GUNNER") then { + private _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; + _layer cutText ["", "PLAIN", 0]; if !(isNil QGVAR(fadePFH)) then { [GVAR(fadePFH)] call CBA_fnc_removePerFrameHandler; GVAR(fadePFH) = nil; }; }; -}] call CBA_fnc_addEventHandler; - +}] call CBA_fnc_addPlayerEventHandler; // Add keybinds -["ACE3 Scope Adjustment", QGVAR(AdjustUpMinor), localize LSTRING(AdjustUpMinor), -{ +["ACE3 Scope Adjustment", QGVAR(AdjustUpMinor), localize LSTRING(AdjustUpMinor), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -41,12 +38,9 @@ if (!hasInterface) exitWith {}; // Statement [ACE_player, ELEVATION_UP, MINOR_INCREMENT] call FUNC(adjustScope); -}, -{false}, -[201, [false, false, false]], true] call CBA_fnc_addKeybind; +}, {false}, [201, [false, false, false]], true] call CBA_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustDownMinor), localize LSTRING(AdjustDownMinor), -{ +["ACE3 Scope Adjustment", QGVAR(AdjustDownMinor), localize LSTRING(AdjustDownMinor), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -56,12 +50,9 @@ if (!hasInterface) exitWith {}; // Statement [ACE_player, ELEVATION_DOWN, MINOR_INCREMENT] call FUNC(adjustScope); -}, -{false}, -[209, [false, false, false]], true] call CBA_fnc_addKeybind; +}, {false}, [209, [false, false, false]], true] call CBA_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustLeftMinor), localize LSTRING(AdjustLeftMinor), -{ +["ACE3 Scope Adjustment", QGVAR(AdjustLeftMinor), localize LSTRING(AdjustLeftMinor), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -71,12 +62,9 @@ if (!hasInterface) exitWith {}; // Statement [ACE_player, WINDAGE_LEFT, MINOR_INCREMENT] call FUNC(adjustScope); -}, -{false}, -[209, [false, true, false]], true] call CBA_fnc_addKeybind; +}, {false}, [209, [false, true, false]], true] call CBA_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustRightMinor), localize LSTRING(AdjustRightMinor), -{ +["ACE3 Scope Adjustment", QGVAR(AdjustRightMinor), localize LSTRING(AdjustRightMinor), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -86,12 +74,9 @@ if (!hasInterface) exitWith {}; // Statement [ACE_player, WINDAGE_RIGHT, MINOR_INCREMENT] call FUNC(adjustScope); -}, -{false}, -[201, [false, true, false]], true] call CBA_fnc_addKeybind; +}, {false}, [201, [false, true, false]], true] call CBA_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustUpMajor), localize LSTRING(AdjustUpMajor), -{ +["ACE3 Scope Adjustment", QGVAR(AdjustUpMajor), localize LSTRING(AdjustUpMajor), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -101,12 +86,9 @@ if (!hasInterface) exitWith {}; // Statement [ACE_player, ELEVATION_UP, MAJOR_INCREMENT] call FUNC(adjustScope); -}, -{false}, -[201, [true, false, false]], true] call CBA_fnc_addKeybind; +}, {false}, [201, [true, false, false]], true] call CBA_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustDownMajor), localize LSTRING(AdjustDownMajor), -{ +["ACE3 Scope Adjustment", QGVAR(AdjustDownMajor), localize LSTRING(AdjustDownMajor), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -116,12 +98,9 @@ if (!hasInterface) exitWith {}; // Statement [ACE_player, ELEVATION_DOWN, MAJOR_INCREMENT] call FUNC(adjustScope); -}, -{false}, -[209, [true, false, false]], true] call CBA_fnc_addKeybind; +}, {false}, [209, [true, false, false]], true] call CBA_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustLeftMajor), localize LSTRING(AdjustLeftMajor), -{ +["ACE3 Scope Adjustment", QGVAR(AdjustLeftMajor), localize LSTRING(AdjustLeftMajor), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -131,12 +110,9 @@ if (!hasInterface) exitWith {}; // Statement [ACE_player, WINDAGE_LEFT, MAJOR_INCREMENT] call FUNC(adjustScope); -}, -{false}, -[209, [true, true, false]], true] call CBA_fnc_addKeybind; +}, {false}, [209, [true, true, false]], true] call CBA_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustRightMajor), localize LSTRING(AdjustRightMajor), -{ +["ACE3 Scope Adjustment", QGVAR(AdjustRightMajor), localize LSTRING(AdjustRightMajor), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -146,9 +122,7 @@ if (!hasInterface) exitWith {}; // Statement [ACE_player, WINDAGE_RIGHT, MAJOR_INCREMENT] call FUNC(adjustScope); -}, -{false}, -[201, [true, true, false]], true] call CBA_fnc_addKeybind; +}, {false}, [201, [true, true, false]], true] call CBA_fnc_addKeybind; // Register fire event handler diff --git a/addons/tacticalladder/XEH_postInit.sqf b/addons/tacticalladder/XEH_postInit.sqf index 723c5b1421..1a6f356fb0 100644 --- a/addons/tacticalladder/XEH_postInit.sqf +++ b/addons/tacticalladder/XEH_postInit.sqf @@ -17,8 +17,8 @@ GVAR(currentAngle) = 0; ["ace_interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call CBA_fnc_addEventHandler; // Cancel adjusting on player change. -["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; -["ace_playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; +["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; +["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addPlayerEventHandler; // handle falling unconscious ["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; diff --git a/addons/trenches/XEH_postInit.sqf b/addons/trenches/XEH_postInit.sqf index af6038d992..1fbfa24116 100644 --- a/addons/trenches/XEH_postInit.sqf +++ b/addons/trenches/XEH_postInit.sqf @@ -16,9 +16,9 @@ GVAR(digDirection) = 0; ["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. -["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; +["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; +["loadout", FUNC(handlePlayerInventoryChanged)] call CBA_fnc_addPlayerEventHandler; +["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addPlayerEventHandler; // handle waking up dragged unit and falling unconscious while dragging ["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; diff --git a/addons/tripod/XEH_postInit.sqf b/addons/tripod/XEH_postInit.sqf index df62d653ab..86fda03b48 100644 --- a/addons/tripod/XEH_postInit.sqf +++ b/addons/tripod/XEH_postInit.sqf @@ -10,8 +10,8 @@ GVAR(height) = 0; ["ace_interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call CBA_fnc_addEventHandler; // Cancel adjusting on player change. -["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; -["ace_playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; +["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; +["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addPlayerEventHandler; // handle falling unconscious ["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; diff --git a/addons/viewdistance/XEH_clientInit.sqf b/addons/viewdistance/XEH_clientInit.sqf index 2572931935..1fed0bd818 100644 --- a/addons/viewdistance/XEH_clientInit.sqf +++ b/addons/viewdistance/XEH_clientInit.sqf @@ -23,7 +23,7 @@ if (!hasInterface) exitWith {}; // 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) - ["ace_playerVehicleChanged",{ + ["vehicle",{ [false] call FUNC(adaptViewDistance); - }] call CBA_fnc_addEventHandler; + }] call CBA_fnc_addPlayerEventHandler; }] call CBA_fnc_addEventHandler;