SoundFilter/SoundFilter/Commands.cs

27 lines
748 B
C#
Raw Normal View History

2021-05-08 17:34:13 +00:00
using System;
using Dalamud.Game.Command;
namespace SoundFilter {
internal class Commands : IDisposable {
private const string Name = "/soundfilter";
private SoundFilterPlugin Plugin { get; }
public Commands(SoundFilterPlugin plugin) {
this.Plugin = plugin;
this.Plugin.Interface.CommandManager.AddHandler(Name, new CommandInfo(this.OnCommand) {
HelpMessage = $"Toggle the {SoundFilterPlugin.Name} config",
});
}
public void Dispose() {
this.Plugin.Interface.CommandManager.RemoveHandler(Name);
}
private void OnCommand(string command, string args) {
this.Plugin.Ui.Settings.Toggle();
}
}
}