From 4c88e0e249cee421fbec04552adea15d4db9f65e Mon Sep 17 00:00:00 2001 From: Stanley Dimant Date: Thu, 20 Apr 2023 11:06:53 +0200 Subject: [PATCH] add show notes instead of names --- .../MareConfiguration/Configurations/MareConfig.cs | 1 + MareSynchronos/MareSynchronos.csproj | 2 +- MareSynchronos/UI/CompactUI.cs | 2 +- MareSynchronos/UI/Handlers/UidDisplayHandler.cs | 8 ++++++++ MareSynchronos/UI/SettingsUi.cs | 14 +++++++++++++- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/MareSynchronos/MareConfiguration/Configurations/MareConfig.cs b/MareSynchronos/MareConfiguration/Configurations/MareConfig.cs index 4dabf69..5ba7473 100644 --- a/MareSynchronos/MareConfiguration/Configurations/MareConfig.cs +++ b/MareSynchronos/MareConfiguration/Configurations/MareConfig.cs @@ -27,6 +27,7 @@ public class MareConfig : IMareConfiguration public bool ProfilesShow { get; set; } = true; public bool ReverseUserSort { get; set; } = false; public bool ShowCharacterNameInsteadOfNotesForVisible { get; set; } = false; + public bool PreferNotesOverNamesForVisible { get; set; } = false; public bool ShowOfflineUsersSeparately { get; set; } = true; public bool ShowOnlineNotifications { get; set; } = false; public bool ShowOnlineNotificationsOnlyForIndividualPairs { get; set; } = true; diff --git a/MareSynchronos/MareSynchronos.csproj b/MareSynchronos/MareSynchronos.csproj index a243fed..2b0abd5 100644 --- a/MareSynchronos/MareSynchronos.csproj +++ b/MareSynchronos/MareSynchronos.csproj @@ -3,7 +3,7 @@ - 0.8.25 + 0.8.26 https://github.com/Penumbra-Sync/client diff --git a/MareSynchronos/UI/CompactUI.cs b/MareSynchronos/UI/CompactUI.cs index 201490c..9d5e990 100644 --- a/MareSynchronos/UI/CompactUI.cs +++ b/MareSynchronos/UI/CompactUI.cs @@ -375,7 +375,7 @@ public class CompactUi : WindowMediatorSubscriberBase var users = GetFilteredUsers() .OrderBy( u => _configService.Current.ShowCharacterNameInsteadOfNotesForVisible && !string.IsNullOrEmpty(u.PlayerName) - ? u.PlayerName + ? (_configService.Current.PreferNotesOverNamesForVisible ? u.GetNote() : u.PlayerName) : (u.GetNote() ?? u.UserData.AliasOrUID), StringComparer.OrdinalIgnoreCase).ToList(); if (_configService.Current.ReverseUserSort) diff --git a/MareSynchronos/UI/Handlers/UidDisplayHandler.cs b/MareSynchronos/UI/Handlers/UidDisplayHandler.cs index 8ad1d7c..75f1295 100644 --- a/MareSynchronos/UI/Handlers/UidDisplayHandler.cs +++ b/MareSynchronos/UI/Handlers/UidDisplayHandler.cs @@ -142,6 +142,14 @@ public class UidDisplayHandler { playerText = pair.PlayerName; textIsUid = false; + if (_mareConfigService.Current.PreferNotesOverNamesForVisible) + { + var note = pair.GetNote(); + if (note != null) + { + playerText = note; + } + } } return (textIsUid, playerText!); diff --git a/MareSynchronos/UI/SettingsUi.cs b/MareSynchronos/UI/SettingsUi.cs index b826f29..6dc8f13 100644 --- a/MareSynchronos/UI/SettingsUi.cs +++ b/MareSynchronos/UI/SettingsUi.cs @@ -516,6 +516,7 @@ public class SettingsUi : WindowMediatorSubscriberBase var profileDelay = _configService.Current.ProfileDelay; var profileOnRight = _configService.Current.ProfilePopoutRight; var enableRightClickMenu = _configService.Current.EnableRightClickMenus; + var preferNotesInsteadOfName = _configService.Current.PreferNotesOverNamesForVisible; if (ImGui.Checkbox("Enable Game Right Click Menu Entries", ref enableRightClickMenu)) { @@ -538,13 +539,24 @@ public class SettingsUi : WindowMediatorSubscriberBase } UiSharedService.DrawHelpText("This will show all currently offline users in a special 'Offline' group in the main UI."); - if (ImGui.Checkbox("Show player name instead of note for visible players", ref showNameInsteadOfNotes)) + if (ImGui.Checkbox("Show player name for visible players", ref showNameInsteadOfNotes)) { _configService.Current.ShowCharacterNameInsteadOfNotesForVisible = showNameInsteadOfNotes; _configService.Save(); } UiSharedService.DrawHelpText("This will show the character name instead of custom set note when a character is visible"); + ImGui.Indent(); + if (!_configService.Current.ShowCharacterNameInsteadOfNotesForVisible) ImGui.BeginDisabled(); + if (ImGui.Checkbox("Prefer notes over player names for visible players", ref preferNotesInsteadOfName)) + { + _configService.Current.PreferNotesOverNamesForVisible = preferNotesInsteadOfName; + _configService.Save(); + } + UiSharedService.DrawHelpText("If you set a note for a player it will be shown instead of the player name"); + if (!_configService.Current.ShowCharacterNameInsteadOfNotesForVisible) ImGui.EndDisabled(); + ImGui.Unindent(); + if (ImGui.Checkbox("Show Mare Profiles on Hover", ref showProfiles)) { Mediator.Publish(new ClearProfileDataMessage());