Improve GamePaths and parsing, add support for identifying skeletons and phybs.

This commit is contained in:
Ottermandias 2025-02-27 13:08:41 +01:00
parent 8860d1e39a
commit c6de7ddebd
17 changed files with 65 additions and 83 deletions

View file

@ -124,7 +124,7 @@ public partial class MtrlTab
private FullPath FindAssociatedShpk(out string defaultPath, out Utf8GamePath defaultGamePath)
{
defaultPath = GamePaths.Shader.ShpkPath(Mtrl.ShaderPackage.Name);
defaultPath = GamePaths.Shader(Mtrl.ShaderPackage.Name);
if (!Utf8GamePath.FromString(defaultPath, out defaultGamePath))
return FullPath.Empty;

View file

@ -55,7 +55,7 @@ public sealed class AtchMetaDrawer : MetaDrawer<AtchIdentifier, AtchEntry>, ISer
if (filePath.Length == 0 || !File.Exists(filePath))
throw new FileNotFoundException();
var gr = GamePaths.ParseRaceCode(filePath);
var gr = Parser.ParseRaceCode(filePath);
if (gr is GenderRace.Unknown)
throw new Exception($"Could not identify race code from path {filePath}.");
var text = File.ReadAllBytes(filePath);
@ -277,7 +277,7 @@ public sealed class AtchMetaDrawer : MetaDrawer<AtchIdentifier, AtchEntry>, ISer
if (!ret)
return false;
index = Math.Clamp(index, (ushort)0, (ushort)(currentAtchPoint!.Entries.Length - 1));
index = Math.Clamp(index, (ushort)0, (ushort)(currentAtchPoint.Entries.Length - 1));
identifier = identifier with { EntryIndex = index };
return true;
}

View file

@ -68,7 +68,7 @@ public partial class ModEditWindow
{
_dragDropManager.CreateImGuiSource("atchDrag", f => f.Extensions.Contains(".atch"), f =>
{
var gr = GamePaths.ParseRaceCode(f.Files.FirstOrDefault() ?? string.Empty);
var gr = Parser.ParseRaceCode(f.Files.FirstOrDefault() ?? string.Empty);
if (gr is GenderRace.Unknown)
return false;