From 53d35083a315b19601cc639a3f9ca8b9d1abcf09 Mon Sep 17 00:00:00 2001 From: cmod31 Date: Thu, 2 Feb 2023 10:23:17 +0100 Subject: [PATCH] more json experiments --- src/scene-scripts/gui/dialog_bubble.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/scene-scripts/gui/dialog_bubble.cs b/src/scene-scripts/gui/dialog_bubble.cs index eebacc8..ae5f0df 100644 --- a/src/scene-scripts/gui/dialog_bubble.cs +++ b/src/scene-scripts/gui/dialog_bubble.cs @@ -5,8 +5,15 @@ 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) { @@ -15,8 +22,8 @@ public partial class dialog_bubble : CanvasLayer Array dialogLinestest = new Array(); dialogLinestest.Add("test"); dialogLinestest.Add("test2"); - GD.Print(dialogLinestest); - GD.Print((parsedDialog.AsGodotDictionary()["tipp"]).AsGodotArray()[2].AsGodotArray()[4].VariantType); - if(GetParent().Name == "player") GetParent().allowMovement = true; + GD.Print(); + test = parsedDialog.AsGodotDictionary()["tipp"]; + if (GetParent().Name == "player") GetParent().allowMovement = true; } }