feat: Add /xlprofiler command (#1662)

Make it easier for end users to open the profiler to pull load time reports.
This commit is contained in:
KazWolfe 2024-02-17 01:25:43 -08:00 committed by GitHub
parent 4b601f15c7
commit 0bb69cbd5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -141,6 +141,13 @@ internal class DalamudCommands : IServiceType
"Toggle Dalamud UI display modes. Native UI modifications may also be affected by this, but that depends on the plugin."), "Toggle Dalamud UI display modes. Native UI modifications may also be affected by this, but that depends on the plugin."),
}); });
commandManager.AddHandler("/xlprofiler", new CommandInfo(this.OnOpenProfilerCommand)
{
HelpMessage = Loc.Localize(
"DalamudProfilerHelp",
"Open Dalamud's startup timing profiler."),
});
commandManager.AddHandler("/imdebug", new CommandInfo(this.OnDebugImInfoCommand) commandManager.AddHandler("/imdebug", new CommandInfo(this.OnDebugImInfoCommand)
{ {
HelpMessage = "ImGui DEBUG", HelpMessage = "ImGui DEBUG",
@ -409,4 +416,9 @@ internal class DalamudCommands : IServiceType
} }
} }
} }
private void OnOpenProfilerCommand(string command, string arguments)
{
Service<DalamudInterface>.Get().ToggleProfilerWindow();
}
} }