fix: wire item_confirmed signal and set item cursor icon
This commit is contained in:
@@ -193,40 +193,6 @@ func _gui_input(event: InputEvent) -> void:
|
||||
hide_overlay()
|
||||
close_requested.emit()
|
||||
|
||||
func _gui_input(event: InputEvent) -> void:
|
||||
print("HI")
|
||||
if not _is_visible:
|
||||
return
|
||||
|
||||
if event is InputEventMouseButton:
|
||||
print("CLOSE")
|
||||
if event.button_index == 1 and event.pressed:
|
||||
|
||||
_clear_selection()
|
||||
hide_overlay()
|
||||
close_requested.emit()
|
||||
if not _is_dragging:
|
||||
pass
|
||||
elif event.button_index == 1 and not event.pressed:
|
||||
if _is_dragging:
|
||||
if _hovered_slot == null:
|
||||
_clear_selection()
|
||||
hide_overlay()
|
||||
close_requested.emit()
|
||||
elif _hovered_slot == _selected_slot:
|
||||
_handle_release_same_item()
|
||||
else:
|
||||
combine_requested.emit(_selected_slot.item_id, _hovered_slot.item_id)
|
||||
_clear_selection()
|
||||
return
|
||||
|
||||
if event is InputEventMouseMotion and _is_dragging and _dragged_item:
|
||||
_dragged_item.position = get_local_mouse_position() - Vector2(24, 24)
|
||||
var panel_rect = panel.get_global_rect()
|
||||
if not panel_rect.has_point(get_global_mouse_position()):
|
||||
_clear_selection()
|
||||
hide_overlay()
|
||||
close_requested.emit()
|
||||
|
||||
func _on_combination_attempted(item_a_id: String, item_b_id: String) -> void:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user