qbcore-framework / qb-inventory

Slot Based Inventory System Used With QB-Core :school_satchel:
GNU General Public License v3.0
51 stars 380 forks source link

Prevent Inventory Spam Opening #41

Closed IdrisDose closed 3 years ago

IdrisDose commented 3 years ago

Hey, I noticed an issue when playing with the inventory if you press and hold the tab it will spam the inventory opening animation.

To fix this should be simple: in client/main.lua:114:

RegisterCommand('inventory', function()
    if not isCrafting then
        if not inInventory then
              -- PlayerData function.....
        end
    end
end)

Thanks, was going to make a PR but perhaps it might be a simple fix just to put in issues.

BerkieBb commented 3 years ago

Small fixes can be put in a pull request too, even if it is 1 character that changed, nothing is a problem

CaptnSloth commented 3 years ago

@ IdrisDose I test and dont work as tab is both a open and close function I just edited the app.js

$(document).on('keydown', function() { switch(event.keyCode) { case 27: // ESC Inventory.Close(); break; case 8: // Backspace Inventory.Close(); break; } });

josh-tf commented 3 years ago

I've submitted a PR here which solves the above issues and keeps the same key to open/close:

https://github.com/qbcore-framework/qb-inventory/pull/48

IdrisDose commented 3 years ago

I've submitted a PR here which solves the above issues and keeps the same key to open/close:

48

Thanks heaps!

I forgot to submit my PR but I did pretty much the same thing.