mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Pass actor in GearsetDataLoaded instead of looking it up.
This commit is contained in:
parent
c0ad4aab51
commit
aad978f5f6
3 changed files with 4 additions and 5 deletions
|
|
@ -11,7 +11,7 @@ namespace Glamourer.Events;
|
||||||
/// </list>
|
/// </list>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class GearsetDataLoaded()
|
public sealed class GearsetDataLoaded()
|
||||||
: EventWrapper<Model, GearsetDataLoaded.Priority>(nameof(GearsetDataLoaded))
|
: EventWrapper<Actor, Model, GearsetDataLoaded.Priority>(nameof(GearsetDataLoaded))
|
||||||
{
|
{
|
||||||
public enum Priority
|
public enum Priority
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ public unsafe class UpdateSlotService : IDisposable
|
||||||
{
|
{
|
||||||
var ret = _loadGearsetDataHook.Original(drawDataContainer, gearsetData);
|
var ret = _loadGearsetDataHook.Original(drawDataContainer, gearsetData);
|
||||||
var drawObject = drawDataContainer->OwnerObject->DrawObject;
|
var drawObject = drawDataContainer->OwnerObject->DrawObject;
|
||||||
GearsetDataLoadedEvent.Invoke(drawObject);
|
GearsetDataLoadedEvent.Invoke(drawDataContainer->OwnerObject, drawObject);
|
||||||
Glamourer.Log.Excessive($"[LoadAllEquipmentDetour] GearsetItemData: {FormatGearsetItemDataStruct(*gearsetData)}");
|
Glamourer.Log.Excessive($"[LoadAllEquipmentDetour] GearsetItemData: {FormatGearsetItemDataStruct(*gearsetData)}");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -264,10 +264,9 @@ public class StateListener : IDisposable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGearsetDataLoaded(Model model)
|
private void OnGearsetDataLoaded(Actor actor, Model model)
|
||||||
{
|
{
|
||||||
var actor = _penumbra.GameObjectFromDrawObject(model);
|
if (!actor.Valid || (_condition[ConditionFlag.CreatingCharacter] && actor.Index >= ObjectIndex.CutsceneStart))
|
||||||
if (_condition[ConditionFlag.CreatingCharacter] && actor.Index >= ObjectIndex.CutsceneStart)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// ensure actor and state are valid.
|
// ensure actor and state are valid.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue