forked from codecat/tm-editor-trails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebugWindow.as
39 lines (33 loc) · 1.3 KB
/
DebugWindow.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
namespace DebugWindow
{
void Render()
{
if (UI::Begin("Editor Trails Debug", Setting_ShowDebugWindow)) {
Setting_CaptureSamples = UI::Checkbox("Capture samples", Setting_CaptureSamples);
Setting_ClearOnStart = UI::Checkbox("Clear trails on editor play start", Setting_ClearOnStart);
if (UI::Button("Clear trails")) {
Trails::Clear();
}
UI::Separator();
UI::Text("State::InEditor: \\$f39" + tostring(State::InEditor));
UI::Text("State::InEditorPlay: \\$f39" + tostring(State::InEditorPlay));
UI::Text("State::MenuButtonDown: \\$f39" + tostring(State::MenuButtonDown));
UI::Text("State::CurrentRaceTime: \\$f39" + tostring(State::CurrentRaceTime));
UI::Separator();
UI::Text("Trail count: \\$f39" + Trails::Items.Length);
for (int i = int(Trails::Items.Length) - 1; i >= 0; i--) {
auto trail = Trails::Items[i];
UI::Separator();
UI::Text("Replay " + i + ":");
UI::Text("-- Samples: \\$f39" + trail.m_samples.Length);
UI::Text("-- Duration: \\$f39" + Text::Format("%.02f", trail.GetDuration()) + " seconds");
UI::Text("-- Events: \\$f39" + trail.m_events.Length);
for (uint j = 0; j < trail.m_events.Length; j++) {
auto event = trail.m_events[j];
UI::Text("-- Event[" + j + "] = \\$f39\"" + event.Text() + "\"");
}
}
}
UI::End();
}
}