Add preliminary pap handling to character collections.

This commit is contained in:
Ottermandias 2022-06-04 19:02:58 +02:00
parent c0102368c3
commit f0131dd5ba
3 changed files with 83 additions and 2 deletions

View file

@ -40,6 +40,7 @@ public partial class PathResolver : IDisposable
// A potential next request will add the path anew.
var nonDefault = HandleMaterialSubFiles( type, out var collection )
|| PathCollections.TryRemove( gamePath.Path, out collection )
|| HandlePapFile( type, gamePath, out collection )
|| HandleDecalFile( type, gamePath, out collection );
if( !nonDefault )
{
@ -59,7 +60,7 @@ public partial class PathResolver : IDisposable
private bool HandleDecalFile( ResourceType type, Utf8GamePath gamePath, out ModCollection? collection )
{
if( type == ResourceType.Tex
if( type == ResourceType.Tex
&& _lastCreatedCollection != null
&& gamePath.Path.Substring( "chara/common/texture/".Length ).StartsWith( 'd', 'e', 'c', 'a', 'l', '_', 'f', 'a', 'c', 'e' ) )
{
@ -71,6 +72,19 @@ public partial class PathResolver : IDisposable
return false;
}
private bool HandlePapFile( ResourceType type, Utf8GamePath gamePath, out ModCollection? collection )
{
if( type is ResourceType.Pap or ResourceType.Tmb
&& _animationLoadCollection != null)
{
collection = _animationLoadCollection;
return true;
}
collection = null;
return false;
}
public void Enable()
{
if( Enabled )