Skip to content

Commit 908327c

Browse files
Arsenal - Fix search (#11430)
* Arsenal - Fix search * Apply suggestion from @johnb432 Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
1 parent 0abb0f5 commit 908327c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

addons/arsenal/functions/fnc_handleSearchbar.sqf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
152152
private _currentClassname = "";
153153

154154
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
155+
if (_isMagazine) then {
156+
_searchString = _searchString call EFUNC(common,getConfigName);
157+
};
155158
// Go through all items in panel and see if they need to be deleted or not
156159
for "_lbIndex" from (lbSize _leftPanelCtrl) - 1 to 0 step -1 do {
157160
_currentDisplayName = _leftPanelCtrl lbText _lbIndex;
@@ -160,7 +163,12 @@ if ((ctrlIDC _control) == IDC_rightSearchbar) then {
160163
if (_currentDisplayName isEqualTo format [" <%1>", localize "str_empty"]) then {continue};
161164

162165
// Remove item in panel if it doesn't match search, skip otherwise
163-
if ((_currentDisplayName == "") || {!(_currentDisplayName regexMatch _searchPattern) && {!(_currentClassname regexMatch _searchPattern) && {!_isMagazine && {_searchString in (compatibleMagazines _currentClassname)}}}}) then {
166+
if ((_currentDisplayName == "") || {
167+
if (_isMagazine) then {
168+
!(_searchString in (compatibleMagazines _currentClassname))
169+
} else {
170+
!(_currentDisplayName regexMatch _searchPattern) && {!(_currentClassname regexMatch _searchPattern)}
171+
}}) then {
164172
_leftPanelCtrl lbDelete _lbIndex;
165173
};
166174
};

0 commit comments

Comments
 (0)