Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High cpu usage by constantly running updateInventorySelection #108

Closed
xPaw opened this issue Jan 4, 2019 · 0 comments · Fixed by #174
Closed

High cpu usage by constantly running updateInventorySelection #108

xPaw opened this issue Jan 4, 2019 · 0 comments · Fixed by #174

Comments

@xPaw
Copy link
Contributor

xPaw commented Jan 4, 2019

When selecting multiple items, it seems that the script constantly runs updateInventorySelection function which eats up cpu when you have many items selected at once.

Which is caused by this code:

// Wait until g_ActiveInventory.selectedItem is identical to the selected UI item.
// This also makes sure that the new - and correct - item_info (iteminfo0 or iteminfo1) is visible.
var selectedItemIdUI = $('div', item).attr('id');
var selectedItemIdInventory = getActiveInventory().selectedItem.appid +
'_' +
getActiveInventory().selectedItem.contextid +
'_' +
getActiveInventory().selectedItem.assetid;
if (selectedItemIdUI !== selectedItemIdInventory) {
setTimeout(function() {
updateInventorySelection(item);
}, 250);
return;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant