From 0bb69cbd5f8f4633faef1181d067286ac5fc5116 Mon Sep 17 00:00:00 2001 From: KazWolfe Date: Sat, 17 Feb 2024 01:25:43 -0800 Subject: [PATCH] feat: Add /xlprofiler command (#1662) Make it easier for end users to open the profiler to pull load time reports. --- Dalamud/Interface/Internal/DalamudCommands.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Dalamud/Interface/Internal/DalamudCommands.cs b/Dalamud/Interface/Internal/DalamudCommands.cs index 4654a019d..ace8887f1 100644 --- a/Dalamud/Interface/Internal/DalamudCommands.cs +++ b/Dalamud/Interface/Internal/DalamudCommands.cs @@ -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."), }); + commandManager.AddHandler("/xlprofiler", new CommandInfo(this.OnOpenProfilerCommand) + { + HelpMessage = Loc.Localize( + "DalamudProfilerHelp", + "Open Dalamud's startup timing profiler."), + }); + commandManager.AddHandler("/imdebug", new CommandInfo(this.OnDebugImInfoCommand) { HelpMessage = "ImGui DEBUG", @@ -409,4 +416,9 @@ internal class DalamudCommands : IServiceType } } } + + private void OnOpenProfilerCommand(string command, string arguments) + { + Service.Get().ToggleProfilerWindow(); + } }