debug: add logging to inventory overlay and backpack for click debugging
This commit is contained in:
@@ -224,12 +224,13 @@ func _on_inventory_changed() -> void:
|
||||
_update_floating_item()
|
||||
|
||||
func _gui_input(event: InputEvent) -> void:
|
||||
|
||||
print("[BACKPACK] _gui_input: %s, state=%s" % [event, State.keys()[_state]])
|
||||
if event is InputEventMouseButton and event.pressed and event.button_index == 1:
|
||||
print("OBTAINED")
|
||||
if _state == State.IDLE:
|
||||
print("[BACKPACK] transitioning to OPEN")
|
||||
transition_to(State.OPEN)
|
||||
elif _state == State.OPEN:
|
||||
print("[BACKPACK] transitioning to IDLE")
|
||||
transition_to(State.IDLE)
|
||||
|
||||
func _notification(what: int) -> void:
|
||||
|
||||
@@ -33,6 +33,10 @@ func _ready() -> void:
|
||||
InventoryManager.combination_attempted.connect(_on_combination_attempted)
|
||||
|
||||
func show_overlay() -> void:
|
||||
print("[OVERLAY] show_overlay called, inventory has %d items" % InventoryManager.inventory.size())
|
||||
|
||||
func hide_overlay() -> void:
|
||||
print("[OVERLAY] hide_overlay called")
|
||||
_refresh_grid()
|
||||
if _fade_tween:
|
||||
_fade_tween.kill()
|
||||
@@ -95,6 +99,7 @@ func _refresh_grid() -> void:
|
||||
grid.columns = SLOTS_PER_ROW
|
||||
|
||||
func _on_slot_clicked(item_id: String) -> void:
|
||||
print("[OVERLAY] _on_slot_clicked: '%s', input_active=%s" % [item_id, input_active])
|
||||
if not input_active:
|
||||
return
|
||||
|
||||
@@ -179,6 +184,7 @@ func _update_hover_label() -> void:
|
||||
hover_label.text = ""
|
||||
|
||||
func _on_background_gui_input(event: InputEvent) -> void:
|
||||
print("[OVERLAY] background clicked")
|
||||
if event is InputEventMouseButton and event.button_index == 1 and event.pressed:
|
||||
hide_overlay()
|
||||
close_requested.emit()
|
||||
|
||||
@@ -35,8 +35,10 @@ func set_hover(hovered: bool) -> void:
|
||||
item_box.color = Color(0.8, 0.8, 0.8, 1)
|
||||
|
||||
func _gui_input(event: InputEvent) -> void:
|
||||
print("[SLOT:%s] _gui_input: %s" % [item_id, event])
|
||||
if event is InputEventMouseButton:
|
||||
if event.button_index == 1 and event.pressed:
|
||||
print("[SLOT:%s] emitting clicked" % item_id)
|
||||
clicked.emit(item_id)
|
||||
elif event.button_index == 2:
|
||||
right_clicked.emit(item_id)
|
||||
|
||||
Reference in New Issue
Block a user