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