From 15e5b2b8c77344b74fcc90c9f98a1a4eab3e39de Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sat, 21 Jan 2023 11:20:44 +1300 Subject: [PATCH] Remove references to terminal.gd --- examples/web_console/web_console.tscn | 9 +-- test/integration/terminal.test.gd | 3 - test/platform/unix/unix.test.gd | 1 - test/scenes/basic.tscn | 25 +++------ test/scenes/basic_fullscreen.tscn | 19 +++---- test/scenes/multiple_inputs.tscn | 36 ++++-------- test/scenes/pty_and_terminal.tscn | 79 +++++++++------------------ test/scenes/theme.gd | 11 +--- test/scenes/theme.tscn | 9 +-- test/scenes/write_random.tscn | 11 ++-- 10 files changed, 68 insertions(+), 135 deletions(-) diff --git a/examples/web_console/web_console.tscn b/examples/web_console/web_console.tscn index 21c83b3..4ceb74e 100644 --- a/examples/web_console/web_console.tscn +++ b/examples/web_console/web_console.tscn @@ -1,6 +1,5 @@ -[gd_scene load_steps=3 format=3 uid="uid://d3xc4utggdchf"] +[gd_scene load_steps=2 format=3 uid="uid://d3xc4utggdchf"] -[ext_resource type="Script" path="res://addons/godot_xterm/terminal.gd" id="2"] [ext_resource type="Script" path="res://examples/web_console/web_console.gd" id="3"] [node name="WebConsole" type="Control"] @@ -12,9 +11,7 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("3") -[node name="Terminal" type="Control" parent="."] -anchors_preset = 0 +[node name="Terminal" type="Terminal" parent="."] +layout_mode = 0 anchor_right = 1.0 anchor_bottom = 1.0 -focus_mode = 2 -script = ExtResource("2") diff --git a/test/integration/terminal.test.gd b/test/integration/terminal.test.gd index f05e544..d8aeffd 100644 --- a/test/integration/terminal.test.gd +++ b/test/integration/terminal.test.gd @@ -1,7 +1,5 @@ extends "res://addons/gut/test.gd" -const Terminal := preload("res://addons/godot_xterm/terminal.gd") - var terminal: Terminal @@ -42,7 +40,6 @@ func test_writing_random_data_to_terminal_does_not_crash_application(): class TestTheme: extends "res://addons/gut/test.gd" - const Terminal := preload("res://addons/godot_xterm/terminal.gd") const TestScene := preload("../scenes/theme.tscn") const default_theme := preload("res://addons/godot_xterm/themes/default.tres") diff --git a/test/platform/unix/unix.test.gd b/test/platform/unix/unix.test.gd index 641333b..ec83995 100644 --- a/test/platform/unix/unix.test.gd +++ b/test/platform/unix/unix.test.gd @@ -175,7 +175,6 @@ class TestPTYSize: # See: https://github.com/lihop/godot-xterm/issues/56 const PTY := preload("res://addons/godot_xterm/pty.gd") - const Terminal := preload("res://addons/godot_xterm/terminal.gd") var pty: PTY var terminal: Terminal diff --git a/test/scenes/basic.tscn b/test/scenes/basic.tscn index 80809a7..fdb4095 100644 --- a/test/scenes/basic.tscn +++ b/test/scenes/basic.tscn @@ -1,29 +1,22 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=2 format=3 uid="uid://bk8v3o87tcdp3"] -[ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=2] -[ext_resource path="res://test/scenes/basic.gd" type="Script" id=3] +[ext_resource type="Script" path="res://test/scenes/basic.gd" id="3"] [node name="BasicNewTerm" type="Control"] +layout_mode = 3 +anchors_preset = 0 offset_right = 43.0 offset_bottom = 43.0 -script = ExtResource( 3 ) -__meta__ = { -"_edit_use_anchors_": false -} +script = ExtResource("3") [node name="ColorRect" type="ColorRect" parent="."] +layout_mode = 0 offset_right = 40.0 offset_bottom = 40.0 -color = Color( 0, 1, 0, 1 ) -__meta__ = { -"_edit_use_anchors_": false -} +color = Color(0, 1, 0, 1) -[node name="Terminal" type="Control" parent="."] +[node name="Terminal" type="Terminal" parent="."] +layout_mode = 0 anchor_right = 1.0 anchor_bottom = 1.0 focus_mode = 1 -script = ExtResource( 2 ) -__meta__ = { -"_edit_use_anchors_": false -} diff --git a/test/scenes/basic_fullscreen.tscn b/test/scenes/basic_fullscreen.tscn index 26bb092..11661a2 100644 --- a/test/scenes/basic_fullscreen.tscn +++ b/test/scenes/basic_fullscreen.tscn @@ -1,21 +1,16 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=2 format=3 uid="uid://bo7q8qjwr52t0"] -[ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=1] -[ext_resource path="res://test/scenes/basic.gd" type="Script" id=2] +[ext_resource type="Script" path="res://test/scenes/basic.gd" id="2"] [node name="BasicNewTerm" type="Control"] +layout_mode = 3 +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -script = ExtResource( 2 ) -__meta__ = { -"_edit_use_anchors_": false -} +script = ExtResource("2") -[node name="Terminal" type="Control" parent="."] +[node name="Terminal" type="Terminal" parent="."] +layout_mode = 0 anchor_right = 1.0 anchor_bottom = 1.0 focus_mode = 1 -script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} diff --git a/test/scenes/multiple_inputs.tscn b/test/scenes/multiple_inputs.tscn index 2b7e036..bf7fd01 100644 --- a/test/scenes/multiple_inputs.tscn +++ b/test/scenes/multiple_inputs.tscn @@ -1,50 +1,34 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=1] +[gd_scene format=3 uid="uid://hc4uloxp4q2o"] [node name="HBoxContainer" type="HBoxContainer"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 [node name="HBoxContainer" type="HBoxContainer" parent="."] -offset_right = 1024.0 -offset_bottom = 600.0 +layout_mode = 2 size_flags_horizontal = 3 [node name="TextEdit" type="TextEdit" parent="HBoxContainer"] -offset_right = 338.0 -offset_bottom = 600.0 +layout_mode = 2 size_flags_horizontal = 3 [node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"] -offset_left = 342.0 -offset_right = 681.0 -offset_bottom = 600.0 +layout_mode = 2 size_flags_horizontal = 3 [node name="TextEdit3" type="TextEdit" parent="HBoxContainer/VBoxContainer"] -offset_right = 339.0 -offset_bottom = 197.0 +layout_mode = 2 size_flags_vertical = 3 -[node name="Terminal" type="Control" parent="HBoxContainer/VBoxContainer"] -offset_top = 201.0 -offset_right = 339.0 -offset_bottom = 398.0 -focus_mode = 2 +[node name="Terminal" type="Terminal" parent="HBoxContainer/VBoxContainer"] +layout_mode = 2 size_flags_vertical = 3 -script = ExtResource( 1 ) [node name="TextEdit2" type="TextEdit" parent="HBoxContainer/VBoxContainer"] -offset_top = 402.0 -offset_right = 339.0 -offset_bottom = 600.0 +layout_mode = 2 size_flags_vertical = 3 [node name="TextEdit2" type="TextEdit" parent="HBoxContainer"] -offset_left = 685.0 -offset_right = 1024.0 -offset_bottom = 600.0 +layout_mode = 2 size_flags_horizontal = 3 - -[connection signal="data_sent" from="HBoxContainer/VBoxContainer/Terminal" to="HBoxContainer/VBoxContainer/Terminal" method="write"] diff --git a/test/scenes/pty_and_terminal.tscn b/test/scenes/pty_and_terminal.tscn index 0cc79b7..7491b56 100644 --- a/test/scenes/pty_and_terminal.tscn +++ b/test/scenes/pty_and_terminal.tscn @@ -1,88 +1,67 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=2 format=3 uid="uid://31l3ufwtaidn"] -[ext_resource path="res://addons/godot_xterm/terminal.gd" type="Script" id=1] -[ext_resource path="res://addons/godot_xterm/pty.gd" type="Script" id=2] +[ext_resource type="Script" path="res://addons/godot_xterm/pty.gd" id="2"] [node name="PTYandTerminal" type="Node"] [node name="PTYChild" type="Node" parent="."] -[node name="Terminal" type="Control" parent="PTYChild"] +[node name="Terminal" type="Terminal" parent="PTYChild"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -script = ExtResource( 1 ) [node name="PTY" type="Node" parent="PTYChild/Terminal"] -script = ExtResource( 2 ) +script = ExtResource("2") terminal_path = NodePath("..") -env = { -"COLORTERM": "truecolor", -"TERM": "xterm-256color" -} [node name="PTYSiblingAbove" type="Node" parent="."] [node name="PTY" type="Node" parent="PTYSiblingAbove"] -script = ExtResource( 2 ) +script = ExtResource("2") terminal_path = NodePath("../Terminal") -env = { -"COLORTERM": "truecolor", -"TERM": "xterm-256color" -} -[node name="Terminal" type="Control" parent="PTYSiblingAbove"] +[node name="Terminal" type="Terminal" parent="PTYSiblingAbove"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -script = ExtResource( 1 ) [node name="PTYSiblingBelow" type="Node" parent="."] -[node name="Terminal" type="Control" parent="PTYSiblingBelow"] +[node name="Terminal" type="Terminal" parent="PTYSiblingBelow"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -script = ExtResource( 1 ) [node name="PTY" type="Node" parent="PTYSiblingBelow"] -script = ExtResource( 2 ) +script = ExtResource("2") terminal_path = NodePath("../Terminal") -env = { -"COLORTERM": "truecolor", -"TERM": "xterm-256color" -} [node name="PTYCousinAbove" type="Node" parent="."] [node name="Node" type="Node" parent="PTYCousinAbove"] [node name="PTY" type="Node" parent="PTYCousinAbove/Node"] -script = ExtResource( 2 ) +script = ExtResource("2") terminal_path = NodePath("../../Terminal") -env = { -"COLORTERM": "truecolor", -"TERM": "xterm-256color" -} -[node name="Terminal" type="Control" parent="PTYCousinAbove"] +[node name="Terminal" type="Terminal" parent="PTYCousinAbove"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -script = ExtResource( 1 ) [node name="PTYCousinBelow" type="Node" parent="."] -[node name="Terminal" type="Control" parent="PTYCousinBelow"] +[node name="Terminal" type="Terminal" parent="PTYCousinBelow"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -script = ExtResource( 1 ) [node name="Node" type="Node" parent="PTYCousinBelow"] [node name="PTY" type="Node" parent="PTYCousinBelow/Node"] -script = ExtResource( 2 ) +script = ExtResource("2") terminal_path = NodePath("../../Terminal") -env = { -"COLORTERM": "truecolor", -"TERM": "xterm-256color" -} [node name="PTYCousinAbove2" type="Node" parent="."] @@ -91,41 +70,37 @@ env = { [node name="Node" type="Node" parent="PTYCousinAbove2/Node"] [node name="PTY" type="Node" parent="PTYCousinAbove2/Node/Node"] -script = ExtResource( 2 ) +script = ExtResource("2") terminal_path = NodePath("../../../Control/Terminal") -env = { -"COLORTERM": "truecolor", -"TERM": "xterm-256color" -} [node name="Control" type="Control" parent="PTYCousinAbove2"] +layout_mode = 3 +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -[node name="Terminal" type="Control" parent="PTYCousinAbove2/Control"] +[node name="Terminal" type="Terminal" parent="PTYCousinAbove2/Control"] +layout_mode = 0 anchor_right = 1.0 anchor_bottom = 1.0 -script = ExtResource( 1 ) [node name="PTYCousinBelow2" type="Node" parent="."] [node name="Control" type="Control" parent="PTYCousinBelow2"] +layout_mode = 3 +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -[node name="Terminal" type="Control" parent="PTYCousinBelow2/Control"] +[node name="Terminal" type="Terminal" parent="PTYCousinBelow2/Control"] +layout_mode = 0 anchor_right = 1.0 anchor_bottom = 1.0 -script = ExtResource( 1 ) [node name="Node" type="Node" parent="PTYCousinBelow2"] [node name="Node" type="Node" parent="PTYCousinBelow2/Node"] [node name="PTY" type="Node" parent="PTYCousinBelow2/Node/Node"] -script = ExtResource( 2 ) +script = ExtResource("2") terminal_path = NodePath("../../../Control/Terminal") -env = { -"COLORTERM": "truecolor", -"TERM": "xterm-256color" -} diff --git a/test/scenes/theme.gd b/test/scenes/theme.gd index e01bc85..5d6102c 100644 --- a/test/scenes/theme.gd +++ b/test/scenes/theme.gd @@ -1,7 +1,5 @@ @tool -extends "res://addons/godot_xterm/terminal.gd" - -signal theme_changed +extends Terminal func _ready(): @@ -24,10 +22,3 @@ func _ready(): write("\u001b[1mL\u001b[0m") # Bold. write("\u001b[3mL\u001b[0m") # Italic. write("\u001b[1m\u001b[3mL\u001b[0m") # Bold Italic. - - -func _notification(what): - super._notification(what) - match what: - NOTIFICATION_THEME_CHANGED: - call_deferred("emit_signal", "theme_changed") diff --git a/test/scenes/theme.tscn b/test/scenes/theme.tscn index 079e8ed..9d921d4 100644 --- a/test/scenes/theme.tscn +++ b/test/scenes/theme.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=2 format=3 uid="uid://dntcn0ixbgikx"] -[ext_resource path="res://test/scenes/theme.gd" type="Script" id=1] +[ext_resource type="Script" path="res://test/scenes/theme.gd" id="1"] -[node name="Terminal" type="Control"] +[node name="Terminal" type="Terminal"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -script = ExtResource( 1 ) +script = ExtResource("1") diff --git a/test/scenes/write_random.tscn b/test/scenes/write_random.tscn index 37210bf..2ecef7e 100644 --- a/test/scenes/write_random.tscn +++ b/test/scenes/write_random.tscn @@ -1,7 +1,7 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=2 format=3 uid="uid://y1f8mwiknqcm"] -[sub_resource type="GDScript" id=1] -script/source = "extends \"res://addons/godot_xterm/terminal.gd\" +[sub_resource type="GDScript" id="GDScript_wc7yv"] +script/source = "extends Terminal var rng := RandomNumberGenerator.new() @@ -15,7 +15,8 @@ func _process(_delta): write(PackedByteArray([rng.randi() % 256])) " -[node name="Terminal" type="Control"] +[node name="Terminal" type="Terminal"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -script = SubResource( 1 ) +script = SubResource("GDScript_wc7yv")