# HG changeset patch # User Alys Brooks # Date 2021-08-04 07:47:31 # Node ID 9963e0e05125dbd89197f7bb2de0dc3a3f1c9887 # Parent 82c352fd371d044b20dc3fd387bb7883bccb1c21 Display one dialog at a time. 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 @@ -6,6 +6,7 @@ using System.Linq; using isometricparkfna.UI; +using isometricparkfna.Utils; using isometricparkfna.Engines; using isometricparkfna.Components; using isometricparkfna.Messages; @@ -66,6 +67,12 @@ { var width = gdm.PreferredBackBufferWidth; + + Entity dialogEntity = default; + Node dialogNode = default; + + + foreach (ref readonly var entity in ReadEntities()) { var window_type = GetComponent(entity).type; @@ -113,16 +120,28 @@ case Window.Dialog: var dialog = GetComponent(entity).Dialog; - var show = true; - var paused = true; - DialogInterface.RenderDialog(entity, this.BridgeEngine, ref show, ref paused, this.BridgeEngine.font, dialog); + + if ((dialogEntity == null) + || (dialogEntity.ID == 0) + || entity.ID < dialogEntity.ID) + { + dialogEntity = entity; + dialogNode = dialog; + } break; default: // Logging.Error(String.Format("Unknown window type {0} ", window_type)); break; } + } } + if (dialogNode != null) + { + var show = true; + var paused = true; + DialogInterface.RenderDialog(dialogEntity, this.BridgeEngine, ref show, ref paused, this.BridgeEngine.font, dialogNode); + } } public void setFont(ImFontPtr font)