ACE3/addons/tripod/functions/fnc_adjust.sqf

46 lines
1.2 KiB
Plaintext
Raw Normal View History

2015-06-04 19:13:44 +00:00
/*
* Author: Ruthberg
* Adjust tripod height
*
* Arguments:
* 0: tripod <OBJECT>
*
* Return value:
* None
2015-08-07 06:07:10 +00:00
*
* Example:
* [tripod] call ace_tripod_fnc_adjust
*
* Public: No
2015-06-04 19:13:44 +00:00
*/
#include "script_component.hpp"
2015-08-07 06:07:10 +00:00
params ["_tripod"];
2015-06-04 19:13:44 +00:00
GVAR(adjuster) = ACE_player;
GVAR(adjusting) = true;
GVAR(adjustPFH) = [{
2015-08-07 06:07:10 +00:00
params ["_args", "_pfhId"];
_args params ["_tripod"];
2015-06-04 19:13:44 +00:00
if (GVAR(adjuster) != ACE_player || !GVAR(adjusting)) exitWith {
call EFUNC(interaction,hideMouseHint);
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Adjust), -1]] call EFUNC(Common,removeActionEventHandler);
2015-08-07 06:07:10 +00:00
[_pfhId] call cba_fnc_removePerFrameHandler;
2015-06-04 19:13:44 +00:00
};
2015-08-07 06:07:10 +00:00
2015-06-04 19:13:44 +00:00
{
_tripod animate [_x, 1 - GVAR(height)];
2015-08-07 06:07:10 +00:00
} count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"];
2015-06-04 19:13:44 +00:00
}, 0, [_tripod]] call CBA_fnc_addPerFrameHandler;
[localize "STR_ACE_Tripod_Done", "", localize "STR_ACE_Tripod_ScrollAction"] call EFUNC(interaction,showMouseHint);
ACE_player setVariable [QGVAR(Adjust),
[ACE_player, "DefaultAction",
{GVAR(adjustPFH) != -1 && GVAR(adjusting)},
{GVAR(adjusting) = false;}
] call EFUNC(common,AddActionEventHandler)];