mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
#1965 - Mouse cooldown for click to interact option
This commit is contained in:
parent
19a4f3fbb1
commit
c5a371e9b6
@ -71,7 +71,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
||||
private["_angle", "_dir", "_screenPos", "_realDistance", "_up", "_virtualPos", "_virtualPosASL", "_lineInterection"];
|
||||
|
||||
PARAMS_2(_args,_pfID);
|
||||
EXPLODE_6_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_actionID);
|
||||
EXPLODE_7_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_actionID,_startDiagTime);
|
||||
|
||||
_virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]);
|
||||
if (cameraView == "EXTERNAL") then {
|
||||
@ -80,8 +80,10 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
||||
_virtualPos = _virtualPosASL call EFUNC(common,ASLToPosition);
|
||||
_lineInterection = lineIntersects [eyePos ACE_player, _virtualPosASL, ACE_player];
|
||||
|
||||
//Don't allow placing in a bad position:
|
||||
if (_lineInterection && {GVAR(placeAction) == PLACE_APPROVE}) then {GVAR(placeAction) = PLACE_WAITING;};
|
||||
//Don't allow placing in a bad position or placing right away (click to interact option)
|
||||
if ((GVAR(placeAction) == PLACE_APPROVE) && {_lineInterection || {ACE_diagTime < (_startDiagTime + 0.333)}}) then {
|
||||
GVAR(placeAction) = PLACE_WAITING;
|
||||
};
|
||||
|
||||
if ((GVAR(placeAction) != PLACE_WAITING) ||
|
||||
{_unit != ACE_player} ||
|
||||
@ -118,5 +120,5 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
||||
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModelDirAndUp [[1,0,0], _up];
|
||||
};
|
||||
};
|
||||
}, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _actionID]] call CBA_fnc_addPerFrameHandler;
|
||||
}, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _actionID, ACE_diagTime]] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user