Skip to content

Commit

Permalink
Cargo - Add Option to Reopen Menu After Unload (#8487)
Browse files Browse the repository at this point in the history
Co-authored-by: jonpas <jonpas33@gmail.com>
  • Loading branch information
654wak654 and jonpas authored Oct 10, 2021
1 parent 2a7eb07 commit 64decdd
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
17 changes: 16 additions & 1 deletion addons/cargo/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#include "script_component.hpp"

["ace_addCargo", {_this call FUNC(addCargoItem)}] call CBA_fnc_addEventHandler;
[QGVAR(paradropItem), {_this call FUNC(paradropItem)}] call CBA_fnc_addEventHandler;
[QGVAR(paradropItem), {
params ["_item", "_vehicle"];

private _unloaded = [_item, _vehicle] call FUNC(paradropItem);

if (_unloaded && {GVAR(openAfterUnload) in [2, 3]}) then {
GVAR(interactionVehicle) = _vehicle;
GVAR(interactionParadrop) = true;
createDialog QGVAR(menu);
};
}] call CBA_fnc_addEventHandler;

["ace_loadCargo", {
params ["_item", "_vehicle"];
Expand Down Expand Up @@ -37,6 +47,11 @@

[[_hint, _itemName, _vehicleName], 3.0] call EFUNC(common,displayTextStructured);

if (_unloaded && {GVAR(openAfterUnload) in [1, 3]}) then {
GVAR(interactionVehicle) = _vehicle;
GVAR(interactionParadrop) = false;
createDialog QGVAR(menu);
};

// TOOO maybe drag/carry the unloaded item?
}] call CBA_fnc_addEventHandler;
Expand Down
9 changes: 9 additions & 0 deletions addons/cargo/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,12 @@
true,
{[QGVAR(paradropTimeCoefficent), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;

[
QGVAR(openAfterUnload), "LIST",
[LSTRING(openAfterUnload), LSTRING(openAfterUnload_description)],
[LELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(openMenu)],
[[0, 1, 2, 3], [ELSTRING(common,never), LSTRING(unloadObject), LSTRING(paradropButton), ELSTRING(common,both)], 0],
false,
{[QGVAR(openAfterUnload), _this, true] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
8 changes: 8 additions & 0 deletions addons/cargo/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,13 @@
<Czech>Upravuje jak dlouho nakládají/vykládání trvá.\nVýsledkem je čas v sekundách - velikost objektu vynásobená touto hodnotou.</Czech>
<Spanish>Modifica el tiempo de carga/descarga de objetos.\n El Tiempo en segundos, es el tamño del objeto multiplicado por este valor.</Spanish>
</Key>
<Key ID="STR_ACE_Cargo_openAfterUnload">
<English>Reopen Cargo Menu</English>
<Turkish>Kargo Menüsünü Tekrar Aç</Turkish>
</Key>
<Key ID="STR_ACE_Cargo_openAfterUnload_description">
<English>Reopen the Cargo Menu after successful unload.</English>
<Turkish>Başarılı bir yük indirmeden sonra Kargo Menüsünü tekrar göster.</Turkish>
</Key>
</Package>
</Project>
4 changes: 4 additions & 0 deletions addons/common/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1466,5 +1466,9 @@
<Russian>Показывать действие в меню взаимодействия с собой.</Russian>
<Turkish>Kendi etkileşimim menüsünde animasyonları göster</Turkish>
</Key>
<Key ID="STR_ACE_Common_both">
<English>Both</English>
<Turkish>İkisi de</Turkish>
</Key>
</Package>
</Project>

0 comments on commit 64decdd

Please sign in to comment.