From 8c23ec64fa9a3fa02d118b13527f7882ceb7ed16 Mon Sep 17 00:00:00 2001 From: Mosh Date: Fri, 14 Feb 2025 12:33:41 +0100 Subject: [PATCH] TD-66 CodeCleanup2.0 --- scenes/login.tscn | 61 +++++++++++++++++--- scenes/username_input.gd | 11 ---- scenes/username_label.gd | 11 ---- scripts/Login/login_button.gd | 19 ------ {scenes => scripts/login}/v_box_container.gd | 2 +- test.gd | 11 ---- 6 files changed, 55 insertions(+), 60 deletions(-) delete mode 100644 scenes/username_input.gd delete mode 100644 scenes/username_label.gd delete mode 100644 scripts/Login/login_button.gd rename {scenes => scripts/login}/v_box_container.gd (81%) delete mode 100644 test.gd diff --git a/scenes/login.tscn b/scenes/login.tscn index 6059615..c427b7f 100644 --- a/scenes/login.tscn +++ b/scenes/login.tscn @@ -1,12 +1,59 @@ [gd_scene load_steps=6 format=3 uid="uid://dtaaw31x3n22f"] -[ext_resource type="Script" path="res://scenes/v_box_container.gd" id="1_xvh5p"] -[ext_resource type="Script" path="res://scripts/Login/login_button.gd" id="2_lg3ab"] -[ext_resource type="Script" path="res://scenes/username_label.gd" id="2_sxlqo"] -[ext_resource type="Script" path="res://scenes/username_input.gd" id="3_q2601"] +[ext_resource type="Script" path="res://scripts/login/v_box_container.gd" id="1_xvh5p"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_d0bbp"] +[sub_resource type="GDScript" id="GDScript_ol411"] +script/source = "extends RichTextLabel + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass +" + +[sub_resource type="GDScript" id="GDScript_4n687"] +script/source = "extends LineEdit + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass +" + +[sub_resource type="GDScript" id="GDScript_7g1da"] +script/source = "extends Node + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + + +func _on_button_up() -> void: + + pass # Replace with function body. + + +func _on_username_input_text_changed(new_text: String) -> void: + pass # Replace with function body. +" + [node name="Login" type="Control"] layout_mode = 3 anchors_preset = 15 @@ -61,11 +108,11 @@ text = "Username: " fit_content = true scroll_active = false -script = ExtResource("2_sxlqo") +script = SubResource("GDScript_ol411") [node name="UsernameInput" type="LineEdit" parent="Panel/VBoxContainer/InputContainer/UsernameContainer"] layout_mode = 2 -script = ExtResource("3_q2601") +script = SubResource("GDScript_4n687") [node name="PasswordContainer" type="VBoxContainer" parent="Panel/VBoxContainer/InputContainer"] layout_mode = 2 @@ -82,7 +129,7 @@ layout_mode = 2 [node name="Button" type="Button" parent="Panel/VBoxContainer"] layout_mode = 2 text = "Login" -script = ExtResource("2_lg3ab") +script = SubResource("GDScript_7g1da") [node name="HTTPRequest" type="HTTPRequest" parent="Panel/VBoxContainer"] diff --git a/scenes/username_input.gd b/scenes/username_input.gd deleted file mode 100644 index 58b3a3a..0000000 --- a/scenes/username_input.gd +++ /dev/null @@ -1,11 +0,0 @@ -extends LineEdit - - -# Called when the node enters the scene tree for the first time. -func _ready() -> void: - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - pass diff --git a/scenes/username_label.gd b/scenes/username_label.gd deleted file mode 100644 index 936b642..0000000 --- a/scenes/username_label.gd +++ /dev/null @@ -1,11 +0,0 @@ -extends RichTextLabel - - -# Called when the node enters the scene tree for the first time. -func _ready() -> void: - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - pass diff --git a/scripts/Login/login_button.gd b/scripts/Login/login_button.gd deleted file mode 100644 index 14eb290..0000000 --- a/scripts/Login/login_button.gd +++ /dev/null @@ -1,19 +0,0 @@ -extends Node - -# Called when the node enters the scene tree for the first time. -func _ready() -> void: - pass - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - pass - - -func _on_button_up() -> void: - - pass # Replace with function body. - - -func _on_username_input_text_changed(new_text: String) -> void: - pass # Replace with function body. diff --git a/scenes/v_box_container.gd b/scripts/login/v_box_container.gd similarity index 81% rename from scenes/v_box_container.gd rename to scripts/login/v_box_container.gd index 8a8f0cd..88d6993 100644 --- a/scenes/v_box_container.gd +++ b/scripts/login/v_box_container.gd @@ -20,5 +20,5 @@ func _on_button_button_up() -> void: $HTTPRequest.request(url, headers, HTTPClient.METHOD_POST, json) -func _on_http_request_request_completed(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray) -> void: +func _on_http_request_request_completed( result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray) -> void: print(body.get_string_from_utf8()) diff --git a/test.gd b/test.gd deleted file mode 100644 index a1d4176..0000000 --- a/test.gd +++ /dev/null @@ -1,11 +0,0 @@ -extends Control - - -# Called when the node enters the scene tree for the first time. -func _ready() -> void: - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - pass