From bfbfb659251cd7f5b50575bdd2c8fa9be81ff902 Mon Sep 17 00:00:00 2001 From: RisaDev <151885272+RisaDev@users.noreply.github.com> Date: Thu, 11 Apr 2024 00:35:08 +0300 Subject: [PATCH] Do not allow setting current profile as default when it is enabled --- .../UI/Windows/MainWindow/Tabs/Profiles/ProfilePanel.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CustomizePlus/UI/Windows/MainWindow/Tabs/Profiles/ProfilePanel.cs b/CustomizePlus/UI/Windows/MainWindow/Tabs/Profiles/ProfilePanel.cs index c31ede3..71a5dfd 100644 --- a/CustomizePlus/UI/Windows/MainWindow/Tabs/Profiles/ProfilePanel.cs +++ b/CustomizePlus/UI/Windows/MainWindow/Tabs/Profiles/ProfilePanel.cs @@ -157,21 +157,21 @@ public class ProfilePanel ImGui.SameLine(); var isDefault = _manager.DefaultProfile == _selector.Selected; - var isDefaultEnabled = _manager.DefaultProfile?.Enabled ?? false; - using (ImRaii.Disabled(isDefaultEnabled)) + var isDefaultOrCurrentProfilesEnabled = _manager.DefaultProfile?.Enabled ?? false || enabled; + using (ImRaii.Disabled(isDefaultOrCurrentProfilesEnabled)) { if (ImGui.Checkbox("##DefaultProfile", ref isDefault)) _manager.SetDefaultProfile(isDefault ? _selector.Selected! : null); ImGuiUtil.LabeledHelpMarker("Default profile (Players and Retainers only)", "Whether the templates in this profile are applied to all players and retainers without a specific profile. Only one profile can be default at the same time."); } - if(isDefaultEnabled) + if(isDefaultOrCurrentProfilesEnabled) { ImGui.SameLine(); ImGui.PushStyleColor(ImGuiCol.Text, Constants.Colors.Warning); ImGuiUtil.PrintIcon(FontAwesomeIcon.ExclamationTriangle); ImGui.PopStyleColor(); - ImGuiUtil.HoverTooltip("Can only be changed while the default profile is disabled."); + ImGuiUtil.HoverTooltip("Can only be changed while currently selected and the default profiles are disabled."); } } }