mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Let Material Path Resolver search through temporary collections.
This commit is contained in:
parent
311882948a
commit
95e7febd38
3 changed files with 17 additions and 15 deletions
|
|
@ -1,7 +1,7 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Penumbra.GameData.Structs
|
||||
{
|
||||
namespace Penumbra.GameData.Structs;
|
||||
|
||||
[StructLayout( LayoutKind.Sequential, Pack = 1 )]
|
||||
public readonly struct CharacterArmor
|
||||
{
|
||||
|
|
@ -12,4 +12,3 @@ namespace Penumbra.GameData.Structs
|
|||
public override string ToString()
|
||||
=> $"{Set},{Variant},{Stain}";
|
||||
}
|
||||
}
|
||||
|
|
@ -77,7 +77,7 @@ public partial class ModCollection
|
|||
// Create a new temporary collection that does not save and has a negative index.
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue