Added ability to apply profile to several characters

This commit is contained in:
RisaDev
2024-10-19 02:55:38 +03:00
parent 3ff5806322
commit 7085cf616c
14 changed files with 324 additions and 164 deletions

View File

@@ -17,6 +17,7 @@ using CustomizePlus.Profiles.Data;
using CustomizePlus.Game.Services;
using CustomizePlus.Profiles.Events;
using CustomizePlus.GameData.Extensions;
using System.Linq;
namespace CustomizePlus.UI.Windows.MainWindow.Tabs.Profiles;
@@ -133,7 +134,8 @@ public class ProfileFileSystemSelector : FileSystemSelector<Profile, ProfileStat
case ProfileChanged.Type.Deleted:
case ProfileChanged.Type.Renamed:
case ProfileChanged.Type.Toggled:
case ProfileChanged.Type.ChangedCharacter:
case ProfileChanged.Type.AddedCharacter:
case ProfileChanged.Type.RemovedCharacter:
case ProfileChanged.Type.ReloadedAll:
SetFilterDirty();
break;
@@ -239,10 +241,13 @@ public class ProfileFileSystemSelector : FileSystemSelector<Profile, ProfileStat
return false;
}
var identifier = _gameObjectService.GetCurrentPlayerActorIdentifier();
if (leaf.Value.Enabled)
state.Color = leaf.Value.Character.MatchesIgnoringOwnership(_gameObjectService.GetCurrentPlayerActorIdentifier()) ? ColorId.LocalCharacterEnabledProfile : ColorId.EnabledProfile;
state.Color = leaf.Value.Characters.Any(x => x.MatchesIgnoringOwnership(identifier)) ? ColorId.LocalCharacterEnabledProfile : ColorId.EnabledProfile;
else
state.Color = leaf.Value.Character.MatchesIgnoringOwnership(_gameObjectService.GetCurrentPlayerActorIdentifier()) ? ColorId.LocalCharacterDisabledProfile : ColorId.DisabledProfile;
state.Color = leaf.Value.Characters.Any(x => x.MatchesIgnoringOwnership(identifier)) ? ColorId.LocalCharacterDisabledProfile : ColorId.DisabledProfile;
//todo: missing actor color
return ApplyStringFilters(leaf, leaf.Value);
}