From acd28bbed74633a5c99bd6d4f24c1702356eb8d2 Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Tue, 28 May 2019 16:07:31 +0200 Subject: [PATCH 1/6] Add refuelTick Event --- addons/refuel/functions/fnc_refuel.sqf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/refuel/functions/fnc_refuel.sqf b/addons/refuel/functions/fnc_refuel.sqf index 4717f1206c8..5aaa07fbee4 100644 --- a/addons/refuel/functions/fnc_refuel.sqf +++ b/addons/refuel/functions/fnc_refuel.sqf @@ -93,6 +93,8 @@ if (_maxFuel == 0) then { }; _unit setVariable [QGVAR(tempFuel), _fuelInSink]; + [QGVAR(refuelTick), [_source, _sink, _rateTime]] call CBA_fnc_localEvent; + [QEGVAR(common,setFuel), [_sink, _fuelInSink], _sink] call CBA_fnc_targetEvent; [_source, _fuelInSource] call FUNC(setFuel); } else { From 2b60298166031778e2da6726bbe08e08270184b5 Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Tue, 28 May 2019 16:14:31 +0200 Subject: [PATCH 2/6] Add refuelStarted event --- addons/refuel/functions/fnc_turnOn.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/refuel/functions/fnc_turnOn.sqf b/addons/refuel/functions/fnc_turnOn.sqf index 4cbbc0033d2..19f820959f9 100644 --- a/addons/refuel/functions/fnc_turnOn.sqf +++ b/addons/refuel/functions/fnc_turnOn.sqf @@ -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(refuelStarted), [_nozzle getVariable QGVAR(source), _nozzle getVariable QGVAR(sink)]] call CBA_fnc_localEvent; \ No newline at end of file From 1fed9dbd235bcb72117e842529a6c914c6551b57 Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Tue, 28 May 2019 16:17:44 +0200 Subject: [PATCH 3/6] Add refuelStopped event --- addons/refuel/functions/fnc_refuel.sqf | 1 + addons/refuel/functions/fnc_turnOff.sqf | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/refuel/functions/fnc_refuel.sqf b/addons/refuel/functions/fnc_refuel.sqf index 5aaa07fbee4..f7e13d81c8d 100644 --- a/addons/refuel/functions/fnc_refuel.sqf +++ b/addons/refuel/functions/fnc_refuel.sqf @@ -102,6 +102,7 @@ if (_maxFuel == 0) then { }; if (_finished) exitWith { + [QGVAR(refuelStopped), [_source, _sink]] call CBA_fnc_localEvent; _nozzle setVariable [QGVAR(lastTickMissionTime), nil]; _nozzle setVariable [QGVAR(isRefueling), false, true]; }; diff --git a/addons/refuel/functions/fnc_turnOff.sqf b/addons/refuel/functions/fnc_turnOff.sqf index 1448a0d1450..019b5a54296 100644 --- a/addons/refuel/functions/fnc_turnOff.sqf +++ b/addons/refuel/functions/fnc_turnOff.sqf @@ -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(refuelStopped), [_nozzle getVariable QGVAR(source), _nozzle getVariable QGVAR(sink)]] call CBA_fnc_localEvent; \ No newline at end of file From fb5c726627e98a2ec433007e3c56db095263660f Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Tue, 28 May 2019 16:43:03 +0200 Subject: [PATCH 4/6] Add event documentation --- docs/wiki/framework/events-framework.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/wiki/framework/events-framework.md b/docs/wiki/framework/events-framework.md index 7a1481a2993..a3374eb895e 100644 --- a/docs/wiki/framework/events-framework.md +++ b/docs/wiki/framework/events-framework.md @@ -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_refuelStarted` | [_source, _target] | Local | Listen | Refueling has started +|`ace_refuel_refuelTick` | [_source, _target, _amount] | Local | Listen | Amount of fuel transferred in a tick +|`ace_refuel_refuelStopped` | [_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. From 7556c90a1ad446606fa9e2fc207d39d40a5a90df Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Wed, 29 May 2019 12:43:20 +0200 Subject: [PATCH 5/6] Rename events Fix EOF --- addons/refuel/functions/fnc_refuel.sqf | 2 +- addons/refuel/functions/fnc_turnOff.sqf | 2 +- addons/refuel/functions/fnc_turnOn.sqf | 2 +- docs/wiki/framework/events-framework.md | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/refuel/functions/fnc_refuel.sqf b/addons/refuel/functions/fnc_refuel.sqf index f7e13d81c8d..9a0ddee9255 100644 --- a/addons/refuel/functions/fnc_refuel.sqf +++ b/addons/refuel/functions/fnc_refuel.sqf @@ -93,7 +93,7 @@ if (_maxFuel == 0) then { }; _unit setVariable [QGVAR(tempFuel), _fuelInSink]; - [QGVAR(refuelTick), [_source, _sink, _rateTime]] call CBA_fnc_localEvent; + [QGVAR(tick), [_source, _sink, _rateTime]] call CBA_fnc_localEvent; [QEGVAR(common,setFuel), [_sink, _fuelInSink], _sink] call CBA_fnc_targetEvent; [_source, _fuelInSource] call FUNC(setFuel); diff --git a/addons/refuel/functions/fnc_turnOff.sqf b/addons/refuel/functions/fnc_turnOff.sqf index 019b5a54296..6b5f17a95df 100644 --- a/addons/refuel/functions/fnc_turnOff.sqf +++ b/addons/refuel/functions/fnc_turnOff.sqf @@ -21,4 +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(refuelStopped), [_nozzle getVariable QGVAR(source), _nozzle getVariable QGVAR(sink)]] call CBA_fnc_localEvent; \ No newline at end of file +[QGVAR(stopped), [_nozzle getVariable QGVAR(source), _nozzle getVariable QGVAR(sink)]] call CBA_fnc_localEvent; diff --git a/addons/refuel/functions/fnc_turnOn.sqf b/addons/refuel/functions/fnc_turnOn.sqf index 19f820959f9..b96cc6cda4e 100644 --- a/addons/refuel/functions/fnc_turnOn.sqf +++ b/addons/refuel/functions/fnc_turnOn.sqf @@ -21,4 +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(refuelStarted), [_nozzle getVariable QGVAR(source), _nozzle getVariable QGVAR(sink)]] call CBA_fnc_localEvent; \ No newline at end of file +[QGVAR(started), [_nozzle getVariable QGVAR(source), _nozzle getVariable QGVAR(sink)]] call CBA_fnc_localEvent; diff --git a/docs/wiki/framework/events-framework.md b/docs/wiki/framework/events-framework.md index a3374eb895e..f4f0cf9fae2 100644 --- a/docs/wiki/framework/events-framework.md +++ b/docs/wiki/framework/events-framework.md @@ -93,9 +93,9 @@ MenuType: 0 = Interaction, 1 = Self Interaction | Event Key | Parameters | Locality | Type | Description | |----------|---------|---------|---------|---------|---------| -|`ace_refuel_refuelStarted` | [_source, _target] | Local | Listen | Refueling has started -|`ace_refuel_refuelTick` | [_source, _target, _amount] | Local | Listen | Amount of fuel transferred in a tick -|`ace_refuel_refuelStopped` | [_source, _target] | Local | Listen | Refueling has stopped +|`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 From 86ff415ce5ca4d8879de29113198034b9ccecbfa Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Wed, 29 May 2019 12:43:59 +0200 Subject: [PATCH 6/6] Rename one more event --- addons/refuel/functions/fnc_refuel.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/refuel/functions/fnc_refuel.sqf b/addons/refuel/functions/fnc_refuel.sqf index 9a0ddee9255..f3e042cd563 100644 --- a/addons/refuel/functions/fnc_refuel.sqf +++ b/addons/refuel/functions/fnc_refuel.sqf @@ -102,7 +102,7 @@ if (_maxFuel == 0) then { }; if (_finished) exitWith { - [QGVAR(refuelStopped), [_source, _sink]] call CBA_fnc_localEvent; + [QGVAR(stopped), [_source, _sink]] call CBA_fnc_localEvent; _nozzle setVariable [QGVAR(lastTickMissionTime), nil]; _nozzle setVariable [QGVAR(isRefueling), false, true]; };