From 1a142bcc9d5a86dcd3c6990d0ad9ef4a1f87f56b Mon Sep 17 00:00:00 2001 From: cmod31 Date: Sat, 4 Feb 2023 21:01:07 +0100 Subject: [PATCH] welcome dialogue begin --- scenes/gui/dialog_bubble.tscn | 11 +------ scenes/gui/dlg_answer_button.tscn | 1 + .../dialogue-system/dialog_bubble.cs | 32 +++++++++++++++---- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/scenes/gui/dialog_bubble.tscn b/scenes/gui/dialog_bubble.tscn index d192cc2..c9bb463 100644 --- a/scenes/gui/dialog_bubble.tscn +++ b/scenes/gui/dialog_bubble.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=6 format=3 uid="uid://bkm7365u1mm3o"] +[gd_scene load_steps=5 format=3 uid="uid://bkm7365u1mm3o"] [ext_resource type="Script" path="res://src/scene-scripts/dialogue-system/dialog_bubble.cs" id="1_xtj1q"] [ext_resource type="FontFile" uid="uid://cx6bvqk0ghmjv" path="res://assets/fonts/urbane-rounded-medium.otf" id="2_qrihj"] [ext_resource type="Texture2D" uid="uid://04pdpdvkg2s" path="res://assets/textures/dialogue/dialogue_answer_ninepatch.png" id="3_n3y1v"] -[ext_resource type="PackedScene" uid="uid://cv87js42t1sty" path="res://scenes/gui/dlg_answer_button.tscn" id="4_r5f4t"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5w2xu"] @@ -101,11 +100,3 @@ theme_override_constants/margin_bottom = 30 [node name="v_box_container" type="VBoxContainer" parent="box/panel_container/margin_container"] layout_mode = 2 - -[node name="answer_button" parent="box/panel_container/margin_container/v_box_container" instance=ExtResource("4_r5f4t")] -layout_mode = 2 -text = "needs focus on mouse hover" - -[node name="answer_button_2" parent="box/panel_container/margin_container/v_box_container" instance=ExtResource("4_r5f4t")] -layout_mode = 2 -text = "jkbhjvvjvhgvhjv" diff --git a/scenes/gui/dlg_answer_button.tscn b/scenes/gui/dlg_answer_button.tscn index a8a0c52..7d854b3 100644 --- a/scenes/gui/dlg_answer_button.tscn +++ b/scenes/gui/dlg_answer_button.tscn @@ -29,5 +29,6 @@ theme_override_styles/hover = SubResource("StyleBoxEmpty_h66dw") theme_override_styles/pressed = SubResource("StyleBoxEmpty_2axga") theme_override_styles/disabled = SubResource("StyleBoxEmpty_s6xfc") theme_override_styles/focus = SubResource("StyleBoxEmpty_trdc6") +text = "this is placeholder text" icon = ExtResource("2_tkpfr") alignment = 0 diff --git a/src/scene-scripts/dialogue-system/dialog_bubble.cs b/src/scene-scripts/dialogue-system/dialog_bubble.cs index ceae4f4..e085401 100644 --- a/src/scene-scripts/dialogue-system/dialog_bubble.cs +++ b/src/scene-scripts/dialogue-system/dialog_bubble.cs @@ -9,12 +9,11 @@ public partial class dialog_bubble : CanvasLayer public ArrayList dlgLines = new ArrayList(); public int dlgPointer = 0; public RichTextLabel richText; + public int dialogOptionsLength; public override void _Ready() { richText = GetNode("box/rich_text_label"); - dlgLines.Add("Hello! I'm a [color=purple]debug character[/color] and..."); - dlgLines.Add("[center][b][wave amp=50 freq=15][rainbow]This is cool test text[/rainbow][/wave][/b][/center]"); //bbcode gets counted to so typewrite effect takes decades //make a seperate variable without bbcode and count that instead } public void GetDialog(string file, string title, Variant actor, string playerName) { @@ -22,16 +21,25 @@ public partial class dialog_bubble : CanvasLayer GetNode