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

Reimplement old parameter syntax for (Un)LoadCargo events #3403

Merged
merged 1 commit into from
Feb 25, 2016
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
6 changes: 3 additions & 3 deletions addons/cargo/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
["AddCargoByClass", {_this call FUNC(addCargoItem)}] call EFUNC(common,addEventHandler);

["LoadCargo", {
(_this select 0) params ["_item","_vehicle"];
params ["_item", "_vehicle"];
TRACE_2("LoadCargo EH",_item,_vehicle);

private _loaded = [_item, _vehicle] call FUNC(loadItem);
Expand All @@ -22,9 +22,9 @@
}] call EFUNC(common,addEventHandler);

["UnloadCargo", {
(_this select 0) params ["_item","_vehicle", ["_unloader", objNull]];
params ["_item", "_vehicle", ["_unloader", objNull]];
TRACE_3("UnloadCargo EH",_item,_vehicle,_unloader);

private _unloaded = [_item, _vehicle, _unloader] call FUNC(unloadItem); //returns true if sucessful

private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
Expand Down
8 changes: 7 additions & 1 deletion addons/cargo/functions/fnc_startLoadIn.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ private _return = false;
if ([_object, _vehicle] call FUNC(canLoadItemIn)) then {
private _size = [_object] call FUNC(getSizeItem);

[5 * _size, [_object,_vehicle], "LoadCargo", {}, localize LSTRING(LoadingItem)] call EFUNC(common,progressBar);
[
5 * _size,
[_object,_vehicle],
{["LoadCargo", _this select 0] call EFUNC(common,localEvent)},
{},
localize LSTRING(LoadingItem)
] call EFUNC(common,progressBar);
_return = true;
} else {
private _displayName = getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName");
Expand Down
10 changes: 9 additions & 1 deletion addons/cargo/functions/fnc_startUnload.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ private _item = _loaded select _selected; //This can be an object or a classname
if ([_item, GVAR(interactionVehicle), ACE_player] call FUNC(canUnloadItem)) then {
private _size = [_item] call FUNC(getSizeItem);

[5 * _size, [_item, GVAR(interactionVehicle), ACE_player], "UnloadCargo", {}, localize LSTRING(UnloadingItem), {true}, ["isNotSwimming"]] call EFUNC(common,progressBar);
[
5 * _size,
[_item, GVAR(interactionVehicle), ACE_player],
{["UnloadCargo", _this select 0] call EFUNC(common,localEvent)},
{},
localize LSTRING(UnloadingItem),
{true},
["isNotSwimming"]
] call EFUNC(common,progressBar);
} else {
private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
private _displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
Expand Down