mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
#1785 - Handle option for all "deploy" actions
This commit is contained in:
parent
c5a371e9b6
commit
5bcc867bac
@ -51,8 +51,12 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
|||||||
|
|
||||||
[_unit, QGVAR(vehAttach), true] call EFUNC(common,setForceWalkStatus);
|
[_unit, QGVAR(vehAttach), true] call EFUNC(common,setForceWalkStatus);
|
||||||
|
|
||||||
[{[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint)}, []] call EFUNC(common,execNextFrame);
|
[{ //wait a frame to handle "Do When releasing action menu key"
|
||||||
|
PARAMS_1(_unit);
|
||||||
|
if (GVAR(placeAction) != PLACE_WAITING) exitWith {};
|
||||||
|
[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint);
|
||||||
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)];
|
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)];
|
||||||
|
}, [_unit]] call EFUNC(common,execNextFrame);
|
||||||
|
|
||||||
_actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize LSTRING(CancelAction)], {GVAR(placeAction) = PLACE_CANCEL}];
|
_actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize LSTRING(CancelAction)], {GVAR(placeAction) = PLACE_CANCEL}];
|
||||||
|
|
||||||
@ -71,7 +75,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
|||||||
private["_angle", "_dir", "_screenPos", "_realDistance", "_up", "_virtualPos", "_virtualPosASL", "_lineInterection"];
|
private["_angle", "_dir", "_screenPos", "_realDistance", "_up", "_virtualPos", "_virtualPosASL", "_lineInterection"];
|
||||||
|
|
||||||
PARAMS_2(_args,_pfID);
|
PARAMS_2(_args,_pfID);
|
||||||
EXPLODE_7_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_actionID,_startDiagTime);
|
EXPLODE_6_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_actionID);
|
||||||
|
|
||||||
_virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]);
|
_virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]);
|
||||||
if (cameraView == "EXTERNAL") then {
|
if (cameraView == "EXTERNAL") then {
|
||||||
@ -80,10 +84,8 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
|||||||
_virtualPos = _virtualPosASL call EFUNC(common,ASLToPosition);
|
_virtualPos = _virtualPosASL call EFUNC(common,ASLToPosition);
|
||||||
_lineInterection = lineIntersects [eyePos ACE_player, _virtualPosASL, ACE_player];
|
_lineInterection = lineIntersects [eyePos ACE_player, _virtualPosASL, ACE_player];
|
||||||
|
|
||||||
//Don't allow placing in a bad position or placing right away (click to interact option)
|
//Don't allow placing in a bad position:
|
||||||
if ((GVAR(placeAction) == PLACE_APPROVE) && {_lineInterection || {ACE_diagTime < (_startDiagTime + 0.333)}}) then {
|
if (_lineInterection && {GVAR(placeAction) == PLACE_APPROVE}) then {GVAR(placeAction) = PLACE_WAITING;};
|
||||||
GVAR(placeAction) = PLACE_WAITING;
|
|
||||||
};
|
|
||||||
|
|
||||||
if ((GVAR(placeAction) != PLACE_WAITING) ||
|
if ((GVAR(placeAction) != PLACE_WAITING) ||
|
||||||
{_unit != ACE_player} ||
|
{_unit != ACE_player} ||
|
||||||
@ -120,5 +122,5 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
|||||||
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModelDirAndUp [[1,0,0], _up];
|
((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModelDirAndUp [[1,0,0], _up];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _actionID, ACE_diagTime]] call CBA_fnc_addPerFrameHandler;
|
}, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _actionID]] call CBA_fnc_addPerFrameHandler;
|
||||||
};
|
};
|
||||||
|
@ -37,7 +37,7 @@ deleteVehicle _wirecoil;
|
|||||||
_unit setVariable [QGVAR(wireDeployed), false];
|
_unit setVariable [QGVAR(wireDeployed), false];
|
||||||
|
|
||||||
GVAR(deployPFH) = [{
|
GVAR(deployPFH) = [{
|
||||||
EXPLODE_4_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit,_action);
|
EXPLODE_3_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit);
|
||||||
|
|
||||||
private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"];
|
private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"];
|
||||||
_posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL);
|
_posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL);
|
||||||
@ -73,12 +73,13 @@ GVAR(deployPFH) = [{
|
|||||||
{
|
{
|
||||||
_wireNoGeo animate [_x, _anim];
|
_wireNoGeo animate [_x, _anim];
|
||||||
} foreach WIRE_FAST;
|
} foreach WIRE_FAST;
|
||||||
}, 0, [_wireNoGeo, _wireNoGeoPos, _unit, _action]] call CBA_fnc_addPerFrameHandler;
|
}, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
[localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint);
|
[localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint);
|
||||||
|
[{ //wait a frame to handle "Do When releasing action menu key" option
|
||||||
GVAR(placer) setVariable [QGVAR(Deploy),
|
GVAR(placer) setVariable [QGVAR(Deploy),
|
||||||
[GVAR(placer), "DefaultAction",
|
[GVAR(placer), "DefaultAction",
|
||||||
{GVAR(deployPFH) != -1},
|
{GVAR(deployPFH) != -1},
|
||||||
{GVAR(placer) setVariable [QGVAR(wireDeployed), true]}
|
{GVAR(placer) setVariable [QGVAR(wireDeployed), true]}
|
||||||
] call EFUNC(common,AddActionEventHandler)];
|
] call EFUNC(common,AddActionEventHandler)];
|
||||||
|
}, _this] call EFUNC(common,execNextFrame);
|
||||||
|
@ -34,14 +34,17 @@ GVAR(deployPFH) = [{
|
|||||||
|
|
||||||
[localize LSTRING(ConfirmDeployment), localize LSTRING(CancelDeployment), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint);
|
[localize LSTRING(ConfirmDeployment), localize LSTRING(CancelDeployment), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint);
|
||||||
|
|
||||||
GVAR(placer) setVariable [QGVAR(Deploy),
|
[{ //wait a frame to handle "Do When releasing action menu key" option
|
||||||
|
GVAR(placer) setVariable [QGVAR(Deploy),
|
||||||
[GVAR(placer), "DefaultAction",
|
[GVAR(placer), "DefaultAction",
|
||||||
{GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))},
|
{GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))},
|
||||||
{call FUNC(deployConfirm);}
|
{call FUNC(deployConfirm);}
|
||||||
] call EFUNC(common,AddActionEventHandler)];
|
] call EFUNC(common,AddActionEventHandler)];
|
||||||
|
|
||||||
GVAR(placer) setVariable [QGVAR(Cancel),
|
GVAR(placer) setVariable [QGVAR(Cancel),
|
||||||
[GVAR(placer), "zoomtemp",
|
[GVAR(placer), "zoomtemp",
|
||||||
{GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))},
|
{GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))},
|
||||||
{call FUNC(deployCancel);}
|
{call FUNC(deployCancel);}
|
||||||
] call EFUNC(common,AddActionEventHandler)];
|
] call EFUNC(common,AddActionEventHandler)];
|
||||||
|
|
||||||
|
}, _this] call EFUNC(common,execNextFrame);
|
||||||
|
@ -39,14 +39,17 @@ GVAR(currentAngle) = 0;
|
|||||||
|
|
||||||
[localize LSTRING(Deploy), localize LSTRING(Drop), localize LSTRING(Adjust)] call EFUNC(interaction,showMouseHint);
|
[localize LSTRING(Deploy), localize LSTRING(Drop), localize LSTRING(Adjust)] call EFUNC(interaction,showMouseHint);
|
||||||
|
|
||||||
ACE_player setVariable [QGVAR(Deploy),
|
[{ //wait a frame to handle "Do When releasing action menu key" option
|
||||||
|
ACE_player setVariable [QGVAR(Deploy),
|
||||||
[ACE_player, "DefaultAction",
|
[ACE_player, "DefaultAction",
|
||||||
{!isNull GVAR(ladder)},
|
{!isNull GVAR(ladder)},
|
||||||
{GVAR(ladder) call FUNC(confirmTLdeploy);}
|
{GVAR(ladder) call FUNC(confirmTLdeploy);}
|
||||||
] call EFUNC(common,AddActionEventHandler)];
|
] call EFUNC(common,AddActionEventHandler)];
|
||||||
|
|
||||||
ACE_player setVariable [QGVAR(Cancel),
|
ACE_player setVariable [QGVAR(Cancel),
|
||||||
[ACE_player, "zoomtemp",
|
[ACE_player, "zoomtemp",
|
||||||
{!isNull GVAR(ladder)},
|
{!isNull GVAR(ladder)},
|
||||||
{GVAR(ladder) call FUNC(cancelTLdeploy);}
|
{GVAR(ladder) call FUNC(cancelTLdeploy);}
|
||||||
] call EFUNC(common,AddActionEventHandler)];
|
] call EFUNC(common,AddActionEventHandler)];
|
||||||
|
|
||||||
|
}, _this] call EFUNC(common,execNextFrame);
|
||||||
|
@ -36,8 +36,11 @@ GVAR(adjustPFH) = [{
|
|||||||
|
|
||||||
[localize "STR_ACE_Tripod_Done", "", localize "STR_ACE_Tripod_ScrollAction"] call EFUNC(interaction,showMouseHint);
|
[localize "STR_ACE_Tripod_Done", "", localize "STR_ACE_Tripod_ScrollAction"] call EFUNC(interaction,showMouseHint);
|
||||||
|
|
||||||
ACE_player setVariable [QGVAR(Adjust),
|
[{ //wait a frame to handle "Do When releasing action menu key" option
|
||||||
|
if (!GVAR(adjusting)) exitWith {ERROR("Not Adjusting");};
|
||||||
|
ACE_player setVariable [QGVAR(Adjust),
|
||||||
[ACE_player, "DefaultAction",
|
[ACE_player, "DefaultAction",
|
||||||
{GVAR(adjustPFH) != -1 && GVAR(adjusting)},
|
{GVAR(adjustPFH) != -1 && GVAR(adjusting)},
|
||||||
{GVAR(adjusting) = false;}
|
{GVAR(adjusting) = false;}
|
||||||
] call EFUNC(common,AddActionEventHandler)];
|
] call EFUNC(common,AddActionEventHandler)];
|
||||||
|
}, _this] call EFUNC(common,execNextFrame);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user