2015-05-09 02:47:15 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* On button up
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* call ace_interaction_fnc_onButtonUp
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-11 23:13:47 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-05-09 20:14:00 +00:00
|
|
|
private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_distance"];
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-01-12 04:20:02 +00:00
|
|
|
_player = ACE_player;
|
2015-01-11 19:32:51 +00:00
|
|
|
_vehicle = vehicle _player;
|
2015-01-11 23:13:47 +00:00
|
|
|
_target = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1);
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-01-11 23:13:47 +00:00
|
|
|
_count = count GVAR(Buttons);
|
|
|
|
_index = call FUNC(getSelectedButton);
|
2015-01-11 19:32:51 +00:00
|
|
|
|
|
|
|
_action = if (_index != -1 && {_index < _count}) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
GVAR(Buttons) select _index
|
2015-01-11 19:32:51 +00:00
|
|
|
} else {
|
2015-04-06 16:22:43 +00:00
|
|
|
["", {}, {false}, 0, [], "", "", {false}, [], 0]
|
2015-01-11 19:32:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
(findDisplay 1713999) closeDisplay 1;
|
|
|
|
closeDialog 0;
|
|
|
|
|
|
|
|
|
|
|
|
_statement = _action select 1;
|
|
|
|
_condition = _action select 2;
|
|
|
|
_conditionShow = _action select 7;
|
|
|
|
_distance = _action select 9;
|
|
|
|
|
2015-01-11 23:13:47 +00:00
|
|
|
if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
[_target, _player] call _statement;
|
2015-01-11 19:32:51 +00:00
|
|
|
};
|