2021-05-26 23:12:06 +00:00
|
|
|
|
using System;
|
|
|
|
|
using Dalamud.Game.Command;
|
|
|
|
|
|
|
|
|
|
namespace TextBoxStyler {
|
|
|
|
|
public class Commands : IDisposable {
|
|
|
|
|
private const string CommandName = "/textstyle";
|
|
|
|
|
|
|
|
|
|
private Plugin Plugin { get; }
|
|
|
|
|
|
|
|
|
|
internal Commands(Plugin plugin) {
|
|
|
|
|
this.Plugin = plugin;
|
|
|
|
|
|
2021-08-29 17:49:52 +00:00
|
|
|
|
this.Plugin.CommandManager.AddHandler(CommandName, new CommandInfo(this.OnCommand) {
|
2023-09-28 06:20:52 +00:00
|
|
|
|
HelpMessage = $"Opens the settings for {Plugin.Name}",
|
2021-05-26 23:12:06 +00:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Dispose() {
|
2021-08-29 17:49:52 +00:00
|
|
|
|
this.Plugin.CommandManager.RemoveHandler(CommandName);
|
2021-05-26 23:12:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnCommand(string command, string args) {
|
|
|
|
|
this.Plugin.Ui.ToggleConfig();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|