diff --git a/dialogue/npcs/villager_normal.json b/dialogue/npcs/villager_normal.json index b3b7371..524d0e8 100644 --- a/dialogue/npcs/villager_normal.json +++ b/dialogue/npcs/villager_normal.json @@ -1,5 +1,4 @@ { - "dialogTitle": "Brain damaged Debug Character", "dialogType": "villager", "playerbeginoptions": { "talk": [ diff --git a/scenes/gui/dialog_bubble.tscn b/scenes/gui/dialog_bubble.tscn index c6bc828..9fb8033 100644 --- a/scenes/gui/dialog_bubble.tscn +++ b/scenes/gui/dialog_bubble.tscn @@ -1,15 +1,15 @@ -[gd_scene load_steps=4 format=3 uid="uid://cg86tsupfq53i"] +[gd_scene load_steps=4 format=3 uid="uid://bkm7365u1mm3o"] -[ext_resource type="Script" path="res://src/scene-scripts/dialog_bubble.cs" id="1_210k6"] +[ext_resource type="Script" path="res://src/scene-scripts/dialogue-system/dialog_bubble.cs" id="1_5xn2c"] [ext_resource type="FontFile" uid="uid://cx6bvqk0ghmjv" path="res://assets/fonts/urbane-rounded-medium.otf" id="2_qrihj"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5w2xu"] [node name="dialog_bubble" type="CanvasLayer"] -script = ExtResource("1_210k6") +script = ExtResource("1_5xn2c") metadata/_edit_use_anchors_ = true -[node name="color_rect" type="ColorRect" parent="."] +[node name="box" type="ColorRect" parent="."] anchors_preset = -1 anchor_left = 0.083 anchor_top = 0.694 @@ -22,7 +22,7 @@ offset_bottom = 19.6479 grow_horizontal = 2 grow_vertical = 0 -[node name="text_label" type="RichTextLabel" parent="color_rect"] +[node name="rich_text_label" type="RichTextLabel" parent="box"] layout_mode = 1 anchors_preset = -1 anchor_left = 0.034 @@ -40,10 +40,9 @@ theme_override_fonts/normal_font = ExtResource("2_qrihj") theme_override_font_sizes/normal_font_size = 32 theme_override_font_sizes/bold_font_size = 80 bbcode_enabled = true -text = "this is test text or [center][b][wave amp=50 freq=15][rainbow]This is test text[/rainbow][/wave][/b][/center]" scroll_active = false -[node name="name_label" type="Label" parent="color_rect"] +[node name="name_label" type="Label" parent="box"] layout_mode = 1 anchors_preset = -1 anchor_left = 0.01 @@ -56,42 +55,44 @@ offset_right = 0.389984 offset_bottom = 0.118996 theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_fonts/font = ExtResource("2_qrihj") -theme_override_font_sizes/font_size = 32 +theme_override_font_sizes/font_size = 36 text = "???" -[node name="PanelContainer" type="PanelContainer" parent="."] +[node name="panel_container" type="PanelContainer" parent="box"] +visible = false +layout_mode = 1 anchors_preset = 3 anchor_left = 1.0 anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 -offset_left = -466.0 -offset_top = -312.0 -offset_right = -144.0 -offset_bottom = -239.0 +offset_left = -307.0 +offset_top = -304.0 +offset_right = 15.0 +offset_bottom = -231.0 grow_horizontal = 0 grow_vertical = 0 size_flags_horizontal = 8 size_flags_vertical = 8 theme_override_styles/panel = SubResource("StyleBoxEmpty_5w2xu") -[node name="NinePatchRect" type="NinePatchRect" parent="PanelContainer"] +[node name="nine_patch_rect" type="NinePatchRect" parent="box/panel_container"] layout_mode = 2 -[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"] +[node name="margin_container" type="MarginContainer" parent="box/panel_container"] layout_mode = 2 theme_override_constants/margin_left = 15 theme_override_constants/margin_top = 15 theme_override_constants/margin_right = 15 theme_override_constants/margin_bottom = 15 -[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer"] +[node name="v_box_container" type="VBoxContainer" parent="box/panel_container/margin_container"] layout_mode = 2 -[node name="Button" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="button" type="Button" parent="box/panel_container/margin_container/v_box_container"] custom_minimum_size = Vector2(128, 32) layout_mode = 2 theme_override_fonts/font = ExtResource("2_qrihj") theme_override_font_sizes/font_size = 28 -text = "i want to hear more" +text = "---" alignment = 0 diff --git a/scenes/player.tscn b/scenes/player.tscn index cdfc770..2f78f6e 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://src/scene-scripts/player.cs" id="1_qehox"] [ext_resource type="Texture2D" uid="uid://olceowuycu8c" path="res://assets/textures/debug/dummy-player-atlas.png" id="2_yu1q5"] -[ext_resource type="PackedScene" uid="uid://cg86tsupfq53i" path="res://scenes/gui/dialog_bubble.tscn" id="3_8f573"] +[ext_resource type="PackedScene" uid="uid://bkm7365u1mm3o" path="res://scenes/gui/dialog_bubble.tscn" id="3_8f573"] [sub_resource type="AtlasTexture" id="AtlasTexture_tokqm"] atlas = ExtResource("2_yu1q5") @@ -132,3 +132,4 @@ editor_draw_drag_margin = true current = true [node name="dialog_bubble" parent="." instance=ExtResource("3_8f573")] +visible = false diff --git a/scenes/tiles/dialogdebug_cupcake.tscn b/scenes/tiles/dialogdebug_cupcake.tscn index 71a762c..b010f24 100644 --- a/scenes/tiles/dialogdebug_cupcake.tscn +++ b/scenes/tiles/dialogdebug_cupcake.tscn @@ -19,7 +19,8 @@ position = Vector2(0, 20.625) shape = SubResource("RectangleShape2D_pchpi") [node name="dialog_trigger_area" parent="." instance=ExtResource("2_blpmd")] -dialogFile = "res://dialogue/npcs/villager_normal.json" +file = "res://dialogue/npcs/villager_normal.json" +title = "Debug cupcake" [node name="collision_shape_2d" parent="dialog_trigger_area" index="0"] shape = SubResource("RectangleShape2D_d78tr") diff --git a/src/scene-scripts/dialog_bubble.cs b/src/scene-scripts/dialog_bubble.cs deleted file mode 100644 index 4dce904..0000000 --- a/src/scene-scripts/dialog_bubble.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Godot; -using Godot.Collections; -using System; - -public partial class dialog_bubble : CanvasLayer -{ - public Variant parsedDialog; - public Variant test; - public override void _Process(double delta) - { - if (Input.IsActionJustPressed("ui_filedialog_refresh"))//F5 - { - if (test.VariantType == Variant.Type.Array) - test = test.AsGodotArray()[0]; - GD.Print(test); - } - } - public void GetDialog(string dialogFile) - { - parsedDialog = Json.ParseString(FileAccess.Open(dialogFile, FileAccess.ModeFlags.Read).GetAsText()); - GetNode