mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
vehicleLock - Use QGVAR
This commit is contained in:
parent
fef50ae48f
commit
87ee34ba35
@ -3,14 +3,14 @@
|
|||||||
class ACE_unlockVehicle { \
|
class ACE_unlockVehicle { \
|
||||||
displayName = CSTRING(Action_UnLock); \
|
displayName = CSTRING(Action_UnLock); \
|
||||||
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \
|
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \
|
||||||
statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [ARR_2(_target,false)], [_target])] call CBA_fnc_targetEvent); \
|
statement = QUOTE([ARR_3(QUOTE(QGVAR(setVehicleLock)), [ARR_2(_target,false)], [_target])] call CBA_fnc_targetEvent); \
|
||||||
priority = 0.3; \
|
priority = 0.3; \
|
||||||
icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \
|
icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \
|
||||||
}; \
|
}; \
|
||||||
class ACE_lockVehicle { \
|
class ACE_lockVehicle { \
|
||||||
displayName = CSTRING(Action_Lock); \
|
displayName = CSTRING(Action_Lock); \
|
||||||
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \
|
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \
|
||||||
statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [ARR_2(_target,true)], [_target])] call CBA_fnc_targetEvent); \
|
statement = QUOTE([ARR_3(QUOTE(QGVAR(setVehicleLock)), [ARR_2(_target,true)], [_target])] call CBA_fnc_targetEvent); \
|
||||||
priority = 0.2; \
|
priority = 0.2; \
|
||||||
icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \
|
icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \
|
||||||
}; \
|
}; \
|
||||||
@ -27,7 +27,7 @@
|
|||||||
displayName = CSTRING(Action_UnLock); \
|
displayName = CSTRING(Action_UnLock); \
|
||||||
distance = 4; \
|
distance = 4; \
|
||||||
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \
|
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \
|
||||||
statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [ARR_2(_target,false)], [_target])] call CBA_fnc_targetEvent); \
|
statement = QUOTE([ARR_3(QUOTE(QGVAR(setVehicleLock)), [ARR_2(_target,false)], [_target])] call CBA_fnc_targetEvent); \
|
||||||
priority = 0.3; \
|
priority = 0.3; \
|
||||||
icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \
|
icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \
|
||||||
}; \
|
}; \
|
||||||
@ -35,7 +35,7 @@
|
|||||||
displayName = CSTRING(Action_Lock); \
|
displayName = CSTRING(Action_Lock); \
|
||||||
distance = 4; \
|
distance = 4; \
|
||||||
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \
|
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \
|
||||||
statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [ARR_2(_target,true)], [_target])] call CBA_fnc_targetEvent); \
|
statement = QUOTE([ARR_3(QUOTE(QGVAR(setVehicleLock)), [ARR_2(_target,true)], [_target])] call CBA_fnc_targetEvent); \
|
||||||
priority = 0.2; \
|
priority = 0.2; \
|
||||||
icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \
|
icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \
|
||||||
}; \
|
}; \
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
//Add Event Handlers
|
//Add Event Handlers
|
||||||
["ace_vehicleLock_SetupCustomKey", {_this call FUNC(serverSetupCustomKeyEH)}] call CBA_fnc_addEventHandler;
|
[QGVAR(setupCustomKey), {_this call FUNC(serverSetupCustomKeyEH)}] call CBA_fnc_addEventHandler;
|
||||||
["ace_vehicleLock_SetVehicleLock", {_this call FUNC(setVehicleLockEH)}] call CBA_fnc_addEventHandler;
|
[QGVAR(setVehicleLock), {_this call FUNC(setVehicleLockEH)}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
if (!hasInterface) exitwith {};
|
if (!hasInterface) exitwith {};
|
||||||
|
|
||||||
|
@ -20,6 +20,6 @@ class CfgPatches {
|
|||||||
|
|
||||||
class ACE_newEvents {
|
class ACE_newEvents {
|
||||||
SettingsInitialized = "ace_settingsInitialized";
|
SettingsInitialized = "ace_settingsInitialized";
|
||||||
VehicleLock_SetVehicleLock = "ace_vehicleLock_SetVehicleLock";
|
VehicleLock_SetVehicleLock = QGVAR(setVehicleLock);
|
||||||
VehicleLock_SetupCustomKey = "ace_vehicleLock_SetupCustomKey";
|
VehicleLock_SetupCustomKey = QGVAR(setupCustomKey);
|
||||||
};
|
};
|
||||||
|
@ -36,7 +36,7 @@ if (_useCustom) then {
|
|||||||
_keyMagazine = _newMags select 0;
|
_keyMagazine = _newMags select 0;
|
||||||
TRACE_2("setting up key on server",_veh,_keyMagazine);
|
TRACE_2("setting up key on server",_veh,_keyMagazine);
|
||||||
//Have the server run add the key to the vehicle's key array:
|
//Have the server run add the key to the vehicle's key array:
|
||||||
["ace_vehicleLock_SetupCustomKey", [_veh, _keyMagazine]] call CBA_fnc_serverEvent;
|
[QGVAR(setupCustomKey), [_veh, _keyMagazine]] call CBA_fnc_serverEvent;
|
||||||
} else {
|
} else {
|
||||||
_keyName = [_veh] call FUNC(getVehicleSideKey);
|
_keyName = [_veh] call FUNC(getVehicleSideKey);
|
||||||
_unit addItem _keyName; //addItem has global effects
|
_unit addItem _keyName; //addItem has global effects
|
||||||
|
@ -38,7 +38,7 @@ TRACE_1("params",_vehicle);
|
|||||||
};
|
};
|
||||||
if ((_lock && {(locked _vehicle) != 2}) || {!_lock && {(locked _vehicle) != 0}}) then {
|
if ((_lock && {(locked _vehicle) != 2}) || {!_lock && {(locked _vehicle) != 0}}) then {
|
||||||
TRACE_3("Setting Lock State",_lock,(typeOf _vehicle),_vehicle);
|
TRACE_3("Setting Lock State",_lock,(typeOf _vehicle),_vehicle);
|
||||||
["ace_vehicleLock_SetVehicleLock", [_vehicle, _lock], [_vehicle]] call CBA_fnc_targetEvent;
|
[QGVAR(SetVehicleLock), [_vehicle, _lock], [_vehicle]] call CBA_fnc_targetEvent;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
//Delay call until mission start (so everyone has the eventHandler's installed)
|
//Delay call until mission start (so everyone has the eventHandler's installed)
|
||||||
|
@ -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);
|
[_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize LSTRING(Action_LockpickInUse)), _condition] call EFUNC(common,progressBar);
|
||||||
};
|
};
|
||||||
case "finishLockpick": {
|
case "finishLockpick": {
|
||||||
["ace_vehicleLock_SetVehicleLock", [_veh, false], [_veh]] call CBA_fnc_targetEvent;
|
[QGVAR(setVehicleLock), [_veh, false], [_veh]] call CBA_fnc_targetEvent;
|
||||||
};
|
};
|
||||||
default {
|
default {
|
||||||
ERROR("bad function type");
|
ERROR("bad function type");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: PabstMirror
|
* 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:
|
* Arguments:
|
||||||
* 0: Vehicle <OBJECT>
|
* 0: Vehicle <OBJECT>
|
||||||
|
Loading…
Reference in New Issue
Block a user