From b2bd1a5fb7d5d9d9dd6dd7efcfbb7776a9e37a83 Mon Sep 17 00:00:00 2001 From: CakeAndBanana Date: Mon, 15 Sep 2025 16:11:12 +0200 Subject: [PATCH] Added filter option to hide syncshells in main ui/all syncshells --- .../Configurations/LightlessConfig.cs | 1 + LightlessSync/UI/CompactUI.cs | 7 ++++++- LightlessSync/UI/SettingsUi.cs | 9 +++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/LightlessSync/LightlessConfiguration/Configurations/LightlessConfig.cs b/LightlessSync/LightlessConfiguration/Configurations/LightlessConfig.cs index cfe5277..002bf1a 100644 --- a/LightlessSync/LightlessConfiguration/Configurations/LightlessConfig.cs +++ b/LightlessSync/LightlessConfiguration/Configurations/LightlessConfig.cs @@ -43,6 +43,7 @@ public class LightlessConfig : ILightlessConfiguration public bool ShowCharacterNameInsteadOfNotesForVisible { get; set; } = false; public bool ShowOfflineUsersSeparately { get; set; } = true; public bool ShowSyncshellOfflineUsersSeparately { get; set; } = true; + public bool ShowGroupedSyncshellsInAll { get; set; } = true; public bool GroupUpSyncshells { get; set; } = true; public bool ShowOnlineNotifications { get; set; } = false; public bool ShowOnlineNotificationsOnlyForIndividualPairs { get; set; } = true; diff --git a/LightlessSync/UI/CompactUI.cs b/LightlessSync/UI/CompactUI.cs index 440f9ce..6aa159d 100644 --- a/LightlessSync/UI/CompactUI.cs +++ b/LightlessSync/UI/CompactUI.cs @@ -548,6 +548,8 @@ public class CompactUi : WindowMediatorSubscriberBase => u.Value.Exists(g => string.Equals(g.GID, group.GID, StringComparison.Ordinal)); bool FilterNotTaggedUsers(KeyValuePair> u) => u.Key.IsDirectlyPaired && !u.Key.IsOneSidedPair && !_tagHandler.HasAnyPairTag(u.Key.UserData.UID); + bool FilterNotTaggedSyncshells(GroupFullInfoDto group) + => (!_tagHandler.HasAnySyncshellTag(group.GID) && !_configService.Current.ShowGroupedSyncshellsInAll) || _configService.Current.ShowGroupedSyncshellsInAll; bool FilterOfflineUsers(KeyValuePair> u) => ((u.Key.IsDirectlyPaired && _configService.Current.ShowSyncshellOfflineUsersSeparately) || !_configService.Current.ShowSyncshellOfflineUsersSeparately) @@ -571,7 +573,10 @@ public class CompactUi : WindowMediatorSubscriberBase foreach (var group in _pairManager.GroupPairs.Select(g => g.Key).OrderBy(g => g.GroupAliasOrGID, StringComparer.OrdinalIgnoreCase)) { GetGroups(allPairs, filteredPairs, group, out ImmutableList allGroupPairs, out Dictionary> filteredGroupPairs); - groupFolders.Add(_drawEntityFactory.CreateDrawGroupFolder(group, filteredGroupPairs, allGroupPairs)); + if (FilterNotTaggedSyncshells(group)) + { + groupFolders.Add(_drawEntityFactory.CreateDrawGroupFolder(group, filteredGroupPairs, allGroupPairs)); + } } if (_configService.Current.GroupUpSyncshells) diff --git a/LightlessSync/UI/SettingsUi.cs b/LightlessSync/UI/SettingsUi.cs index 3904155..e16957b 100644 --- a/LightlessSync/UI/SettingsUi.cs +++ b/LightlessSync/UI/SettingsUi.cs @@ -927,6 +927,7 @@ public class SettingsUi : WindowMediatorSubscriberBase var preferNotesInsteadOfName = _configService.Current.PreferNotesOverNamesForVisible; var useFocusTarget = _configService.Current.UseFocusTarget; var groupUpSyncshells = _configService.Current.GroupUpSyncshells; + var groupedSyncshells = _configService.Current.ShowGroupedSyncshellsInAll; var groupInVisible = _configService.Current.ShowSyncshellUsersInVisible; var syncshellOfflineSeparate = _configService.Current.ShowSyncshellOfflineUsersSeparately; @@ -1144,6 +1145,14 @@ public class SettingsUi : WindowMediatorSubscriberBase } _uiShared.DrawHelpText("This will group up all Syncshells in a special 'All Syncshells' folder in the main UI."); + if (ImGui.Checkbox("Show grouped syncshells in main screen/all syncshells", ref groupedSyncshells)) + { + _configService.Current.ShowGroupedSyncshellsInAll = groupedSyncshells; + _configService.Save(); + Mediator.Publish(new RefreshUiMessage()); + } + _uiShared.DrawHelpText("This will show grouped syncshells in main screen or group 'All Syncshells'."); + if (ImGui.Checkbox("Show player name for visible players", ref showNameInsteadOfNotes)) { _configService.Current.ShowCharacterNameInsteadOfNotesForVisible = showNameInsteadOfNotes;