diff --git a/isometric-park-fna/FNAGame.cs b/isometric-park-fna/FNAGame.cs --- a/isometric-park-fna/FNAGame.cs +++ b/isometric-park-fna/FNAGame.cs @@ -83,6 +83,7 @@ private GraphicsDeviceManager gdm; private bool showBudget; private BudgetWindow budgetWindow; + private bool showForest; private static void Main(string[] args) { @@ -131,6 +132,7 @@ showInitial = true; messageIndex = 0; showBudget = false; + showForest = true; showGrid = true; this.Window.Title = "Isometric Park"; @@ -830,6 +832,8 @@ ref this.simulation.paused, debugWindow.monoFont, this.currentNode); } + ForestWindow.Render(ref this.showForest, debugWindow.monoFont, this.simulation); + _imGuiRenderer.AfterLayout(); diff --git a/isometric-park-fna/UI/ForestWindow.cs b/isometric-park-fna/UI/ForestWindow.cs new file mode 100644 --- /dev/null +++ b/isometric-park-fna/UI/ForestWindow.cs @@ -0,0 +1,56 @@ +using ImGuiNET; + +using Num = System.Numerics; + +namespace isometricparkfna.UI +{ + + public static class ForestWindow + { + public static void Render(ref bool show, ImFontPtr font, Simulation sim) + { + if (show) + { + ImGui.PushFont(font); + + ImGui.PushStyleVar(ImGuiStyleVar.FrameRounding, 0.0f); + ImGui.PushStyleVar(ImGuiStyleVar.WindowRounding, 0.0f); + ImGui.PushStyleVar(ImGuiStyleVar.FrameBorderSize, 1.0f); + ImGui.PushStyleColor(ImGuiCol.WindowBg, new Num.Vector4(0.75f, 0.75f, 0.75f, 1f)); + + var title_bar = new Num.Vector4(0.65f, 0.65f, 0.65f, 1f); + ImGui.PushStyleColor(ImGuiCol.TitleBg, title_bar); + ImGui.PushStyleColor(ImGuiCol.TitleBgActive, title_bar); + ImGui.PushStyleColor(ImGuiCol.TitleBgCollapsed, title_bar); + + ImGui.PushStyleColor(ImGuiCol.Border, new Num.Vector4(0f, 0f, 0f, 1f)); + ImGui.PushStyleColor(ImGuiCol.BorderShadow, new Num.Vector4(0f, 0f, 0f, 0.5f)); + + + + ImGui.PushStyleColor(ImGuiCol.Button, new Num.Vector4(0.75f, 0.75f, 0.75f, 1f)); + ImGui.PushStyleColor(ImGuiCol.Text, new Num.Vector4(0f, 0f, 0f, 1f)); + ImGui.Begin("Forest Policy", ref show); + + + int new_tree_planting = sim.tree_planting; + ImGui.SliderInt("Tree Planting ($100 ea.)", ref new_tree_planting, 0, 25); + sim.tree_planting = new_tree_planting; + + int new_tree_clearing = sim.tree_clearing; + ImGui.SliderInt("Tree Clearing ($100 ea.)", ref new_tree_clearing, 0, 25); + sim.tree_clearing = new_tree_clearing; + + if (ImGui.Button("Okay")) + { + show = false; + } + + ImGui.End(); + ImGui.PopStyleVar(3); + ImGui.PopStyleColor(8); + ImGui.PopFont(); + } + } + } +} \ No newline at end of file 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 @@ -48,6 +48,7 @@ +