Glamourer-related changes.

This commit is contained in:
Ottermandias 2023-07-12 02:45:40 +02:00
parent a7ace8a8c8
commit 9e0c38169f
15 changed files with 184 additions and 90 deletions

View file

@ -96,7 +96,7 @@ public sealed partial class IndividualCollections
identifiers = new[]
{
manager.CreateRetainer(retainerName, 0),
manager.CreateRetainer(retainerName, ActorIdentifier.RetainerType.Both),
};
break;
case IdentifierType.Owned:
@ -131,7 +131,7 @@ public sealed partial class IndividualCollections
ObjectKind.EventNpc => manager.Data.ENpcs,
ObjectKind.Companion => manager.Data.Companions,
ObjectKind.MountType => manager.Data.Mounts,
(ObjectKind)15 => manager.Data.Ornaments,
ObjectKind.Ornament => manager.Data.Ornaments,
_ => throw new NotImplementedException(),
};
return table.Where(kvp => kvp.Value == name)

View file

@ -122,14 +122,14 @@ public unsafe class MetaState : IDisposable
_gameEventManager.CharacterBaseCreated -= OnCharacterBaseCreated;
}
private void OnCreatingCharacterBase(uint modelCharaId, nint customize, nint equipData)
private void OnCreatingCharacterBase(nint modelCharaId, nint customize, nint equipData)
{
_lastCreatedCollection = _collectionResolver.IdentifyLastGameObjectCollection(true);
if (_lastCreatedCollection.Valid && _lastCreatedCollection.AssociatedGameObject != nint.Zero)
_communicator.CreatingCharacterBase.Invoke(_lastCreatedCollection.AssociatedGameObject,
_lastCreatedCollection.ModCollection.Name, (nint)(&modelCharaId), customize, equipData);
_lastCreatedCollection.ModCollection.Name, modelCharaId, customize, equipData);
var decal = new DecalReverter(_config, _characterUtility, _resources, _lastCreatedCollection, UsesDecal(modelCharaId, customize));
var decal = new DecalReverter(_config, _characterUtility, _resources, _lastCreatedCollection, UsesDecal(*(uint*)modelCharaId, customize));
var cmp = _lastCreatedCollection.ModCollection.TemporarilySetCmpFile(_characterUtility);
_characterBaseCreateMetaChanges.Dispose(); // Should always be empty.
_characterBaseCreateMetaChanges = new DisposableContainer(decal, cmp);

View file

@ -2,7 +2,6 @@ using Dalamud.Hooking;
using Dalamud.Utility.Signatures;
using Penumbra.GameData;
using System;
using System.Diagnostics;
using FFXIVClientStructs.FFXIV.Client.Game.Character;
using FFXIVClientStructs.FFXIV.Client.Game.Object;
using Penumbra.Interop.Structs;
@ -154,7 +153,7 @@ public unsafe class GameEventManager : IDisposable
{
try
{
((CreatingCharacterBaseEvent)subscriber).Invoke(a, b, c);
((CreatingCharacterBaseEvent)subscriber).Invoke((nint) (&a), b, c);
}
catch (Exception ex)
{
@ -181,7 +180,7 @@ public unsafe class GameEventManager : IDisposable
return ret;
}
public delegate void CreatingCharacterBaseEvent(uint modelCharaId, nint customize, nint equipment);
public delegate void CreatingCharacterBaseEvent(nint modelCharaId, nint customize, nint equipment);
public delegate void CharacterBaseCreatedEvent(uint modelCharaId, nint customize, nint equipment, nint drawObject);
#endregion