diff --git a/isometric-park-fna/Engines/ImGuiWindowBridgeEngine.cs b/isometric-park-fna/Engines/ImGuiWindowBridgeEngine.cs --- a/isometric-park-fna/Engines/ImGuiWindowBridgeEngine.cs +++ b/isometric-park-fna/Engines/ImGuiWindowBridgeEngine.cs @@ -18,7 +18,7 @@ typeof(SelectMessage), typeof(JumpCameraMessage), typeof(GameStateMessage), - typeof(GameStateMessage), + typeof(GameRateMessage), typeof(SetResolutionMessage), typeof(SetFontMessage), typeof(SetTrespassingPolicyMessage), @@ -51,6 +51,7 @@ public List setDialogMessages; public List dialogChoiceMessages; public List setOptionMessages; + public List gameRateMessages; bool showBudget { get; } bool showForest { get; } @@ -98,6 +99,8 @@ this.setDialogMessages = new List(); this.dialogChoiceMessages = new List(); this.setOptionMessages = new List(); + this.gameRateMessages = new List(); + this.windowStatuses = new Dictionary(); this.showContractIndicator = false; @@ -194,6 +197,11 @@ SendMessage(message); } + foreach (var message in this.gameRateMessages) + { + SendMessage(message); + } + foreach (var message in this.setOptionMessages) { foreach (var entity in ReadEntities()) @@ -259,6 +267,7 @@ this.setTextVariableMessages.Clear(); this.setDialogMessages.Clear(); this.dialogChoiceMessages.Clear(); + this.gameRateMessages.Clear(); this.setOptionMessages.Clear(); } } diff --git a/isometric-park-fna/Renderers/ImGuiWindowRenderer.cs b/isometric-park-fna/Renderers/ImGuiWindowRenderer.cs --- a/isometric-park-fna/Renderers/ImGuiWindowRenderer.cs +++ b/isometric-park-fna/Renderers/ImGuiWindowRenderer.cs @@ -149,13 +149,12 @@ NewGameWindow.Render(this.BridgeEngine.font, this.BridgeEngine.italicFont, this.BridgeEngine); break; case Window.Dialog: - - dialog_count++; + dialog_count++; if (HasComponent(entity)) { - image_index = GetComponent(entity).ImageIndex; + image_index = GetComponent(entity).ImageIndex; } else { @@ -185,8 +184,7 @@ if (dialogNode.Hydrated) { var show = true; - var paused = true; - DialogInterface.RenderDialog(dialogEntity, this.BridgeEngine, ref show, ref paused, this.BridgeEngine.font, dialogNode, image_index); + DialogInterface.RenderDialog(dialogEntity, this.BridgeEngine, ref show, this.BridgeEngine.font, dialogNode, image_index); dialog_open = true; } Logging.Trace(String.Format("{0} dialogs (open? {1}).", dialog_count, dialog_open)); diff --git a/isometric-park-fna/UI/Dialog.cs b/isometric-park-fna/UI/Dialog.cs --- a/isometric-park-fna/UI/Dialog.cs +++ b/isometric-park-fna/UI/Dialog.cs @@ -132,8 +132,9 @@ } public static void RenderDialog(Entity entity, - ImGuiWindowBridgeEngine bridgeEngine, ref bool show, ref bool paused, ImFontPtr font, DialogComponent dialogComponent, int imageIndex) + ImGuiWindowBridgeEngine bridgeEngine, ref bool show, ImFontPtr font, DialogComponent dialogComponent, int imageIndex) { + var paused = true; if (show) { ImGui.PushFont(font); @@ -224,6 +225,11 @@ StyleSets.defaultSet.pop(); ImGui.PopFont(); } + if (!paused) + { + bridgeEngine.gameRateMessages.Add(new GameRateMessage{ + paused = paused}); + } } } }