mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 20:24:17 +01:00
Maybe fix left finger resource nodes.
This commit is contained in:
parent
a54e45f9c3
commit
50db83146a
4 changed files with 24 additions and 24 deletions
|
|
@ -37,7 +37,7 @@ internal partial record ResolveContext
|
||||||
{
|
{
|
||||||
var path = IsEquipmentSlot(SlotIndex)
|
var path = IsEquipmentSlot(SlotIndex)
|
||||||
? GamePaths.Equipment.Mdl.Path(Equipment.Set, ResolveModelRaceCode(), Slot.ToSlot())
|
? GamePaths.Equipment.Mdl.Path(Equipment.Set, ResolveModelRaceCode(), Slot.ToSlot())
|
||||||
: GamePaths.Accessory.Mdl.Path(Equipment.Set, ResolveModelRaceCode(), Slot.ToSlot());
|
: GamePaths.Accessory.Mdl.Path(Equipment.Set, ResolveModelRaceCode(), SlotIndex.ToEquipSlot());
|
||||||
return Utf8GamePath.FromString(path, out var gamePath) ? gamePath : Utf8GamePath.Empty;
|
return Utf8GamePath.FromString(path, out var gamePath) ? gamePath : Utf8GamePath.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -340,9 +340,9 @@ internal unsafe partial record ResolveContext(
|
||||||
|
|
||||||
internal ResourceNode.UiData GuessModelUiData(Utf8GamePath gamePath)
|
internal ResourceNode.UiData GuessModelUiData(Utf8GamePath gamePath)
|
||||||
{
|
{
|
||||||
var path = gamePath.ToString().Split('/', StringSplitOptions.RemoveEmptyEntries);
|
var path = gamePath.Path.Split((byte)'/');
|
||||||
// Weapons intentionally left out.
|
// Weapons intentionally left out.
|
||||||
var isEquipment = SafeGet(path, 0) == "chara" && SafeGet(path, 1) is "accessory" or "equipment";
|
var isEquipment = path.Count >= 2 && path[0].Span.SequenceEqual("chara"u8) && (path[1].Span.SequenceEqual("accessory"u8) || path[1].Span.SequenceEqual("equipment"u8));
|
||||||
if (isEquipment)
|
if (isEquipment)
|
||||||
foreach (var item in Global.Identifier.Identify(Equipment.Set, 0, Equipment.Variant, Slot.ToSlot()))
|
foreach (var item in Global.Identifier.Identify(Equipment.Set, 0, Equipment.Variant, Slot.ToSlot()))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,20 +7,20 @@ namespace Penumbra.Interop.ResourceTree;
|
||||||
|
|
||||||
public class ResourceNode : ICloneable
|
public class ResourceNode : ICloneable
|
||||||
{
|
{
|
||||||
public string? Name;
|
public string? Name;
|
||||||
public string? FallbackName;
|
public string? FallbackName;
|
||||||
public ChangedItemIconFlag IconFlag;
|
public ChangedItemIconFlag IconFlag;
|
||||||
public readonly ResourceType Type;
|
public readonly ResourceType Type;
|
||||||
public readonly nint ObjectAddress;
|
public readonly nint ObjectAddress;
|
||||||
public readonly nint ResourceHandle;
|
public readonly nint ResourceHandle;
|
||||||
public Utf8GamePath[] PossibleGamePaths;
|
public Utf8GamePath[] PossibleGamePaths;
|
||||||
public FullPath FullPath;
|
public FullPath FullPath;
|
||||||
public string? ModName;
|
public string? ModName;
|
||||||
public string? ModRelativePath;
|
public string? ModRelativePath;
|
||||||
public CiByteString AdditionalData;
|
public CiByteString AdditionalData;
|
||||||
public readonly ulong Length;
|
public readonly ulong Length;
|
||||||
public readonly List<ResourceNode> Children;
|
public readonly List<ResourceNode> Children;
|
||||||
internal ResolveContext? ResolveContext;
|
internal ResolveContext? ResolveContext;
|
||||||
|
|
||||||
public Utf8GamePath GamePath
|
public Utf8GamePath GamePath
|
||||||
{
|
{
|
||||||
|
|
@ -53,7 +53,7 @@ public class ResourceNode : ICloneable
|
||||||
{
|
{
|
||||||
Name = other.Name;
|
Name = other.Name;
|
||||||
FallbackName = other.FallbackName;
|
FallbackName = other.FallbackName;
|
||||||
IconFlag = other.IconFlag;
|
IconFlag = other.IconFlag;
|
||||||
Type = other.Type;
|
Type = other.Type;
|
||||||
ObjectAddress = other.ObjectAddress;
|
ObjectAddress = other.ObjectAddress;
|
||||||
ResourceHandle = other.ResourceHandle;
|
ResourceHandle = other.ResourceHandle;
|
||||||
|
|
@ -82,7 +82,7 @@ public class ResourceNode : ICloneable
|
||||||
|
|
||||||
public void SetUiData(UiData uiData)
|
public void SetUiData(UiData uiData)
|
||||||
{
|
{
|
||||||
Name = uiData.Name;
|
Name = uiData.Name;
|
||||||
IconFlag = uiData.IconFlag;
|
IconFlag = uiData.IconFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,8 +81,8 @@ public class ResourceTree
|
||||||
ModelType.Human => i switch
|
ModelType.Human => i switch
|
||||||
{
|
{
|
||||||
< 10 => globalContext.CreateContext(model, i, i.ToEquipSlot().ToEquipType(), equipment[(int)i]),
|
< 10 => globalContext.CreateContext(model, i, i.ToEquipSlot().ToEquipType(), equipment[(int)i]),
|
||||||
16 => globalContext.CreateContext(model, i, FullEquipType.Glasses, equipment[10]),
|
16 => globalContext.CreateContext(model, i, FullEquipType.Glasses, equipment[10]),
|
||||||
17 => globalContext.CreateContext(model, i, FullEquipType.Unknown, equipment[11]),
|
17 => globalContext.CreateContext(model, i, FullEquipType.Unknown, equipment[11]),
|
||||||
_ => globalContext.CreateContext(model, i),
|
_ => globalContext.CreateContext(model, i),
|
||||||
},
|
},
|
||||||
_ => i < equipment.Length
|
_ => i < equipment.Length
|
||||||
|
|
@ -185,7 +185,7 @@ public class ResourceTree
|
||||||
{
|
{
|
||||||
pbdNode = pbdNode.Clone();
|
pbdNode = pbdNode.Clone();
|
||||||
pbdNode.FallbackName = "Racial Deformer";
|
pbdNode.FallbackName = "Racial Deformer";
|
||||||
pbdNode.IconFlag = ChangedItemIconFlag.Customization;
|
pbdNode.IconFlag = ChangedItemIconFlag.Customization;
|
||||||
}
|
}
|
||||||
|
|
||||||
Nodes.Add(pbdNode);
|
Nodes.Add(pbdNode);
|
||||||
|
|
@ -203,7 +203,7 @@ public class ResourceTree
|
||||||
{
|
{
|
||||||
decalNode = decalNode.Clone();
|
decalNode = decalNode.Clone();
|
||||||
decalNode.FallbackName = "Face Decal";
|
decalNode.FallbackName = "Face Decal";
|
||||||
decalNode.IconFlag = ChangedItemIconFlag.Customization;
|
decalNode.IconFlag = ChangedItemIconFlag.Customization;
|
||||||
}
|
}
|
||||||
|
|
||||||
Nodes.Add(decalNode);
|
Nodes.Add(decalNode);
|
||||||
|
|
@ -220,7 +220,7 @@ public class ResourceTree
|
||||||
{
|
{
|
||||||
legacyDecalNode = legacyDecalNode.Clone();
|
legacyDecalNode = legacyDecalNode.Clone();
|
||||||
legacyDecalNode.FallbackName = "Legacy Body Decal";
|
legacyDecalNode.FallbackName = "Legacy Body Decal";
|
||||||
legacyDecalNode.IconFlag = ChangedItemIconFlag.Customization;
|
legacyDecalNode.IconFlag = ChangedItemIconFlag.Customization;
|
||||||
}
|
}
|
||||||
|
|
||||||
Nodes.Add(legacyDecalNode);
|
Nodes.Add(legacyDecalNode);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue