diff options
| author | Radio <radiohotline@disroot.org> | 2026-04-20 21:32:25 +0300 |
|---|---|---|
| committer | Radio <radiohotline@disroot.org> | 2026-04-20 21:32:25 +0300 |
| commit | a516eb1ea9ecd1b5f0dc320736e111f785e92b85 (patch) | |
| tree | 36e5fa08c8f62e55eab18f2b7548ad8981479aad /scripts/window.gd | |
| parent | 47d6d16267965387465460c28078a378a5bfbc62 (diff) | |
Diffstat (limited to 'scripts/window.gd')
| -rw-r--r-- | scripts/window.gd | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/window.gd b/scripts/window.gd index 75f29a7..af0b81a 100644 --- a/scripts/window.gd +++ b/scripts/window.gd @@ -1,12 +1,12 @@ -extends Area2D +extends Window var _mouse_in = false -@onready var window = $Window func _ready() -> void: mouse_entered.connect(_on_mouse_entered) mouse_exited.connect(_on_mouse_exited) - window.visible = false + close_requested.connect(_on_close_requested) + visible = false func _process(_delta: float) -> void: if Input.is_action_just_pressed("mouse1") and _mouse_in: @@ -17,6 +17,9 @@ func _on_mouse_entered(): func _on_mouse_exited(): _mouse_in = false - -func _on_notepad_icon_open_app(app_name: Variant) -> void: - window.visible = !window.visible + +func _on_open_app() -> void: + visible = true + +func _on_close_requested() -> void: + visible = false |
