ld-56/no_cre_build_signals.gd

23 lines
413 B
GDScript3
Raw Normal View History

2024-10-07 17:07:46 +00:00
extends Node2D
var mouse_in_window
func _ready() -> void:
Triggerer.listen("released", _on_released)
func _on_released(_data):
if mouse_in_window:
get_window().grab_focus()
func _notification(blah):
match blah:
NOTIFICATION_WM_MOUSE_EXIT:
mouse_in_window = false
NOTIFICATION_WM_MOUSE_ENTER:
mouse_in_window = true
if not Persister.get_value("grabbing"):
get_window().grab_focus()