Use Penumbra.GameData Actor and Model and ObjectManager.

This commit is contained in:
Ottermandias 2024-03-19 23:19:46 +01:00
parent 05d261d4a3
commit 9750736d57
44 changed files with 171 additions and 512 deletions

View file

@ -2,15 +2,15 @@
using Dalamud.Interface.Internal.Notifications;
using Glamourer.Designs;
using Glamourer.Gui;
using Glamourer.Interop;
using Glamourer.Interop.Structs;
using Glamourer.Services;
using ImGuiNET;
using OtterGui;
using OtterGui.Classes;
using Penumbra.GameData.Enums;
using Penumbra.GameData.Interop;
using Penumbra.GameData.Structs;
using CustomizeIndex = Penumbra.GameData.Enums.CustomizeIndex;
using ObjectManager = Glamourer.Interop.ObjectManager;
namespace Glamourer.State;

View file

@ -12,6 +12,8 @@ using Dalamud.Plugin.Services;
using Glamourer.GameData;
using Penumbra.GameData.DataContainers;
using Glamourer.Designs;
using Penumbra.GameData.Interop;
using ObjectManager = Glamourer.Interop.ObjectManager;
namespace Glamourer.State;
@ -550,10 +552,10 @@ public class StateListener : IDisposable
/// only if we kept track of state of someone who went to the aesthetician,
/// or if they used other tools to change things.
/// </summary>
private UpdateState UpdateBaseData(Actor actor, ActorState state, CustomizeArray customize, bool checkTransform)
private unsafe UpdateState UpdateBaseData(Actor actor, ActorState state, CustomizeArray customize, bool checkTransform)
{
// Customize array does not agree between game object and draw object => transformation.
if (checkTransform && !actor.GetCustomize().Equals(customize))
if (checkTransform && !actor.Customize->Equals(customize))
return UpdateState.Transformed;
// Customize array did not change to stored state.

View file

@ -12,7 +12,7 @@ using Penumbra.GameData.Actors;
using Penumbra.GameData.DataContainers;
using Penumbra.GameData.Enums;
using Penumbra.GameData.Structs;
using System;
using Penumbra.GameData.Interop;
namespace Glamourer.State;
@ -163,7 +163,7 @@ public sealed class StateManager(
else
{
// Obtain all data from the game object.
ret.Customize = actor.GetCustomize();
ret.Customize = *actor.Customize;
foreach (var slot in EquipSlotExtensions.EqdpSlots)
{

View file

@ -1,5 +1,5 @@
using Glamourer.Interop.Structs;
using Penumbra.GameData.Enums;
using Penumbra.GameData.Enums;
using Penumbra.GameData.Interop;
using Penumbra.GameData.Structs;
namespace Glamourer.State;
@ -344,10 +344,10 @@ public class WorldSets
}
private unsafe (byte, byte, Race, Gender) GetData(Actor actor)
private static unsafe (byte, byte, Race, Gender) GetData(Actor actor)
{
var customize = actor.GetCustomize();
return (actor.AsCharacter->CharacterData.Level, actor.Job, customize.Race, customize.Gender);
var customize = actor.Customize;
return (actor.AsCharacter->CharacterData.Level, actor.Job, customize->Race, customize->Gender);
}
public void Apply(Actor actor, Random rng, Span<CharacterArmor> armor)
@ -356,7 +356,7 @@ public class WorldSets
Apply(level, job, race, gender, rng, armor);
}
public void Apply(byte level, byte job, Race race, Gender gender, Random rng, Span<CharacterArmor> armor)
private void Apply(byte level, byte job, Race race, Gender gender, Random rng, Span<CharacterArmor> armor)
{
var opt = GetGroup(level, job, race, gender, rng);
if (opt == null)
@ -375,7 +375,7 @@ public class WorldSets
Apply(level, job, race, gender, rng, ref armor, slot);
}
public void Apply(byte level, byte job, Race race, Gender gender, Random rng, ref CharacterArmor armor, EquipSlot slot)
private void Apply(byte level, byte job, Race race, Gender gender, Random rng, ref CharacterArmor armor, EquipSlot slot)
{
var opt = GetGroup(level, job, race, gender, rng);
if (opt == null)
@ -398,7 +398,7 @@ public class WorldSets
Apply(level, job, race, gender, rng, ref weapon, slot);
}
public void Apply(byte level, byte job, Race race, Gender gender, Random rng, ref CharacterWeapon weapon, EquipSlot slot)
private void Apply(byte level, byte job, Race race, Gender gender, Random rng, ref CharacterWeapon weapon, EquipSlot slot)
{
var opt = GetGroup(level, job, race, gender, rng);
if (opt == null)