add show notes instead of names

This commit is contained in:
Stanley Dimant
2023-04-20 11:06:53 +02:00
parent 5b52896243
commit 4c88e0e249
5 changed files with 24 additions and 3 deletions

View File

@@ -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)

View File

@@ -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!);

View File

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