mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-01-02 05:43:42 +01:00
More renaming...
This commit is contained in:
parent
7bad131542
commit
f38a252295
55 changed files with 423 additions and 407 deletions
|
|
@ -3,6 +3,7 @@ using Penumbra.GameData.Enums;
|
|||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.Interop.Structs;
|
||||
using System.Collections.Generic;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.String.Functions;
|
||||
|
||||
namespace Penumbra.Meta.Files;
|
||||
|
|
@ -11,8 +12,8 @@ namespace Penumbra.Meta.Files;
|
|||
// We only support manipulating the racial scaling parameters at the moment.
|
||||
public sealed unsafe class CmpFile : MetaBaseFile
|
||||
{
|
||||
public static readonly Interop.CharacterUtility.InternalIndex InternalIndex =
|
||||
Interop.CharacterUtility.ReverseIndices[ ( int )CharacterUtility.Index.HumanCmp ];
|
||||
public static readonly CharacterUtility.InternalIndex InternalIndex =
|
||||
CharacterUtility.ReverseIndices[ ( int )MetaIndex.HumanCmp ];
|
||||
|
||||
private const int RacialScalingStart = 0x2A800;
|
||||
|
||||
|
|
@ -34,7 +35,7 @@ public sealed unsafe class CmpFile : MetaBaseFile
|
|||
}
|
||||
|
||||
public CmpFile()
|
||||
: base( CharacterUtility.Index.HumanCmp )
|
||||
: base( MetaIndex.HumanCmp )
|
||||
{
|
||||
AllocateData( DefaultData.Length );
|
||||
Reset();
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.String.Functions;
|
||||
|
||||
|
|
@ -96,7 +97,7 @@ public sealed unsafe class ExpandedEqdpFile : MetaBaseFile
|
|||
}
|
||||
|
||||
public ExpandedEqdpFile( GenderRace raceCode, bool accessory )
|
||||
: base( CharacterUtility.EqdpIdx( raceCode, accessory ) )
|
||||
: base( CharacterUtilityData.EqdpIdx( raceCode, accessory ) )
|
||||
{
|
||||
var def = ( byte* )DefaultData.Data;
|
||||
var blockSize = *( ushort* )( def + IdentifierSize );
|
||||
|
|
@ -114,7 +115,7 @@ public sealed unsafe class ExpandedEqdpFile : MetaBaseFile
|
|||
public EqdpEntry GetDefault( int setIdx )
|
||||
=> GetDefault( Index, setIdx );
|
||||
|
||||
public static EqdpEntry GetDefault( Interop.CharacterUtility.InternalIndex idx, int setIdx )
|
||||
public static EqdpEntry GetDefault( CharacterUtility.InternalIndex idx, int setIdx )
|
||||
=> GetDefault( ( byte* )Penumbra.CharacterUtility.DefaultResource( idx ).Address, setIdx );
|
||||
|
||||
public static EqdpEntry GetDefault( byte* data, int setIdx )
|
||||
|
|
@ -139,5 +140,5 @@ public sealed unsafe class ExpandedEqdpFile : MetaBaseFile
|
|||
}
|
||||
|
||||
public static EqdpEntry GetDefault( GenderRace raceCode, bool accessory, int setIdx )
|
||||
=> GetDefault( Interop.CharacterUtility.ReverseIndices[ ( int )CharacterUtility.EqdpIdx( raceCode, accessory ) ], setIdx );
|
||||
=> GetDefault( CharacterUtility.ReverseIndices[ ( int )CharacterUtilityData.EqdpIdx( raceCode, accessory ) ], setIdx );
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.String.Functions;
|
||||
|
||||
|
|
@ -75,13 +76,13 @@ public unsafe class ExpandedEqpGmpBase : MetaBaseFile
|
|||
}
|
||||
|
||||
public ExpandedEqpGmpBase( bool gmp )
|
||||
: base( gmp ? CharacterUtility.Index.Gmp : CharacterUtility.Index.Eqp )
|
||||
: base( gmp ? MetaIndex.Gmp : MetaIndex.Eqp )
|
||||
{
|
||||
AllocateData( MaxSize );
|
||||
Reset();
|
||||
}
|
||||
|
||||
protected static ulong GetDefaultInternal( Interop.CharacterUtility.InternalIndex fileIndex, int setIdx, ulong def )
|
||||
protected static ulong GetDefaultInternal( CharacterUtility.InternalIndex fileIndex, int setIdx, ulong def )
|
||||
{
|
||||
var data = ( byte* )Penumbra.CharacterUtility.DefaultResource(fileIndex).Address;
|
||||
if( setIdx == 0 )
|
||||
|
|
@ -111,8 +112,8 @@ public unsafe class ExpandedEqpGmpBase : MetaBaseFile
|
|||
|
||||
public sealed class ExpandedEqpFile : ExpandedEqpGmpBase, IEnumerable<EqpEntry>
|
||||
{
|
||||
public static readonly Interop.CharacterUtility.InternalIndex InternalIndex =
|
||||
Interop.CharacterUtility.ReverseIndices[ (int) CharacterUtility.Index.Eqp ];
|
||||
public static readonly CharacterUtility.InternalIndex InternalIndex =
|
||||
CharacterUtility.ReverseIndices[ (int) MetaIndex.Eqp ];
|
||||
|
||||
public ExpandedEqpFile()
|
||||
: base( false )
|
||||
|
|
@ -158,8 +159,8 @@ public sealed class ExpandedEqpFile : ExpandedEqpGmpBase, IEnumerable<EqpEntry>
|
|||
|
||||
public sealed class ExpandedGmpFile : ExpandedEqpGmpBase, IEnumerable<GmpEntry>
|
||||
{
|
||||
public static readonly Interop.CharacterUtility.InternalIndex InternalIndex =
|
||||
Interop.CharacterUtility.ReverseIndices[( int )CharacterUtility.Index.Gmp];
|
||||
public static readonly CharacterUtility.InternalIndex InternalIndex =
|
||||
CharacterUtility.ReverseIndices[( int )MetaIndex.Gmp];
|
||||
|
||||
public ExpandedGmpFile()
|
||||
: base( true )
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
using Penumbra.String.Functions;
|
||||
|
|
@ -175,7 +176,7 @@ public sealed unsafe class EstFile : MetaBaseFile
|
|||
}
|
||||
|
||||
public EstFile( EstManipulation.EstType estType )
|
||||
: base( ( CharacterUtility.Index )estType )
|
||||
: base( ( MetaIndex )estType )
|
||||
{
|
||||
var length = DefaultData.Length;
|
||||
AllocateData( length + IncreaseSize );
|
||||
|
|
@ -185,7 +186,7 @@ public sealed unsafe class EstFile : MetaBaseFile
|
|||
public ushort GetDefault( GenderRace genderRace, ushort setId )
|
||||
=> GetDefault( Index, genderRace, setId );
|
||||
|
||||
public static ushort GetDefault( Interop.CharacterUtility.InternalIndex index, GenderRace genderRace, ushort setId )
|
||||
public static ushort GetDefault( CharacterUtility.InternalIndex index, GenderRace genderRace, ushort setId )
|
||||
{
|
||||
var data = ( byte* )Penumbra.CharacterUtility.DefaultResource( index ).Address;
|
||||
var count = *( int* )data;
|
||||
|
|
@ -199,9 +200,9 @@ public sealed unsafe class EstFile : MetaBaseFile
|
|||
return *( ushort* )( data + 4 + count * EntryDescSize + idx * EntrySize );
|
||||
}
|
||||
|
||||
public static ushort GetDefault( CharacterUtility.Index index, GenderRace genderRace, ushort setId )
|
||||
=> GetDefault( Interop.CharacterUtility.ReverseIndices[ ( int )index ], genderRace, setId );
|
||||
public static ushort GetDefault( MetaIndex metaIndex, GenderRace genderRace, ushort setId )
|
||||
=> GetDefault( CharacterUtility.ReverseIndices[ ( int )metaIndex ], genderRace, setId );
|
||||
|
||||
public static ushort GetDefault( EstManipulation.EstType estType, GenderRace genderRace, ushort setId )
|
||||
=> GetDefault( ( CharacterUtility.Index )estType, genderRace, setId );
|
||||
=> GetDefault( ( MetaIndex )estType, genderRace, setId );
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Penumbra.Interop.Structs;
|
||||
|
||||
namespace Penumbra.Meta.Files;
|
||||
|
||||
|
|
@ -64,6 +65,6 @@ public unsafe class EvpFile : MetaBaseFile
|
|||
}
|
||||
|
||||
public EvpFile()
|
||||
: base( ( Interop.Structs.CharacterUtility.Index )1 ) // TODO: Name
|
||||
: base( ( MetaIndex )1 ) // TODO: Name
|
||||
{ }
|
||||
}
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
using System;
|
||||
using Dalamud.Memory;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.String.Functions;
|
||||
using CharacterUtility = Penumbra.Interop.CharacterUtility;
|
||||
using CharacterUtility = Penumbra.Interop.Services.CharacterUtility;
|
||||
|
||||
namespace Penumbra.Meta.Files;
|
||||
|
||||
|
|
@ -11,7 +12,7 @@ public unsafe class MetaBaseFile : IDisposable
|
|||
public int Length { get; private set; }
|
||||
public CharacterUtility.InternalIndex Index { get; }
|
||||
|
||||
public MetaBaseFile( Interop.Structs.CharacterUtility.Index idx )
|
||||
public MetaBaseFile( MetaIndex idx )
|
||||
=> Index = CharacterUtility.ReverseIndices[ ( int )idx ];
|
||||
|
||||
protected (IntPtr Data, int Length) DefaultData
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.Meta.Files;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
@ -13,13 +14,13 @@ public partial class MetaManager
|
|||
private readonly List< RspManipulation > _cmpManipulations = new();
|
||||
|
||||
public void SetCmpFiles()
|
||||
=> SetFile( _cmpFile, CharacterUtility.Index.HumanCmp );
|
||||
=> SetFile( _cmpFile, MetaIndex.HumanCmp );
|
||||
|
||||
public static void ResetCmpFiles()
|
||||
=> SetFile( null, CharacterUtility.Index.HumanCmp );
|
||||
=> SetFile( null, MetaIndex.HumanCmp );
|
||||
|
||||
public Interop.CharacterUtility.List.MetaReverter TemporarilySetCmpFile()
|
||||
=> TemporarilySetFile( _cmpFile, CharacterUtility.Index.HumanCmp );
|
||||
public CharacterUtility.MetaList.MetaReverter TemporarilySetCmpFile()
|
||||
=> TemporarilySetFile( _cmpFile, MetaIndex.HumanCmp );
|
||||
|
||||
public void ResetCmp()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
|||
using OtterGui;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.Meta.Files;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
@ -12,24 +13,24 @@ namespace Penumbra.Meta.Manager;
|
|||
|
||||
public partial class MetaManager
|
||||
{
|
||||
private readonly ExpandedEqdpFile?[] _eqdpFiles = new ExpandedEqdpFile[CharacterUtility.EqdpIndices.Length]; // TODO: female Hrothgar
|
||||
private readonly ExpandedEqdpFile?[] _eqdpFiles = new ExpandedEqdpFile[CharacterUtilityData.EqdpIndices.Length]; // TODO: female Hrothgar
|
||||
|
||||
private readonly List< EqdpManipulation > _eqdpManipulations = new();
|
||||
|
||||
public void SetEqdpFiles()
|
||||
{
|
||||
for( var i = 0; i < CharacterUtility.EqdpIndices.Length; ++i )
|
||||
for( var i = 0; i < CharacterUtilityData.EqdpIndices.Length; ++i )
|
||||
{
|
||||
SetFile( _eqdpFiles[ i ], CharacterUtility.EqdpIndices[ i ] );
|
||||
SetFile( _eqdpFiles[ i ], CharacterUtilityData.EqdpIndices[ i ] );
|
||||
}
|
||||
}
|
||||
|
||||
public Interop.CharacterUtility.List.MetaReverter? TemporarilySetEqdpFile( GenderRace genderRace, bool accessory )
|
||||
public CharacterUtility.MetaList.MetaReverter? TemporarilySetEqdpFile( GenderRace genderRace, bool accessory )
|
||||
{
|
||||
var idx = CharacterUtility.EqdpIdx( genderRace, accessory );
|
||||
var idx = CharacterUtilityData.EqdpIdx( genderRace, accessory );
|
||||
if( ( int )idx != -1 )
|
||||
{
|
||||
var i = CharacterUtility.EqdpIndices.IndexOf( idx );
|
||||
var i = CharacterUtilityData.EqdpIndices.IndexOf( idx );
|
||||
if( i != -1 )
|
||||
{
|
||||
return TemporarilySetFile( _eqdpFiles[ i ], idx );
|
||||
|
|
@ -41,7 +42,7 @@ public partial class MetaManager
|
|||
|
||||
public static void ResetEqdpFiles()
|
||||
{
|
||||
foreach( var idx in CharacterUtility.EqdpIndices )
|
||||
foreach( var idx in CharacterUtilityData.EqdpIndices )
|
||||
{
|
||||
SetFile( null, idx );
|
||||
}
|
||||
|
|
@ -51,7 +52,7 @@ public partial class MetaManager
|
|||
{
|
||||
foreach( var file in _eqdpFiles.OfType< ExpandedEqdpFile >() )
|
||||
{
|
||||
var relevant = Interop.CharacterUtility.RelevantIndices[ file.Index.Value ];
|
||||
var relevant = CharacterUtility.RelevantIndices[ file.Index.Value ];
|
||||
file.Reset( _eqdpManipulations.Where( m => m.FileIndex() == relevant ).Select( m => ( int )m.SetId ) );
|
||||
}
|
||||
|
||||
|
|
@ -61,7 +62,7 @@ public partial class MetaManager
|
|||
public bool ApplyMod( EqdpManipulation manip )
|
||||
{
|
||||
_eqdpManipulations.AddOrReplace( manip );
|
||||
var file = _eqdpFiles[ Array.IndexOf( CharacterUtility.EqdpIndices, manip.FileIndex() ) ] ??=
|
||||
var file = _eqdpFiles[ Array.IndexOf( CharacterUtilityData.EqdpIndices, manip.FileIndex() ) ] ??=
|
||||
new ExpandedEqdpFile( Names.CombinedRace( manip.Gender, manip.Race ), manip.Slot.IsAccessory() ); // TODO: female Hrothgar
|
||||
return manip.Apply( file );
|
||||
}
|
||||
|
|
@ -71,7 +72,7 @@ public partial class MetaManager
|
|||
if( _eqdpManipulations.Remove( manip ) )
|
||||
{
|
||||
var def = ExpandedEqdpFile.GetDefault( Names.CombinedRace( manip.Gender, manip.Race ), manip.Slot.IsAccessory(), manip.SetId );
|
||||
var file = _eqdpFiles[ Array.IndexOf( CharacterUtility.EqdpIndices, manip.FileIndex() ) ]!;
|
||||
var file = _eqdpFiles[ Array.IndexOf( CharacterUtilityData.EqdpIndices, manip.FileIndex() ) ]!;
|
||||
manip = new EqdpManipulation( def, manip.Slot, manip.Gender, manip.Race, manip.SetId );
|
||||
return manip.Apply( file );
|
||||
}
|
||||
|
|
@ -81,7 +82,7 @@ public partial class MetaManager
|
|||
|
||||
public ExpandedEqdpFile? EqdpFile( GenderRace race, bool accessory )
|
||||
=> _eqdpFiles
|
||||
[ Array.IndexOf( CharacterUtility.EqdpIndices, CharacterUtility.EqdpIdx( race, accessory ) ) ]; // TODO: female Hrothgar
|
||||
[ Array.IndexOf( CharacterUtilityData.EqdpIndices, CharacterUtilityData.EqdpIdx( race, accessory ) ) ]; // TODO: female Hrothgar
|
||||
|
||||
public void DisposeEqdp()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.Meta.Files;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
@ -13,13 +14,13 @@ public partial class MetaManager
|
|||
private readonly List< EqpManipulation > _eqpManipulations = new();
|
||||
|
||||
public void SetEqpFiles()
|
||||
=> SetFile( _eqpFile, CharacterUtility.Index.Eqp );
|
||||
=> SetFile( _eqpFile, MetaIndex.Eqp );
|
||||
|
||||
public static void ResetEqpFiles()
|
||||
=> SetFile( null, CharacterUtility.Index.Eqp );
|
||||
=> SetFile( null, MetaIndex.Eqp );
|
||||
|
||||
public Interop.CharacterUtility.List.MetaReverter TemporarilySetEqpFile()
|
||||
=> TemporarilySetFile( _eqpFile, CharacterUtility.Index.Eqp );
|
||||
public CharacterUtility.MetaList.MetaReverter TemporarilySetEqpFile()
|
||||
=> TemporarilySetFile( _eqpFile, MetaIndex.Eqp );
|
||||
|
||||
public void ResetEqp()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.Meta.Files;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
@ -19,28 +20,28 @@ public partial class MetaManager
|
|||
|
||||
public void SetEstFiles()
|
||||
{
|
||||
SetFile( _estFaceFile, CharacterUtility.Index.FaceEst );
|
||||
SetFile( _estHairFile, CharacterUtility.Index.HairEst );
|
||||
SetFile( _estBodyFile, CharacterUtility.Index.BodyEst );
|
||||
SetFile( _estHeadFile, CharacterUtility.Index.HeadEst );
|
||||
SetFile( _estFaceFile, MetaIndex.FaceEst );
|
||||
SetFile( _estHairFile, MetaIndex.HairEst );
|
||||
SetFile( _estBodyFile, MetaIndex.BodyEst );
|
||||
SetFile( _estHeadFile, MetaIndex.HeadEst );
|
||||
}
|
||||
|
||||
public static void ResetEstFiles()
|
||||
{
|
||||
SetFile( null, CharacterUtility.Index.FaceEst );
|
||||
SetFile( null, CharacterUtility.Index.HairEst );
|
||||
SetFile( null, CharacterUtility.Index.BodyEst );
|
||||
SetFile( null, CharacterUtility.Index.HeadEst );
|
||||
SetFile( null, MetaIndex.FaceEst );
|
||||
SetFile( null, MetaIndex.HairEst );
|
||||
SetFile( null, MetaIndex.BodyEst );
|
||||
SetFile( null, MetaIndex.HeadEst );
|
||||
}
|
||||
|
||||
public Interop.CharacterUtility.List.MetaReverter? TemporarilySetEstFile(EstManipulation.EstType type)
|
||||
public CharacterUtility.MetaList.MetaReverter? TemporarilySetEstFile(EstManipulation.EstType type)
|
||||
{
|
||||
var (file, idx) = type switch
|
||||
{
|
||||
EstManipulation.EstType.Face => ( _estFaceFile, CharacterUtility.Index.FaceEst ),
|
||||
EstManipulation.EstType.Hair => ( _estHairFile, CharacterUtility.Index.HairEst ),
|
||||
EstManipulation.EstType.Body => ( _estBodyFile, CharacterUtility.Index.BodyEst ),
|
||||
EstManipulation.EstType.Head => ( _estHeadFile, CharacterUtility.Index.HeadEst ),
|
||||
EstManipulation.EstType.Face => ( _estFaceFile, MetaIndex.FaceEst ),
|
||||
EstManipulation.EstType.Hair => ( _estHairFile, MetaIndex.HairEst ),
|
||||
EstManipulation.EstType.Body => ( _estBodyFile, MetaIndex.BodyEst ),
|
||||
EstManipulation.EstType.Head => ( _estHeadFile, MetaIndex.HeadEst ),
|
||||
_ => ( null, 0 ),
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.Meta.Files;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
@ -13,13 +14,13 @@ public partial class MetaManager
|
|||
private readonly List< GmpManipulation > _gmpManipulations = new();
|
||||
|
||||
public void SetGmpFiles()
|
||||
=> SetFile( _gmpFile, CharacterUtility.Index.Gmp );
|
||||
=> SetFile( _gmpFile, MetaIndex.Gmp );
|
||||
|
||||
public static void ResetGmpFiles()
|
||||
=> SetFile( null, CharacterUtility.Index.Gmp );
|
||||
=> SetFile( null, MetaIndex.Gmp );
|
||||
|
||||
public Interop.CharacterUtility.List.MetaReverter TemporarilySetGmpFile()
|
||||
=> TemporarilySetFile( _gmpFile, CharacterUtility.Index.Gmp );
|
||||
public CharacterUtility.MetaList.MetaReverter TemporarilySetGmpFile()
|
||||
=> TemporarilySetFile( _gmpFile, MetaIndex.Gmp );
|
||||
|
||||
public void ResetGmp()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System.Diagnostics.CodeAnalysis;
|
|||
using System.Runtime.CompilerServices;
|
||||
using OtterGui;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.Meta.Files;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
@ -162,36 +163,36 @@ public partial class MetaManager : IDisposable, IEnumerable< KeyValuePair< MetaM
|
|||
Penumbra.Log.Debug( $"{_collection.AnonymizedName}: Loaded {loaded} delayed meta manipulations." );
|
||||
}
|
||||
|
||||
public void SetFile( CharacterUtility.Index index )
|
||||
public void SetFile( MetaIndex metaIndex )
|
||||
{
|
||||
switch( index )
|
||||
switch( metaIndex )
|
||||
{
|
||||
case CharacterUtility.Index.Eqp:
|
||||
SetFile( _eqpFile, index );
|
||||
case MetaIndex.Eqp:
|
||||
SetFile( _eqpFile, metaIndex );
|
||||
break;
|
||||
case CharacterUtility.Index.Gmp:
|
||||
SetFile( _gmpFile, index );
|
||||
case MetaIndex.Gmp:
|
||||
SetFile( _gmpFile, metaIndex );
|
||||
break;
|
||||
case CharacterUtility.Index.HumanCmp:
|
||||
SetFile( _cmpFile, index );
|
||||
case MetaIndex.HumanCmp:
|
||||
SetFile( _cmpFile, metaIndex );
|
||||
break;
|
||||
case CharacterUtility.Index.FaceEst:
|
||||
SetFile( _estFaceFile, index );
|
||||
case MetaIndex.FaceEst:
|
||||
SetFile( _estFaceFile, metaIndex );
|
||||
break;
|
||||
case CharacterUtility.Index.HairEst:
|
||||
SetFile( _estHairFile, index );
|
||||
case MetaIndex.HairEst:
|
||||
SetFile( _estHairFile, metaIndex );
|
||||
break;
|
||||
case CharacterUtility.Index.HeadEst:
|
||||
SetFile( _estHeadFile, index );
|
||||
case MetaIndex.HeadEst:
|
||||
SetFile( _estHeadFile, metaIndex );
|
||||
break;
|
||||
case CharacterUtility.Index.BodyEst:
|
||||
SetFile( _estBodyFile, index );
|
||||
case MetaIndex.BodyEst:
|
||||
SetFile( _estBodyFile, metaIndex );
|
||||
break;
|
||||
default:
|
||||
var i = CharacterUtility.EqdpIndices.IndexOf( index );
|
||||
var i = CharacterUtilityData.EqdpIndices.IndexOf( metaIndex );
|
||||
if( i != -1 )
|
||||
{
|
||||
SetFile( _eqdpFiles[ i ], index );
|
||||
SetFile( _eqdpFiles[ i ], metaIndex );
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -199,21 +200,21 @@ public partial class MetaManager : IDisposable, IEnumerable< KeyValuePair< MetaM
|
|||
}
|
||||
|
||||
[MethodImpl( MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization )]
|
||||
private static unsafe void SetFile( MetaBaseFile? file, CharacterUtility.Index index )
|
||||
private static unsafe void SetFile( MetaBaseFile? file, MetaIndex metaIndex )
|
||||
{
|
||||
if( file == null )
|
||||
{
|
||||
Penumbra.CharacterUtility.ResetResource( index );
|
||||
Penumbra.CharacterUtility.ResetResource( metaIndex );
|
||||
}
|
||||
else
|
||||
{
|
||||
Penumbra.CharacterUtility.SetResource( index, ( IntPtr )file.Data, file.Length );
|
||||
Penumbra.CharacterUtility.SetResource( metaIndex, ( IntPtr )file.Data, file.Length );
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl( MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization )]
|
||||
private static unsafe Interop.CharacterUtility.List.MetaReverter TemporarilySetFile( MetaBaseFile? file, CharacterUtility.Index index )
|
||||
private static unsafe CharacterUtility.MetaList.MetaReverter TemporarilySetFile( MetaBaseFile? file, MetaIndex metaIndex )
|
||||
=> file == null
|
||||
? Penumbra.CharacterUtility.TemporarilyResetResource( index )
|
||||
: Penumbra.CharacterUtility.TemporarilySetResource( index, ( IntPtr )file.Data, file.Length );
|
||||
? Penumbra.CharacterUtility.TemporarilyResetResource( metaIndex )
|
||||
: Penumbra.CharacterUtility.TemporarilySetResource( metaIndex, ( IntPtr )file.Data, file.Length );
|
||||
}
|
||||
|
|
@ -81,8 +81,8 @@ public readonly struct EqdpManipulation : IMetaManipulation< EqdpManipulation >
|
|||
return set != 0 ? set : Slot.CompareTo( other.Slot );
|
||||
}
|
||||
|
||||
public CharacterUtility.Index FileIndex()
|
||||
=> CharacterUtility.EqdpIdx( Names.CombinedRace( Gender, Race ), Slot.IsAccessory() );
|
||||
public MetaIndex FileIndex()
|
||||
=> CharacterUtilityData.EqdpIdx( Names.CombinedRace( Gender, Race ), Slot.IsAccessory() );
|
||||
|
||||
public bool Apply( ExpandedEqdpFile file )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ public readonly struct EqpManipulation : IMetaManipulation< EqpManipulation >
|
|||
return set != 0 ? set : Slot.CompareTo( other.Slot );
|
||||
}
|
||||
|
||||
public CharacterUtility.Index FileIndex()
|
||||
=> CharacterUtility.Index.Eqp;
|
||||
public MetaIndex FileIndex()
|
||||
=> MetaIndex.Eqp;
|
||||
|
||||
public bool Apply( ExpandedEqpFile file )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ public readonly struct EstManipulation : IMetaManipulation< EstManipulation >
|
|||
{
|
||||
public enum EstType : byte
|
||||
{
|
||||
Hair = CharacterUtility.Index.HairEst,
|
||||
Face = CharacterUtility.Index.FaceEst,
|
||||
Body = CharacterUtility.Index.BodyEst,
|
||||
Head = CharacterUtility.Index.HeadEst,
|
||||
Hair = MetaIndex.HairEst,
|
||||
Face = MetaIndex.FaceEst,
|
||||
Body = MetaIndex.BodyEst,
|
||||
Head = MetaIndex.HeadEst,
|
||||
}
|
||||
|
||||
public static string ToName( EstType type )
|
||||
|
|
@ -89,8 +89,8 @@ public readonly struct EstManipulation : IMetaManipulation< EstManipulation >
|
|||
return s != 0 ? s : SetId.CompareTo( other.SetId );
|
||||
}
|
||||
|
||||
public CharacterUtility.Index FileIndex()
|
||||
=> ( CharacterUtility.Index )Slot;
|
||||
public MetaIndex FileIndex()
|
||||
=> ( MetaIndex )Slot;
|
||||
|
||||
public bool Apply( EstFile file )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ public readonly struct GmpManipulation : IMetaManipulation< GmpManipulation >
|
|||
public int CompareTo( GmpManipulation other )
|
||||
=> SetId.CompareTo( other.SetId );
|
||||
|
||||
public CharacterUtility.Index FileIndex()
|
||||
=> CharacterUtility.Index.Gmp;
|
||||
public MetaIndex FileIndex()
|
||||
=> MetaIndex.Gmp;
|
||||
|
||||
public bool Apply( ExpandedGmpFile file )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -142,8 +142,8 @@ public readonly struct ImcManipulation : IMetaManipulation< ImcManipulation >
|
|||
return b != 0 ? b : Variant.CompareTo( other.Variant );
|
||||
}
|
||||
|
||||
public CharacterUtility.Index FileIndex()
|
||||
=> ( CharacterUtility.Index )( -1 );
|
||||
public MetaIndex FileIndex()
|
||||
=> ( MetaIndex )( -1 );
|
||||
|
||||
public Utf8GamePath GamePath()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Penumbra.Meta.Manipulations;
|
|||
|
||||
public interface IMetaManipulation
|
||||
{
|
||||
public CharacterUtility.Index FileIndex();
|
||||
public MetaIndex FileIndex();
|
||||
}
|
||||
|
||||
public interface IMetaManipulation< T >
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ public readonly struct RspManipulation : IMetaManipulation< RspManipulation >
|
|||
return s != 0 ? s : Attribute.CompareTo( other.Attribute );
|
||||
}
|
||||
|
||||
public CharacterUtility.Index FileIndex()
|
||||
=> CharacterUtility.Index.HumanCmp;
|
||||
public MetaIndex FileIndex()
|
||||
=> MetaIndex.HumanCmp;
|
||||
|
||||
public bool Apply( CmpFile file )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue