Skin Fixer: Switch to a passive approach.

Do not load skin.shpk for ourselves as it causes a race condition.
Instead, inspect the materials' ShPk names.
This commit is contained in:
Exter-N 2023-09-05 12:53:53 +02:00
parent 94a0a3902c
commit 32608ea45b
7 changed files with 126 additions and 95 deletions

View file

@ -16,9 +16,6 @@ public sealed class CreatedCharacterBase : EventWrapper<Action<nint, ModCollecti
{
/// <seealso cref="PenumbraApi.CreatedCharacterBase"/>
Api = int.MinValue,
/// <seealso cref="Interop.Services.SkinFixer.OnCharacterBaseCreated"/>
SkinFixer = 0,
}
public CreatedCharacterBase()

View file

@ -0,0 +1,24 @@
using System;
using OtterGui.Classes;
namespace Penumbra.Communication;
/// <summary> <list type="number">
/// <item>Parameter is the material resource handle for which the shader package has been loaded. </item>
/// <item>Parameter is the associated game object. </item>
/// </list> </summary>
public sealed class MtrlShpkLoaded : EventWrapper<Action<nint, nint>, MtrlShpkLoaded.Priority>
{
public enum Priority
{
/// <seealso cref="Interop.Services.SkinFixer.OnMtrlShpkLoaded"/>
SkinFixer = 0,
}
public MtrlShpkLoaded()
: base(nameof(MtrlShpkLoaded))
{ }
public void Invoke(nint mtrlResourceHandle, nint gameObject)
=> Invoke(this, mtrlResourceHandle, gameObject);
}