mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 04:34:19 +01:00
Change EST files to be sorted and thus work.
This commit is contained in:
parent
19b295bbc3
commit
aa7d71530d
1 changed files with 122 additions and 117 deletions
|
|
@ -4,10 +4,11 @@ using System.Linq;
|
||||||
using Lumina.Data;
|
using Lumina.Data;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
|
|
||||||
namespace Penumbra.Meta.Files
|
namespace Penumbra.Meta.Files;
|
||||||
{
|
|
||||||
// EST Structure:
|
// EST Structure:
|
||||||
// 1x [NumEntries : UInt32]
|
// 1x [NumEntries : UInt32]
|
||||||
|
// Apparently entries need to be sorted.
|
||||||
// #NumEntries x [SetId : UInt16] [RaceId : UInt16]
|
// #NumEntries x [SetId : UInt16] [RaceId : UInt16]
|
||||||
// #NumEntries x [SkeletonId : UInt16]
|
// #NumEntries x [SkeletonId : UInt16]
|
||||||
public class EstFile
|
public class EstFile
|
||||||
|
|
@ -15,17 +16,22 @@ namespace Penumbra.Meta.Files
|
||||||
private const ushort EntryDescSize = 4;
|
private const ushort EntryDescSize = 4;
|
||||||
private const ushort EntrySize = 2;
|
private const ushort EntrySize = 2;
|
||||||
|
|
||||||
private readonly Dictionary< GenderRace, Dictionary< ushort, ushort > > _entries = new();
|
private readonly SortedList< GenderRace, SortedList< ushort, ushort > > _entries = new();
|
||||||
private uint NumEntries { get; set; }
|
private uint NumEntries { get; set; }
|
||||||
|
|
||||||
private EstFile( EstFile clone )
|
private EstFile( EstFile clone )
|
||||||
{
|
{
|
||||||
NumEntries = clone.NumEntries;
|
NumEntries = clone.NumEntries;
|
||||||
_entries = new Dictionary< GenderRace, Dictionary< ushort, ushort > >( clone._entries.Count );
|
_entries = new SortedList< GenderRace, SortedList< ushort, ushort > >( clone._entries.Count );
|
||||||
foreach( var kvp in clone._entries )
|
foreach( var (genderRace, data) in clone._entries )
|
||||||
{
|
{
|
||||||
var dict = kvp.Value.ToDictionary( k => k.Key, k => k.Value );
|
var dict = new SortedList< ushort, ushort >( data.Count );
|
||||||
_entries.Add( kvp.Key, dict );
|
foreach( var (setId, value) in data )
|
||||||
|
{
|
||||||
|
dict.Add( setId, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
_entries.Add( genderRace, dict );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,7 +64,7 @@ namespace Penumbra.Meta.Files
|
||||||
{
|
{
|
||||||
if( !_entries.TryGetValue( gr, out var setDict ) )
|
if( !_entries.TryGetValue( gr, out var setDict ) )
|
||||||
{
|
{
|
||||||
_entries[ gr ] = new Dictionary< ushort, ushort >();
|
_entries[ gr ] = new SortedList< ushort, ushort >();
|
||||||
setDict = _entries[ gr ];
|
setDict = _entries[ gr ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -154,4 +160,3 @@ namespace Penumbra.Meta.Files
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue