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

Zeus - Added ace_cargoLoaded event #7520

Merged
merged 1 commit into from
Apr 18, 2020
Merged

Zeus - Added ace_cargoLoaded event #7520

merged 1 commit into from
Apr 18, 2020

Conversation

shukari
Copy link
Contributor

@shukari shukari commented Feb 11, 2020

When merged this pull request will:

  • the load in module wasnt triggering the ace_cargoLoaded module

Question

Why is the ace_cargoLoaded event not in the https://github.com/acemod/ACE3/blob/master/addons/cargo/functions/fnc_loadItem.sqf fnc?

@shukari
Copy link
Contributor Author

shukari commented Apr 16, 2020

@SilentSpike can you review as ace_zeus maintainer?

@jonpas
Copy link
Member

jonpas commented Apr 16, 2020

I would prefer this to be reworked, but this works just fine as well.

@jonpas jonpas added this to the 3.13.2 milestone Apr 16, 2020
@jonpas jonpas added the kind/enhancement Release Notes: **IMPROVED:** label Apr 16, 2020
@kymckay
Copy link
Member

kymckay commented Apr 16, 2020

I feel it would make more sense if we moved the listenable events in cargo into the loadItem function itself:

private _loaded = [_item, _vehicle] call FUNC(loadItem);
// Show hint as feedback
private _hint = [LSTRING(LoadingFailed), LSTRING(LoadedItem)] select _loaded;
private _itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
private _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
[[_hint, _itemName, _vehicleName], 3.0] call EFUNC(common,displayTextStructured);
if (_loaded) then {
// Invoke listenable event
["ace_cargoLoaded", [_item, _vehicle]] call CBA_fnc_globalEvent;

That way there's only one origin point in the code for this event. Same for the unload one found below the above code snippet.

@PabstMirror
Copy link
Contributor

Can cleanup events later, merging for now

@PabstMirror PabstMirror merged commit 4302a94 into acemod:master Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants