# HG changeset patch # User Alys Brooks # Date 2021-06-26 22:12:00 # Node ID b98cc88a06b1b672f7ae32a919b0680afe5188a7 # Parent dc01129dd0353ed09b537f3d8ec2a811a782916d Finish refactoring. diff --git a/isometric-park-fna/UI/ContractWindow.cs b/isometric-park-fna/UI/ContractWindow.cs --- a/isometric-park-fna/UI/ContractWindow.cs +++ b/isometric-park-fna/UI/ContractWindow.cs @@ -52,7 +52,7 @@ if (ContractWindow.hadFocus.ContainsKey(title) && ContractWindow.hadFocus[title]) { - ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); + ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.white); } ImGui.Begin(name, ref newShow, diff --git a/isometric-park-fna/UI/ContractsWindow.cs b/isometric-park-fna/UI/ContractsWindow.cs --- a/isometric-park-fna/UI/ContractsWindow.cs +++ b/isometric-park-fna/UI/ContractsWindow.cs @@ -39,7 +39,7 @@ ImGui.SetNextWindowSize(new Num.Vector2(320, 340)); if(ContractsWindow.had_focus) { - ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); + ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.white); } ImGui.Begin("Contracts", ref newShow, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings); if (ContractsWindow.had_focus) 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 @@ -120,7 +120,7 @@ ImGui.SetNextWindowSize(new Num.Vector2(400, 200)); if(DialogInterface.hadFocus) { - ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); + ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.white); } ImGui.Begin(currentNode.data.speaker, ref show, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoSavedSettings); if (DialogInterface.hadFocus) 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 @@ -24,7 +24,7 @@ if(ForestWindow.hadFocus) { - ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); + ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.white); } ImGui.Begin("Forest Policy", ref show, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoSavedSettings); diff --git a/isometric-park-fna/UI/Menu.cs b/isometric-park-fna/UI/Menu.cs --- a/isometric-park-fna/UI/Menu.cs +++ b/isometric-park-fna/UI/Menu.cs @@ -18,7 +18,7 @@ if (active) { ImGui.PushStyleColor(ImGuiCol.Button, activeColor); ImGui.PushStyleColor(ImGuiCol.ButtonHovered, activeColor); - ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); + ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.grey); } var result = ImGui.Button(label); @@ -37,7 +37,7 @@ StyleSets.defaultSet.push(); - ImGui.PushStyleColor(ImGuiCol.MenuBarBg, StyleSet.grey); + ImGui.PushStyleColor(ImGuiCol.MenuBarBg, StyleSets.grey); if (ImGui.BeginMainMenuBar()) { @@ -46,56 +46,56 @@ ImGui.SetCursorPosX(width - 520); - if (Menu.activeButton("\ue0c2 Contracts", bridgeEngine.windowStatuses[Window.Contracts], StyleSet.selected)) + if (Menu.activeButton("\ue0c2 Contracts", bridgeEngine.windowStatuses[Window.Contracts], StyleSets.selected)) { Logging.Trace("Contracts toggled."); Logging.Spy(bridgeEngine.windowStatuses, "statuses"); bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.Contracts}); } //Budget isn't connected to an entity yet: - if (Menu.activeButton("$ Budget", showBudget, StyleSet.selected)) + if (Menu.activeButton("$ Budget", showBudget, StyleSets.selected)) { bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.Budget}); } - if (Menu.activeButton("\ue124 Forest", bridgeEngine.windowStatuses[Window.Forest], StyleSet.selected)) + if (Menu.activeButton("\ue124 Forest", bridgeEngine.windowStatuses[Window.Forest], StyleSets.selected)) { bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.Forest}); } - if (Menu.activeButton("\ue0bf News", bridgeEngine.windowStatuses[Window.News], StyleSet.selected)) + if (Menu.activeButton("\ue0bf News", bridgeEngine.windowStatuses[Window.News], StyleSets.selected)) { bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.News}); } ImGui.Text("|"); - if (Menu.activeButton("\ue0ac Pause", paused, StyleSet.selected )) + if (Menu.activeButton("\ue0ac Pause", paused, StyleSets.selected )) { paused = !paused; } - if (Menu.activeButton("1", (rate == 0), StyleSet.selected)) + if (Menu.activeButton("1", (rate == 0), StyleSets.selected)) { paused = false; rate = 0; } - else if (Menu.activeButton("2", (rate == 1), StyleSet.selected)) + else if (Menu.activeButton("2", (rate == 1), StyleSets.selected)) { paused = false; rate = 1; } - else if (Menu.activeButton("3", (rate == 2), StyleSet.selected)) + else if (Menu.activeButton("3", (rate == 2), StyleSets.selected)) { paused = false; rate = 2; } - else if (Menu.activeButton("4", (rate == 3), StyleSet.selected)) + else if (Menu.activeButton("4", (rate == 3), StyleSets.selected)) { paused = false; rate = 3; } #if DEBUG - else if (Menu.activeButton("5", (rate == 4), StyleSet.selected)) + else if (Menu.activeButton("5", (rate == 4), StyleSets.selected)) { paused = false; rate = 4; diff --git a/isometric-park-fna/UI/NewsWindow.cs b/isometric-park-fna/UI/NewsWindow.cs --- a/isometric-park-fna/UI/NewsWindow.cs +++ b/isometric-park-fna/UI/NewsWindow.cs @@ -77,7 +77,7 @@ if(NewsWindow.had_focus) { - ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); + ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.white); } ImGui.Begin("NEWS", ref newShow, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings); diff --git a/isometric-park-fna/UI/OptionsWindow.cs b/isometric-park-fna/UI/OptionsWindow.cs --- a/isometric-park-fna/UI/OptionsWindow.cs +++ b/isometric-park-fna/UI/OptionsWindow.cs @@ -48,7 +48,7 @@ // ImGui.SetNextWindowSize(new Num.Vector2(320, 320)); if(OptionsWindow.hadFocus) { - ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); + ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.white); } ImGui.Begin("Options", ref newShow, ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse); diff --git a/isometric-park-fna/UI/StyleSet.cs b/isometric-park-fna/UI/StyleSet.cs --- a/isometric-park-fna/UI/StyleSet.cs +++ b/isometric-park-fna/UI/StyleSet.cs @@ -8,52 +8,6 @@ { public class StyleSet { - public static Num.Vector4 grey = new Num.Vector4(0.75f, 0.75f, 0.75f, 1f); - public static Num.Vector4 darkgrey = new Num.Vector4(0.45f, 0.45f, 0.45f, 1f); - public static Num.Vector4 black = new Num.Vector4(0f, 0f, 0f, 1f); - public static Num.Vector4 white = new Num.Vector4(1f, 1f, 1f, 1f); - public static Num.Vector4 title_bar = new Num.Vector4(0.65f, 0.65f, 0.65f, 1f); - - // public static Num.Vector4 selected = new Num.Vector4(0.0f, 0.0f, 0.75f, 1f); - public static Num.Vector4 selected = new Num.Vector4(0.0f, 0.0f, 0.55f, 1f); - public static Dictionary defaultWindowVars = new Dictionary{ - { ImGuiStyleVar.FrameRounding, 0.0f }, - {ImGuiStyleVar.WindowRounding, 0.0f}, - {ImGuiStyleVar.FrameBorderSize, 1.0f}, - {ImGuiStyleVar.TabRounding, 0.0f}, - }; - public static Dictionary defaultWindowColors = new Dictionary{ - - {ImGuiCol.WindowBg, grey}, - {ImGuiCol.FrameBg, grey}, - {ImGuiCol.FrameBgHovered, grey}, - {ImGuiCol.Header, darkgrey}, - {ImGuiCol.HeaderHovered, darkgrey}, - {ImGuiCol.HeaderActive, darkgrey}, - {ImGuiCol.ButtonHovered, grey}, - {ImGuiCol.ButtonActive, darkgrey}, - {ImGuiCol.SliderGrab, darkgrey}, - {ImGuiCol.SliderGrabActive, darkgrey}, - - - {ImGuiCol.Tab, darkgrey}, - {ImGuiCol.TabHovered, darkgrey}, - {ImGuiCol.TabActive, selected}, - - {ImGuiCol.CheckMark, black}, - - {ImGuiCol.TitleBg, title_bar}, - {ImGuiCol.TitleBgActive, selected}, - {ImGuiCol.TitleBgCollapsed, title_bar}, - - {ImGuiCol.Border, black}, - {ImGuiCol.BorderShadow, black}, - - {ImGuiCol.PopupBg, white}, - - {ImGuiCol.Button, grey}, - {ImGuiCol.Text, black} - }; // public static IMFont public static void pushStyleVarSet(Dictionary style_set)