Description:
Unpause when dialog ends.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r461:195b2dcc9f2d -

@@ -18,7 +18,7
18 typeof(SelectMessage),
18 typeof(SelectMessage),
19 typeof(JumpCameraMessage),
19 typeof(JumpCameraMessage),
20 typeof(GameStateMessage),
20 typeof(GameStateMessage),
21 typeof(GameStateMessage),
21 typeof(GameRateMessage),
22 typeof(SetResolutionMessage),
22 typeof(SetResolutionMessage),
23 typeof(SetFontMessage),
23 typeof(SetFontMessage),
24 typeof(SetTrespassingPolicyMessage),
24 typeof(SetTrespassingPolicyMessage),
@@ -51,6 +51,7
51 public List<SetDialogMessage> setDialogMessages;
51 public List<SetDialogMessage> setDialogMessages;
52 public List<DialogChoiceMessage> dialogChoiceMessages;
52 public List<DialogChoiceMessage> dialogChoiceMessages;
53 public List<SetOptionMessage> setOptionMessages;
53 public List<SetOptionMessage> setOptionMessages;
54 public List<GameRateMessage> gameRateMessages;
54
55
55 bool showBudget { get; }
56 bool showBudget { get; }
56 bool showForest { get; }
57 bool showForest { get; }
@@ -98,6 +99,8
98 this.setDialogMessages = new List<SetDialogMessage>();
99 this.setDialogMessages = new List<SetDialogMessage>();
99 this.dialogChoiceMessages = new List<DialogChoiceMessage>();
100 this.dialogChoiceMessages = new List<DialogChoiceMessage>();
100 this.setOptionMessages = new List<SetOptionMessage>();
101 this.setOptionMessages = new List<SetOptionMessage>();
102 this.gameRateMessages = new List<GameRateMessage>();
103
101 this.windowStatuses = new Dictionary<Window, bool>();
104 this.windowStatuses = new Dictionary<Window, bool>();
102
105
103 this.showContractIndicator = false;
106 this.showContractIndicator = false;
@@ -194,6 +197,11
194 SendMessage(message);
197 SendMessage(message);
195 }
198 }
196
199
200 foreach (var message in this.gameRateMessages)
201 {
202 SendMessage(message);
203 }
204
197 foreach (var message in this.setOptionMessages)
205 foreach (var message in this.setOptionMessages)
198 {
206 {
199 foreach (var entity in ReadEntities<OptionsComponent>())
207 foreach (var entity in ReadEntities<OptionsComponent>())
@@ -259,6 +267,7
259 this.setTextVariableMessages.Clear();
267 this.setTextVariableMessages.Clear();
260 this.setDialogMessages.Clear();
268 this.setDialogMessages.Clear();
261 this.dialogChoiceMessages.Clear();
269 this.dialogChoiceMessages.Clear();
270 this.gameRateMessages.Clear();
262 this.setOptionMessages.Clear();
271 this.setOptionMessages.Clear();
263 }
272 }
264 }
273 }
@@ -149,13 +149,12
149 NewGameWindow.Render(this.BridgeEngine.font, this.BridgeEngine.italicFont, this.BridgeEngine);
149 NewGameWindow.Render(this.BridgeEngine.font, this.BridgeEngine.italicFont, this.BridgeEngine);
150 break;
150 break;
151 case Window.Dialog:
151 case Window.Dialog:
152
152 dialog_count++;
153 dialog_count++;
154
153
155
154
156 if (HasComponent<ImageComponent>(entity))
155 if (HasComponent<ImageComponent>(entity))
157 {
156 {
158 image_index = GetComponent<ImageComponent>(entity).ImageIndex;
157 image_index = GetComponent<ImageComponent>(entity).ImageIndex;
159 }
158 }
160 else
159 else
161 {
160 {
@@ -185,8 +184,7
185 if (dialogNode.Hydrated)
184 if (dialogNode.Hydrated)
186 {
185 {
187 var show = true;
186 var show = true;
188 var paused = true;
187 DialogInterface.RenderDialog(dialogEntity, this.BridgeEngine, ref show, this.BridgeEngine.font, dialogNode, image_index);
189 DialogInterface.RenderDialog(dialogEntity, this.BridgeEngine, ref show, ref paused, this.BridgeEngine.font, dialogNode, image_index);
190 dialog_open = true;
188 dialog_open = true;
191 }
189 }
192 Logging.Trace(String.Format("{0} dialogs (open? {1}).", dialog_count, dialog_open));
190 Logging.Trace(String.Format("{0} dialogs (open? {1}).", dialog_count, dialog_open));
@@ -132,8 +132,9
132 }
132 }
133
133
134 public static void RenderDialog(Entity entity,
134 public static void RenderDialog(Entity entity,
135 ImGuiWindowBridgeEngine bridgeEngine, ref bool show, ref bool paused, ImFontPtr font, DialogComponent dialogComponent, int imageIndex)
135 ImGuiWindowBridgeEngine bridgeEngine, ref bool show, ImFontPtr font, DialogComponent dialogComponent, int imageIndex)
136 {
136 {
137 var paused = true;
137 if (show)
138 if (show)
138 {
139 {
139 ImGui.PushFont(font);
140 ImGui.PushFont(font);
@@ -224,6 +225,11
224 StyleSets.defaultSet.pop();
225 StyleSets.defaultSet.pop();
225 ImGui.PopFont();
226 ImGui.PopFont();
226 }
227 }
228 if (!paused)
229 {
230 bridgeEngine.gameRateMessages.Add(new GameRateMessage{
231 paused = paused});
232 }
227 }
233 }
228 }
234 }
229 }
235 }
You need to be logged in to leave comments. Login now