Description:
Add second dialog, more for testing purposes.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -50,7 +50,7 | |||
|
50 | 50 | |
|
51 | 51 | public static class DialogInterface |
|
52 | 52 | { |
|
53 |
public static Node<DialogOption> RenderDialog( |
|
|
53 | public static Node<DialogOption> RenderDialog(ref bool show, ref bool paused, ImFontPtr font, Node<DialogOption> currentNode) | |
|
54 | 54 | { |
|
55 | 55 | if (show) |
|
56 | 56 | { |
@@ -73,7 +73,7 | |||
|
73 | 73 | |
|
74 | 74 | ImGui.PushStyleColor(ImGuiCol.Button, new Num.Vector4(0.75f, 0.75f, 0.75f, 1f)); |
|
75 | 75 | ImGui.PushStyleColor(ImGuiCol.Text, new Num.Vector4(0f, 0f, 0f, 1f)); |
|
76 |
ImGui.Begin( |
|
|
76 | ImGui.Begin("The Governor", ref show); | |
|
77 | 77 | |
|
78 | 78 | |
|
79 | 79 | ImGui.TextWrapped(currentNode.data.response); |
@@ -93,7 +93,6 | |||
|
93 | 93 | { |
|
94 | 94 | show = false; |
|
95 | 95 | paused = false; |
|
96 | //return null; | |
|
97 | 96 | } |
|
98 | 97 | } |
|
99 | 98 | |
@@ -101,7 +100,6 | |||
|
101 | 100 | { |
|
102 | 101 | show = false; |
|
103 | 102 | paused = false; |
|
104 | //return null; | |
|
105 | 103 | |
|
106 | 104 | } |
|
107 | 105 | ImGui.End(); |
@@ -69,6 +69,8 | |||
|
69 | 69 | private static bool enableCulling = false; |
|
70 | 70 | |
|
71 | 71 | private Node<DialogOption> currentNode; |
|
72 | private Queue<Node<DialogOption>> remainingDialog; | |
|
73 | ||
|
72 | 74 | |
|
73 | 75 | private bool showGrid = true; |
|
74 | 76 | private string output; |
@@ -127,6 +129,10 | |||
|
127 | 129 | |
|
128 | 130 | currentNode = DialogTrees.introTree; |
|
129 | 131 | |
|
132 | this.remainingDialog = new Queue<Node<DialogOption>>(); | |
|
133 | ||
|
134 | this.remainingDialog.Enqueue(DialogTrees.testTree); | |
|
135 | ||
|
130 | 136 | |
|
131 | 137 | var json = "{" + |
|
132 | 138 | " 'origin': '#sentence#'," + |
@@ -370,6 +376,13 | |||
|
370 | 376 | |
|
371 | 377 | this.simulation.update(gameTime.ElapsedGameTime); |
|
372 | 378 | |
|
379 | ||
|
380 | if (!this.showInitial && this.remainingDialog.Count > 0) | |
|
381 | { | |
|
382 | this.currentNode = this.remainingDialog.Dequeue(); | |
|
383 | this.showInitial = true; | |
|
384 | } | |
|
385 | ||
|
373 | 386 | this.original_point = Vector2.Transform(new Vector2(mouseCur.X, mouseCur.Y), Matrix.Invert(camera.get_transformation(GraphicsDevice))); |
|
374 | 387 | |
|
375 | 388 | //int gridx = (int)((this.original_point.X-baseOffsetX) / Tile.TileStepX); |
@@ -777,8 +790,12 | |||
|
777 | 790 | // new DialogOption{ response="Oh yeah, of course.", choice="..." }}; |
|
778 | 791 | |
|
779 | 792 | |
|
780 | this.currentNode = DialogInterface.RenderDialog("The Governor", ref this.showInitial, | |
|
781 | ref this.simulation.paused, debugWindow.monoFont, this.currentNode); | |
|
793 | if (this.currentNode != null) | |
|
794 | { | |
|
795 | this.currentNode = DialogInterface.RenderDialog(ref this.showInitial, | |
|
796 | ref this.simulation.paused, debugWindow.monoFont, this.currentNode); | |
|
797 | } | |
|
798 | ||
|
782 | 799 | |
|
783 | 800 | |
|
784 | 801 |
You need to be logged in to leave comments.
Login now