fix: single-click selects item and closes overlay
This commit is contained in:
@@ -101,12 +101,13 @@ func _on_slot_clicked(item_id: String) -> void:
|
|||||||
for child in grid.get_children():
|
for child in grid.get_children():
|
||||||
if child is InventorySlot and child.item_id == item_id:
|
if child is InventorySlot and child.item_id == item_id:
|
||||||
if _selected_slot == null:
|
if _selected_slot == null:
|
||||||
_selected_slot = child
|
InventoryManager.select_item(item_id)
|
||||||
_drag_start_time = Time.get_ticks_msec() / 1000.0
|
item_confirmed.emit(item_id)
|
||||||
_is_dragging = true
|
hide_overlay()
|
||||||
_create_drag_preview(child)
|
|
||||||
elif _selected_slot.item_id == item_id:
|
elif _selected_slot.item_id == item_id:
|
||||||
_handle_release_same_item()
|
InventoryManager.select_item(item_id)
|
||||||
|
item_confirmed.emit(item_id)
|
||||||
|
hide_overlay()
|
||||||
else:
|
else:
|
||||||
combine_requested.emit(_selected_slot.item_id, item_id)
|
combine_requested.emit(_selected_slot.item_id, item_id)
|
||||||
_clear_selection()
|
_clear_selection()
|
||||||
|
|||||||
Reference in New Issue
Block a user