From 69cec724f5e00d181c8f491f063934a002c0780b Mon Sep 17 00:00:00 2001 From: Tiger Jove Date: Thu, 22 Jan 2026 17:05:27 +0100 Subject: [PATCH] fix: reduce debug spam --- src/logic-scenes/luna/playables/story_playable.gd | 6 +----- src/logic-scenes/playable.gd | 8 ++++++++ src/logic-scenes/startup/accessibility_container.gd | 6 ++++-- src/singletons/main/main.gd | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/logic-scenes/luna/playables/story_playable.gd b/src/logic-scenes/luna/playables/story_playable.gd index 3fcae45..c8292c1 100644 --- a/src/logic-scenes/luna/playables/story_playable.gd +++ b/src/logic-scenes/luna/playables/story_playable.gd @@ -173,7 +173,7 @@ func play(): func _unhandled_input(event: InputEvent) -> void: - if event.is_action_type(): print_debug("Unhandled Input", event) + #if event.is_action_type(): print_debug("Unhandled Input", event) var just_revealed_text := false if event is InputEventMouseButton: if event.button_index == MOUSE_BUTTON_WHEEL_DOWN: @@ -221,7 +221,3 @@ func _on_text_finished(): func _emit_thunder() -> void: if State.room is YouthRoom: (State.room as YouthRoom).play_thunder() - -func notification(what: int, _reversed: bool = false) -> void: - if what == NOTIFICATION_VISIBILITY_CHANGED: - self.set_process_input(visible) diff --git a/src/logic-scenes/playable.gd b/src/logic-scenes/playable.gd index e1d0d97..50250e8 100644 --- a/src/logic-scenes/playable.gd +++ b/src/logic-scenes/playable.gd @@ -5,6 +5,7 @@ class_name Playable func _ready() -> void: prints("playable.gd", "_ready()", self) + visibility_changed.connect(_visibility_change) hide() # HACK: Lets us debug playables more easily if get_parent() == get_tree().root: _debug_mode() @@ -42,3 +43,10 @@ func _debug_mode(): await get_tree().create_timer(1).timeout appear() play() + + +func _visibility_change(): + prints(name, "NOTIFICATION_VISIBILITY_CHANGED", is_visible_in_tree()) + self.set_process_input(is_visible_in_tree()) + self.set_process_unhandled_input(is_visible_in_tree()) + \ No newline at end of file diff --git a/src/logic-scenes/startup/accessibility_container.gd b/src/logic-scenes/startup/accessibility_container.gd index 910a1fa..7cc3ac5 100644 --- a/src/logic-scenes/startup/accessibility_container.gd +++ b/src/logic-scenes/startup/accessibility_container.gd @@ -16,7 +16,7 @@ func _find_selectable_in(parent:Control) -> Control: return self func _unhandled_input(event : InputEvent) -> void: - if event.is_action_type(): print_debug("Unhandled Input", event) + #if event.is_action_type(): print_debug("Unhandled Input", event) if event.is_action_type(): if event.is_action_pressed("ui_left"): previous() elif event.is_action_pressed("ui_right"): next() @@ -41,6 +41,8 @@ func previous() -> void: else: current_tab -= 1 -func notification(what: int, _reversed: bool = false) -> void: +func _notification(what: int, _reversed: bool = false) -> void: if what == NOTIFICATION_VISIBILITY_CHANGED: + prints(name, "NOTIFICATION_VISIBILITY_CHANGED", visible) self.set_process_input(visible) + self.set_process_unhandled_input(visible) diff --git a/src/singletons/main/main.gd b/src/singletons/main/main.gd index 3e6cee0..935a2b0 100644 --- a/src/singletons/main/main.gd +++ b/src/singletons/main/main.gd @@ -109,7 +109,7 @@ func _load_room(scene_path: String) -> void: var last_mode := DisplayServer.WINDOW_MODE_WINDOWED func _unhandled_input(event: InputEvent) -> void: - if not event.is_action_type(): return + #if event.is_action_type(): print_debug("Unhandled Input", event) if event.is_action_pressed("ui_pause"): state = AppState.PAUSE