2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-08-13 17:33:55 +00:00
|
|
|
/*
|
|
|
|
* Author: GitHawk
|
|
|
|
* Get the remaining fuel amount
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-08-20 20:10:26 +00:00
|
|
|
* 0: Unit <OBJECT>
|
2017-09-10 19:43:03 +00:00
|
|
|
* 1: Fuel Source <OBJECT>
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-14 01:18:54 +00:00
|
|
|
* None
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-08-21 20:43:45 +00:00
|
|
|
* [player, fuelTruck] call ace_refuel_fnc_checkFuel
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
2015-08-14 01:18:54 +00:00
|
|
|
* Public: No
|
2015-08-13 17:33:55 +00:00
|
|
|
*/
|
|
|
|
|
2017-09-10 19:43:03 +00:00
|
|
|
params [["_unit", objNull, [objNull]], ["_source", objNull, [objNull]]];
|
2016-02-02 14:03:06 +00:00
|
|
|
|
2017-09-10 19:43:03 +00:00
|
|
|
private _fuel = [_source] call FUNC(getFuel);
|
2015-08-13 17:33:55 +00:00
|
|
|
|
|
|
|
[
|
2022-08-17 11:25:37 +00:00
|
|
|
GVAR(progressDuration) * 2,
|
2017-09-10 19:43:03 +00:00
|
|
|
[_unit, _source, _fuel],
|
2015-08-13 17:33:55 +00:00
|
|
|
{
|
|
|
|
params ["_args"];
|
2017-09-10 19:43:03 +00:00
|
|
|
_args params [["_unit", objNull, [objNull]], ["_source", objNull, [objNull]], ["_fuel", 0, [0]]];
|
2015-08-13 17:33:55 +00:00
|
|
|
if (_fuel > 0 ) then {
|
2016-06-04 10:12:56 +00:00
|
|
|
[QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RemainingFuel), _fuel], 2, _unit], _unit] call CBA_fnc_targetEvent;
|
2015-08-13 17:33:55 +00:00
|
|
|
} else {
|
2016-06-04 10:12:56 +00:00
|
|
|
[QEGVAR(common,displayTextStructured), [LSTRING(Hint_Empty), 2, _unit], _unit] call CBA_fnc_targetEvent;
|
2015-08-13 17:33:55 +00:00
|
|
|
};
|
|
|
|
true
|
|
|
|
},
|
|
|
|
{true},
|
2015-08-21 20:43:45 +00:00
|
|
|
localize LSTRING(CheckFuelAction),
|
2015-08-13 17:33:55 +00:00
|
|
|
{true},
|
2017-09-10 19:43:03 +00:00
|
|
|
[INTERACT_EXCEPTIONS]
|
2015-08-13 17:33:55 +00:00
|
|
|
] call EFUNC(common,progressBar);
|