diff options
| author | radiohotline <radiohotline@disroot.org> | 2026-01-22 16:16:25 +0300 |
|---|---|---|
| committer | radiohotline <radiohotline@disroot.org> | 2026-01-22 16:16:25 +0300 |
| commit | 47d6d16267965387465460c28078a378a5bfbc62 (patch) | |
| tree | b6baad3552287a168cafcd8bd284666d7c53a3d7 /scripts/app.gd | |
| parent | 9ee544bd13f358d39fd549d4127a96073c86637e (diff) | |
peace and love on planet earth (added preliminary icons and windows)
Diffstat (limited to 'scripts/app.gd')
| -rw-r--r-- | scripts/app.gd | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/app.gd b/scripts/app.gd new file mode 100644 index 0000000..18ad260 --- /dev/null +++ b/scripts/app.gd @@ -0,0 +1,24 @@ +extends Area2D + +signal open_app(app_name: String) + +enum Apps { NOTEPAD, FOLDER } + +@export var app_name: Apps + +var _mouse_in = false + +func _ready() -> void: + mouse_entered.connect(_on_mouse_entered) + mouse_exited.connect(_on_mouse_exited) + +func _process(_delta: float) -> void: + if Input.is_action_just_pressed("mouse1") and _mouse_in: + open_app.emit(app_name) + +func _on_mouse_entered(): + _mouse_in = true + +func _on_mouse_exited(): + _mouse_in = false + |
