Skip to content
Open
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
5 changes: 4 additions & 1 deletion addons/arsenal/functions/fnc_handleSearchbar.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,16 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
private _currentDisplayName = "";
private _currentClassname = "";

private _isMagazine = isClass (configFile >> "CfgMagazines" >> _searchString); // Check if search term is a magazine for magazine lookups. Direct match is fine as user will ctrl+c the classname
// Go through all items in panel and see if they need to be deleted or not
for "_lbIndex" from (lbSize _leftPanelCtrl) - 1 to 0 step -1 do {
_currentDisplayName = _leftPanelCtrl lbText _lbIndex;
_currentClassname = _leftPanelCtrl lbData _lbIndex;

if (_currentDisplayName isEqualTo format [" <%1>", localize "str_empty"]) then {continue};

// Remove item in panel if it doesn't match search, skip otherwise
if ((_currentDisplayName == "") || {!(_currentDisplayName regexMatch _searchPattern) && {!(_currentClassname regexMatch _searchPattern)}}) then {
if ((_currentDisplayName == "") || {!(_currentDisplayName regexMatch _searchPattern) && {!(_currentClassname regexMatch _searchPattern) && {!_isMagazine && {_searchString in (compatibleMagazines _currentClassname)}}}}) then {
_leftPanelCtrl lbDelete _lbIndex;
};
};
Expand Down
Loading