mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Add collection groups for Children and Elderly.
This commit is contained in:
parent
2e6cc73666
commit
7ae6d0a348
3 changed files with 30 additions and 10 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 97dc16ba32bf78c4d3a4d210a08010cd6d4eec3c
|
||||
Subproject commit 1f62ae970e02e48f686a41a2cecdb79e0af87994
|
||||
|
|
@ -13,6 +13,8 @@ public enum CollectionType : byte
|
|||
FemalePlayerCharacter = Api.Enums.ApiCollectionType.FemalePlayerCharacter,
|
||||
MaleNonPlayerCharacter = Api.Enums.ApiCollectionType.MaleNonPlayerCharacter,
|
||||
FemaleNonPlayerCharacter = Api.Enums.ApiCollectionType.FemaleNonPlayerCharacter,
|
||||
NonPlayerChild = Api.Enums.ApiCollectionType.NonPlayerChild,
|
||||
NonPlayerElderly = Api.Enums.ApiCollectionType.NonPlayerElderly,
|
||||
|
||||
MaleMidlander = Api.Enums.ApiCollectionType.MaleMidlander,
|
||||
FemaleMidlander = Api.Enums.ApiCollectionType.FemaleMidlander,
|
||||
|
|
@ -97,15 +99,15 @@ public enum CollectionType : byte
|
|||
Default = Api.Enums.ApiCollectionType.Default, // The default collection was changed
|
||||
Interface = Api.Enums.ApiCollectionType.Interface, // The ui collection was changed
|
||||
Current = Api.Enums.ApiCollectionType.Current, // The current collection was changed
|
||||
Individual, // An individual collection was changed
|
||||
Inactive, // A collection was added or removed
|
||||
Temporary, // A temporary collections was set or deleted via IPC
|
||||
Individual, // An individual collection was changed
|
||||
Inactive, // A collection was added or removed
|
||||
Temporary, // A temporary collections was set or deleted via IPC
|
||||
}
|
||||
|
||||
public static class CollectionTypeExtensions
|
||||
{
|
||||
public static bool IsSpecial( this CollectionType collectionType )
|
||||
=> collectionType is >= CollectionType.Yourself and < CollectionType.Default;
|
||||
=> collectionType < CollectionType.Default;
|
||||
|
||||
public static readonly (CollectionType, string, string)[] Special = Enum.GetValues< CollectionType >()
|
||||
.Where( IsSpecial )
|
||||
|
|
@ -265,6 +267,8 @@ public static class CollectionTypeExtensions
|
|||
=> collectionType switch
|
||||
{
|
||||
CollectionType.Yourself => "Your Character",
|
||||
CollectionType.NonPlayerChild => "Non-Player Children",
|
||||
CollectionType.NonPlayerElderly => "Non-Player Elderly",
|
||||
CollectionType.MalePlayerCharacter => "Male Player Characters",
|
||||
CollectionType.MaleNonPlayerCharacter => "Male Non-Player Characters",
|
||||
CollectionType.MaleMidlander => $"Male {SubRace.Midlander.ToName()}",
|
||||
|
|
@ -345,7 +349,13 @@ public static class CollectionTypeExtensions
|
|||
=> collectionType switch
|
||||
{
|
||||
CollectionType.Yourself => "This collection applies to your own character, regardless of its name.\n"
|
||||
+ "It takes precedence before all other collections except for explicitly named character collections.",
|
||||
+ "It takes precedence before all other collections except for explicitly named individual collections.",
|
||||
CollectionType.NonPlayerChild =>
|
||||
"This collection applies to all non-player characters with a child body-type.\n"
|
||||
+ "It takes precedence before all other collections except for explicitly named individual collections.",
|
||||
CollectionType.NonPlayerElderly =>
|
||||
"This collection applies to all non-player characters with an elderly body-type.\n"
|
||||
+ "It takes precedence before all other collections except for explicitly named individual collections.",
|
||||
CollectionType.MalePlayerCharacter =>
|
||||
"This collection applies to all male player characters that do not have a more specific character or racial collections associated.",
|
||||
CollectionType.MaleNonPlayerCharacter =>
|
||||
|
|
|
|||
|
|
@ -133,12 +133,22 @@ public unsafe partial class PathResolver
|
|||
var character = ( Character* )actor;
|
||||
if( character->ModelCharaId >= 0 && character->ModelCharaId < ValidHumanModels.Count && ValidHumanModels[ character->ModelCharaId ] )
|
||||
{
|
||||
var race = ( SubRace )character->CustomizeData[ 4 ];
|
||||
var gender = ( Gender )( character->CustomizeData[ 1 ] + 1 );
|
||||
var isNpc = actor->ObjectKind != ( byte )ObjectKind.Player;
|
||||
var bodyType = character->CustomizeData[2];
|
||||
var collection = bodyType switch
|
||||
{
|
||||
3 => Penumbra.CollectionManager.ByType( CollectionType.NonPlayerElderly ),
|
||||
4 => Penumbra.CollectionManager.ByType( CollectionType.NonPlayerChild ),
|
||||
_ => null,
|
||||
};
|
||||
if( collection != null )
|
||||
return collection;
|
||||
|
||||
var race = ( SubRace )character->CustomizeData[ 4 ];
|
||||
var gender = ( Gender )( character->CustomizeData[ 1 ] + 1 );
|
||||
var isNpc = actor->ObjectKind != ( byte )ObjectKind.Player;
|
||||
|
||||
var type = CollectionTypeExtensions.FromParts( race, gender, isNpc );
|
||||
var collection = Penumbra.CollectionManager.ByType( type );
|
||||
collection = Penumbra.CollectionManager.ByType( type );
|
||||
collection ??= Penumbra.CollectionManager.ByType( CollectionTypeExtensions.FromParts( gender, isNpc ) );
|
||||
return collection;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue