fix: reduce debug spam
This commit is contained in:
parent
6c9bbe871d
commit
69cec724f5
|
|
@ -173,7 +173,7 @@ func play():
|
||||||
|
|
||||||
|
|
||||||
func _unhandled_input(event: InputEvent) -> void:
|
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
|
var just_revealed_text := false
|
||||||
if event is InputEventMouseButton:
|
if event is InputEventMouseButton:
|
||||||
if event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
|
if event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
|
||||||
|
|
@ -221,7 +221,3 @@ func _on_text_finished():
|
||||||
func _emit_thunder() -> void:
|
func _emit_thunder() -> void:
|
||||||
if State.room is YouthRoom: (State.room as YouthRoom).play_thunder()
|
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)
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ class_name Playable
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
prints("playable.gd", "_ready()", self)
|
prints("playable.gd", "_ready()", self)
|
||||||
|
visibility_changed.connect(_visibility_change)
|
||||||
hide()
|
hide()
|
||||||
# HACK: Lets us debug playables more easily
|
# HACK: Lets us debug playables more easily
|
||||||
if get_parent() == get_tree().root: _debug_mode()
|
if get_parent() == get_tree().root: _debug_mode()
|
||||||
|
|
@ -42,3 +43,10 @@ func _debug_mode():
|
||||||
await get_tree().create_timer(1).timeout
|
await get_tree().create_timer(1).timeout
|
||||||
appear()
|
appear()
|
||||||
play()
|
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())
|
||||||
|
|
||||||
|
|
@ -16,7 +16,7 @@ func _find_selectable_in(parent:Control) -> Control:
|
||||||
return self
|
return self
|
||||||
|
|
||||||
func _unhandled_input(event : InputEvent) -> void:
|
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_type():
|
||||||
if event.is_action_pressed("ui_left"): previous()
|
if event.is_action_pressed("ui_left"): previous()
|
||||||
elif event.is_action_pressed("ui_right"): next()
|
elif event.is_action_pressed("ui_right"): next()
|
||||||
|
|
@ -41,6 +41,8 @@ func previous() -> void:
|
||||||
else:
|
else:
|
||||||
current_tab -= 1
|
current_tab -= 1
|
||||||
|
|
||||||
func notification(what: int, _reversed: bool = false) -> void:
|
func _notification(what: int, _reversed: bool = false) -> void:
|
||||||
if what == NOTIFICATION_VISIBILITY_CHANGED:
|
if what == NOTIFICATION_VISIBILITY_CHANGED:
|
||||||
|
prints(name, "NOTIFICATION_VISIBILITY_CHANGED", visible)
|
||||||
self.set_process_input(visible)
|
self.set_process_input(visible)
|
||||||
|
self.set_process_unhandled_input(visible)
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ func _load_room(scene_path: String) -> void:
|
||||||
var last_mode := DisplayServer.WINDOW_MODE_WINDOWED
|
var last_mode := DisplayServer.WINDOW_MODE_WINDOWED
|
||||||
|
|
||||||
func _unhandled_input(event: InputEvent) -> void:
|
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"):
|
if event.is_action_pressed("ui_pause"):
|
||||||
state = AppState.PAUSE
|
state = AppState.PAUSE
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue