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 @@ -44,8 +44,7 @@ ImGui.PushFont(font); ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None; - StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.pushColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.push(); ImGui.SetNextWindowSize(new Num.Vector2(320, 420)); var title = string.Format("Contract {0} ## {1}", name, entity.ID); @@ -164,8 +163,7 @@ ImGui.End(); ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; - StyleSet.popStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.popColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.pop(); ImGui.PopFont(); // Logging.Trace("Finished."); 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 @@ -34,8 +34,7 @@ ImGui.PushFont(font); ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None; - StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.pushColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.push(); ImGui.SetNextWindowSize(new Num.Vector2(320, 340)); if(ContractsWindow.had_focus) @@ -150,8 +149,7 @@ ImGui.End(); ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; - StyleSet.popStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.popColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.pop(); ImGui.PopFont(); } 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 @@ -115,8 +115,7 @@ ImGui.PushFont(font); ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None; - StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.pushColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.push(); ImGui.SetNextWindowSize(new Num.Vector2(400, 200)); if(DialogInterface.hadFocus) @@ -166,8 +165,7 @@ } ImGui.End(); ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; - StyleSet.popStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.popColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.pop(); ImGui.PopFont(); } return new_child; 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 @@ -19,8 +19,7 @@ ImGui.PushFont(font); ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None; - StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.pushColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.push(); if(ForestWindow.hadFocus) @@ -56,11 +55,8 @@ ImGui.End(); ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; - // ImGui.PopStyleVar(3); - // ImGui.PopStyleColor(8); - StyleSet.popStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.popColorSet(StyleSet.defaultWindowColors); - ImGui.PopFont(); + StyleSets.defaultSet.pop(); + ImGui.PopFont(); } if (show != newShow) { diff --git a/isometric-park-fna/UI/InGameMenu.cs b/isometric-park-fna/UI/InGameMenu.cs --- a/isometric-park-fna/UI/InGameMenu.cs +++ b/isometric-park-fna/UI/InGameMenu.cs @@ -27,8 +27,7 @@ Num.Vector2 text_size = ImGui.CalcTextSize("Quit to Main Menu"); Num.Vector2 button_size = new Num.Vector2((int)text_size.X*1.1f, (int)text_size.Y*1.25f+5); - StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.pushColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.push(); ImGui.SetNextWindowPos(new Num.Vector2(width/2, 200)); @@ -62,8 +61,7 @@ ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; - StyleSet.popStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.popColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.pop(); ImGui.PopFont(); } } diff --git a/isometric-park-fna/UI/MainMenu.cs b/isometric-park-fna/UI/MainMenu.cs --- a/isometric-park-fna/UI/MainMenu.cs +++ b/isometric-park-fna/UI/MainMenu.cs @@ -28,8 +28,8 @@ Num.Vector2 button_size = new Num.Vector2((int)text_size.X*1.1f, (int)text_size.Y*1.25f+5); - StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.pushColorSet(StyleSet.defaultWindowColors); + + StyleSets.defaultSet.push(); ImGui.Begin("##Toolbar", ref newShow, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoTitleBar); @@ -46,10 +46,8 @@ ImGui.End(); - ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; - StyleSet.popStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.popColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.pop(); ImGui.PopFont(); } } 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 @@ -36,8 +36,7 @@ ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None; - StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.pushColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.push(); ImGui.PushStyleColor(ImGuiCol.MenuBarBg, StyleSet.grey); if (ImGui.BeginMainMenuBar()) @@ -106,11 +105,9 @@ ImGui.EndMainMenuBar(); - // ImGui.End(); ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; - StyleSet.popStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.popColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.pop(); ImGui.PopStyleColor(1); ImGui.PopFont(); } 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 @@ -71,9 +71,7 @@ ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None; - StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.pushColorSet(StyleSet.defaultWindowColors); - + StyleSets.defaultSet.push(); ImGui.SetNextWindowSize(new Num.Vector2(400, 400)); @@ -135,10 +133,10 @@ } ImGui.End(); + ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; - - StyleSet.popStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.popColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.pop(); + ImGui.PopFont(); } 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 @@ -89,20 +89,20 @@ ) { - this.windowVars = windowVars; - this.windowColors = windowColors; + this.WindowVars = windowVars; + this.WindowColors = windowColors; } public void push() { - StyleSet.pushColorSet(this.windowColors); - StyleSet.pushStyleVarSet(this.windowVars); + StyleSet.pushColorSet(this.WindowColors); + StyleSet.pushStyleVarSet(this.WindowVars); } public void pop() { - StyleSet.popColorSet(this.windowColors); - StyleSet.popStyleVarSet(this.windowVars); + StyleSet.popColorSet(this.WindowColors); + StyleSet.popStyleVarSet(this.WindowVars); }