Create PluginStatsWindow and track times for plugin BuildUI event

This commit is contained in:
Caraxi 2020-06-03 09:00:58 +09:30
parent cf212e33d6
commit 77d4502b60
3 changed files with 123 additions and 0 deletions

View file

@ -211,6 +211,7 @@ namespace Dalamud {
private bool isImguiDrawPluginWindow = false;
private bool isImguiDrawCreditsWindow = false;
private bool isImguiDrawSettingsWindow = false;
private bool isImguiDrawPluginStatWindow = false;
private DalamudLogWindow logWindow;
private DalamudDataWindow dataWindow;
@ -218,6 +219,7 @@ namespace Dalamud {
private DalamudSettingsWindow settingsWindow;
private PluginInstallerWindow pluginWindow;
private ConditionDebugWindow conditionDebugWindow;
private DalamudPluginStatWindow pluginStatWindow;
private void BuildDalamudUi()
{
@ -294,6 +296,12 @@ namespace Dalamud {
this.pluginWindow = new PluginInstallerWindow(this.PluginManager, this.PluginRepository, this.StartInfo.GameVersion);
this.isImguiDrawPluginWindow = true;
}
if (ImGui.MenuItem("Open Plugin Stats")) {
if (!this.isImguiDrawPluginStatWindow) {
this.pluginStatWindow = new DalamudPluginStatWindow(this.PluginManager);
this.isImguiDrawPluginStatWindow = true;
}
}
if (ImGui.MenuItem("Print plugin info")) {
foreach (var plugin in this.PluginManager.Plugins) {
// TODO: some more here, state maybe?
@ -396,6 +404,14 @@ namespace Dalamud {
{
this.conditionDebugWindow.Draw();
}
if (this.isImguiDrawPluginStatWindow) {
this.isImguiDrawPluginStatWindow = this.pluginStatWindow != null && this.pluginStatWindow.Draw();
if (!this.isImguiDrawPluginStatWindow) {
this.pluginStatWindow?.Dispose();
this.pluginStatWindow = null;
}
}
}
#endregion