2015-06-02 17:30:50 +00:00
|
|
|
/*
|
|
|
|
* Author: Garth 'L-H' de Wet, Ruthberg
|
|
|
|
* Starts the deploy process for sandbags.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-08-08 00:00:00 +00:00
|
|
|
* [] call ace_sandbag_fnc_deploy
|
2015-06-02 17:30:50 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
closeDialog 0;
|
|
|
|
|
|
|
|
GVAR(placer) = ACE_player;
|
|
|
|
|
|
|
|
[GVAR(placer), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus);
|
|
|
|
|
2015-08-08 00:00:00 +00:00
|
|
|
GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"];
|
2015-06-02 17:30:50 +00:00
|
|
|
GVAR(sandBag) enableSimulationGlobal false;
|
|
|
|
|
|
|
|
GVAR(deployPFH) = [{
|
|
|
|
if (GVAR(placer) != ACE_player) exitWith {
|
2015-06-02 18:07:35 +00:00
|
|
|
call FUNC(deployCancel);
|
2015-06-02 17:30:50 +00:00
|
|
|
};
|
2015-08-08 00:00:00 +00:00
|
|
|
GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0]));
|
2015-06-02 17:30:50 +00:00
|
|
|
GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player);
|
|
|
|
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
|
|
|
|
2015-06-06 02:02:24 +00:00
|
|
|
[localize LSTRING(ConfirmDeployment), localize LSTRING(CancelDeployment), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint);
|
2015-06-02 17:30:50 +00:00
|
|
|
|
|
|
|
GVAR(placer) setVariable [QGVAR(Deploy),
|
|
|
|
[GVAR(placer), "DefaultAction",
|
|
|
|
{GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))},
|
|
|
|
{call FUNC(deployConfirm);}
|
|
|
|
] call EFUNC(common,AddActionEventHandler)];
|
|
|
|
|
|
|
|
GVAR(placer) setVariable [QGVAR(Cancel),
|
|
|
|
[GVAR(placer), "zoomtemp",
|
|
|
|
{GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))},
|
2015-06-02 18:07:35 +00:00
|
|
|
{call FUNC(deployCancel);}
|
2015-06-02 17:30:50 +00:00
|
|
|
] call EFUNC(common,AddActionEventHandler)];
|