From f20bd89dc4a7bf14a88b1effcaa1887b29314525 Mon Sep 17 00:00:00 2001 From: Sophia Pearson Date: Mon, 5 Sep 2022 20:35:53 +0200 Subject: gui: split GUI into Terminal components --- Scenes/Game/CommandInputArea.tscn | 12 +++++++++ Scenes/Game/Game.tscn | 51 +++++++++++++++++++++------------------ Scenes/Game/Input.tscn | 38 ----------------------------- Scenes/Game/Output.tscn | 29 ---------------------- Scenes/Game/OutputBlock.tscn | 15 ------------ Scenes/Game/StatusLine.tscn | 28 --------------------- 6 files changed, 40 insertions(+), 133 deletions(-) create mode 100644 Scenes/Game/CommandInputArea.tscn delete mode 100644 Scenes/Game/Input.tscn delete mode 100644 Scenes/Game/Output.tscn delete mode 100644 Scenes/Game/OutputBlock.tscn delete mode 100644 Scenes/Game/StatusLine.tscn (limited to 'Scenes/Game') diff --git a/Scenes/Game/CommandInputArea.tscn b/Scenes/Game/CommandInputArea.tscn new file mode 100644 index 0000000..b377443 --- /dev/null +++ b/Scenes/Game/CommandInputArea.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Scenes/Terminal/InputArea.tscn" type="PackedScene" id=1] +[ext_resource path="res://Scripts/Game/CommandParser.cs" type="Script" id=2] +[ext_resource path="res://Scripts/Game/CommandInputArea.cs" type="Script" id=3] + +[node name="CommandInputArea" instance=ExtResource( 1 )] +script = ExtResource( 3 ) + +[node name="CommandParser" type="Node" parent="." index="2"] +unique_name_in_owner = true +script = ExtResource( 2 ) diff --git a/Scenes/Game/Game.tscn b/Scenes/Game/Game.tscn index 7ea6324..e2f7bc2 100644 --- a/Scenes/Game/Game.tscn +++ b/Scenes/Game/Game.tscn @@ -1,38 +1,43 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=7 format=2] -[ext_resource path="res://Scenes/Game/StatusLine.tscn" type="PackedScene" id=1] -[ext_resource path="res://Scenes/Game/Output.tscn" type="PackedScene" id=2] -[ext_resource path="res://Scenes/Game/Input.tscn" type="PackedScene" id=3] +[ext_resource path="res://Scenes/Terminal/Screen.tscn" type="PackedScene" id=1] +[ext_resource path="res://Scenes/Terminal/OutputArea.tscn" type="PackedScene" id=2] +[ext_resource path="res://Scenes/Game/CommandInputArea.tscn" type="PackedScene" id=3] [ext_resource path="res://Scripts/Game/Game.cs" type="Script" id=4] -[ext_resource path="res://Scenes/Game/OutputBlock.tscn" type="PackedScene" id=5] +[ext_resource path="res://Scenes/Terminal/StatusArea.tscn" type="PackedScene" id=5] +[ext_resource path="res://Scenes/Terminal/OutputBlock.tscn" type="PackedScene" id=6] -[node name="Game" type="VBoxContainer"] -anchor_right = 1.0 -anchor_bottom = 1.0 -custom_constants/separation = 0 +[node name="Game" type="Node"] script = ExtResource( 4 ) -[node name="StatusLine" parent="." instance=ExtResource( 1 )] +[node name="Screen" parent="." instance=ExtResource( 1 )] + +[node name="TopBar" parent="Screen/ScreenContainer" index="0"] +margin_bottom = 27.0 + +[node name="StatusArea" parent="Screen/ScreenContainer/TopBar" index="0" instance=ExtResource( 5 )] unique_name_in_owner = true Title = "Adventure Title" -[node name="Output" parent="." instance=ExtResource( 2 )] +[node name="Content" parent="Screen/ScreenContainer" index="1"] +margin_top = 27.0 +margin_bottom = 455.0 + +[node name="OutputArea" parent="Screen/ScreenContainer/Content" index="0" instance=ExtResource( 2 )] unique_name_in_owner = true anchor_right = 0.0 anchor_bottom = 0.0 -margin_top = 31.0 margin_right = 640.0 -margin_bottom = 451.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -OutputBlockScene = ExtResource( 5 ) +margin_bottom = 428.0 +OutputBlockScene = ExtResource( 6 ) + +[node name="BottomBar" parent="Screen/ScreenContainer" index="2"] +margin_top = 455.0 -[node name="Input" parent="." instance=ExtResource( 3 )] +[node name="InputArea" parent="Screen/ScreenContainer/BottomBar" index="0" instance=ExtResource( 3 )] unique_name_in_owner = true -anchor_right = 0.0 -margin_top = 451.0 -margin_right = 640.0 -margin_bottom = 480.0 -[connection signal="CommandSubmitted" from="Input" to="." method="OnCommandSubmitted"] -[connection signal="UnknownInputSubmitted" from="Input" to="." method="OnUnknownInputSubmitted"] +[connection signal="CommandSubmitted" from="Screen/ScreenContainer/BottomBar/InputArea" to="." method="OnCommandSubmitted"] +[connection signal="UnknownInputSubmitted" from="Screen/ScreenContainer/BottomBar/InputArea" to="." method="OnUnknownInputSubmitted"] + +[editable path="Screen"] diff --git a/Scenes/Game/Input.tscn b/Scenes/Game/Input.tscn deleted file mode 100644 index baf5315..0000000 --- a/Scenes/Game/Input.tscn +++ /dev/null @@ -1,38 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://Scripts/Game/Input.cs" type="Script" id=1] -[ext_resource path="res://Scripts/Game/CommandParser.cs" type="Script" id=2] - -[node name="Input" type="PanelContainer"] -anchor_right = 1.0 -theme_type_variation = "InvertedPanelContainer" -script = ExtResource( 1 ) - -[node name="Container" type="HBoxContainer" parent="."] -margin_left = 8.0 -margin_top = 2.0 -margin_right = 632.0 -margin_bottom = 27.0 - -[node name="PromptLabel" type="Label" parent="Container"] -unique_name_in_owner = true -margin_right = 20.0 -margin_bottom = 25.0 -theme_type_variation = "InvertedLabel" -text = "?>" - -[node name="TextInput" type="LineEdit" parent="Container"] -unique_name_in_owner = true -margin_left = 28.0 -margin_right = 624.0 -margin_bottom = 25.0 -size_flags_horizontal = 3 -context_menu_enabled = false -selecting_enabled = false -caret_blink = true - -[node name="CommandParser" type="Node" parent="."] -unique_name_in_owner = true -script = ExtResource( 2 ) - -[connection signal="text_entered" from="Container/TextInput" to="." method="OnTextEntered"] diff --git a/Scenes/Game/Output.tscn b/Scenes/Game/Output.tscn deleted file mode 100644 index 70ca6c3..0000000 --- a/Scenes/Game/Output.tscn +++ /dev/null @@ -1,29 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://Scenes/Game/OutputBlock.tscn" type="PackedScene" id=1] -[ext_resource path="res://Scripts/Game/Output.cs" type="Script" id=2] - -[node name="Output" type="PanelContainer"] -anchor_right = 1.0 -anchor_bottom = 1.0 -script = ExtResource( 2 ) - -[node name="ScrollContainer" type="ScrollContainer" parent="."] -margin_left = 8.0 -margin_top = 2.0 -margin_right = 632.0 -margin_bottom = 478.0 -mouse_filter = 1 -scroll_horizontal_enabled = false - -[node name="LineContainer" type="VBoxContainer" parent="ScrollContainer"] -unique_name_in_owner = true -margin_right = 624.0 -margin_bottom = 476.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="OutputBlock" parent="ScrollContainer/LineContainer" instance=ExtResource( 1 )] -anchor_right = 0.0 -margin_right = 624.0 -margin_bottom = 27.0 diff --git a/Scenes/Game/OutputBlock.tscn b/Scenes/Game/OutputBlock.tscn deleted file mode 100644 index f4fc1dd..0000000 --- a/Scenes/Game/OutputBlock.tscn +++ /dev/null @@ -1,15 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://Scripts/Game/OutputBlock.cs" type="Script" id=1] - -[node name="OutputBlock" type="MarginContainer"] -anchor_right = 1.0 -script = ExtResource( 1 ) - -[node name="ContentLabel" type="RichTextLabel" parent="."] -unique_name_in_owner = true -margin_right = 640.0 -margin_bottom = 27.0 -bbcode_enabled = true -fit_content_height = true -scroll_active = false diff --git a/Scenes/Game/StatusLine.tscn b/Scenes/Game/StatusLine.tscn deleted file mode 100644 index fc167ec..0000000 --- a/Scenes/Game/StatusLine.tscn +++ /dev/null @@ -1,28 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://Scripts/Game/StatusLine.cs" type="Script" id=1] - -[node name="StatusLine" type="PanelContainer"] -margin_right = 640.0 -margin_bottom = 31.0 -theme_type_variation = "InvertedPanelContainer" -script = ExtResource( 1 ) - -[node name="Container" type="HBoxContainer" parent="."] -margin_left = 8.0 -margin_top = 2.0 -margin_right = 632.0 -margin_bottom = 29.0 -size_flags_horizontal = 3 - -[node name="TitleLabel" type="RichTextLabel" parent="Container"] -unique_name_in_owner = true -margin_right = 624.0 -margin_bottom = 27.0 -size_flags_horizontal = 3 -size_flags_vertical = 6 -theme_type_variation = "InvertedRichTextLabel" -bbcode_enabled = true -text = "This is where the title goes" -fit_content_height = true -scroll_active = false -- cgit v1.2.3