feat: put settings in trees

This commit is contained in:
Anna 2022-07-19 19:44:44 -04:00
parent 2a60707bad
commit 7bc3147d64
1 changed files with 13 additions and 4 deletions

View File

@ -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();
}
}