feat: add open config button

This commit is contained in:
Anna 2022-02-19 06:56:38 -05:00
parent e8b26e0880
commit 026b56fbda
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0

View File

@ -31,18 +31,24 @@ internal sealed class Settings : IUiComponent {
};
this.Ui.Plugin.Commands.Register("/chat2", "Perform various actions with Chat 2.").Execute += this.Command;
this.Ui.Plugin.Interface.UiBuilder.OpenConfigUi += this.Toggle;
}
public void Dispose() {
this.Ui.Plugin.Interface.UiBuilder.OpenConfigUi -= this.Toggle;
this.Ui.Plugin.Commands.Register("/chat2").Execute -= this.Command;
}
private void Command(string command, string args) {
if (string.IsNullOrWhiteSpace(args)) {
this.Ui.SettingsVisible ^= true;
this.Toggle();
}
}
private void Toggle() {
this.Ui.SettingsVisible ^= true;
}
private void Initialise() {
this.Mutable.UpdateFrom(this.Ui.Plugin.Config);
}