Send IPC OnProfileUpdate when currently used template was changed in editor, fix Profile.GetActiveProfileIdOnCharacter IPC ignoring DefaultLocalPlayerProfile

This commit is contained in:
RisaDev
2024-11-23 19:41:42 +03:00
parent 4ee62205ff
commit e4e10e0f9a
6 changed files with 82 additions and 14 deletions

View File

@@ -428,7 +428,15 @@ public unsafe sealed class ArmatureManager : IDisposable
if (type == TemplateChanged.Type.EditorEnabled ||
type == TemplateChanged.Type.EditorDisabled)
{
foreach (var armature in GetArmaturesForCharacter((ActorIdentifier)arg3!))
ActorIdentifier actor;
bool hasChanges;
if(type == TemplateChanged.Type.EditorEnabled)
actor = (ActorIdentifier)arg3;
else
(actor, hasChanges) = ((ActorIdentifier, bool))arg3;
foreach (var armature in GetArmaturesForCharacter(actor))
{
armature.IsPendingProfileRebind = true;
_logger.Debug($"ArmatureManager.OnTemplateChange template editor enabled/disabled: {type}, pending profile set for {armature}");