I'm redoing the inventory system, and in the process I learned a valuable lesson about planning.
When I started working on the inventory, I thought I would use the "drag and drop" built-in functionality of Godot 4. I was able to get that set up quickly and without much trouble, but I didn't take the time to think about what dragging would actually "do". I had a vague idea: I wanted to be able to drag an entire stack of items, and then ... maybe single-click to select a single item? But what about right-clicking? What about right-click-and-drag?
Turns out this isn't nearly as simple to handle as I thought. For one, there is no built-in functionality to handle right-click-and-drag in Godot. I posted on reddit for help, and got a really fantastic answer for how I could hack together a way to simulate a right-click-and-drag. But it was really fragile, and I soon realized that if I wanted to support controllers (which I'm starting to do already), I would end up rewriting the whole thing anyway.
No comments:
Post a Comment