From 05d29ccce1898ed89c0b650c77242c2fa2805128 Mon Sep 17 00:00:00 2001 From: Sophia Pearson Date: Fri, 20 May 2022 00:45:25 +0200 Subject: texty: initial commit --- .gitattributes | 6 + .gitignore | 8 + .gut_editor_config.json | 39 + .idea/.idea.Texty/.idea/.gitignore | 13 + .idea/.idea.Texty/.idea/.name | 1 + .idea/.idea.Texty/.idea/encodings.xml | 4 + .idea/.idea.Texty/.idea/indexLayout.xml | 8 + .idea/.idea.Texty/.idea/vcs.xml | 6 + Assets/Fonts/VT323-Regular.ttf | 3 + Assets/Fonts/VT323Font24.tres | 9 + Assets/Styles/GUIBox.tres | 12 + Assets/Styles/GUIBoxDisabled.tres | 12 + Assets/Styles/GuiBoxHover.tres | 12 + Assets/Styles/GuiBoxPressed.tres | 12 + Scenes/Game.tscn | 38 + Scenes/InputContainer.tscn | 59 + Scenes/OutputContainer.tscn | 26 + Scenes/OutputRow.tscn | 32 + Scenes/Texty.tscn | 7 + ScriptTemplates/TextyScriptTemplate.cs | 14 + Scripts/Game.cs | 30 + Scripts/InputContainer.cs | 44 + Scripts/OutputContainer.cs | 53 + Scripts/OutputRow.cs | 72 + Tests/ComponentTests/test_InputContainer.gd | 94 ++ Tests/ComponentTests/test_OutputRow.gd | 46 + Texty.csproj | 16 + Texty.sln | 19 + addons/gut/GutScene.gd | 502 ++++++ addons/gut/GutScene.tscn | 639 ++++++++ addons/gut/LICENSE.md | 22 + addons/gut/UserFileViewer.gd | 55 + addons/gut/UserFileViewer.tscn | 128 ++ addons/gut/autofree.gd | 59 + addons/gut/comparator.gd | 130 ++ addons/gut/compare_result.gd | 47 + addons/gut/diff_formatter.gd | 64 + addons/gut/diff_tool.gd | 162 ++ addons/gut/double_templates/function_template.txt | 6 + addons/gut/double_templates/script_template.txt | 59 + addons/gut/doubler.gd | 760 ++++++++++ addons/gut/fonts/AnonymousPro-Bold.ttf | 3 + addons/gut/fonts/AnonymousPro-BoldItalic.ttf | 3 + addons/gut/fonts/AnonymousPro-Italic.ttf | 3 + addons/gut/fonts/AnonymousPro-Regular.ttf | 3 + addons/gut/fonts/CourierPrime-Bold.ttf | 3 + addons/gut/fonts/CourierPrime-BoldItalic.ttf | 3 + addons/gut/fonts/CourierPrime-Italic.ttf | 3 + addons/gut/fonts/CourierPrime-Regular.ttf | 3 + addons/gut/fonts/LobsterTwo-Bold.ttf | 3 + addons/gut/fonts/LobsterTwo-BoldItalic.ttf | 3 + addons/gut/fonts/LobsterTwo-Italic.ttf | 3 + addons/gut/fonts/LobsterTwo-Regular.ttf | 3 + addons/gut/fonts/OFL.txt | 94 ++ addons/gut/get_native_script.gd | 6 + addons/gut/gui/BottomPanelShortcuts.gd | 82 + addons/gut/gui/BottomPanelShortcuts.tscn | 232 +++ addons/gut/gui/GutBottomPanel.gd | 326 ++++ addons/gut/gui/GutBottomPanel.tscn | 386 +++++ addons/gut/gui/GutRunner.gd | 98 ++ addons/gut/gui/GutRunner.tscn | 9 + addons/gut/gui/GutSceneTheme.tres | 11 + addons/gut/gui/RunAtCursor.gd | 130 ++ addons/gut/gui/RunAtCursor.tscn | 80 + addons/gut/gui/Settings.tscn | 7 + addons/gut/gui/ShortcutButton.gd | 164 ++ addons/gut/gui/ShortcutButton.tscn | 80 + addons/gut/gui/arrow.png | 3 + addons/gut/gui/arrow.png.import | 35 + addons/gut/gui/gut_config_gui.gd | 408 +++++ addons/gut/gui/play.png | 3 + addons/gut/gui/play.png.import | 35 + addons/gut/gui/script_text_editor_controls.gd | 230 +++ addons/gut/gut.gd | 1676 +++++++++++++++++++++ addons/gut/gut_cmdln.gd | 308 ++++ addons/gut/gut_config.gd | 177 +++ addons/gut/gut_plugin.gd | 27 + addons/gut/hook_script.gd | 41 + addons/gut/icon.png | 3 + addons/gut/icon.png.import | 35 + addons/gut/input_factory.gd | 142 ++ addons/gut/input_sender.gd | 365 +++++ addons/gut/junit_xml_export.gd | 94 ++ addons/gut/logger.gd | 348 +++++ addons/gut/method_maker.gd | 275 ++++ addons/gut/one_to_many.gd | 38 + addons/gut/optparse.gd | 248 +++ addons/gut/orphan_counter.gd | 55 + addons/gut/parameter_factory.gd | 75 + addons/gut/parameter_handler.gd | 37 + addons/gut/plugin.cfg | 7 + addons/gut/plugin_control.gd | 253 ++++ addons/gut/printers.gd | 157 ++ addons/gut/result_exporter.gd | 111 ++ addons/gut/signal_watcher.gd | 166 ++ addons/gut/source_code_pro.fnt | Bin 0 -> 26499 bytes addons/gut/spy.gd | 108 ++ addons/gut/strutils.gd | 179 +++ addons/gut/stub_params.gd | 94 ++ addons/gut/stubber.gd | 216 +++ addons/gut/summary.gd | 206 +++ addons/gut/test.gd | 1651 ++++++++++++++++++++ addons/gut/test_collector.gd | 286 ++++ addons/gut/thing_counter.gd | 43 + addons/gut/utils.gd | 389 +++++ default_env.tres | 7 + icon.png | 3 + icon.png.import | 35 + metadata.json | 5 + project.godot | 60 + results.xml | 9 + 111 files changed, 13712 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .gut_editor_config.json create mode 100644 .idea/.idea.Texty/.idea/.gitignore create mode 100644 .idea/.idea.Texty/.idea/.name create mode 100644 .idea/.idea.Texty/.idea/encodings.xml create mode 100644 .idea/.idea.Texty/.idea/indexLayout.xml create mode 100644 .idea/.idea.Texty/.idea/vcs.xml create mode 100644 Assets/Fonts/VT323-Regular.ttf create mode 100644 Assets/Fonts/VT323Font24.tres create mode 100644 Assets/Styles/GUIBox.tres create mode 100644 Assets/Styles/GUIBoxDisabled.tres create mode 100644 Assets/Styles/GuiBoxHover.tres create mode 100644 Assets/Styles/GuiBoxPressed.tres create mode 100644 Scenes/Game.tscn create mode 100644 Scenes/InputContainer.tscn create mode 100644 Scenes/OutputContainer.tscn create mode 100644 Scenes/OutputRow.tscn create mode 100644 Scenes/Texty.tscn create mode 100644 ScriptTemplates/TextyScriptTemplate.cs create mode 100644 Scripts/Game.cs create mode 100644 Scripts/InputContainer.cs create mode 100644 Scripts/OutputContainer.cs create mode 100644 Scripts/OutputRow.cs create mode 100644 Tests/ComponentTests/test_InputContainer.gd create mode 100644 Tests/ComponentTests/test_OutputRow.gd create mode 100644 Texty.csproj create mode 100644 Texty.sln create mode 100644 addons/gut/GutScene.gd create mode 100644 addons/gut/GutScene.tscn create mode 100644 addons/gut/LICENSE.md create mode 100644 addons/gut/UserFileViewer.gd create mode 100644 addons/gut/UserFileViewer.tscn create mode 100644 addons/gut/autofree.gd create mode 100644 addons/gut/comparator.gd create mode 100644 addons/gut/compare_result.gd create mode 100644 addons/gut/diff_formatter.gd create mode 100644 addons/gut/diff_tool.gd create mode 100644 addons/gut/double_templates/function_template.txt create mode 100644 addons/gut/double_templates/script_template.txt create mode 100644 addons/gut/doubler.gd create mode 100644 addons/gut/fonts/AnonymousPro-Bold.ttf create mode 100644 addons/gut/fonts/AnonymousPro-BoldItalic.ttf create mode 100644 addons/gut/fonts/AnonymousPro-Italic.ttf create mode 100644 addons/gut/fonts/AnonymousPro-Regular.ttf create mode 100644 addons/gut/fonts/CourierPrime-Bold.ttf create mode 100644 addons/gut/fonts/CourierPrime-BoldItalic.ttf create mode 100644 addons/gut/fonts/CourierPrime-Italic.ttf create mode 100644 addons/gut/fonts/CourierPrime-Regular.ttf create mode 100644 addons/gut/fonts/LobsterTwo-Bold.ttf create mode 100644 addons/gut/fonts/LobsterTwo-BoldItalic.ttf create mode 100644 addons/gut/fonts/LobsterTwo-Italic.ttf create mode 100644 addons/gut/fonts/LobsterTwo-Regular.ttf create mode 100644 addons/gut/fonts/OFL.txt create mode 100644 addons/gut/get_native_script.gd create mode 100644 addons/gut/gui/BottomPanelShortcuts.gd create mode 100644 addons/gut/gui/BottomPanelShortcuts.tscn create mode 100644 addons/gut/gui/GutBottomPanel.gd create mode 100644 addons/gut/gui/GutBottomPanel.tscn create mode 100644 addons/gut/gui/GutRunner.gd create mode 100644 addons/gut/gui/GutRunner.tscn create mode 100644 addons/gut/gui/GutSceneTheme.tres create mode 100644 addons/gut/gui/RunAtCursor.gd create mode 100644 addons/gut/gui/RunAtCursor.tscn create mode 100644 addons/gut/gui/Settings.tscn create mode 100644 addons/gut/gui/ShortcutButton.gd create mode 100644 addons/gut/gui/ShortcutButton.tscn create mode 100644 addons/gut/gui/arrow.png create mode 100644 addons/gut/gui/arrow.png.import create mode 100644 addons/gut/gui/gut_config_gui.gd create mode 100644 addons/gut/gui/play.png create mode 100644 addons/gut/gui/play.png.import create mode 100644 addons/gut/gui/script_text_editor_controls.gd create mode 100644 addons/gut/gut.gd create mode 100644 addons/gut/gut_cmdln.gd create mode 100644 addons/gut/gut_config.gd create mode 100644 addons/gut/gut_plugin.gd create mode 100644 addons/gut/hook_script.gd create mode 100644 addons/gut/icon.png create mode 100644 addons/gut/icon.png.import create mode 100644 addons/gut/input_factory.gd create mode 100644 addons/gut/input_sender.gd create mode 100644 addons/gut/junit_xml_export.gd create mode 100644 addons/gut/logger.gd create mode 100644 addons/gut/method_maker.gd create mode 100644 addons/gut/one_to_many.gd create mode 100644 addons/gut/optparse.gd create mode 100644 addons/gut/orphan_counter.gd create mode 100644 addons/gut/parameter_factory.gd create mode 100644 addons/gut/parameter_handler.gd create mode 100644 addons/gut/plugin.cfg create mode 100644 addons/gut/plugin_control.gd create mode 100644 addons/gut/printers.gd create mode 100644 addons/gut/result_exporter.gd create mode 100644 addons/gut/signal_watcher.gd create mode 100644 addons/gut/source_code_pro.fnt create mode 100644 addons/gut/spy.gd create mode 100644 addons/gut/strutils.gd create mode 100644 addons/gut/stub_params.gd create mode 100644 addons/gut/stubber.gd create mode 100644 addons/gut/summary.gd create mode 100644 addons/gut/test.gd create mode 100644 addons/gut/test_collector.gd create mode 100644 addons/gut/thing_counter.gd create mode 100644 addons/gut/utils.gd create mode 100644 default_env.tres create mode 100644 icon.png create mode 100644 icon.png.import create mode 100644 metadata.json create mode 100644 project.godot create mode 100644 results.xml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2e13b2c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +*.png filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text + +addons/* linguist-vendored + +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..70ac9e9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +/.import +/.mono +/data_* + +/export/*/* +/!export/*/.gitkeep + +Texty.sln.DotSettings.user diff --git a/.gut_editor_config.json b/.gut_editor_config.json new file mode 100644 index 0000000..d05bd4e --- /dev/null +++ b/.gut_editor_config.json @@ -0,0 +1,39 @@ +{ + "background_color": "ff262626", + "config_file": "res://.gutconfig.json", + "dirs": [ + "res://Tests" + ], + "disable_colors": false, + "double_strategy": "partial", + "font_color": "ffcccccc", + "font_name": "CourierPrime", + "font_size": 16, + "hide_orphans": false, + "ignore_pause": false, + "include_subdirs": true, + "inner_class": null, + "junit_xml_file": "", + "junit_xml_timestamp": false, + "log_level": 1, + "opacity": 100, + "post_run_script": "", + "pre_run_script": "", + "prefix": "test_", + "selected": null, + "should_exit": false, + "should_exit_on_success": true, + "should_maximize": true, + "compact_mode": false, + "show_help": false, + "suffix": ".gd", + "tests": [ + + ], + "unit_test_name": null, + "gut_on_top": false, + "panel_options": { + "font_name": "CourierPrime", + "font_size": 12 + } +} \ No newline at end of file diff --git a/.idea/.idea.Texty/.idea/.gitignore b/.idea/.idea.Texty/.idea/.gitignore new file mode 100644 index 0000000..847ae99 --- /dev/null +++ b/.idea/.idea.Texty/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/.idea.Texty.iml +/modules.xml +/projectSettingsUpdater.xml +/contentModel.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.Texty/.idea/.name b/.idea/.idea.Texty/.idea/.name new file mode 100644 index 0000000..9c75361 --- /dev/null +++ b/.idea/.idea.Texty/.idea/.name @@ -0,0 +1 @@ +Texty \ No newline at end of file diff --git a/.idea/.idea.Texty/.idea/encodings.xml b/.idea/.idea.Texty/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.Texty/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.Texty/.idea/indexLayout.xml b/.idea/.idea.Texty/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.Texty/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.Texty/.idea/vcs.xml b/.idea/.idea.Texty/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.Texty/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Assets/Fonts/VT323-Regular.ttf b/Assets/Fonts/VT323-Regular.ttf new file mode 100644 index 0000000..01ef3b2 --- /dev/null +++ b/Assets/Fonts/VT323-Regular.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:214c2bbd6f7d1a9787413a01dccdf6134fd1ed7934e425d07c2ad32b1568979a +size 86576 diff --git a/Assets/Fonts/VT323Font24.tres b/Assets/Fonts/VT323Font24.tres new file mode 100644 index 0000000..b2091a5 --- /dev/null +++ b/Assets/Fonts/VT323Font24.tres @@ -0,0 +1,9 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[sub_resource type="DynamicFontData" id=1] +font_path = "res://Assets/Fonts/VT323-Regular.ttf" + +[resource] +size = 24 +use_filter = true +font_data = SubResource( 1 ) diff --git a/Assets/Styles/GUIBox.tres b/Assets/Styles/GUIBox.tres new file mode 100644 index 0000000..81e3687 --- /dev/null +++ b/Assets/Styles/GUIBox.tres @@ -0,0 +1,12 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +content_margin_left = 8.0 +content_margin_right = 8.0 +content_margin_top = 8.0 +content_margin_bottom = 8.0 +bg_color = Color( 0.1, 0.1, 0.1, 0.627451 ) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 diff --git a/Assets/Styles/GUIBoxDisabled.tres b/Assets/Styles/GUIBoxDisabled.tres new file mode 100644 index 0000000..81e3687 --- /dev/null +++ b/Assets/Styles/GUIBoxDisabled.tres @@ -0,0 +1,12 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +content_margin_left = 8.0 +content_margin_right = 8.0 +content_margin_top = 8.0 +content_margin_bottom = 8.0 +bg_color = Color( 0.1, 0.1, 0.1, 0.627451 ) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 diff --git a/Assets/Styles/GuiBoxHover.tres b/Assets/Styles/GuiBoxHover.tres new file mode 100644 index 0000000..4681f62 --- /dev/null +++ b/Assets/Styles/GuiBoxHover.tres @@ -0,0 +1,12 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +content_margin_left = 8.0 +content_margin_right = 8.0 +content_margin_top = 8.0 +content_margin_bottom = 8.0 +bg_color = Color( 0, 0, 0, 0.627451 ) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 diff --git a/Assets/Styles/GuiBoxPressed.tres b/Assets/Styles/GuiBoxPressed.tres new file mode 100644 index 0000000..cedec54 --- /dev/null +++ b/Assets/Styles/GuiBoxPressed.tres @@ -0,0 +1,12 @@ +[gd_resource type="StyleBoxFlat" format=2] + +[resource] +content_margin_left = 8.0 +content_margin_right = 8.0 +content_margin_top = 8.0 +content_margin_bottom = 8.0 +bg_color = Color( 0, 0, 0, 0.862745 ) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 diff --git a/Scenes/Game.tscn b/Scenes/Game.tscn new file mode 100644 index 0000000..5c24cf2 --- /dev/null +++ b/Scenes/Game.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://Scenes/InputContainer.tscn" type="PackedScene" id=1] +[ext_resource path="res://Scripts/Game.cs" type="Script" id=2] +[ext_resource path="res://Scenes/OutputContainer.tscn" type="PackedScene" id=3] +[ext_resource path="res://Scenes/OutputRow.tscn" type="PackedScene" id=4] + +[node name="Game" type="MarginContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 8.0 +margin_top = 8.0 +margin_right = -8.0 +margin_bottom = -8.0 +script = ExtResource( 2 ) +__meta__ = { +"_edit_group_": true +} +OutputRowScene = ExtResource( 4 ) + +[node name="LayoutContainer" type="VBoxContainer" parent="."] +margin_right = 1008.0 +margin_bottom = 584.0 +custom_constants/separation = 8 + +[node name="OutputContainer" parent="LayoutContainer" instance=ExtResource( 3 )] +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_right = 1008.0 +margin_bottom = 535.0 + +[node name="InputContainer" parent="LayoutContainer" instance=ExtResource( 1 )] +anchor_right = 0.0 +margin_top = 543.0 +margin_right = 1008.0 +margin_bottom = 584.0 + +[connection signal="InputSubmitted" from="LayoutContainer/InputContainer" to="." method="OnInputSubmitted"] diff --git a/Scenes/InputContainer.tscn b/Scenes/InputContainer.tscn new file mode 100644 index 0000000..bd63da5 --- /dev/null +++ b/Scenes/InputContainer.tscn @@ -0,0 +1,59 @@ +[gd_scene load_steps=10 format=2] + +[ext_resource path="res://Assets/Styles/GuiBoxHover.tres" type="StyleBox" id=1] +[ext_resource path="res://Assets/Fonts/VT323Font24.tres" type="DynamicFont" id=2] +[ext_resource path="res://Assets/Styles/GUIBox.tres" type="StyleBox" id=3] +[ext_resource path="res://Assets/Styles/GuiBoxPressed.tres" type="StyleBox" id=4] +[ext_resource path="res://Scripts/InputContainer.cs" type="Script" id=5] +[ext_resource path="res://Assets/Styles/GUIBoxDisabled.tres" type="StyleBox" id=6] + +[sub_resource type="StyleBoxEmpty" id=2] + +[sub_resource type="InputEventAction" id=3] +action = "ui_accept" + +[sub_resource type="ShortCut" id=4] +shortcut = SubResource( 3 ) + +[node name="InputContainer" type="HBoxContainer"] +anchor_right = 1.0 +custom_constants/separation = 8 +script = ExtResource( 5 ) +__meta__ = { +"_edit_group_": true +} + +[node name="InputField" type="LineEdit" parent="."] +margin_right = 940.0 +margin_bottom = 41.0 +size_flags_horizontal = 3 +custom_colors/font_color = Color( 0.839216, 0.00784314, 0.439216, 1 ) +custom_fonts/font = ExtResource( 2 ) +custom_styles/focus = SubResource( 2 ) +custom_styles/normal = ExtResource( 3 ) +context_menu_enabled = false +clear_button_enabled = true +placeholder_text = "Enter a command" +caret_blink = true + +[node name="SubmitButton" type="Button" parent="."] +margin_left = 948.0 +margin_right = 1024.0 +margin_bottom = 41.0 +custom_colors/font_color_disabled = Color( 0.580392, 0.580392, 0.580392, 1 ) +custom_colors/font_color_focus = Color( 0.839216, 0.00784314, 0.439216, 1 ) +custom_colors/font_color = Color( 0.839216, 0.00784314, 0.439216, 1 ) +custom_colors/font_color_hover = Color( 0.929412, 0.00784314, 0.486275, 1 ) +custom_colors/font_color_pressed = Color( 0.929412, 0.00784314, 0.486275, 1 ) +custom_fonts/font = ExtResource( 2 ) +custom_styles/hover = ExtResource( 1 ) +custom_styles/pressed = ExtResource( 4 ) +custom_styles/focus = ExtResource( 3 ) +custom_styles/disabled = ExtResource( 6 ) +custom_styles/normal = ExtResource( 3 ) +shortcut = SubResource( 4 ) +text = "Submit" + +[connection signal="text_changed" from="InputField" to="." method="OnInputChanged"] +[connection signal="text_entered" from="InputField" to="." method="OnInputSubmitted"] +[connection signal="pressed" from="SubmitButton" to="." method="OnInputSubmitted"] diff --git a/Scenes/OutputContainer.tscn b/Scenes/OutputContainer.tscn new file mode 100644 index 0000000..c058837 --- /dev/null +++ b/Scenes/OutputContainer.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://Assets/Styles/GUIBox.tres" type="StyleBox" id=2] +[ext_resource path="res://Scripts/OutputContainer.cs" type="Script" id=3] + +[node name="OutputContainer" type="PanelContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_styles/panel = ExtResource( 2 ) +script = ExtResource( 3 ) + +[node name="ScrollContainer" type="ScrollContainer" parent="."] +margin_left = 8.0 +margin_top = 8.0 +margin_right = 1016.0 +margin_bottom = 592.0 +follow_focus = true +scroll_horizontal_enabled = false + +[node name="OutputRows" type="VBoxContainer" parent="ScrollContainer"] +margin_right = 1008.0 +margin_bottom = 584.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 diff --git a/Scenes/OutputRow.tscn b/Scenes/OutputRow.tscn new file mode 100644 index 0000000..9259e77 --- /dev/null +++ b/Scenes/OutputRow.tscn @@ -0,0 +1,32 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://Assets/Fonts/VT323Font24.tres" type="DynamicFont" id=1] +[ext_resource path="res://Scripts/OutputRow.cs" type="Script" id=2] + +[node name="OutputRow" type="VBoxContainer"] +margin_right = 992.0 +margin_bottom = 32.0 +size_flags_horizontal = 3 +script = ExtResource( 2 ) +__meta__ = { +"_edit_group_": true +} + +[node name="Input" type="Label" parent="."] +margin_right = 992.0 +margin_bottom = 25.0 +size_flags_horizontal = 3 +custom_colors/font_color = Color( 0.839216, 0.00784314, 0.439216, 1 ) +custom_fonts/font = ExtResource( 1 ) +text = "This is where the input goes" +autowrap = true + +[node name="Output" type="Label" parent="." groups=["output_rows"]] +margin_top = 29.0 +margin_right = 992.0 +margin_bottom = 54.0 +size_flags_horizontal = 3 +custom_colors/font_color = Color( 0, 0.333333, 1, 1 ) +custom_fonts/font = ExtResource( 1 ) +text = "This is where the output goes" +autowrap = true diff --git a/Scenes/Texty.tscn b/Scenes/Texty.tscn new file mode 100644 index 0000000..4198184 --- /dev/null +++ b/Scenes/Texty.tscn @@ -0,0 +1,7 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://Scenes/Game.tscn" type="PackedScene" id=1] + +[node name="Texty" type="Node"] + +[node name="Game" parent="." instance=ExtResource( 1 )] diff --git a/ScriptTemplates/TextyScriptTemplate.cs b/ScriptTemplates/TextyScriptTemplate.cs new file mode 100644 index 0000000..d9cdcfb --- /dev/null +++ b/ScriptTemplates/TextyScriptTemplate.cs @@ -0,0 +1,14 @@ +using Godot; + +namespace Texty.Scripts +{ + public class %CLASS% : %BASE% + { + + public override void _Ready() + { + } + + } +} + diff --git a/Scripts/Game.cs b/Scripts/Game.cs new file mode 100644 index 0000000..645c922 --- /dev/null +++ b/Scripts/Game.cs @@ -0,0 +1,30 @@ +using System.Diagnostics; +using Godot; + +namespace Texty.Scripts +{ + public abstract class Game : MarginContainer + { + public VBoxContainer LayoutContainer; + public OutputContainer OutputContainer; + + [Export(PropertyHint.File, "*.tscn")] public PackedScene OutputRowScene; + + public override void _Ready() + { + Debug.Assert(OutputRowScene != null, $"The {nameof(OutputRowScene)} was not set!"); + + LayoutContainer = GetNode(nameof(LayoutContainer)); + OutputContainer = LayoutContainer.GetNode(nameof(OutputContainer)); + } + + public void OnInputSubmitted(string text) + { + var newRow = OutputRowScene.Instance(); + newRow.InputText = text; + newRow.OutputText = "THE OUTPUT SHOULD GO HERE!"; + + OutputContainer.Add(newRow); + } + } +} \ No newline at end of file diff --git a/Scripts/InputContainer.cs b/Scripts/InputContainer.cs new file mode 100644 index 0000000..485086e --- /dev/null +++ b/Scripts/InputContainer.cs @@ -0,0 +1,44 @@ +using Godot; + +namespace Texty.Scripts +{ + public abstract class InputContainer : HBoxContainer + { + [Signal] + public delegate void InputSubmitted(string text); + + public LineEdit InputField; + public Button SubmitButton; + + public override void _Ready() + { + InputField = GetNode(nameof(InputField)); + SubmitButton = GetNode