feat: add /xlversion command

This commit is contained in:
goat 2021-12-06 19:02:10 +01:00
parent 264cf58a8f
commit 64cb19cb93
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5
2 changed files with 26 additions and 4 deletions

View file

@ -8,7 +8,9 @@ using Dalamud.Configuration.Internal;
using Dalamud.Game;
using Dalamud.Game.Command;
using Dalamud.Game.Gui;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Plugin.Internal;
using Dalamud.Utility;
using Serilog;
namespace Dalamud.Interface.Internal
@ -124,6 +126,11 @@ namespace Dalamud.Interface.Internal
"Change various In-Game-Addon settings like chat channels and the discord bot setup."),
});
commandManager.AddHandler("/xlversion", new CommandInfo(this.OnDebugImInfoCommand)
{
HelpMessage = "Dalamud version info",
});
commandManager.AddHandler("/imdebug", new CommandInfo(this.OnDebugImInfoCommand)
{
HelpMessage = "ImGui DEBUG",
@ -306,6 +313,21 @@ namespace Dalamud.Interface.Internal
Log.Information(info);
}
private void OnVersionInfo(string command, string arguments)
{
var chatGui = Service<ChatGui>.Get();
chatGui.Print(new SeStringBuilder()
.AddItalics("Dalamud:")
.AddText($" D{Util.AssemblyVersion}({Util.GetGitHash()}")
.Build());
chatGui.Print(new SeStringBuilder()
.AddItalics("FFXIVCS:")
.AddText($" {Util.GetGitHashClientStructs()}")
.Build());
}
private void OnOpenInstallerCommand(string command, string arguments)
{
Service<DalamudInterface>.Get().TogglePluginInstallerWindow();