Arsenal - Fix sorting when using search (#7877)

* fix sorting when using search

* remove unused line

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
Brett 2020-08-27 09:44:18 -06:00 committed by GitHub
parent 241f1aefbd
commit b51cf3575c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -108,7 +108,7 @@ missionNamespace setVariable [
private _for = if (_right) then {
for '_i' from 0 to ((lnbSize _panel select 0) - 1)
} else {
for '_i' from 1 to (lbSize _panel - 1)
for '_i' from 0 to (lbSize _panel - 1)
};
_for do {
@ -128,9 +128,11 @@ _for do {
if (_right) then {
_panel lnbSetText [[_i, 1], format ["%1%2", _value, _panel lnbText [_i, 1]]];
} else {
if !(_item isEqualTo "") then {
_panel lbSetText [_i, format ["%1%2", _value, _panel lbText _i]];
};
};
};
if (_right) then {
_panel lnbSort [1, false];
@ -150,6 +152,9 @@ if (_right) then {
if (_cursel >= 0) then {
if (_data == _selected) then {_panel lbSetCurSel _i};
};
_panel lbSetText [_i, getText (_cfgClass >> _data >> "displayName")];
private _name = getText (_cfgClass >> _data >> "displayName");
if !(_name isEqualTo "") then {
_panel lbSetText [_i, _name];
};
};
};