Mtrl editor: Disregard obsolete modded ShPks

This commit is contained in:
Exter-N 2025-03-30 20:29:25 +02:00 committed by Ottermandias
parent 1d517103b3
commit abb47751c8
2 changed files with 8 additions and 3 deletions

View file

@ -49,7 +49,7 @@ public sealed class ShpkPathPreProcessor(ResourceManagerService resourceManager,
return null;
}
private static SanityCheckResult SanityCheck(string path)
internal static SanityCheckResult SanityCheck(string path)
{
try
{
@ -79,7 +79,7 @@ public sealed class ShpkPathPreProcessor(ResourceManagerService resourceManager,
_ => string.Empty,
};
private enum SanityCheckResult
internal enum SanityCheckResult
{
Success,
IoError,

View file

@ -10,6 +10,7 @@ using Penumbra.GameData;
using Penumbra.GameData.Data;
using Penumbra.GameData.Files;
using Penumbra.GameData.Files.ShaderStructs;
using Penumbra.Interop.Processing;
using Penumbra.String.Classes;
using static Penumbra.GameData.Files.ShpkFile;
@ -128,7 +129,11 @@ public partial class MtrlTab
if (!Utf8GamePath.FromString(defaultPath, out defaultGamePath))
return FullPath.Empty;
return _edit.FindBestMatch(defaultGamePath);
var path = _edit.FindBestMatch(defaultGamePath);
if (!path.IsRooted || ShpkPathPreProcessor.SanityCheck(path.FullName) == ShpkPathPreProcessor.SanityCheckResult.Success)
return path;
return new FullPath(defaultPath);
}
private void LoadShpk(FullPath path)