Description:
Reorganize debug window.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -102,7 +102,7 | |||
|
102 | 102 | AddComponent(newDialog, |
|
103 | 103 | new VisibilityComponent{ visible = true}); |
|
104 | 104 | |
|
105 |
index = GetSpeakerImageIndex(this.Grammar, this.Random, speaker |
|
|
105 | index = GetSpeakerImageIndex(this.Grammar, this.Random, speaker); | |
|
106 | 106 | |
|
107 | 107 | AddComponent(newDialog, new ImageComponent { |
|
108 | 108 | ImageIndex = index}); |
@@ -210,79 +210,95 | |||
|
210 | 210 | if (show) |
|
211 | 211 | { |
|
212 | 212 | ImGui.Begin("Debug", ref show); |
|
213 | ImGui.Text(string.Format("fps: {0:F3}", debugInfo.fps)); | |
|
214 | ImGui.Text(string.Format("Draw Time: {0:F3}", debugInfo.drawTime.TotalMilliseconds.ToString())); | |
|
215 | ImGui.Text(string.Format("Update Time: {0:F3}", debugInfo.updateTime.TotalMilliseconds.ToString())); | |
|
216 | ImGui.Text(string.Format("Tiles Drawn: {0:F}", debugInfo.tilesDrawn)); | |
|
213 | ||
|
214 | if (ImGui.BeginTabBar("DebugTabs")) | |
|
215 | { | |
|
216 | if(ImGui.BeginTabItem("Debug")) | |
|
217 | { | |
|
218 | ||
|
219 | ImGui.Text(string.Format("fps: {0:F3}", debugInfo.fps)); | |
|
220 | ImGui.Text(string.Format("Draw Time: {0:F3}", debugInfo.drawTime.TotalMilliseconds.ToString())); | |
|
221 | ImGui.Text(string.Format("Update Time: {0:F3}", debugInfo.updateTime.TotalMilliseconds.ToString())); | |
|
222 | ImGui.Text(string.Format("Tiles Drawn: {0:F}", debugInfo.tilesDrawn)); | |
|
217 | 223 | |
|
218 | 224 | |
|
219 |
|
|
|
220 |
|
|
|
225 | ImGui.Text(string.Format("\nCamera Position: {0}", debugInfo.cameraPosition.ToString())); | |
|
226 | ImGui.Text(string.Format("\nGrid Position: {0} (has tree: {1})", debugInfo.mouseGrid.ToString(), debugInfo.hasTree)); | |
|
221 | 227 | |
|
222 |
|
|
|
228 | ImGui.Text(string.Format("Application average {0:F3} ms/frame ({1:F1} FPS", 1000f / ImGui.GetIO().Framerate, ImGui.GetIO().Framerate)); | |
|
223 | 229 | |
|
224 | 230 | |
|
225 | 231 | |
|
226 |
|
|
|
227 | { | |
|
228 |
|
|
|
229 | } | |
|
232 | if (ImGui.Button("Test Window")) | |
|
233 | { | |
|
234 | this.show_test_window = !this.show_test_window; | |
|
235 | } | |
|
230 | 236 | |
|
231 | if (ImGui.Button("Test Logging")) | |
|
232 | { | |
|
233 | Logging.Log(LogLevel.Critical, "Test"); | |
|
234 | Logging.Log(LogLevel.Error, "Test"); | |
|
235 | Logging.Log(LogLevel.Warning, "Test"); | |
|
236 | Logging.Log(LogLevel.Info, "Test"); | |
|
237 | Logging.Log(LogLevel.Debug, "Test"); | |
|
238 | Logging.Log(LogLevel.Trace, "Test"); | |
|
237 | if (ImGui.Button("Test Logging")) | |
|
238 | { | |
|
239 | Logging.Log(LogLevel.Critical, "Test"); | |
|
240 | Logging.Log(LogLevel.Error, "Test"); | |
|
241 | Logging.Log(LogLevel.Warning, "Test"); | |
|
242 | Logging.Log(LogLevel.Info, "Test"); | |
|
243 | Logging.Log(LogLevel.Debug, "Test"); | |
|
244 | Logging.Log(LogLevel.Trace, "Test"); | |
|
239 | 245 | |
|
240 | Logging.Critical("Test"); | |
|
241 | Logging.Error("Test"); | |
|
242 | Logging.Warning("Test"); | |
|
243 | Logging.Success("Test"); | |
|
244 | Logging.Info("Test"); | |
|
245 | Logging.Debug("Test"); | |
|
246 | Logging.Trace("Test"); | |
|
246 | Logging.Critical("Test"); | |
|
247 | Logging.Error("Test"); | |
|
248 | Logging.Warning("Test"); | |
|
249 | Logging.Success("Test"); | |
|
250 | Logging.Info("Test"); | |
|
251 | Logging.Debug("Test"); | |
|
252 | Logging.Trace("Test"); | |
|
247 | 253 | |
|
254 | // var t = (testa: 1, testb: 2); | |
|
255 | //Logging.Log(LogLevel.Critical, "Test", t); | |
|
256 | Logging.Log(LogLevel.Critical, "test", new{test=9.0f}); | |
|
257 | //Logging.Log(LogLevel.Critical, "{0}", 0, null, "", 9.0f); | |
|
248 | 258 | |
|
249 | // var t = (testa: 1, testb: 2); | |
|
250 | //Logging.Log(LogLevel.Critical, "Test", t); | |
|
251 | Logging.Log(LogLevel.Critical, "test", new{test=9.0f}); | |
|
252 | //Logging.Log(LogLevel.Critical, "{0}", 0, null, "", 9.0f); | |
|
259 | Logging.Spy(new {debugInfo.cameraPosition, debugInfo.updateTime, test = 9.0f /2}); | |
|
253 | 260 | |
|
254 | Logging.Spy(new {debugInfo.cameraPosition, debugInfo.updateTime, test = 9.0f /2}); | |
|
261 | } | |
|
255 | 262 | |
|
256 | } | |
|
257 | ||
|
258 | if (ImGui.BeginCombo("Log Level", Logging.minimumConsoleLevel.ToString())) | |
|
259 | { | |
|
260 | foreach(LogLevel level in LogLevel.GetValues(typeof(LogLevel))) | |
|
261 | { | |
|
262 | if(ImGui.Selectable(level.ToString())) | |
|
263 | { | |
|
264 | Logging.minimumConsoleLevel = level; | |
|
265 | } | |
|
266 | } | |
|
267 | ImGui.EndCombo(); | |
|
268 | } | |
|
263 | if (ImGui.BeginCombo("Log Level", Logging.minimumConsoleLevel.ToString())) | |
|
264 | { | |
|
265 | foreach(LogLevel level in LogLevel.GetValues(typeof(LogLevel))) | |
|
266 | { | |
|
267 | if(ImGui.Selectable(level.ToString())) | |
|
268 | { | |
|
269 | Logging.minimumConsoleLevel = level; | |
|
270 | } | |
|
271 | } | |
|
272 | ImGui.EndCombo(); | |
|
273 | } | |
|
269 | 274 | |
|
270 |
|
|
|
271 | { | |
|
272 |
|
|
|
273 | } | |
|
274 | ||
|
275 | if (debugInfo.pastFps.Length >= 1) | |
|
276 | { | |
|
277 | ImGui.PlotLines("Frame Rate", ref debugInfo.pastFps[0], debugInfo.pastFps.Length); | |
|
278 | } | |
|
279 | ImGui.EndTabItem(); | |
|
280 | } | |
|
281 | if(ImGui.BeginTabItem("Additional Info")) | |
|
282 | { | |
|
283 | foreach (string k in additionalInfo.Keys) | |
|
284 | { | |
|
285 | ImGui.Text(string.Format("{0}: {1}", k, additionalInfo[k])); | |
|
286 | } | |
|
275 | 287 | |
|
276 | foreach (string k in additionalInfo.Keys) | |
|
277 | { | |
|
278 | ImGui.Text(string.Format("{0}: {1}", k, additionalInfo[k])); | |
|
279 | } | |
|
288 | ImGui.EndTabItem(); | |
|
289 | } | |
|
290 | ||
|
291 | if(ImGui.BeginTabItem("Texture Samples")) | |
|
292 | { | |
|
280 | 293 | |
|
281 |
|
|
|
282 |
|
|
|
283 |
|
|
|
294 | ImGui.Text("Texture sample"); | |
|
295 | 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 | |
|
296 | 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 | |
|
284 | 297 | |
|
285 | ImGui.End(); | |
|
298 | ImGui.EndTabItem(); | |
|
299 | } | |
|
300 | ImGui.EndTabBar(); | |
|
301 | ImGui.End(); | |
|
286 | 302 | } |
|
287 | 303 | |
|
288 | 304 | if (this.show_test_window) |
@@ -290,7 +306,9 | |||
|
290 | 306 | ImGui.SetNextWindowPos(new Num.Vector2(650, 20), ImGuiCond.FirstUseEver); |
|
291 | 307 | ImGui.ShowDemoWindow(ref show_test_window); |
|
292 | 308 | } |
|
309 | } | |
|
293 | 310 | |
|
311 | ||
|
294 | 312 | } |
|
295 | 313 | } |
|
296 | 314 | } |
@@ -157,6 +157,9 | |||
|
157 | 157 | ImGui.Columns(2); |
|
158 | 158 | ImGui.SetColumnWidth(0, 120); |
|
159 | 159 | |
|
160 | var metadata = DialogInterface.map.Metadata[imageIndex]; | |
|
161 | String Tooltip = String.Format("{0}\n\nSource: {1}", metadata.Description, metadata.Source); | |
|
162 | ||
|
160 | 163 | Widgets.MapImageTooltip(DialogInterface.map, new Num.Vector2(111, 148), imageIndex, DialogInterface.map.Metadata[imageIndex].Description); |
|
161 | 164 | |
|
162 | 165 | ImGui.NextColumn(); |
You need to be logged in to leave comments.
Login now