Change most things to new byte strings, introduce new ResourceLoader and Logger fully.

This commit is contained in:
Ottermandias 2022-03-06 16:45:16 +01:00
parent 5d77cd5514
commit f5fccb0235
55 changed files with 2681 additions and 2730 deletions

View file

@ -36,7 +36,7 @@ public class ModsController : WebApiController
public object GetFiles()
{
return Penumbra.ModManager.Collections.CurrentCollection.Cache?.ResolvedFiles.ToDictionary(
o => ( string )o.Key,
o => o.Key.ToString(),
o => o.Value.FullName
)
?? new Dictionary< string, string >();

View file

@ -5,6 +5,7 @@ using System.Reflection;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Logging;
using Lumina.Data;
using Penumbra.GameData.ByteString;
using Penumbra.GameData.Enums;
using Penumbra.GameData.Util;
using Penumbra.Mods;
@ -78,16 +79,15 @@ public class PenumbraApi : IDisposable, IPenumbraApi
private static string ResolvePath( string path, ModManager manager, ModCollection collection )
{
if( !Penumbra.Config.IsEnabled )
if( !Penumbra.Config.EnableMods )
{
return path;
}
var gamePath = new GamePath( path );
var gamePath = Utf8GamePath.FromString( path, out var p, true ) ? p : Utf8GamePath.Empty;
var ret = collection.Cache?.ResolveSwappedOrReplacementPath( gamePath );
ret ??= manager.Collections.ForcedCollection.Cache?.ResolveSwappedOrReplacementPath( gamePath );
ret ??= path;
return ret;
return ret?.ToString() ?? path;
}
public string ResolvePath( string path )