From 08ae1a42c694ec409921225daa59ab42fac75d58 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sun, 9 Aug 2020 16:29:26 +0300 Subject: Allow options in dialogue --- scenes/GUI.tscn | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) (limited to 'scenes/GUI.tscn') diff --git a/scenes/GUI.tscn b/scenes/GUI.tscn index 46ad35e..01bf2ef 100644 --- a/scenes/GUI.tscn +++ b/scenes/GUI.tscn @@ -1,14 +1,8 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://scripts/GUI.gd" type="Script" id=1] - -[sub_resource type="Gradient" id=1] -offsets = PoolRealArray( 0 ) -colors = PoolColorArray( 0.458824, 0.0470588, 0.501961, 1 ) - -[sub_resource type="GradientTexture" id=2] -gradient = SubResource( 1 ) -width = 40 +[ext_resource path="res://scripts/DialogueBox.gd" type="Script" id=2] +[ext_resource path="res://scenes/DialogueOptionButton.tscn" type="PackedScene" id=3] [node name="GUI" type="MarginContainer"] anchor_right = 1.0 @@ -42,10 +36,11 @@ margin_right = 984.0 margin_bottom = 560.0 rect_min_size = Vector2( 0, 40 ) color = Color( 0.403922, 0.360784, 0.54902, 1 ) +script = ExtResource( 2 ) [node name="Name" type="Label" parent="BottomRow/DialogueBox"] -anchor_top = -0.00774612 -anchor_bottom = -0.00774612 +anchor_left = 0.02 +anchor_right = 0.02 margin_left = 18.9 margin_top = 14.0836 margin_right = 84.9 @@ -56,9 +51,7 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Text" type="Label" parent="BottomRow/DialogueBox"] -anchor_top = -0.00774612 -anchor_bottom = -0.00774612 +[node name="Body" type="Label" parent="BottomRow/DialogueBox"] margin_left = 94.1902 margin_top = 14.0836 margin_right = 160.19 @@ -69,21 +62,19 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="NextButton" type="TextureButton" parent="BottomRow/DialogueBox"] -anchor_left = 0.95 -anchor_right = 0.95 +[node name="HBoxContainer" type="HBoxContainer" parent="BottomRow/DialogueBox"] +anchor_left = 0.94 +anchor_right = 0.98 margin_top = 10.0 margin_bottom = 10.0 -rect_min_size = Vector2( 40, 20 ) -texture_normal = SubResource( 2 ) -expand = true +grow_horizontal = 0 +alignment = 2 __meta__ = { "_edit_use_anchors_": false } -[node name="Label" type="Label" parent="BottomRow/DialogueBox/NextButton"] -margin_left = 12.0 -margin_top = 3.0 -text = ">>" -valign = 1 -[connection signal="pressed" from="BottomRow/DialogueBox/NextButton" to="." method="_on_NextButton_pressed"] +[node name="DialogueOptionButton" parent="BottomRow/DialogueBox/HBoxContainer" instance=ExtResource( 3 )] +margin_left = 0.0 +margin_right = 71.0 +[connection signal="option_pressed" from="BottomRow/DialogueBox" to="." method="_on_DialogueBox_option_pressed"] +[connection signal="pressed" from="BottomRow/DialogueBox/HBoxContainer/DialogueOptionButton" to="BottomRow/DialogueBox" method="_on_DialogueOptionButton_pressed"] -- cgit v1.3