mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-30 12:23:41 +01:00
Fix unnecessary EST file creations.
This commit is contained in:
parent
a7b90639c6
commit
c53f29c257
1 changed files with 12 additions and 2 deletions
|
|
@ -74,7 +74,7 @@ public sealed class EstCache(MetaFileManager manager, ModCollection collection)
|
|||
|
||||
public EstEntry GetEstEntry(EstIdentifier identifier)
|
||||
{
|
||||
var file = GetFile(identifier);
|
||||
var file = GetCurrentFile(identifier);
|
||||
return file != null
|
||||
? file[identifier.GenderRace, identifier.SetId]
|
||||
: EstFile.GetDefault(Manager, identifier);
|
||||
|
|
@ -124,9 +124,19 @@ public sealed class EstCache(MetaFileManager manager, ModCollection collection)
|
|||
Clear();
|
||||
}
|
||||
|
||||
private EstFile? GetCurrentFile(EstIdentifier identifier)
|
||||
=> identifier.Slot switch
|
||||
{
|
||||
EstType.Hair => _estHairFile,
|
||||
EstType.Face => _estFaceFile,
|
||||
EstType.Body => _estBodyFile,
|
||||
EstType.Head => _estHeadFile,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
private EstFile? GetFile(EstIdentifier identifier)
|
||||
{
|
||||
if (Manager.CharacterUtility.Ready)
|
||||
if (!Manager.CharacterUtility.Ready)
|
||||
return null;
|
||||
|
||||
return identifier.Slot switch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue