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 | AddComponent(newDialog, |
|
102 | AddComponent(newDialog, |
|
103 | new VisibilityComponent{ visible = true}); |
|
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 | AddComponent(newDialog, new ImageComponent { |
|
107 | AddComponent(newDialog, new ImageComponent { |
|
108 | ImageIndex = index}); |
|
108 | ImageIndex = index}); |
@@ -210,79 +210,95 | |||||
|
210 | if (show) |
|
210 | if (show) |
|
211 | { |
|
211 | { |
|
212 | ImGui.Begin("Debug", ref show); |
|
212 | ImGui.Begin("Debug", ref show); |
|
213 | ImGui.Text(string.Format("fps: {0:F3}", debugInfo.fps)); |
|
213 | |
|
214 | ImGui.Text(string.Format("Draw Time: {0:F3}", debugInfo.drawTime.TotalMilliseconds.ToString())); |
|
214 | if (ImGui.BeginTabBar("DebugTabs")) |
|
215 | ImGui.Text(string.Format("Update Time: {0:F3}", debugInfo.updateTime.TotalMilliseconds.ToString())); |
|
215 | { |
|
216 | ImGui.Text(string.Format("Tiles Drawn: {0:F}", debugInfo.tilesDrawn)); |
|
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 |
|
|
225 | ImGui.Text(string.Format("\nCamera Position: {0}", debugInfo.cameraPosition.ToString())); |
|
220 |
|
|
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 |
|
|
232 | if (ImGui.Button("Test Window")) |
|
227 | { |
|
233 | { |
|
228 |
|
|
234 | this.show_test_window = !this.show_test_window; |
|
229 | } |
|
235 | } |
|
230 |
|
236 | ||
|
231 | if (ImGui.Button("Test Logging")) |
|
237 | if (ImGui.Button("Test Logging")) |
|
232 | { |
|
238 | { |
|
233 | Logging.Log(LogLevel.Critical, "Test"); |
|
239 | Logging.Log(LogLevel.Critical, "Test"); |
|
234 | Logging.Log(LogLevel.Error, "Test"); |
|
240 | Logging.Log(LogLevel.Error, "Test"); |
|
235 | Logging.Log(LogLevel.Warning, "Test"); |
|
241 | Logging.Log(LogLevel.Warning, "Test"); |
|
236 | Logging.Log(LogLevel.Info, "Test"); |
|
242 | Logging.Log(LogLevel.Info, "Test"); |
|
237 | Logging.Log(LogLevel.Debug, "Test"); |
|
243 | Logging.Log(LogLevel.Debug, "Test"); |
|
238 | Logging.Log(LogLevel.Trace, "Test"); |
|
244 | Logging.Log(LogLevel.Trace, "Test"); |
|
239 |
|
245 | ||
|
240 | Logging.Critical("Test"); |
|
246 | Logging.Critical("Test"); |
|
241 | Logging.Error("Test"); |
|
247 | Logging.Error("Test"); |
|
242 | Logging.Warning("Test"); |
|
248 | Logging.Warning("Test"); |
|
243 | Logging.Success("Test"); |
|
249 | Logging.Success("Test"); |
|
244 | Logging.Info("Test"); |
|
250 | Logging.Info("Test"); |
|
245 | Logging.Debug("Test"); |
|
251 | Logging.Debug("Test"); |
|
246 | Logging.Trace("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); |
|
259 | Logging.Spy(new {debugInfo.cameraPosition, debugInfo.updateTime, test = 9.0f /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); |
|
||
|
253 |
|
260 | ||
|
254 | Logging.Spy(new {debugInfo.cameraPosition, debugInfo.updateTime, test = 9.0f /2}); |
|
261 | } |
|
255 |
|
262 | ||
|
256 | } |
|
263 | if (ImGui.BeginCombo("Log Level", Logging.minimumConsoleLevel.ToString())) |
|
257 |
|
264 | { | |
|
258 | if (ImGui.BeginCombo("Log Level", Logging.minimumConsoleLevel.ToString())) |
|
265 | foreach(LogLevel level in LogLevel.GetValues(typeof(LogLevel))) |
|
259 | { |
|
266 | { |
|
260 | foreach(LogLevel level in LogLevel.GetValues(typeof(LogLevel))) |
|
267 | if(ImGui.Selectable(level.ToString())) |
|
261 | { |
|
268 | { |
|
262 | if(ImGui.Selectable(level.ToString())) |
|
269 | Logging.minimumConsoleLevel = level; |
|
263 | { |
|
270 | } |
|
264 | Logging.minimumConsoleLevel = level; |
|
271 | } |
|
265 | } |
|
272 | ImGui.EndCombo(); |
|
266 | } |
|
273 | } |
|
267 | ImGui.EndCombo(); |
|
||
|
268 | } |
|
||
|
269 |
|
274 | ||
|
270 |
|
|
275 | if (debugInfo.pastFps.Length >= 1) |
|
271 | { |
|
276 | { |
|
272 |
|
|
277 | ImGui.PlotLines("Frame Rate", ref debugInfo.pastFps[0], debugInfo.pastFps.Length); |
|
273 | } |
|
278 | } |
|
274 |
|
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) |
|
288 | ImGui.EndTabItem(); |
|
277 | { |
|
289 | } |
|
278 | ImGui.Text(string.Format("{0}: {1}", k, additionalInfo[k])); |
|
290 | |
|
279 | } |
|
291 | if(ImGui.BeginTabItem("Texture Samples")) |
|
|
292 | { | ||
|
280 |
|
293 | ||
|
281 |
|
|
294 | ImGui.Text("Texture sample"); |
|
282 |
|
|
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 |
|
283 |
|
|
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 | if (this.show_test_window) |
|
304 | if (this.show_test_window) |
@@ -290,7 +306,9 | |||||
|
290 | ImGui.SetNextWindowPos(new Num.Vector2(650, 20), ImGuiCond.FirstUseEver); |
|
306 | ImGui.SetNextWindowPos(new Num.Vector2(650, 20), ImGuiCond.FirstUseEver); |
|
291 | ImGui.ShowDemoWindow(ref show_test_window); |
|
307 | ImGui.ShowDemoWindow(ref show_test_window); |
|
292 | } |
|
308 | } |
|
|
309 | } | ||
|
293 |
|
310 | ||
|
|
311 | |||
|
294 | } |
|
312 | } |
|
295 | } |
|
313 | } |
|
296 | } |
|
314 | } |
@@ -157,6 +157,9 | |||||
|
157 | ImGui.Columns(2); |
|
157 | ImGui.Columns(2); |
|
158 | ImGui.SetColumnWidth(0, 120); |
|
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 | Widgets.MapImageTooltip(DialogInterface.map, new Num.Vector2(111, 148), imageIndex, DialogInterface.map.Metadata[imageIndex].Description); |
|
163 | Widgets.MapImageTooltip(DialogInterface.map, new Num.Vector2(111, 148), imageIndex, DialogInterface.map.Metadata[imageIndex].Description); |
|
161 |
|
164 | ||
|
162 | ImGui.NextColumn(); |
|
165 | ImGui.NextColumn(); |
You need to be logged in to leave comments.
Login now