Phazorknight / Cogito

Immersive Sim Template Project for GODOT 4
MIT License
670 stars 72 forks source link

Unrelated inventory squares are highlighted when squares are selected #216

Open BryceBarbara opened 2 weeks ago

BryceBarbara commented 2 weeks ago

Cogito and Godot Engine Version: The Cogito pulled from master - v4.3.beta1.mono.official [a4f2ea91a]

Description: When using a mouse, selecting an object's inventory square (populated or not) causes a corresponding player's inventory slot to highlight.

I believe this line of code is the culprit. It appears it might need a check above it to see if the player is using a mouse/gamepad.

Unrelated to the bug, I think InputHelper could use a is_using_mouse() method that does the device_index == -1 check. That would remove the need to know the implementation details of InputHelper.

Reproduction steps:

  1. Open an object's inventory
  2. Click on some squares
  3. See the player's inventory highlight

Expected behavior: I would expect nothing to happen to any of the inventory squares except for the one I am interacting with.

Screenshots:

https://github.com/Phazorknight/Cogito/assets/24460210/82371e2c-44e2-4fd0-91e0-6b085b9a12ae