From 2f57e22f06f90f36acd25b0dfa1fc09554293095 Mon Sep 17 00:00:00 2001 From: vaporvee Date: Tue, 29 Nov 2022 21:37:32 +0100 Subject: [PATCH] now using multiple files instead of giant multiple files with extra keys --- dialog/npcs/villager_normal.json | 12 +++++++++ dialog/npcs/villagers.json | 26 -------------------- scenes/tiles/dialogdebug_cupcake.tscn | 2 +- src/scene-scripts/gui/dialog_trigger_area.cs | 4 +-- 4 files changed, 14 insertions(+), 30 deletions(-) create mode 100644 dialog/npcs/villager_normal.json delete mode 100644 dialog/npcs/villagers.json diff --git a/dialog/npcs/villager_normal.json b/dialog/npcs/villager_normal.json new file mode 100644 index 0000000..05b67ae --- /dev/null +++ b/dialog/npcs/villager_normal.json @@ -0,0 +1,12 @@ +{ + "randomWelcomeText":[ + "Oh hello, §player§... You look great! What do you want from me?", + "Hey, §player§! Hope you have fun today!", + "Hi! What's up §player§?" + ], + "debugAnswer": "Cool master you set me up successfully for this simulation!", + "randomGoodbyeText":[ + "Was nice talking to you goodbye!", + "Have a great day, §player§!" + ] +} \ No newline at end of file diff --git a/dialog/npcs/villagers.json b/dialog/npcs/villagers.json deleted file mode 100644 index 3616391..0000000 --- a/dialog/npcs/villagers.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "1": { - "randomWelcomeText":[ - "Oh hello, §player§... You look great! What do you want from me?", - "Hey, §player§! Hope you have fun today!", - "Hi! What's up §player§?" - ], - "debugAnswer": "Cool master you set me up successfully for this simulation!", - "randomGoodbyeText":[ - "Was nice talking to you goodbye!", - "Have a great day, §player§!" - ] - }, - "2": { - "randomWelcomeText":[ - "Oh hello, §player§... You look great! What do you want from me?", - "Hey, §player§! Hope you have fun today!", - "Hi! What's up §player§?" - ], - "debugAnswer": "Cool master you set me up successfully for this simulation!", - "randomGoodbyeText":[ - "Was nice talking to you goodbye!", - "Have a great day, §player§!" - ] - } -} \ No newline at end of file diff --git a/scenes/tiles/dialogdebug_cupcake.tscn b/scenes/tiles/dialogdebug_cupcake.tscn index 75d9383..991219a 100644 --- a/scenes/tiles/dialogdebug_cupcake.tscn +++ b/scenes/tiles/dialogdebug_cupcake.tscn @@ -18,7 +18,7 @@ texture = ExtResource("1_imilm") shape = SubResource("RectangleShape2D_pchpi") [node name="dialog_trigger_area" parent="." instance=ExtResource("2_blpmd")] -dialogFile = "res://dialog/npcs/villagers.json" +dialogFile = "res://dialog/npcs/villager_normal.json" [node name="collision_shape_2d" parent="dialog_trigger_area" index="0"] shape = SubResource("RectangleShape2D_d78tr") diff --git a/src/scene-scripts/gui/dialog_trigger_area.cs b/src/scene-scripts/gui/dialog_trigger_area.cs index 19cbef3..a192e3a 100644 --- a/src/scene-scripts/gui/dialog_trigger_area.cs +++ b/src/scene-scripts/gui/dialog_trigger_area.cs @@ -13,9 +13,7 @@ public partial class dialog_trigger_area : Area2D var jsonFile = JSON.ParseString(text); Dictionary allDialog = (Dictionary)jsonFile; - Dictionary firsChunkDialog = (Dictionary)allDialog["1"]; - - GD.Print(firsChunkDialog["debugAnswer"]); + GD.Print(allDialog["debugAnswer"]); }