mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Mtrl editor: Disregard obsolete modded ShPks
This commit is contained in:
parent
1d517103b3
commit
abb47751c8
2 changed files with 8 additions and 3 deletions
|
|
@ -49,7 +49,7 @@ public sealed class ShpkPathPreProcessor(ResourceManagerService resourceManager,
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static SanityCheckResult SanityCheck(string path)
|
internal static SanityCheckResult SanityCheck(string path)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -79,7 +79,7 @@ public sealed class ShpkPathPreProcessor(ResourceManagerService resourceManager,
|
||||||
_ => string.Empty,
|
_ => string.Empty,
|
||||||
};
|
};
|
||||||
|
|
||||||
private enum SanityCheckResult
|
internal enum SanityCheckResult
|
||||||
{
|
{
|
||||||
Success,
|
Success,
|
||||||
IoError,
|
IoError,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ using Penumbra.GameData;
|
||||||
using Penumbra.GameData.Data;
|
using Penumbra.GameData.Data;
|
||||||
using Penumbra.GameData.Files;
|
using Penumbra.GameData.Files;
|
||||||
using Penumbra.GameData.Files.ShaderStructs;
|
using Penumbra.GameData.Files.ShaderStructs;
|
||||||
|
using Penumbra.Interop.Processing;
|
||||||
using Penumbra.String.Classes;
|
using Penumbra.String.Classes;
|
||||||
using static Penumbra.GameData.Files.ShpkFile;
|
using static Penumbra.GameData.Files.ShpkFile;
|
||||||
|
|
||||||
|
|
@ -128,7 +129,11 @@ public partial class MtrlTab
|
||||||
if (!Utf8GamePath.FromString(defaultPath, out defaultGamePath))
|
if (!Utf8GamePath.FromString(defaultPath, out defaultGamePath))
|
||||||
return FullPath.Empty;
|
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)
|
private void LoadShpk(FullPath path)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue