mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
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:
parent
7054d4bb51
commit
aedb5169d3
@ -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 {
|
||||
|
@ -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);
|
||||
}];
|
||||
|
Loading…
Reference in New Issue
Block a user