From 5b315bb0ee60078aaaab4088ea5b08bf248fd9de Mon Sep 17 00:00:00 2001 From: Duncan Brown Date: Thu, 11 Aug 2022 19:29:05 -0400 Subject: [PATCH] fix: allows inactive/non-interactive item clicks to pass through to appropriate background click event --- addons/escoria-core/game/esc_inputs_manager.gd | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/addons/escoria-core/game/esc_inputs_manager.gd b/addons/escoria-core/game/esc_inputs_manager.gd index 44cc95c37..3cc0bbbe5 100644 --- a/addons/escoria-core/game/esc_inputs_manager.gd +++ b/addons/escoria-core/game/esc_inputs_manager.gd @@ -344,6 +344,10 @@ func _on_mouse_left_clicked_item(item: ESCItem, event: InputEvent) -> void: self, "Ignoring left click on %s with event %s." % [item.global_id, event] ) + + # Treat this as a background click now + _on_left_click_on_bg(item.global_position) + return if hover_stack.empty() or hover_stack.back() == item: @@ -374,6 +378,10 @@ func _on_mouse_left_double_clicked_item( self, "Ignoring double-left click on %s with event %s." % [item.global_id, event] ) + + # Treat this as a background click now + _on_double_left_click_on_bg(item.global_position) + return escoria.logger.info( @@ -400,6 +408,10 @@ func _on_mouse_right_clicked_item(item: ESCItem, event: InputEvent) -> void: self, "Ignoring right click on %s with event %s." % [item.global_id, event] ) + + # Treat this as a background click now + _on_right_click_on_bg(item.global_position) + return escoria.logger.info(