diff --git a/isometric-park-fna/Dialog.cs b/isometric-park-fna/Dialog.cs --- a/isometric-park-fna/Dialog.cs +++ b/isometric-park-fna/Dialog.cs @@ -50,7 +50,7 @@ public static class DialogInterface { - public static Node RenderDialog(string title, ref bool show, ref bool paused, ImFontPtr font, Node currentNode) + public static Node RenderDialog(ref bool show, ref bool paused, ImFontPtr font, Node currentNode) { if (show) { @@ -73,7 +73,7 @@ ImGui.PushStyleColor(ImGuiCol.Button, new Num.Vector4(0.75f, 0.75f, 0.75f, 1f)); ImGui.PushStyleColor(ImGuiCol.Text, new Num.Vector4(0f, 0f, 0f, 1f)); - ImGui.Begin(title, ref show); + ImGui.Begin("The Governor", ref show); ImGui.TextWrapped(currentNode.data.response); @@ -93,7 +93,6 @@ { show = false; paused = false; - //return null; } } @@ -101,7 +100,6 @@ { show = false; paused = false; - //return null; } ImGui.End(); diff --git a/isometric-park-fna/FNAGame.cs b/isometric-park-fna/FNAGame.cs --- a/isometric-park-fna/FNAGame.cs +++ b/isometric-park-fna/FNAGame.cs @@ -69,6 +69,8 @@ private static bool enableCulling = false; private Node currentNode; + private Queue> remainingDialog; + private bool showGrid = true; private string output; @@ -127,6 +129,10 @@ currentNode = DialogTrees.introTree; + this.remainingDialog = new Queue>(); + + this.remainingDialog.Enqueue(DialogTrees.testTree); + var json = "{" + " 'origin': '#sentence#'," + @@ -370,6 +376,13 @@ this.simulation.update(gameTime.ElapsedGameTime); + + if (!this.showInitial && this.remainingDialog.Count > 0) + { + this.currentNode = this.remainingDialog.Dequeue(); + this.showInitial = true; + } + this.original_point = Vector2.Transform(new Vector2(mouseCur.X, mouseCur.Y), Matrix.Invert(camera.get_transformation(GraphicsDevice))); //int gridx = (int)((this.original_point.X-baseOffsetX) / Tile.TileStepX); @@ -777,8 +790,12 @@ // new DialogOption{ response="Oh yeah, of course.", choice="..." }}; - this.currentNode = DialogInterface.RenderDialog("The Governor", ref this.showInitial, - ref this.simulation.paused, debugWindow.monoFont, this.currentNode); + if (this.currentNode != null) + { + this.currentNode = DialogInterface.RenderDialog(ref this.showInitial, + ref this.simulation.paused, debugWindow.monoFont, this.currentNode); + } +