diff options
| author | Jan Tuomi <jan.tuomi@valuemotive.com> | 2020-08-09 16:29:26 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan.tuomi@valuemotive.com> | 2020-08-09 16:29:26 +0300 |
| commit | 08ae1a42c694ec409921225daa59ab42fac75d58 (patch) | |
| tree | 8130cc772a35cb081333d73c9015638e586aca41 /scenes | |
| parent | 1119130621fe5bbc048fb8404263acc65490d0cd (diff) | |
Allow options in dialoguemaster
Diffstat (limited to 'scenes')
| -rw-r--r-- | scenes/DialogueOptionButton.tscn | 33 | ||||
| -rw-r--r-- | scenes/GUI.tscn | 41 |
2 files changed, 49 insertions, 25 deletions
diff --git a/scenes/DialogueOptionButton.tscn b/scenes/DialogueOptionButton.tscn new file mode 100644 index 0000000..033bbba --- /dev/null +++ b/scenes/DialogueOptionButton.tscn @@ -0,0 +1,33 @@ +[gd_scene load_steps=4 format=2] + +[sub_resource type="StyleBoxFlat" id=3] +bg_color = Color( 0.368627, 0.0352941, 0.313726, 1 ) +border_width_left = 6 +border_width_right = 6 + +[sub_resource type="StyleBoxFlat" id=2] +bg_color = Color( 0.484375, 0.110941, 0.422868, 1 ) +border_width_left = 6 +border_width_right = 6 +border_color = Color( 0.486275, 0.109804, 0.423529, 1 ) + +[sub_resource type="StyleBoxFlat" id=1] +bg_color = Color( 0.368627, 0.0352941, 0.313726, 1 ) +border_width_left = 6 +border_width_right = 6 +border_color = Color( 0.368627, 0.0352941, 0.313726, 1 ) + +[node name="DialogueOptionButton" type="Button"] +margin_left = 88.0 +margin_right = 128.0 +margin_bottom = 20.0 +rect_min_size = Vector2( 40, 20 ) +size_flags_horizontal = 3 +custom_styles/hover = SubResource( 3 ) +custom_styles/pressed = SubResource( 2 ) +custom_styles/focus = SubResource( 3 ) +custom_styles/normal = SubResource( 1 ) +text = "Long text" +__meta__ = { +"_edit_use_anchors_": false +} 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"] |
