Having watched all the tutorials I think I need to, I am trying to refactor my earlier code to better use features of Godot such as resources. It will likely be a tall order to have it ready for my programming partner by tomorrow, especially with more demands on my time coming up later today.
OK after two focus sessions, I have my existing ingredient selection screen working with the new Resource-based Ingredients!
Next up I want to do some serious refactoring of the UI itself to better match the tutorial I watched, which was trying to recreate Slay the Spire, which seems to be a very good match for what we want to do on this screen.
After doing some major folder hierarchy restructuring, next up in my big refactor is getting drag and drop working, and it seems to be doing so!
The tutorial did everything in sprites and collision areas, but before I found that tutorial, I had found one that uses Godot 4's built-in drag-and-drop functionality for Control objects that are part of the UI hierarchy rather than the standard Node hierarchy. Since my UI is all Controls rather than Nodes, I just decided to use that instead, and it was way simpler, but we'll see if there are things that are annoying1.
The next thing is to also refactor how the keyboard and controller moves things through the different drop areas because as of now, the mouse drag-and-drop breaks my existing input code. I think I have a good design that will feel very natural, though I suspect that non-mouse players may actually be at a speed advantage2.
-
As an example of simplicity, the tutorial created a whole state machine for base, clicking, dragging, and releasing, but I just needed to override some basic signal methods like
_GetDragDataand_CanDropData. -
I don't have a problem with that because I honestly prefer controller to MKB, even for PC games...
