From 7bc3147d64519ba98f70319822dc488cf26987d6 Mon Sep 17 00:00:00 2001 From: Anna Date: Tue, 19 Jul 2022 19:44:44 -0400 Subject: [PATCH] feat: put settings in trees --- client/ExtraChat/Ui/PluginUi.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/client/ExtraChat/Ui/PluginUi.cs b/client/ExtraChat/Ui/PluginUi.cs index c6650e1..6283c12 100644 --- a/client/ExtraChat/Ui/PluginUi.cs +++ b/client/ExtraChat/Ui/PluginUi.cs @@ -187,12 +187,19 @@ internal class PluginUi : IDisposable { // ImGui.EndCombo(); // } - if (ImGui.Checkbox("Allow receiving invites", ref this.Plugin.ConfigInfo.AllowInvites)) { - anyChanged = true; - Task.Run(async () => await this.Plugin.Client.AllowInvitesToast(this.Plugin.ConfigInfo.AllowInvites)); + if (this.Plugin.LocalPlayer is { } player) { + ImGui.SetNextItemOpen(true); + if (ImGui.TreeNodeEx($"Settings for {player.Name}@{player.HomeWorld.GameData?.Name}")) { + if (ImGui.Checkbox("Allow receiving invites", ref this.Plugin.ConfigInfo.AllowInvites)) { + anyChanged = true; + Task.Run(async () => await this.Plugin.Client.AllowInvitesToast(this.Plugin.ConfigInfo.AllowInvites)); + } + + ImGui.TreePop(); + } } - if (this.Plugin.Client.Status == Client.State.Connected && ImGui.CollapsingHeader("Delete account")) { + if (this.Plugin.Client.Status == Client.State.Connected && ImGui.TreeNodeEx("Delete account")) { ImGui.PushTextWrapPos(); if (this.Plugin.Client.Channels.Count > 0) { @@ -206,6 +213,8 @@ internal class PluginUi : IDisposable { } ImGui.PopTextWrapPos(); + + ImGui.TreePop(); } }