Refuel - Add events for start, stop and progress (#7023)

* Add refuelTick Event

* Add refuelStarted event

* Add refuelStopped event

* Add event documentation

* Rename events

Fix EOF

* Rename one more event
This commit is contained in:
Dedmen Miller 2019-10-13 20:08:35 +02:00 committed by PabstMirror
parent 2e5cdbd62c
commit 3946928cbe
4 changed files with 13 additions and 0 deletions

View File

@ -93,6 +93,8 @@ if (_maxFuel == 0) then {
};
_unit setVariable [QGVAR(tempFuel), _fuelInSink];
[QGVAR(tick), [_source, _sink, _rateTime]] call CBA_fnc_localEvent;
[QEGVAR(common,setFuel), [_sink, _fuelInSink], _sink] call CBA_fnc_targetEvent;
[_source, _fuelInSource] call FUNC(setFuel);
} else {
@ -100,6 +102,7 @@ if (_maxFuel == 0) then {
};
if (_finished) exitWith {
[QGVAR(stopped), [_source, _sink]] call CBA_fnc_localEvent;
_nozzle setVariable [QGVAR(lastTickMissionTime), nil];
_nozzle setVariable [QGVAR(isRefueling), false, true];
};

View File

@ -21,3 +21,4 @@ params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]];
_nozzle setVariable [QGVAR(lastTickMissionTime), nil];
_nozzle setVariable [QGVAR(isRefueling), false, true];
[LSTRING(Hint_Stopped), 1.5, _unit] call EFUNC(common,displayTextStructured);
[QGVAR(stopped), [_nozzle getVariable QGVAR(source), _nozzle getVariable QGVAR(sink)]] call CBA_fnc_localEvent;

View File

@ -21,3 +21,4 @@ params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]];
_nozzle setVariable [QGVAR(lastTickMissionTime), CBA_missionTime];
_nozzle setVariable [QGVAR(isRefueling), true, true];
[LSTRING(Hint_Started), 1.5, _unit] call EFUNC(common,displayTextStructured);
[QGVAR(started), [_nozzle getVariable QGVAR(source), _nozzle getVariable QGVAR(sink)]] call CBA_fnc_localEvent;

View File

@ -89,6 +89,14 @@ MenuType: 0 = Interaction, 1 = Self Interaction
|----------|---------|---------|---------|---------|---------|
|`ace_wireCuttingStarted` | [_unit, _fence] | Global | Listen | Fence cutting started
### 2.9 Refuel (`ace_refuel`)
| Event Key | Parameters | Locality | Type | Description |
|----------|---------|---------|---------|---------|---------|
|`ace_refuel_started` | [_source, _target] | Local | Listen | Refueling has started
|`ace_refuel_tick` | [_source, _target, _amount] | Local | Listen | Amount of fuel transferred in a tick
|`ace_refuel_stopped` | [_source, _target] | Local | Listen | Refueling has stopped
## 3. Usage
Also Reference [CBA Events System](https://github.com/CBATeam/CBA_A3/wiki/Custom-Events-System){:target="_blank"} documentation.