From 2a4355dfb9bd8d1b90a93a8a88250191ced038d0 Mon Sep 17 00:00:00 2001 From: Tim Beswick Date: Sat, 20 Aug 2022 22:28:16 +0100 Subject: [PATCH] Cargo - Add setting for carry after cargo unload (#8997) * Add setting for carry after cargo unload * Fix typos * Contributors * Don't make setting global * Update addons/cargo/stringtable.xml Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com> Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com> --- AUTHORS.txt | 1 + addons/cargo/functions/fnc_unloadCarryItem.sqf | 1 + addons/cargo/initSettings.sqf | 9 +++++++++ addons/cargo/stringtable.xml | 6 ++++++ 4 files changed, 17 insertions(+) diff --git a/AUTHORS.txt b/AUTHORS.txt index 4035308b0f..544a7d36b6 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -165,6 +165,7 @@ Sniperwolf572 System98 SzwedzikPL Tachi +tbeswick96 Tessa Elieff Timi007 Toaster diff --git a/addons/cargo/functions/fnc_unloadCarryItem.sqf b/addons/cargo/functions/fnc_unloadCarryItem.sqf index d60904cdc0..36985b5425 100644 --- a/addons/cargo/functions/fnc_unloadCarryItem.sqf +++ b/addons/cargo/functions/fnc_unloadCarryItem.sqf @@ -19,6 +19,7 @@ params ["_unloader", "_object"]; TRACE_2("unloadCarryItem-start",_unloader,_object); if !(["ace_dragging"] call EFUNC(common,isModLoaded)) exitWith {}; +if !(GVAR(carryAfterUnload)) exitWith {}; // When unloading attached objects, this code will run before server has finished moving object to the safe position [{ diff --git a/addons/cargo/initSettings.sqf b/addons/cargo/initSettings.sqf index cf40c55beb..e971d2d9c7 100644 --- a/addons/cargo/initSettings.sqf +++ b/addons/cargo/initSettings.sqf @@ -42,3 +42,12 @@ false, {[QGVAR(enableRename), _this, true] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; + +[ + QGVAR(carryAfterUnload), "CHECKBOX", + [LSTRING(carryAfterUnload), LSTRING(carryAfterUnload_description)], + [LELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(openMenu)], + true, + false, + {[QGVAR(carryAfterUnload), _this] call EFUNC(common,cbaSettings_settingChanged)} +] call CBA_fnc_addSetting; diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 16a59779cf..34e582c86e 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -482,5 +482,11 @@ 成功卸货后,重新打开货物菜单。 화물을 성공적으로 내리고 난 다음 화물 메뉴를 열지 결정합니다. + + Carry After Unload + + + Controls whether cargo items are carried or dragged after unloading. +