Description:
Fix dialog bug (I hope!) and support multiple dialog entries.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r457:4baa9b294202 -

@@ -86,15 +86,23
86 86 foreach (ref readonly var choiceMessage in ReadMessages<DialogChoiceMessage>())
87 87 {
88 88
89 if (Story.currentChoices.Count > 0)
89 if (Story.currentChoices.Count > 0
90 | Story.canContinue)
90 91 {
91 92 //Advance the story
92 Logging.Debug("Advancing story.");
93 Story.ChooseChoiceIndex(choiceMessage.Choice);
93
94 if (Story.currentChoices.Count > 0)
95 {
96 Logging.Debug("Advancing story (choice).");
97 Story.ChooseChoiceIndex(choiceMessage.Choice);
98 }
99 else {
100 Logging.Debug("Advancing story (continuation).");
101 }
94 102
95 103 //Update the dialog component with the new speaker, dialog, and options:
96 104
97 var continuation = this.Grammar.Flatten(this.Story.ContinueMaximally());
105 var continuation = this.Grammar.Flatten(this.Story.Continue());
98 106 var parts = Regex.Split(continuation, ":", 0);
99 107 var speaker = (parts.Length == 2) ? this.Grammar.Flatten(parts[0]) : "Dialog";
100 108 var dialog = (parts.Length == 2) ? this.Grammar.Flatten(parts[1]) : continuation;
@@ -144,7 +152,7
144 152 var Knot = GetComponent<DialogComponent>(lowestEntity).Knot;
145 153
146 154 Story.ChoosePathString(Knot);
147 var continuation = this.Story.ContinueMaximally();
155 var continuation = this.Story.Continue();
148 156 var parts = Regex.Split(continuation, ":", 0);
149 157 var speaker = (parts.Length == 2) ? this.Grammar.Flatten(parts[0]) : "Dialog";
150 158 var dialog = (parts.Length == 2) ? this.Grammar.Flatten(parts[1]) : continuation;
@@ -89,6 +89,9
89 89 DialogComponent dialogNode = default;
90 90 var image_index = 0; // Needs to be here for scoping reasons.
91 91
92 var dialog_count = 0;
93 var dialog_open = false;
94
92 95 ProfanityLevel profanityLevel = default;
93 96
94 97 foreach (ref readonly var entity in ReadEntities<OptionsComponent>())
@@ -147,6 +150,8
147 150 break;
148 151 case Window.Dialog:
149 152
153 dialog_count++;
154
150 155
151 156 if (HasComponent<ImageComponent>(entity))
152 157 {
@@ -163,7 +168,8
163 168
164 169 if ((dialogEntity == null)
165 170 || (dialogEntity.ID == 0)
166 || entity.ID < dialogEntity.ID)
171 || entity.ID < dialogEntity.ID
172 && dialog.Hydrated)
167 173 {
168 174 dialogEntity = entity;
169 175 dialogNode = dialog;
@@ -181,9 +187,12
181 187 var show = true;
182 188 var paused = true;
183 189 DialogInterface.RenderDialog(dialogEntity, this.BridgeEngine, ref show, ref paused, this.BridgeEngine.font, dialogNode, image_index);
190 dialog_open = true;
184 191 }
192 Logging.Debug(String.Format("{0} dialogs (open? {1}).", dialog_count, dialog_open));
185 193 }
186 194
195
187 196 public void setFont(ImFontPtr font)
188 197 {
189 198 this.BridgeEngine.font = font;
You need to be logged in to leave comments. Login now