Phazorknight / Cogito

Immersive Sim Template Project for GODOT 4
MIT License
865 stars 98 forks source link

Inventory System / Grid based: Item graphic doesn't get position correctly on move (game pad) #205

Open Phazorknight opened 4 months ago

Phazorknight commented 4 months ago

Cogito and Godot Engine Version: beta 202405.15 Godot 4.2.1 stable

Description: Using game pad, when moving an item in the inventory, the inital position of the grabbed item graphic always centers on the first slot in the inventory and only updates once the focus changes to a different slot.

Reproduction steps:

  1. Pick up any item.
  2. Open inventory.
  3. Move item to a slot in the inventory that is not the very first slot top left.
  4. When selecting the item using a game pad, and then pressing the "move" button, the grabbed item graphic gets positioned at the center of the first slot top left. Note that the highlighted slot is correct.

Expected behavior: I expect the grabbed item graphic to be positioned at the center of the slot I had the cursor at when I grabbed the item.

My guess is that this might be happening in inventory_interface.gd around lines 176 - 185, but wasn't able to fully pin it down.

BryceBarbara commented 3 months ago

Just to provide a visual example of it:

https://github.com/Phazorknight/Cogito/assets/24460210/a297ec40-defb-41dd-9c5f-5da5a6b2f91e