Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargo - Add Option to Reopen Menu After Unload #8487

Merged
merged 2 commits into from
Oct 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1464,5 +1464,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>