convert common events to CBA playerEvents

This commit is contained in:
commy2 2016-06-22 01:39:20 +02:00
parent e298f5c71b
commit 89ecc81111
24 changed files with 94 additions and 132 deletions

View File

@ -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 {};

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -43,7 +43,7 @@ GVAR(surfaceCacheIsDust) = false;
// init GlassesChanged eventhandler
GVAR(OldGlasses) = "<null>";
["ace_playerInventoryChanged", {
["loadout", {
params ["_unit"];
private _currentGlasses = goggles _unit;
@ -52,7 +52,7 @@ GVAR(OldGlasses) = "<null>";
["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

View File

@ -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;

View File

@ -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", {

View File

@ -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;

View File

@ -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", {

View File

@ -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;

View File

@ -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

View File

@ -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.");

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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)}];

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;