using the function to grab slot info, this can now check if you have enough inventory slots for items to be given, allowing it to check before TRYING to add them
People were reporting issues with scripts claiming items didn't exist, I believe this was due to their servers having slot starts (eg. alot of clothes or vehicles being loaded)
I've rewritten it to fully delay loading until everything is correctly cached and let the scripts continue. Also hopefully reducing memory footprint for it too.
---
Also slipped in an `experimental` function that grabs inventory config files to check their set InventoryWeight and InventorySlots to automatically apply it for other functions
---
Moves Auth Token stuff to separate file because it doesn't really need to be in `itemcontrol.lua`
Helps me keep track of it better too
Also added a "cooldown" to workaround people's multicharacter scripts claiming the players loaded more than once and breaking it
This is a tricky one to support
They handle their shops inside their script with no way to add one from the outside
They give the ability to trigger a shop from outside the script, but not create one
This just adds that trigger for now
The intention here is to try and add multiple "billing" script functions, so the user can pre-set it for scripts that use `jim_bridge`
Currently only handles `jim-payments`
Workaround function made to detect if new QB Inventory functions are available
This can be used in other situations like checking if a script is working correctly or not and the export has been registered
I've moved the framework caching to a new file `frameworkCache.lua`
This now caches the framework data once when `jim_bridge` starts
Then in `coreloader.lua` now, the information that is cached is now called from that script
This also includes better handling of ESX cached data and should stop errors
This greatly optimizes the loading of all my scripts and lowers server load to speed up server start times
I have been testing this for just under a week and 6 different test servers and it appears to work fine
I've separated the built-in custom native GTA Notifications, skillcheck and draw text targets to separate files to be loaded along side `jim_bridge`
This now makes it so they only load once instead of with every single script, and each one can call on it
This change also makes these systems able to be called outside of `jim_bridge`
For example in my test server I'm currently using:
```lua
function QBCore.Functions.Notify(text, texttype, length, icon)
CreateThread(function()
exports.jim_bridge:Notify(nil, text, icon)
end)
end
```
This should fix issues for crafting complaining inventories are open when they aren't
I was trying to use per inventory checks for them being open until I realised I could just use `IsNuiFocused()` for all inventories to check if there was an nui on the screen that used the mouse, this should be a good workaround for it