Skip to content

Filtered getUnitLoadout#1238

Closed
BrettMayson wants to merge 3 commits intoCBATeam:masterfrom
BrettMayson:unitloadout
Closed

Filtered getUnitLoadout#1238
BrettMayson wants to merge 3 commits intoCBATeam:masterfrom
BrettMayson:unitloadout

Conversation

@BrettMayson
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

commy2 commented Dec 21, 2019

State?

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

commy2 commented Jan 19, 2020

a month

state?

@BrettMayson
Copy link
Copy Markdown
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