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; this.Plugin.Interface.CommandManager.AddHandler(CommandName, new CommandInfo(this.OnCommand) { HelpMessage = $"Opens the settings for {this.Plugin.Name}", }); } public void Dispose() { this.Plugin.Interface.CommandManager.RemoveHandler(CommandName); } private void OnCommand(string command, string args) { this.Plugin.Ui.ToggleConfig(); } } }