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

Filtered getUnitLoadout #1238

Closed
wants to merge 3 commits into from
Closed

Conversation

BrettMayson
Copy link
Contributor

When merged this pull request will:

private _loadout = [player] call CBA_fnc_getUnitLoadout; // Loadout with ItemRadio

private _handle = [{ 
    params ["_loadout", "_handle"]; 
    if ((_loadout select 9) select 2 == "ItemRadio") then { 
        (_loadout select 9) set [2, ""]; 
    }; 
    _loadout
}] call CBA_fnc_addLoadoutFilter;

_loadout = [_loadout] call CBA_fnc_filterLoadout; // Previous loadout with ItemRadio removed
_loadout = [player] call CBA_fnc_getUnitLoadout; // Loadout without ItemRadio

[_handle] call CBA_fnc_removeLoadoutFilter;

_loadout = [player] call CBA_fnc_getUnitLoadout; // Loadout with ItemRadio

@BrettMayson BrettMayson changed the title filtered getUnitLoadout Filtered getUnitLoadout Oct 3, 2019
@commy2
Copy link
Contributor

commy2 commented Oct 3, 2019

Why would you ever remove a filter? Feels like bloat to me making this uglier than need be.

@BrettMayson
Copy link
Contributor Author

I'm not sure, but at only 50 lines excluding the doc blocks I don't know if I would consider it bloat. Supporting the functionality of being able to remove a filter isn't adding much complication, especially since the code is pretty similar to the addPerFrameHandler code.

@commy2
Copy link
Contributor

commy2 commented Dec 21, 2019

State?

@BrettMayson BrettMayson mentioned this pull request Dec 21, 2019
@commy2
Copy link
Contributor

commy2 commented Jan 19, 2020

a month

state?

@BrettMayson
Copy link
Contributor Author

Superseded by #1270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filtered getUnitLoadout
2 participants