diff --git a/Penumbra.GameData/Structs/CharacterArmor.cs b/Penumbra.GameData/Structs/CharacterArmor.cs index c61ac7ab..6b3f60a8 100644 --- a/Penumbra.GameData/Structs/CharacterArmor.cs +++ b/Penumbra.GameData/Structs/CharacterArmor.cs @@ -1,15 +1,14 @@ using System.Runtime.InteropServices; -namespace Penumbra.GameData.Structs -{ - [StructLayout( LayoutKind.Sequential, Pack = 1 )] - public readonly struct CharacterArmor - { - public readonly SetId Set; - public readonly byte Variant; - public readonly StainId Stain; +namespace Penumbra.GameData.Structs; - public override string ToString() - => $"{Set},{Variant},{Stain}"; - } +[StructLayout( LayoutKind.Sequential, Pack = 1 )] +public readonly struct CharacterArmor +{ + public readonly SetId Set; + public readonly byte Variant; + public readonly StainId Stain; + + public override string ToString() + => $"{Set},{Variant},{Stain}"; } \ No newline at end of file diff --git a/Penumbra/Collections/ModCollection.cs b/Penumbra/Collections/ModCollection.cs index 1c913a11..0d485116 100644 --- a/Penumbra/Collections/ModCollection.cs +++ b/Penumbra/Collections/ModCollection.cs @@ -75,9 +75,9 @@ public partial class ModCollection => new(name, CurrentVersion, new Dictionary< string, ModSettings.SavedSettings >()); // Create a new temporary collection that does not save and has a negative index. - public static ModCollection CreateNewTemporary(string tag, string characterName) + public static ModCollection CreateNewTemporary( string tag, string characterName ) { - var collection = new ModCollection($"{tag}_{characterName}_temporary", Empty); + var collection = new ModCollection( $"{tag}_{characterName}", Empty ); collection.ModSettingChanged -= collection.SaveOnChange; collection.InheritanceChanged -= collection.SaveOnChange; collection.Index = ~Penumbra.TempMods.Collections.Count; diff --git a/Penumbra/Interop/Resolver/PathResolver.Material.cs b/Penumbra/Interop/Resolver/PathResolver.Material.cs index e3f1ab56..64e82ab7 100644 --- a/Penumbra/Interop/Resolver/PathResolver.Material.cs +++ b/Penumbra/Interop/Resolver/PathResolver.Material.cs @@ -8,6 +8,7 @@ using Penumbra.Collections; using Penumbra.GameData.ByteString; using Penumbra.GameData.Enums; using Penumbra.Interop.Structs; +using Penumbra.Util; namespace Penumbra.Interop.Resolver; @@ -56,7 +57,7 @@ public unsafe partial class PathResolver } // Check specifically for shpk and tex files whether we are currently in a material load. - private bool HandleMaterialSubFiles( ResourceType type, [NotNullWhen(true)] out ModCollection? collection ) + private bool HandleMaterialSubFiles( ResourceType type, [NotNullWhen( true )] out ModCollection? collection ) { if( _mtrlCollection != null && type is ResourceType.Tex or ResourceType.Shpk ) { @@ -81,7 +82,9 @@ public unsafe partial class PathResolver var lastUnderscore = split.LastIndexOf( ( byte )'_' ); var name = lastUnderscore == -1 ? split.ToString() : split.Substring( 0, lastUnderscore ).ToString(); - if( Penumbra.CollectionManager.ByName( name, out var collection ) ) + if( Penumbra.TempMods.Collections.Values.FindFirst( c => string.Equals( c.Name, name, StringComparison.OrdinalIgnoreCase ), + out var collection ) + || Penumbra.CollectionManager.ByName( name, out collection ) ) { #if DEBUG PluginLog.Verbose( "Using MtrlLoadHandler with collection {$Split:l} for path {$Path:l}.", name, path );