peter-kish / gloot

A universal inventory system for the Godot game engine.
MIT License
561 stars 20 forks source link

Feature: hide item in grid inventory when dragging #219

Closed Sod3n closed 2 months ago

Sod3n commented 2 months ago

Description

Now when we grab item it will hide in grid but still present as drag preview attached to cursor. On drag end item will show again in inventory\slot grid.

Notes

I`m not very familiar with source code so implementation may be not the best. Still all tests passed and feature works as intend. At least it my voice contribution to that this behaviour should be default.

peter-kish commented 2 months ago

I had to revert the changes after all :( It seemed like a good solution, but caused some bugs where the items would stay hidden. Anyways, I implemented an alternative solution and now it seems to work fine. Basically, I moved the show/hide code into ctrl_inventory_item_rect.gd so that it only happens on one place vs on multiple places (ctrl_inventory_grid_basic.gd and ctrl_item_slot.gd).