summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadio <radiohotline@disroot.org>2026-04-20 21:32:25 +0300
committerRadio <radiohotline@disroot.org>2026-04-20 21:32:25 +0300
commita516eb1ea9ecd1b5f0dc320736e111f785e92b85 (patch)
tree36e5fa08c8f62e55eab18f2b7548ad8981479aad
parent47d6d16267965387465460c28078a378a5bfbc62 (diff)
uagghhhhHEADmain
-rw-r--r--icon.tscn36
-rw-r--r--project.godot4
-rw-r--r--scripts/app.gd13
-rw-r--r--scripts/text_edit.gd2
-rw-r--r--scripts/window.gd15
-rw-r--r--test.tscn121
6 files changed, 115 insertions, 76 deletions
diff --git a/icon.tscn b/icon.tscn
new file mode 100644
index 0000000..4a6f964
--- /dev/null
+++ b/icon.tscn
@@ -0,0 +1,36 @@
+[gd_scene load_steps=2 format=3 uid="uid://tbokbp8tfhay"]
+
+[ext_resource type="Script" path="res://scripts/app.gd" id="1_0mkpb"]
+
+[node name="Icon" type="Control"]
+custom_minimum_size = Vector2(100, 100)
+layout_mode = 3
+anchors_preset = 0
+offset_right = 125.0
+offset_bottom = 130.0
+script = ExtResource("1_0mkpb")
+
+[node name="Highlight" type="ColorRect" parent="."]
+layout_mode = 1
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+mouse_filter = 2
+color = Color(0, 0.737255, 0.737255, 0.482353)
+
+[node name="Icon" type="Sprite2D" parent="."]
+position = Vector2(62, 60)
+
+[node name="Label" type="Label" parent="."]
+layout_mode = 1
+anchors_preset = 12
+anchor_top = 1.0
+anchor_right = 1.0
+anchor_bottom = 1.0
+offset_top = -23.0
+grow_horizontal = 2
+grow_vertical = 0
+horizontal_alignment = 1
+autowrap_mode = 3
diff --git a/project.godot b/project.godot
index b9de75c..7cc4842 100644
--- a/project.godot
+++ b/project.godot
@@ -11,8 +11,8 @@ config_version=5
[application]
config/name="Programmer game"
-run/main_scene="uid://ctyp7ogh4dg4m"
-config/features=PackedStringArray("4.5", "Forward Plus")
+run/main_scene="res://test.tscn"
+config/features=PackedStringArray("4.2", "Forward Plus")
config/icon="res://icon.svg"
[input]
diff --git a/scripts/app.gd b/scripts/app.gd
index 18ad260..ffaaa5f 100644
--- a/scripts/app.gd
+++ b/scripts/app.gd
@@ -1,10 +1,8 @@
-extends Area2D
+extends Control
-signal open_app(app_name: String)
+signal open_app()
-enum Apps { NOTEPAD, FOLDER }
-
-@export var app_name: Apps
+@onready var highlight = $Highlight
var _mouse_in = false
@@ -14,11 +12,12 @@ func _ready() -> void:
func _process(_delta: float) -> void:
if Input.is_action_just_pressed("mouse1") and _mouse_in:
- open_app.emit(app_name)
+ open_app.emit()
func _on_mouse_entered():
_mouse_in = true
+ highlight.visible = true
func _on_mouse_exited():
_mouse_in = false
-
+ highlight.visible = false
diff --git a/scripts/text_edit.gd b/scripts/text_edit.gd
index 2ae2839..34eb2f1 100644
--- a/scripts/text_edit.gd
+++ b/scripts/text_edit.gd
@@ -1 +1 @@
-pass
+extends TextEdit
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
diff --git a/test.tscn b/test.tscn
index 7421bfe..390e3d3 100644
--- a/test.tscn
+++ b/test.tscn
@@ -1,80 +1,81 @@
-[gd_scene load_steps=9 format=3 uid="uid://ctyp7ogh4dg4m"]
+[gd_scene load_steps=6 format=3 uid="uid://ctyp7ogh4dg4m"]
[ext_resource type="Texture2D" uid="uid://dasy6m8kpf6ca" path="res://img/pc/wallpaper.jpg" id="1_37kl0"]
-[ext_resource type="Script" uid="uid://d0f04tfkwu6d5" path="res://scripts/app.gd" id="2_6uqi0"]
[ext_resource type="Texture2D" uid="uid://bkd1wowcckcp3" path="res://img/pc/notepad.png" id="2_8uh7m"]
+[ext_resource type="PackedScene" uid="uid://tbokbp8tfhay" path="res://icon.tscn" id="4_5j76u"]
[ext_resource type="Texture2D" uid="uid://ch74o71t4kjv" path="res://img/pc/folder.png" id="4_ppyta"]
-[ext_resource type="Script" uid="uid://d2k4wxk8xqctr" path="res://scripts/window.gd" id="5_g14j6"]
-[ext_resource type="Texture2D" uid="uid://whn2knfhmikb" path="res://img/pc/win.png" id="5_ykrsh"]
+[ext_resource type="Script" path="res://scripts/window.gd" id="5_g14j6"]
-[sub_resource type="RectangleShape2D" id="RectangleShape2D_8uh7m"]
-size = Vector2(110, 125)
+[node name="Main" type="Control"]
+layout_mode = 3
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+mouse_filter = 2
-[sub_resource type="RectangleShape2D" id="RectangleShape2D_g14j6"]
-size = Vector2(586, 367)
+[node name="Wallpaper" type="TextureRect" parent="."]
+layout_mode = 1
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+offset_right = 768.0
+offset_bottom = 552.0
+grow_horizontal = 2
+grow_vertical = 2
+texture = ExtResource("1_37kl0")
+expand_mode = 3
-[node name="Main" type="Node2D"]
+[node name="Notepad" type="Window" parent="."]
+title = "Notepad"
+initial_position = 2
+size = Vector2i(500, 300)
+visible = false
+script = ExtResource("5_g14j6")
-[node name="Wallpaper" type="Sprite2D" parent="."]
-position = Vector2(576, 324.00003)
-scale = Vector2(0.59999996, 0.54)
-texture = ExtResource("1_37kl0")
+[node name="TextEdit" type="TextEdit" parent="Notepad"]
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+wrap_mode = 1
+caret_blink = true
+
+[node name="Folder" type="Window" parent="."]
+title = "Folder"
+initial_position = 2
+size = Vector2i(500, 300)
+visible = false
+script = ExtResource("5_g14j6")
-[node name="Notepad_Icon" type="Area2D" parent="."]
-script = ExtResource("2_6uqi0")
+[node name="Notepad_Icon" parent="." instance=ExtResource("4_5j76u")]
+offset_left = 64.0
+offset_top = 56.0
+offset_right = 189.0
+offset_bottom = 186.0
-[node name="Notepad" type="Sprite2D" parent="Notepad_Icon"]
-position = Vector2(104, 84)
+[node name="Icon" parent="Notepad_Icon" index="1"]
texture = ExtResource("2_8uh7m")
-[node name="Label" type="Label" parent="Notepad_Icon"]
-offset_left = 61.0
-offset_top = 133.0
-offset_right = 129.0
-offset_bottom = 156.0
+[node name="Label" parent="Notepad_Icon" index="2"]
text = "Notepad"
-[node name="CollisionShape2D" type="CollisionShape2D" parent="Notepad_Icon"]
-position = Vector2(100, 95.5)
-shape = SubResource("RectangleShape2D_8uh7m")
-
-[node name="Folder_Icon" type="Area2D" parent="."]
-script = ExtResource("2_6uqi0")
+[node name="Folder_Icon" parent="." instance=ExtResource("4_5j76u")]
+offset_left = 50.0
+offset_top = 253.0
+offset_right = 175.0
+offset_bottom = 383.0
-[node name="Folder" type="Sprite2D" parent="Folder_Icon"]
-position = Vector2(105, 289)
+[node name="Icon" parent="Folder_Icon" index="1"]
texture = ExtResource("4_ppyta")
-[node name="Label" type="Label" parent="Folder_Icon"]
-offset_left = 68.0
-offset_top = 328.0
-offset_right = 136.0
-offset_bottom = 351.0
+[node name="Label" parent="Folder_Icon" index="2"]
text = "Folder"
-[node name="CollisionShape2D" type="CollisionShape2D" parent="Folder_Icon"]
-position = Vector2(100, 294)
-shape = SubResource("RectangleShape2D_8uh7m")
-
-[node name="Notepad" type="Area2D" parent="."]
-script = ExtResource("5_g14j6")
-
-[node name="Window" type="Sprite2D" parent="Notepad"]
-position = Vector2(767.00006, 357)
-scale = Vector2(12.219999, 8)
-texture = ExtResource("5_ykrsh")
-
-[node name="CollisionShape2D" type="CollisionShape2D" parent="Notepad"]
-position = Vector2(767, 356)
-shape = SubResource("RectangleShape2D_g14j6")
-
-[node name="TextEdit" type="TextEdit" parent="Notepad"]
-offset_left = 475.0
-offset_top = 173.0
-offset_right = 1060.0
-offset_bottom = 544.0
-backspace_deletes_composite_character_enabled = true
-wrap_mode = 1
-caret_blink = true
+[connection signal="open_app" from="Notepad_Icon" to="Notepad" method="_on_open_app"]
+[connection signal="open_app" from="Folder_Icon" to="Folder" method="_on_open_app"]
-[connection signal="open_app" from="Notepad_Icon" to="Notepad" method="_on_notepad_icon_open_app"]
+[editable path="Notepad_Icon"]
+[editable path="Folder_Icon"]