From 822995530e7827148c7c511ec51126f3ee1f1701 Mon Sep 17 00:00:00 2001 From: RisaDev <151885272+RisaDev@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:39:22 +0300 Subject: [PATCH] Rename "Default profile", hide character controls when profile is set as default --- CustomizePlus/Profiles/ProfileManager.cs | 4 ++ .../MainWindow/Tabs/Profiles/ProfilePanel.cs | 47 ++++++++++--------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/CustomizePlus/Profiles/ProfileManager.cs b/CustomizePlus/Profiles/ProfileManager.cs index 195a499..8acd8b7 100644 --- a/CustomizePlus/Profiles/ProfileManager.cs +++ b/CustomizePlus/Profiles/ProfileManager.cs @@ -505,6 +505,10 @@ public class ProfileManager : IDisposable bool IsProfileAppliesToCurrentActor(Profile profile) { + //default profile check is done later + if (profile == DefaultProfile) + return false; + return profile.CharacterName.Text == name && (!profile.LimitLookupToOwnedObjects || (actorIdentifier.Type == IdentifierType.Owned && diff --git a/CustomizePlus/UI/Windows/MainWindow/Tabs/Profiles/ProfilePanel.cs b/CustomizePlus/UI/Windows/MainWindow/Tabs/Profiles/ProfilePanel.cs index 50dd0e6..c9b50e7 100644 --- a/CustomizePlus/UI/Windows/MainWindow/Tabs/Profiles/ProfilePanel.cs +++ b/CustomizePlus/UI/Windows/MainWindow/Tabs/Profiles/ProfilePanel.cs @@ -162,8 +162,8 @@ public class ProfilePanel { 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."); + ImGuiUtil.LabeledHelpMarker("Apply to all players and retainers", + "Whether the templates in this profile are applied to all players and retainers without a specific profile. This setting cannot be applied to multiple profiles."); } if(isDefaultOrCurrentProfilesEnabled) { @@ -171,7 +171,7 @@ public class ProfilePanel ImGui.PushStyleColor(ImGuiCol.Text, Constants.Colors.Warning); ImGuiUtil.PrintIcon(FontAwesomeIcon.ExclamationTriangle); ImGui.PopStyleColor(); - ImGuiUtil.HoverTooltip("Can only be changed when currently selected and the default profiles are disabled."); + ImGuiUtil.HoverTooltip("Can only be changed when both currently selected and profile where this checkbox is checked are disabled."); } } } @@ -217,30 +217,35 @@ public class ProfilePanel name = _newCharacterName ?? _selector.Selected!.CharacterName; ImGui.SetNextItemWidth(width.X); - if (!_selector.IncognitoMode) + if(_manager.DefaultProfile != _selector.Selected) { - if (ImGui.InputText("##CharacterName", ref name, 128)) + if (!_selector.IncognitoMode) { - _newCharacterName = name; - _changedProfile = _selector.Selected; - } + if (ImGui.InputText("##CharacterName", ref name, 128)) + { + _newCharacterName = name; + _changedProfile = _selector.Selected; + } - if (ImGui.IsItemDeactivatedAfterEdit() && _changedProfile != null) - { - _manager.ChangeCharacterName(_changedProfile, name); - _newCharacterName = null; - _changedProfile = null; + if (ImGui.IsItemDeactivatedAfterEdit() && _changedProfile != null) + { + _manager.ChangeCharacterName(_changedProfile, name); + _newCharacterName = null; + _changedProfile = null; + } } + else + ImGui.TextUnformatted("Incognito active"); + + ImGui.SameLine(); + var enabled = _selector.Selected?.LimitLookupToOwnedObjects ?? false; + if (ImGui.Checkbox("##LimitLookupToOwnedObjects", ref enabled)) + _manager.SetLimitLookupToOwned(_selector.Selected!, enabled); + ImGuiUtil.LabeledHelpMarker("Limit to my creatures", + "When enabled limits the character search to only your own summons, mounts and minions.\nUseful when there is possibility there will be another character with that name owned by another player.\n* For battle chocobo use \"Chocobo\" as character name."); } else - ImGui.TextUnformatted("Incognito active"); - - ImGui.SameLine(); - var enabled = _selector.Selected?.LimitLookupToOwnedObjects ?? false; - if (ImGui.Checkbox("##LimitLookupToOwnedObjects", ref enabled)) - _manager.SetLimitLookupToOwned(_selector.Selected!, enabled); - ImGuiUtil.LabeledHelpMarker("Limit to my creatures", - "When enabled limits the character search to only your own summons, mounts and minions.\nUseful when there is possibility there will be another character with that name owned by another player.\n* For battle chocobo use \"Chocobo\" as character name."); + ImGui.TextUnformatted("All players and retainers"); } } }