mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-23 16:27:47 +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)
|
public EstEntry GetEstEntry(EstIdentifier identifier)
|
||||||
{
|
{
|
||||||
var file = GetFile(identifier);
|
var file = GetCurrentFile(identifier);
|
||||||
return file != null
|
return file != null
|
||||||
? file[identifier.GenderRace, identifier.SetId]
|
? file[identifier.GenderRace, identifier.SetId]
|
||||||
: EstFile.GetDefault(Manager, identifier);
|
: EstFile.GetDefault(Manager, identifier);
|
||||||
|
|
@ -124,9 +124,19 @@ public sealed class EstCache(MetaFileManager manager, ModCollection collection)
|
||||||
Clear();
|
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)
|
private EstFile? GetFile(EstIdentifier identifier)
|
||||||
{
|
{
|
||||||
if (Manager.CharacterUtility.Ready)
|
if (!Manager.CharacterUtility.Ready)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return identifier.Slot switch
|
return identifier.Slot switch
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue