From 4d6565841eacc497edc3e368b68f00dfce157d8c Mon Sep 17 00:00:00 2001 From: Anna Date: Mon, 5 Sep 2022 05:33:36 -0400 Subject: [PATCH] who's ready for minipenumbra --- client/Commands.cs | 39 ++++++++++++++++++++++++++++++++++++--- client/Ui/Viewer.cs | 3 ++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/client/Commands.cs b/client/Commands.cs index 088a0b7..c350e6e 100644 --- a/client/Commands.cs +++ b/client/Commands.cs @@ -1,3 +1,4 @@ +using System.Text; using Dalamud.Game.Command; using Dalamud.Utility; using Lumina.Excel.GeneratedSheets; @@ -5,18 +6,19 @@ using Lumina.Excel.GeneratedSheets; namespace OrangeGuidanceTomestone; internal class Commands : IDisposable { + private const string CommandName = "/ogt"; private Plugin Plugin { get; } internal Commands(Plugin plugin) { this.Plugin = plugin; - this.Plugin.CommandManager.AddHandler("/ogt", new CommandInfo(this.OnCommand) { - HelpMessage = "Toggle UI", + this.Plugin.CommandManager.AddHandler(CommandName, new CommandInfo(this.OnCommand) { + HelpMessage = $"Toggle UI - try {CommandName} help", }); } public void Dispose() { - this.Plugin.CommandManager.RemoveHandler("/ogt"); + this.Plugin.CommandManager.RemoveHandler(CommandName); } private void OnCommand(string command, string arguments) { @@ -65,6 +67,37 @@ internal class Commands : IDisposable { case "refresh": this.Plugin.Messages.SpawnVfx(); break; + case "viewer": + this.Plugin.Ui.Viewer.Visible ^= true; + break; + case "help": { + var sb = new StringBuilder("\n"); + sb.Append(CommandName); + sb.Append(" - open the main interface"); + + sb.Append('\n'); + sb.Append(CommandName); + sb.Append(" ban - bans the current zone, hiding messages"); + + sb.Append('\n'); + sb.Append(CommandName); + sb.Append(" unban - unbans the current zone, allowing messages to appear"); + + sb.Append('\n'); + sb.Append(CommandName); + sb.Append(" refresh - refreshes the messages in the current zone"); + + sb.Append('\n'); + sb.Append(CommandName); + sb.Append(" viewer - toggle the message viewer window"); + + sb.Append('\n'); + sb.Append(CommandName); + sb.Append(" help - show this help"); + + this.Plugin.ChatGui.Print(sb.ToString()); + break; + } default: this.Plugin.Ui.MainWindow.Visible ^= true; break; diff --git a/client/Ui/Viewer.cs b/client/Ui/Viewer.cs index 11e225d..5987b86 100644 --- a/client/Ui/Viewer.cs +++ b/client/Ui/Viewer.cs @@ -37,9 +37,10 @@ internal class Viewer { if (nearby.Count == 0) { if (this.Plugin.Config.AutoViewer) { this.Visible = false; + } else { + ImGui.TextUnformatted("No nearby messages"); } - ImGui.TextUnformatted("No nearby messages"); goto End; }