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 @@ -36,11 +36,11 @@ public List resolutionMessages; public List fontMessages; - bool showBudget {get;} - bool showForest {get;} - bool showNews {get;} - bool showGrid {get;} - bool showTrees {get;} + bool showBudget {get;} + bool showForest {get;} + bool showNews {get;} + bool showGrid {get;} + bool showTrees {get;} public Dictionary windowStatuses {get;} 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 @@ -36,8 +36,8 @@ bool newShow = true; // Num.Vector2 button_size = new Num.Vector2(120, 20); - StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.pushColorSet(StyleSet.defaultWindowColors); + + StyleSets.defaultSet.push(); // ImGui.SetNextWindowPos(new Num.Vector2(width/2, 200)); @@ -140,8 +140,7 @@ ImGui.End(); ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; - StyleSet.popStyleVarSet(StyleSet.defaultWindowVars); - StyleSet.popColorSet(StyleSet.defaultWindowColors); + StyleSets.defaultSet.pop(); ImGui.PopFont(); if (!newShow) 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 @@ -56,8 +56,6 @@ }; // public static IMFont - /* - */ public static void pushStyleVarSet(Dictionary style_set) { foreach(var pair in style_set) @@ -82,6 +80,32 @@ { ImGui.PopStyleColor(style_set.Count); } + + public Dictionary WindowVars {get;} + public Dictionary WindowColors {get;} + + public StyleSet(Dictionary windowVars, + Dictionary windowColors + ) + { + + this.windowVars = windowVars; + this.windowColors = windowColors; + } + + public void push() + { + StyleSet.pushColorSet(this.windowColors); + StyleSet.pushStyleVarSet(this.windowVars); + } + + public void pop() + { + StyleSet.popColorSet(this.windowColors); + StyleSet.popStyleVarSet(this.windowVars); + } + + } } diff --git a/isometric-park-fna/UI/StyleSets.cs b/isometric-park-fna/UI/StyleSets.cs new file mode 100644 --- /dev/null +++ b/isometric-park-fna/UI/StyleSets.cs @@ -0,0 +1,65 @@ + +using System.Collections.Generic; +using ImGuiNET; + +using Num = System.Numerics; + + +namespace isometricparkfna.UI +{ + public static class StyleSets + { + 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 StyleSet defaultSet = new StyleSet(defaultWindowVars, defaultWindowColors); + + + + } + +} diff --git a/isometric-park-fna/isometric-park-fna.csproj b/isometric-park-fna/isometric-park-fna.csproj --- a/isometric-park-fna/isometric-park-fna.csproj +++ b/isometric-park-fna/isometric-park-fna.csproj @@ -65,6 +65,7 @@ +