who's ready for minipenumbra

This commit is contained in:
Anna 2022-09-05 05:33:36 -04:00
parent 4615cb2b0f
commit 4d6565841e
2 changed files with 38 additions and 4 deletions

View File

@ -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;

View File

@ -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;
}