# HG changeset patch # User Alys Brooks # Date 2021-06-06 08:38:39 # Node ID e8792e669968af2808519cccc7e2689c8fa61e48 # Parent 50316d2c86a6156911bdc7d9f27e6b7ba8d59a87 UI fixes. 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 @@ -106,7 +106,7 @@ public static class DialogInterface { - public static bool had_focus = false; + public static bool hadFocus = false; public static Node RenderDialog(ref bool show, ref bool paused, ImFontPtr font, Node currentNode) { Node new_child = currentNode; @@ -119,16 +119,16 @@ StyleSet.pushColorSet(StyleSet.defaultWindowColors); ImGui.SetNextWindowSize(new Num.Vector2(400, 200)); - if(ContractsWindow.had_focus) + if(DialogInterface.hadFocus) { ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); } ImGui.Begin(currentNode.data.speaker, ref show, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoSavedSettings); - if (ContractsWindow.had_focus) + if (DialogInterface.hadFocus) { ImGui.PopStyleColor(); } - ContractsWindow.had_focus = ImGui.IsWindowFocused(); + DialogInterface.hadFocus = ImGui.IsWindowFocused(); if (currentNode.data.response != null) diff --git a/isometric-park-fna/UI/ForestWindow.cs b/isometric-park-fna/UI/ForestWindow.cs --- a/isometric-park-fna/UI/ForestWindow.cs +++ b/isometric-park-fna/UI/ForestWindow.cs @@ -10,6 +10,7 @@ public static class ForestWindow { + public static bool hadFocus = false; public static void Render(bool show, ImFontPtr font, Simulation sim, ImGuiWindowBridgeEngine engine) { bool newShow = show; @@ -21,7 +22,18 @@ StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars); StyleSet.pushColorSet(StyleSet.defaultWindowColors); + + if(ForestWindow.hadFocus) + { + ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); + } + ImGui.Begin("Forest Policy", ref show, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoSavedSettings); + if (ForestWindow.hadFocus) + { + ImGui.PopStyleColor(); + } + ForestWindow.hadFocus = ImGui.IsWindowFocused(); int new_tree_planting = sim.tree_planting;