mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
Genericise est logic to handle face
This commit is contained in:
parent
aa7f0bace9
commit
0440324432
1 changed files with 6 additions and 6 deletions
|
|
@ -48,7 +48,9 @@ public sealed class ModelManager(IFramework framework, ActiveCollections collect
|
||||||
ObjectType.Accessory => [baseSkeleton],
|
ObjectType.Accessory => [baseSkeleton],
|
||||||
ObjectType.Character when info.BodySlot is BodySlot.Body or BodySlot.Tail => [baseSkeleton],
|
ObjectType.Character when info.BodySlot is BodySlot.Body or BodySlot.Tail => [baseSkeleton],
|
||||||
ObjectType.Character when info.BodySlot is BodySlot.Hair
|
ObjectType.Character when info.BodySlot is BodySlot.Hair
|
||||||
=> [baseSkeleton, ResolveHairSkeleton(info, estManipulations)],
|
=> [baseSkeleton, ResolveEstSkeleton(EstManipulation.EstType.Hair, info, estManipulations)],
|
||||||
|
ObjectType.Character when info.BodySlot is BodySlot.Face
|
||||||
|
=> [baseSkeleton, ResolveEstSkeleton(EstManipulation.EstType.Face, info, estManipulations)],
|
||||||
ObjectType.Character => throw new Exception($"Currently unsupported human model type \"{info.BodySlot}\"."),
|
ObjectType.Character => throw new Exception($"Currently unsupported human model type \"{info.BodySlot}\"."),
|
||||||
ObjectType.DemiHuman => [GamePaths.DemiHuman.Sklb.Path(info.PrimaryId)],
|
ObjectType.DemiHuman => [GamePaths.DemiHuman.Sklb.Path(info.PrimaryId)],
|
||||||
ObjectType.Monster => [GamePaths.Monster.Sklb.Path(info.PrimaryId)],
|
ObjectType.Monster => [GamePaths.Monster.Sklb.Path(info.PrimaryId)],
|
||||||
|
|
@ -57,24 +59,22 @@ public sealed class ModelManager(IFramework framework, ActiveCollections collect
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private string ResolveHairSkeleton(GameObjectInfo info, EstManipulation[] estManipulations)
|
private string ResolveEstSkeleton(EstManipulation.EstType type, GameObjectInfo info, EstManipulation[] estManipulations)
|
||||||
{
|
{
|
||||||
// TODO: might be able to genericse this over esttype based on incoming info
|
|
||||||
var (gender, race) = info.GenderRace.Split();
|
var (gender, race) = info.GenderRace.Split();
|
||||||
var modEst = estManipulations
|
var modEst = estManipulations
|
||||||
.FirstOrNull(est =>
|
.FirstOrNull(est =>
|
||||||
est.Gender == gender
|
est.Gender == gender
|
||||||
&& est.Race == race
|
&& est.Race == race
|
||||||
&& est.Slot == EstManipulation.EstType.Hair
|
&& est.Slot == type
|
||||||
&& est.SetId == info.PrimaryId
|
&& est.SetId == info.PrimaryId
|
||||||
);
|
);
|
||||||
|
|
||||||
// Try to use an entry from the current mod, falling back to the current collection, and finally an unmodified value.
|
// Try to use an entry from the current mod, falling back to the current collection, and finally an unmodified value.
|
||||||
var targetId = modEst?.Entry
|
var targetId = modEst?.Entry
|
||||||
?? collections.Current.MetaCache?.GetEstEntry(EstManipulation.EstType.Hair, info.GenderRace, info.PrimaryId)
|
?? collections.Current.MetaCache?.GetEstEntry(type, info.GenderRace, info.PrimaryId)
|
||||||
?? info.PrimaryId;
|
?? info.PrimaryId;
|
||||||
|
|
||||||
// TODO: i'm not conviced ToSuffix is correct - check!
|
|
||||||
return GamePaths.Skeleton.Sklb.Path(info.GenderRace, info.BodySlot.ToSuffix(), targetId);
|
return GamePaths.Skeleton.Sklb.Path(info.GenderRace, info.BodySlot.ToSuffix(), targetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue