diff --git a/isometric-park-fna/UI/DebugWindow.cs b/isometric-park-fna/UI/DebugWindow.cs --- a/isometric-park-fna/UI/DebugWindow.cs +++ b/isometric-park-fna/UI/DebugWindow.cs @@ -204,111 +204,106 @@ } - public virtual void Layout(DebugInfo debugInfo, Dictionary additionalInfo, ref bool show) - { + public virtual void Layout(DebugInfo debugInfo, Dictionary additionalInfo, ref bool show) + { - if (show) - { - ImGui.Begin("Debug", ref show); + if (show) + { + ImGui.Begin("Debug", ref show); - if (ImGui.BeginTabBar("DebugTabs")) - { - if(ImGui.BeginTabItem("Debug")) - { - - ImGui.Text(string.Format("fps: {0:F3}", debugInfo.fps)); - ImGui.Text(string.Format("Draw Time: {0:F3}", debugInfo.drawTime.TotalMilliseconds.ToString())); - ImGui.Text(string.Format("Update Time: {0:F3}", debugInfo.updateTime.TotalMilliseconds.ToString())); - ImGui.Text(string.Format("Tiles Drawn: {0:F}", debugInfo.tilesDrawn)); + if (ImGui.BeginTabBar("DebugTabs")) + { + if(ImGui.BeginTabItem("Debug")) + { - - ImGui.Text(string.Format("\nCamera Position: {0}", debugInfo.cameraPosition.ToString())); - ImGui.Text(string.Format("\nGrid Position: {0} (has tree: {1})", debugInfo.mouseGrid.ToString(), debugInfo.hasTree)); - - ImGui.Text(string.Format("Application average {0:F3} ms/frame ({1:F1} FPS", 1000f / ImGui.GetIO().Framerate, ImGui.GetIO().Framerate)); - + ImGui.Text(string.Format("fps: {0:F3}", debugInfo.fps)); + ImGui.Text(string.Format("Draw Time: {0:F3}", debugInfo.drawTime.TotalMilliseconds.ToString())); + ImGui.Text(string.Format("Update Time: {0:F3}", debugInfo.updateTime.TotalMilliseconds.ToString())); + ImGui.Text(string.Format("Tiles Drawn: {0:F}", debugInfo.tilesDrawn)); - if (ImGui.Button("Test Window")) - { - this.show_test_window = !this.show_test_window; - } + ImGui.Text(string.Format("\nCamera Position: {0}", debugInfo.cameraPosition.ToString())); + ImGui.Text(string.Format("\nGrid Position: {0} (has tree: {1})", debugInfo.mouseGrid.ToString(), debugInfo.hasTree)); + + ImGui.Text(string.Format("Application average {0:F3} ms/frame ({1:F1} FPS", 1000f / ImGui.GetIO().Framerate, ImGui.GetIO().Framerate)); - if (ImGui.Button("Test Logging")) - { - Logging.Log(LogLevel.Critical, "Test"); - Logging.Log(LogLevel.Error, "Test"); - Logging.Log(LogLevel.Warning, "Test"); - Logging.Log(LogLevel.Info, "Test"); - Logging.Log(LogLevel.Debug, "Test"); - Logging.Log(LogLevel.Trace, "Test"); + if (ImGui.Button("Test Window")) + { + this.show_test_window = !this.show_test_window; + } - Logging.Critical("Test"); - Logging.Error("Test"); - Logging.Warning("Test"); - Logging.Success("Test"); - Logging.Info("Test"); - Logging.Debug("Test"); - Logging.Trace("Test"); + if (ImGui.Button("Test Logging")) + { + Logging.Log(LogLevel.Critical, "Test"); + Logging.Log(LogLevel.Error, "Test"); + Logging.Log(LogLevel.Warning, "Test"); + Logging.Log(LogLevel.Info, "Test"); + Logging.Log(LogLevel.Debug, "Test"); + Logging.Log(LogLevel.Trace, "Test"); - // var t = (testa: 1, testb: 2); - //Logging.Log(LogLevel.Critical, "Test", t); - Logging.Log(LogLevel.Critical, "test", new{test=9.0f}); - //Logging.Log(LogLevel.Critical, "{0}", 0, null, "", 9.0f); + Logging.Critical("Test"); + Logging.Error("Test"); + Logging.Warning("Test"); + Logging.Success("Test"); + Logging.Info("Test"); + Logging.Debug("Test"); + Logging.Trace("Test"); - Logging.Spy(new {debugInfo.cameraPosition, debugInfo.updateTime, test = 9.0f /2}); + // var t = (testa: 1, testb: 2); + //Logging.Log(LogLevel.Critical, "Test", t); + Logging.Log(LogLevel.Critical, "test", new{test=9.0f}); + //Logging.Log(LogLevel.Critical, "{0}", 0, null, "", 9.0f); - } + Logging.Spy(new {debugInfo.cameraPosition, debugInfo.updateTime, test = 9.0f /2}); + + } - if (ImGui.BeginCombo("Log Level", Logging.minimumConsoleLevel.ToString())) - { - foreach(LogLevel level in LogLevel.GetValues(typeof(LogLevel))) - { - if(ImGui.Selectable(level.ToString())) - { - Logging.minimumConsoleLevel = level; - } - } - ImGui.EndCombo(); - } + if (ImGui.BeginCombo("Log Level", Logging.minimumConsoleLevel.ToString())) + { + foreach(LogLevel level in LogLevel.GetValues(typeof(LogLevel))) + { + if(ImGui.Selectable(level.ToString())) + { + Logging.minimumConsoleLevel = level; + } + } + ImGui.EndCombo(); + } - if (debugInfo.pastFps.Length >= 1) - { - ImGui.PlotLines("Frame Rate", ref debugInfo.pastFps[0], debugInfo.pastFps.Length); - } - ImGui.EndTabItem(); - } - if(ImGui.BeginTabItem("Additional Info")) - { - foreach (string k in additionalInfo.Keys) - { - ImGui.Text(string.Format("{0}: {1}", k, additionalInfo[k])); - } + if (debugInfo.pastFps.Length >= 1) + { + ImGui.PlotLines("Frame Rate", ref debugInfo.pastFps[0], debugInfo.pastFps.Length); + } + ImGui.EndTabItem(); + } + if(ImGui.BeginTabItem("Additional Info")) + { + foreach (string k in additionalInfo.Keys) + { + ImGui.Text(string.Format("{0}: {1}", k, additionalInfo[k])); + } - ImGui.EndTabItem(); - } + ImGui.EndTabItem(); + } - if(ImGui.BeginTabItem("Texture Samples")) - { - - ImGui.Text("Texture sample"); - ImGui.Image(_imGuiTexture, new Num.Vector2(250, 200), map.GetSourceUVStart(1), map.GetSourceUVEnd(1), Num.Vector4.One, Num.Vector4.One); // Here, the previously loaded texture is used - ImGui.Image(_imGuiTexture, new Num.Vector2(250, 200), map.GetSourceUVStart(4), map.GetSourceUVEnd(4), Num.Vector4.One, Num.Vector4.One); // Here, the previously loaded texture is used + if(ImGui.BeginTabItem("Texture Samples")) + { + ImGui.Text("Texture sample"); + ImGui.Image(_imGuiTexture, new Num.Vector2(250, 200), map.GetSourceUVStart(1), map.GetSourceUVEnd(1), Num.Vector4.One, Num.Vector4.One); // Here, the previously loaded texture is used + ImGui.Image(_imGuiTexture, new Num.Vector2(250, 200), map.GetSourceUVStart(4), map.GetSourceUVEnd(4), Num.Vector4.One, Num.Vector4.One); // Here, the previously loaded texture is used - ImGui.EndTabItem(); - } - ImGui.EndTabBar(); - ImGui.End(); - } + ImGui.EndTabItem(); + } + ImGui.EndTabBar(); + ImGui.End(); + } - if (this.show_test_window) - { - ImGui.SetNextWindowPos(new Num.Vector2(650, 20), ImGuiCond.FirstUseEver); - ImGui.ShowDemoWindow(ref show_test_window); - } - } - - - } - } + if (this.show_test_window) + { + ImGui.SetNextWindowPos(new Num.Vector2(650, 20), ImGuiCond.FirstUseEver); + ImGui.ShowDemoWindow(ref show_test_window); + } + } + } + } }