mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 20:54:16 +01:00
ResourceTree: Add EID files
This commit is contained in:
parent
57f8587a43
commit
da54222bb1
3 changed files with 29 additions and 1 deletions
|
|
@ -107,6 +107,16 @@ internal record ResolveContext(GlobalResolveContext Global, EquipSlot Slot, Char
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public unsafe ResourceNode? CreateNodeFromEid(ResourceHandle* eid)
|
||||||
|
{
|
||||||
|
if (eid == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var path = Utf8GamePath.Empty; // TODO
|
||||||
|
|
||||||
|
return GetOrCreateNode(ResourceType.Eid, 0, eid, path);
|
||||||
|
}
|
||||||
|
|
||||||
public unsafe ResourceNode? CreateNodeFromImc(ResourceHandle* imc)
|
public unsafe ResourceNode? CreateNodeFromImc(ResourceHandle* imc)
|
||||||
{
|
{
|
||||||
if (imc == null)
|
if (imc == null)
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public class ResourceNode : ICloneable
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Internal
|
public bool Internal
|
||||||
=> Type is ResourceType.Imc;
|
=> Type is ResourceType.Eid or ResourceType.Imc;
|
||||||
|
|
||||||
internal ResourceNode(ResourceType type, nint objectAddress, nint resourceHandle, ulong length, ResolveContext? resolveContext)
|
internal ResourceNode(ResourceType type, nint objectAddress, nint resourceHandle, ulong length, ResolveContext? resolveContext)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,15 @@ public class ResourceTree
|
||||||
CustomizeData = character->DrawData.CustomizeData;
|
CustomizeData = character->DrawData.CustomizeData;
|
||||||
RaceCode = human != null ? (GenderRace)human->RaceSexId : GenderRace.Unknown;
|
RaceCode = human != null ? (GenderRace)human->RaceSexId : GenderRace.Unknown;
|
||||||
|
|
||||||
|
var eid = (ResourceHandle*)model->EID;
|
||||||
|
var eidNode = globalContext.CreateContext(EquipSlot.Unknown, default).CreateNodeFromEid(eid);
|
||||||
|
if (eidNode != null)
|
||||||
|
{
|
||||||
|
if (globalContext.WithUiData)
|
||||||
|
eidNode.FallbackName = "EID";
|
||||||
|
Nodes.Add(eidNode);
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = 0; i < model->SlotCount; ++i)
|
for (var i = 0; i < model->SlotCount; ++i)
|
||||||
{
|
{
|
||||||
var context = globalContext.CreateContext(
|
var context = globalContext.CreateContext(
|
||||||
|
|
@ -113,6 +122,15 @@ public class ResourceTree
|
||||||
weapon != null ? new CharacterArmor(weapon->ModelSetId, (byte)weapon->Variant, (byte)weapon->ModelUnknown) : default
|
weapon != null ? new CharacterArmor(weapon->ModelSetId, (byte)weapon->Variant, (byte)weapon->ModelUnknown) : default
|
||||||
);
|
);
|
||||||
|
|
||||||
|
var eid = (ResourceHandle*)subObject->EID;
|
||||||
|
var eidNode = subObjectContext.CreateNodeFromEid(eid);
|
||||||
|
if (eidNode != null)
|
||||||
|
{
|
||||||
|
if (globalContext.WithUiData)
|
||||||
|
eidNode.FallbackName = $"{subObjectNamePrefix} #{subObjectIndex}, EID";
|
||||||
|
Nodes.Add(eidNode);
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = 0; i < subObject->SlotCount; ++i)
|
for (var i = 0; i < subObject->SlotCount; ++i)
|
||||||
{
|
{
|
||||||
var imc = (ResourceHandle*)subObject->IMCArray[i];
|
var imc = (ResourceHandle*)subObject->IMCArray[i];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue