From 3b81f718c80a4a9edac57461b74f4cdb8e4bf812 Mon Sep 17 00:00:00 2001 From: Moonshrike Date: Tue, 16 Nov 2021 00:12:43 +0200 Subject: [PATCH] funny changes get acquainted with non-working(for now) user input --- .../trinity_site_level_playground.tscn | 2 +- .../scenes/OVERLAY/elements/trajectories.gd | 16 ++++++++ .../scenes/OVERLAY/elements/user_input.tscn | 38 ++++++++++++++++++- 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 source/scenes/OVERLAY/elements/trajectories.gd diff --git a/source/levels/trinity_site/trinity_site_level_playground.tscn b/source/levels/trinity_site/trinity_site_level_playground.tscn index 14ac053..169a1a5 100644 --- a/source/levels/trinity_site/trinity_site_level_playground.tscn +++ b/source/levels/trinity_site/trinity_site_level_playground.tscn @@ -158,10 +158,10 @@ margin_left = 2.37842 margin_top = -35.5 margin_right = 2.37842 margin_bottom = 106.5 -custom_fonts/font = SubResource( 1 ) custom_colors/font_color_shadow = Color( 0, 0, 0, 1 ) custom_constants/shadow_offset_x = 6 custom_constants/shadow_offset_y = 6 +custom_fonts/font = SubResource( 1 ) text = "You are the winner" align = 1 valign = 1 diff --git a/source/scenes/OVERLAY/elements/trajectories.gd b/source/scenes/OVERLAY/elements/trajectories.gd new file mode 100644 index 0000000..49abbc9 --- /dev/null +++ b/source/scenes/OVERLAY/elements/trajectories.gd @@ -0,0 +1,16 @@ +extends Control + +var a_param_line = 0 + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + + + +func _on_LineEdit_text_entered(new_text): + a_param_line = new_text + Global.get('player').enable_trajectory_line('line') + Global.get('player').trajectory = 'line' + pass # Replace with function body. diff --git a/source/scenes/OVERLAY/elements/user_input.tscn b/source/scenes/OVERLAY/elements/user_input.tscn index f97aba3..c394ff9 100644 --- a/source/scenes/OVERLAY/elements/user_input.tscn +++ b/source/scenes/OVERLAY/elements/user_input.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=24 format=2] +[gd_scene load_steps=25 format=2] [ext_resource path="res://source/assets/sprites/GUI/in_game/user_input/background_panel.svg" type="Texture" id=1] [ext_resource path="res://source/fonts/oxygen/Oxygen-Regular.ttf" type="DynamicFontData" id=2] @@ -12,6 +12,7 @@ [ext_resource path="res://source/assets/sprites/GUI/in_game/user_input/ready_button/ready_button_pressed.svg" type="Texture" id=10] [ext_resource path="res://source/assets/sprites/GUI/in_game/user_input/ready_button/ready_button_hover.svg" type="Texture" id=11] [ext_resource path="res://source/assets/sprites/GUI/in_game/user_input/skip_button/skip_button.svg" type="Texture" id=12] +[ext_resource path="res://source/scenes/OVERLAY/elements/trajectories.gd" type="Script" id=13] [sub_resource type="StyleBoxTexture" id=1] texture = ExtResource( 1 ) @@ -85,6 +86,7 @@ margin_left = 50.0 margin_top = 28.0 margin_right = -330.0 margin_bottom = -28.0 +script = ExtResource( 13 ) __meta__ = { "_edit_use_anchors_": false } @@ -123,6 +125,26 @@ __meta__ = { "_edit_use_anchors_": false } +[node name="LineEdit" type="LineEdit" parent="trajectories/line"] +margin_left = 205.0 +margin_top = 35.0 +margin_right = 263.0 +margin_bottom = 59.0 +max_length = 2 +placeholder_text = "a" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="x_label" type="Label" parent="trajectories/line"] +margin_left = 277.0 +margin_top = 44.0 +margin_right = 317.0 +margin_bottom = 58.0 +text = "x" +align = 1 +valign = 1 + [node name="parabol" type="Panel" parent="trajectories"] visible = false anchor_left = 0.5 @@ -228,6 +250,18 @@ __meta__ = { "_edit_use_anchors_": false } +[node name="Func_Label" type="Label" parent="trajectories"] +margin_left = 121.0 +margin_top = 28.0 +margin_right = 237.0 +margin_bottom = 65.0 +text = "f(x) = " +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} + [node name="controls" type="Control" parent="."] margin_left = 165.0 margin_top = 13.0 @@ -292,3 +326,5 @@ custom_fonts/font = SubResource( 11 ) text = "Skip" align = 1 valign = 1 + +[connection signal="text_entered" from="trajectories/line/LineEdit" to="trajectories" method="_on_LineEdit_text_entered"]