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 | |
| parent | 9ee544bd13f358d39fd549d4127a96073c86637e (diff) | |
peace and love on planet earth (added preliminary icons and windows)
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/app.gd | 24 | ||||
| -rw-r--r-- | scripts/app.gd.uid | 1 | ||||
| -rw-r--r-- | scripts/text_edit.gd | 1 | ||||
| -rw-r--r-- | scripts/text_edit.gd.uid | 1 | ||||
| -rw-r--r-- | scripts/window.gd | 22 | ||||
| -rw-r--r-- | scripts/window.gd.uid | 1 |
6 files changed, 50 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 + diff --git a/scripts/app.gd.uid b/scripts/app.gd.uid new file mode 100644 index 0000000..dc41de5 --- /dev/null +++ b/scripts/app.gd.uid @@ -0,0 +1 @@ +uid://d0f04tfkwu6d5 diff --git a/scripts/text_edit.gd b/scripts/text_edit.gd new file mode 100644 index 0000000..2ae2839 --- /dev/null +++ b/scripts/text_edit.gd @@ -0,0 +1 @@ +pass diff --git a/scripts/text_edit.gd.uid b/scripts/text_edit.gd.uid new file mode 100644 index 0000000..eadac18 --- /dev/null +++ b/scripts/text_edit.gd.uid @@ -0,0 +1 @@ +uid://btimg4864c7gg diff --git a/scripts/window.gd b/scripts/window.gd new file mode 100644 index 0000000..75f29a7 --- /dev/null +++ b/scripts/window.gd @@ -0,0 +1,22 @@ +extends Area2D + +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 + +func _process(_delta: float) -> void: + if Input.is_action_just_pressed("mouse1") and _mouse_in: + pass + +func _on_mouse_entered(): + _mouse_in = true + +func _on_mouse_exited(): + _mouse_in = false + +func _on_notepad_icon_open_app(app_name: Variant) -> void: + window.visible = !window.visible diff --git a/scripts/window.gd.uid b/scripts/window.gd.uid new file mode 100644 index 0000000..e5a199f --- /dev/null +++ b/scripts/window.gd.uid @@ -0,0 +1 @@ +uid://d2k4wxk8xqctr |
