diff --git a/isometric-park-fna/UI/Graph.cs b/isometric-park-fna/UI/Graph.cs --- a/isometric-park-fna/UI/Graph.cs +++ b/isometric-park-fna/UI/Graph.cs @@ -17,7 +17,6 @@ namespace isometricparkfna.UI { - public static class GraphWindow { public static bool hadFocus = false; @@ -29,10 +28,9 @@ public static bool always_show_zero = false; - private static string[] money_series = { "Total Funds", - "Subsidies", "Upkeep", "Contracts", "Cashflow", "Misc" - }; - private static string[] tree_series = { "Total trees", "Dead trees", "Crowded trees"}; + private static string[] money_series = {"Total Funds", + "Subsidies", "Upkeep", "Contracts", "Cashflow", "Misc"}; + private static string[] tree_series = {"Total trees", "Dead trees", "Crowded trees"}; public static Dictionary> data_sets = new Dictionary>(); @@ -42,9 +40,7 @@ .Select(e => (e, false)) .ToDictionary(t => t.Item1, t=> t.Item2); - - - public static ImGuiColor[] colors = { ImGuiColor.BLACK, ImGuiColor.RED, ImGuiColor.GREEN, + public static ImGuiColor[] colors = {ImGuiColor.BLACK, ImGuiColor.RED, ImGuiColor.GREEN, ImGuiColor.BLUE, ImGuiColor.DARKGREY, ImGuiColor.LIGHTRED, ImGuiColor.LIGHTGREEN, ImGuiColor.LIGHTBLUE, ImGuiColor.BLACK }; @@ -54,7 +50,6 @@ .Zip(colors, (first, second) => (first, second)) .ToDictionary(t => t.Item1, t => t.Item2); - public static void DrawLinearAxis(ImDrawListPtr draw_list, Num.Vector2 range, bool vertical, int points, Num.Vector2 position) { //See DrawLinearLabels for explanation var tick_spacing = (int)Math.Abs((range.Y - range.X) / (points - 1)); @@ -106,10 +101,8 @@ tick_absolute_position = Num.Vector2.Add(starting_position, tick_position); } - } - public static void DrawLine(ImDrawListPtr draw_list, Num.Vector2 c, Num.Vector2[] points, ImGuiColor col) { var p = Num.Vector2.Zero; @@ -118,7 +111,7 @@ points[i] = Num.Vector2.Add(points[i], c); } - draw_list.AddPolyline(ref points[0], points.Length, (uint)col, 0 /*ImDrawFlags.RoundCornersDefault*/, 1.0f); + draw_list.AddPolyline(ref points[0], points.Length, (uint)col, 0, 1.0f); } public static int Scale(Num.Vector2 domain, Num.Vector2 range, int num) { @@ -155,16 +148,16 @@ } GraphWindow.hadFocus = ImGui.IsWindowFocused(); - data_sets["Total Funds"] = sim.allBudgets().Select(b => (double)b.money); - data_sets["Subsidies"] = sim.allBudgets().Select(b => (double)b.subsidy); - data_sets["Upkeep"] = sim.allBudgets().Select(b => (double)b.upkeep); - data_sets["Contracts"] = sim.allBudgets().Select(b => (double)b.contracts); - data_sets["Misc"] = sim.allBudgets().Select(b => (double)b.misc); - data_sets["Cashflow"] = sim.allBudgets().Select(b => (double)b.cashflow); + data_sets["Total Funds"] = sim.allBudgets().Select(b => (double)b.money); + data_sets["Subsidies"] = sim.allBudgets().Select(b => (double)b.subsidy); + data_sets["Upkeep"] = sim.allBudgets().Select(b => (double)b.upkeep); + data_sets["Contracts"] = sim.allBudgets().Select(b => (double)b.contracts); + data_sets["Misc"] = sim.allBudgets().Select(b => (double)b.misc); + data_sets["Cashflow"] = sim.allBudgets().Select(b => (double)b.cashflow); - data_sets["Total trees"] = sim.allBudgets().Select(b => (double)b.trees); - data_sets["Dead trees"] = sim.allBudgets().Select(b => (double)b.dead_trees); - data_sets["Crowded trees"] = sim.allBudgets().Select(b => (double)b.crowded_trees); + data_sets["Total trees"] = sim.allBudgets().Select(b => (double)b.trees); + data_sets["Dead trees"] = sim.allBudgets().Select(b => (double)b.dead_trees); + data_sets["Crowded trees"] = sim.allBudgets().Select(b => (double)b.crowded_trees); var periods = 12.0d * GraphWindow.year; var keys = data_sets_show.Keys.ToList(); @@ -184,7 +177,7 @@ foreach (var key in keys) { if (data_sets_show[key] && totals.Count() > 0) { var series_min = data_sets[key].Min(); - series_min = series_min >= 0? series_min * 0.90f : series_min *1.10f; + series_min = series_min >= 0? series_min * 0.90f : series_min *1.10f; min = Math.Min(series_min, min); } } @@ -266,7 +259,7 @@ var key = tree_series[i]; if (Menu.activeButton(key, data_sets_show[key], StyleSets.selected, StyleSets.white)) { - data_sets_show[key] = !data_sets_show[key]; + data_sets_show[key] = !data_sets_show[key]; } if (i != tree_series.Length-1) @@ -281,7 +274,7 @@ var key = money_series[i]; if (Menu.activeButton(key, data_sets_show[key], StyleSets.selected, StyleSets.white)) { - data_sets_show[key] = !data_sets_show[key]; + data_sets_show[key] = !data_sets_show[key]; } if ((i % 4 != 3) && (i != money_series.Length-1)) { ImGui.SameLine();