From 4d3b9617047d1d2f2488cb5a3892817b86a14466 Mon Sep 17 00:00:00 2001 From: Anna Date: Sat, 19 Feb 2022 06:56:38 -0500 Subject: [PATCH] feat: add open config button --- ChatTwo/Ui/Settings.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ChatTwo/Ui/Settings.cs b/ChatTwo/Ui/Settings.cs index f821ca9..5748ceb 100755 --- a/ChatTwo/Ui/Settings.cs +++ b/ChatTwo/Ui/Settings.cs @@ -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); }