From 31217ae5d0b3d865787487d989118fcde8db7a2c Mon Sep 17 00:00:00 2001 From: Dart <59131299+DartRuffian@users.noreply.github.com> Date: Mon, 25 Mar 2024 11:08:06 -0500 Subject: [PATCH] Fortify - Add onDeployStop event for cancelling before confirming (#9854) * onDeployStop event * Updated wiki with new event * Fixed params * Revert "onDeployStop event" This reverts commit c3dae82915f7d36754096feaf5ae2249688742e7. * Uses deployCanceled * Re-added fortify stop event * Update fnc_deployObject.sqf --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/fortify/functions/fnc_deployObject.sqf | 1 + docs/wiki/framework/fortify-framework.md | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/fortify/functions/fnc_deployObject.sqf b/addons/fortify/functions/fnc_deployObject.sqf index 4895b261bcd..f7e9e6dbadc 100644 --- a/addons/fortify/functions/fnc_deployObject.sqf +++ b/addons/fortify/functions/fnc_deployObject.sqf @@ -70,6 +70,7 @@ private _mouseClickID = [_player, "DefaultAction", {GVAR(isPlacing) == PLACE_WAI [_unit, _object] call FUNC(deployConfirm); } else { TRACE_1("deleting object",_object); + [QGVAR(onDeployStop), [_unit, _object, _cost]] call CBA_fnc_localEvent; deleteVehicle _object; }; }; diff --git a/docs/wiki/framework/fortify-framework.md b/docs/wiki/framework/fortify-framework.md index 14d48532b58..27bfe7d6139 100644 --- a/docs/wiki/framework/fortify-framework.md +++ b/docs/wiki/framework/fortify-framework.md @@ -119,5 +119,6 @@ Event Name | Passed Parameter(s) | Locality | Description `acex_fortify_objectPlaced` | [player, side, objectPlaced] | Global | Fortify object placed `acex_fortify_objectDeleted` | [player, side, objectDeleted] | Global | Fortify object deleted `acex_fortify_onDeployStart` | [player, object, cost] | Local | Player starts placing object +`ace_fortify_onDeployStop` | [player, object, cost] | Local | Player stops placing object. Raised only if stopped before trying to place (= before progress bar appears). If it's during progress bar, only `ace_fortify_deployCanceled` is raised. `ace_fortify_deployFinished` | [[player, side, configName, posASL, vectorDir, vectorUp, cost], elapsedTime, totalTime, errorCode] | Local | Player successfully finishes building object `ace_fortify_deployCanceled` | [[player, side, configName, posASL, vectorDir, vectorUp, cost], elapsedTime, totalTime, errorCode] | Local | Player cancels building object