Inventory - Fix item lockup when dragging into same inventory (#9697)

* fix rope filtering

* loop

* var declaration begone

* count -> forEach

* LINKFUNC

* remove lbValue change

* handle other file extensions

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
Grim 2024-01-01 18:36:45 -03:00 committed by GitHub
parent 7054d4bb51
commit aedb5169d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View File

@ -18,9 +18,8 @@
disableSerialization;
params ["_display"];
private _index = GVAR(selectedFilterIndex);
private _itemList = _display call FUNC(currentItemListBox);
private _filterFunction = missionNamespace getVariable ((_display displayCtrl IDC_FILTERLISTS) lbData _index);
private _filterFunction = missionNamespace getVariable ((_display displayCtrl IDC_FILTERLISTS) lbData GVAR(selectedFilterIndex));
if (_filterFunction isEqualType {}) then {
for "_i" from (lbSize _itemList) - 1 to 0 step -1 do {

View File

@ -25,7 +25,7 @@ private _filter = _display displayCtrl IDC_FILTERLISTS;
// the first three indecies are hard coded: 0 - weapons , 1 - magazines, 2 - items
// all of them show backpacks, because BI
// all other indecies show everything, so all we have to do is delete stuff we dont like
_filter ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChanged)}];
_filter ctrlAddEventHandler ["LBSelChanged", LINKFUNC(onLBSelChanged)];
// have to add these a frame later, because this event happens before the engine adds the default filters
[{
@ -70,9 +70,5 @@ _dummyControl ctrlAddEventHandler ["Draw", {
private _itemList = _display call FUNC(currentItemListBox);
// monitoring is done by setting a lb value. These are unused here and are reset every time the list box updates.
if (_itemList lbValue 0 != DUMMY_VALUE) then {
_display call FUNC(forceItemListUpdate);
_itemList lbSetValue [0, DUMMY_VALUE];
};
_display call FUNC(forceItemListUpdate);
}];