Skip to content

Best practice or template to interface with the inventory? #104

Answered by peter-kish
BigBroken asked this question in Q&A
Discussion options

You must be logged in to vote

Hi!
Connecting to the inventory_item_acitivated signal should do the trick. It's defined for the CtrlInventory, CtrlInventoryGrid and CtrlInventoryStacked classes and gets emitted when an item is double-clicked in the inventory.

I should probably update the examples to demonstrate this, as it is a pretty common mechanic.

Another way of doing this could be to get all the selected items with get_selected_inventory_items() and do something with them when clicking a button or pressing a key.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BigBroken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants