NoSoliciting/NoSoliciting/Commands.cs

39 lines
1.2 KiB
C#
Raw Normal View History

using System;
using Dalamud.Game.Command;
namespace NoSoliciting {
public class Commands : IDisposable {
private Plugin Plugin { get; }
internal Commands(Plugin plugin) {
this.Plugin = plugin;
2021-08-22 22:07:28 +00:00
this.Plugin.CommandManager.AddHandler("/prmt", new CommandInfo(this.OnCommand) {
HelpMessage = "Opens the NoSoliciting configuration (deprecated)",
ShowInHelp = false,
});
2021-08-22 22:07:28 +00:00
this.Plugin.CommandManager.AddHandler("/nosol", new CommandInfo(this.OnCommand) {
HelpMessage = "Opens the NoSoliciting configuration",
});
}
public void Dispose() {
2021-08-22 22:07:28 +00:00
this.Plugin.CommandManager.RemoveHandler("/nosol");
this.Plugin.CommandManager.RemoveHandler("/prmt");
}
private void OnCommand(string command, string args) {
if (command == "/prmt") {
2023-09-29 00:59:42 +00:00
this.Plugin.ChatGui.PrintError($"[{Plugin.Name}] The /prmt command is deprecated and will be removed. Please use /nosol instead.");
}
if (args == "report") {
2021-03-04 04:34:52 +00:00
this.Plugin.Ui.Report.Toggle();
return;
}
2021-03-04 04:34:52 +00:00
this.Plugin.Ui.Settings.Toggle();
}
}
}