Fix Interaction

This commit is contained in:
PabstMirror 2015-01-30 16:11:16 -06:00
parent 08763b6b9f
commit 7519fefee9
3 changed files with 11 additions and 9 deletions

View File

@ -7,22 +7,23 @@
class ACE_Actions { \ class ACE_Actions { \
class GVAR(AttachVehicle) { \ class GVAR(AttachVehicle) { \
displayName = "$STR_ACE_Attach_AttachDetach"; \ displayName = "$STR_ACE_Attach_AttachDetach"; \
condition = QUOTE( [ARR_3(_player, _target, '')] call FUNC(canAttach) ); \ condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI); ); \ statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
exceptions[] = {"ACE_Drag_isNotDragging"}; \ exceptions[] = {"ACE_Drag_isNotDragging"}; \
showDisabled = 0; \ showDisabled = 0; \
priority = 0; \ priority = 0; \
icon = PATHTOF(UI\attach_ca.paa); \ icon = PATHTOF(UI\attach_ca.paa); \
hotkey = "T"; \ distance = 4; \
}; \ }; \
class GVAR(DetachVehicle) { \ class GVAR(DetachVehicle) { \
displayName = "$STR_ACE_Attach_Detach"; \ displayName = "$STR_ACE_Attach_Detach"; \
condition = QUOTE( [ARR_2(_player, _target)] call FUNC(canDetach) ); \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \ statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
exceptions[] = {"ACE_Drag_isNotDragging"}; \ exceptions[] = {"ACE_Drag_isNotDragging"}; \
showDisabled = 0; \ showDisabled = 0; \
priority = 0; \ priority = 0; \
icon = PATHTOF(UI\detach_ca.paa); \ icon = PATHTOF(UI\detach_ca.paa); \
distance = 4; \
}; \ }; \
}; };
@ -52,7 +53,7 @@ class CfgVehicles {
class ACE_Equipment { class ACE_Equipment {
class GVAR(Attach) { class GVAR(Attach) {
displayName = "$STR_ACE_Attach_AttachDetach"; displayName = "$STR_ACE_Attach_AttachDetach";
condition = QUOTE( [ARR_3(_player, _player, '')] call FUNC(canAttach) ); condition = QUOTE(([ARR_3(_player, _player, '')] call FUNC(canAttach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); ); statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); );
exceptions[] = {"ACE_Drag_isNotDragging"}; exceptions[] = {"ACE_Drag_isNotDragging"};
showDisabled = 0; showDisabled = 0;
@ -62,7 +63,7 @@ class CfgVehicles {
}; };
class GVAR(Detach) { class GVAR(Detach) {
displayName = "$STR_ACE_Attach_Detach"; displayName = "$STR_ACE_Attach_Detach";
condition = QUOTE( [ARR_2(_player, _player)] call FUNC(canDetach) ); condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canDetach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) ); statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) );
exceptions[] = {"ACE_Drag_isNotDragging"}; exceptions[] = {"ACE_Drag_isNotDragging"};
showDisabled = 0; showDisabled = 0;

View File

@ -78,7 +78,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment
}] call BIS_fnc_addStackedEventHandler; }] call BIS_fnc_addStackedEventHandler;
//had to spawn the mouseHint, not sure why //had to spawn the mouseHint, not sure why
[localize "STR_ACE_Attach_PlaceAction", localize "STR_ACE_Attach_CancelAction"] call EFUNC(interaction,showMouseHint); [localize "STR_ACE_Attach_PlaceAction", localize "STR_ACE_Attach_CancelAction"] spawn EFUNC(interaction,showMouseHint);
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {GVAR(pfeh_running) AND !isNull (GVAR(setupObject))}, {call FUNC(placeApprove);}] call EFUNC(common,AddActionEventHandler)]; _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {GVAR(pfeh_running) AND !isNull (GVAR(setupObject))}, {call FUNC(placeApprove);}] call EFUNC(common,AddActionEventHandler)];
_unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {GVAR(pfeh_running) AND !isNull (GVAR(setupObject))}, {call FUNC(placeCancel);}] call EFUNC(common,AddActionEventHandler)]; _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {GVAR(pfeh_running) AND !isNull (GVAR(setupObject))}, {call FUNC(placeCancel);}] call EFUNC(common,AddActionEventHandler)];
}; };

View File

@ -6,7 +6,8 @@ Author: eRazeri and CAA-Picard
Detach an item from a unit Detach an item from a unit
Arguments: Arguments:
unit 0: OBJECT - unit doing the attaching (player)
1: OBJECT - vehicle that it will be detached from (player or vehicle)
Return Value: Return Value:
none none
@ -14,7 +15,7 @@ none
private ["_itemName", "_count", "_attachedItem", "_fnc_detachDelay"]; private ["_itemName", "_count", "_attachedItem", "_fnc_detachDelay"];
PARAMS_2(_unit, _attachToVehicle); PARAMS_2(_unit,_attachToVehicle);
_attachedObjectsArray = _attachToVehicle getVariable ["ACE_AttachedObjects", []]; _attachedObjectsArray = _attachToVehicle getVariable ["ACE_AttachedObjects", []];
_attachedItemsArray = _attachToVehicle getVariable ["ACE_AttachedItemNames", []]; _attachedItemsArray = _attachToVehicle getVariable ["ACE_AttachedItemNames", []];