qbcore-framework / qb-inventory

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

Allow info.label and info.description to control the flow of items through the inventory [SUGGESTION] #469

Closed ZeusesNeckMeat closed 8 months ago

ZeusesNeckMeat commented 11 months ago

The problem

I realize that the problem I ran into is probably rather unique, but I still think it might be worth talking about. In the process of creating a new script I ended up with a new item that I wanted to be able to have different names. Like, thousands of different names (I probably went a little overboard in this script but it works). With that I didn't want to have to add thousands of different items because really these are all the same item, just with a different display name. Currently this isn't possible in qb-inventory.

My main use case for this was a drug script I wrote where weed has many different strains, but all strains should be treated the same way.

Ideal solution

My proposed solution is to make a few changes to qb-inventory/server/main.lua in order to display a single "item" as multiple different items in the player's inventory. I am willing to put out a PR for these changes myself, but I wanted to add the suggestion to get thoughts before doing so. The changes are as follows:

These changes should prevent, or at least drastically reduce, the chances of breaking existing expected functionality, while expanding on the functionality to allow for the same item type to be displayed differently in the UI, without each variation requiring a new item entirely.

Alternative solutions

No response

Additional context

No response

github-actions[bot] commented 9 months ago

This issue has had 60 days of inactivity & will close within 7 days