Merge branch 'main' of https://github.com/Penumbra-Sync/client
This commit is contained in:
@@ -188,6 +188,17 @@ public class CharacterDataFactory
|
|||||||
|
|
||||||
AddReplacementsFromTexture(texPath, objectKind, cache, inheritanceLevel + 1);
|
AddReplacementsFromTexture(texPath, objectKind, cache, inheritanceLevel + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var shpkPath = "shader/sm5/shpk/" + new Utf8String(mtrlResourceHandle->ShpkString).ToString();
|
||||||
|
Logger.Verbose("Checking File Replacement for Shader " + shpkPath);
|
||||||
|
AddReplacementsFromShader(shpkPath, objectKind, cache, inheritanceLevel + 1);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Logger.Verbose("Could not find shpk for Material " + fileName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddReplacement(string varPath, ObjectKind objectKind, CharacterData cache, int inheritanceLevel = 0, bool doNotReverseResolve = false)
|
private void AddReplacement(string varPath, ObjectKind objectKind, CharacterData cache, int inheritanceLevel = 0, bool doNotReverseResolve = false)
|
||||||
@@ -208,6 +219,23 @@ public class CharacterDataFactory
|
|||||||
cache.AddFileReplacement(objectKind, variousReplacement);
|
cache.AddFileReplacement(objectKind, variousReplacement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void AddReplacementsFromShader(string shpkPath, ObjectKind objectKind, CharacterData cache, int inheritanceLevel = 0)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(shpkPath)) return;
|
||||||
|
|
||||||
|
if (cache.FileReplacements.ContainsKey(objectKind))
|
||||||
|
{
|
||||||
|
if (cache.FileReplacements[objectKind].Any(c => c.GamePaths.Contains(shpkPath, StringComparer.Ordinal)))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var shpkFileReplacement = CreateFileReplacement(shpkPath, true);
|
||||||
|
DebugPrint(shpkFileReplacement, objectKind, "Shader", inheritanceLevel);
|
||||||
|
cache.AddFileReplacement(objectKind, shpkFileReplacement);
|
||||||
|
}
|
||||||
|
|
||||||
private void AddReplacementsFromTexture(string texPath, ObjectKind objectKind, CharacterData cache, int inheritanceLevel = 0, bool doNotReverseResolve = true)
|
private void AddReplacementsFromTexture(string texPath, ObjectKind objectKind, CharacterData cache, int inheritanceLevel = 0, bool doNotReverseResolve = true)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(texPath)) return;
|
if (string.IsNullOrEmpty(texPath)) return;
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ public class PeriodicFileScanner : IDisposable
|
|||||||
}
|
}
|
||||||
|
|
||||||
Logger.Debug("Getting files from " + penumbraDir + " and " + _pluginConfiguration.CacheFolder);
|
Logger.Debug("Getting files from " + penumbraDir + " and " + _pluginConfiguration.CacheFolder);
|
||||||
string[] ext = { ".mdl", ".tex", ".mtrl", ".tmb", ".pap", ".avfx", ".atex", ".sklb", ".eid", ".phyb", ".scd", ".skp" };
|
string[] ext = { ".mdl", ".tex", ".mtrl", ".tmb", ".pap", ".avfx", ".atex", ".sklb", ".eid", ".phyb", ".scd", ".skp", ".shpk" };
|
||||||
|
|
||||||
var scannedFiles = new ConcurrentDictionary<string, bool>(Directory.EnumerateFiles(penumbraDir, "*.*", SearchOption.AllDirectories)
|
var scannedFiles = new ConcurrentDictionary<string, bool>(Directory.EnumerateFiles(penumbraDir, "*.*", SearchOption.AllDirectories)
|
||||||
.Select(s => s.ToLowerInvariant())
|
.Select(s => s.ToLowerInvariant())
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class TransientResourceManager : IDisposable
|
|||||||
|
|
||||||
public event TransientResourceLoadedEvent? TransientResourceLoaded;
|
public event TransientResourceLoadedEvent? TransientResourceLoaded;
|
||||||
public IntPtr[] PlayerRelatedPointers = Array.Empty<IntPtr>();
|
public IntPtr[] PlayerRelatedPointers = Array.Empty<IntPtr>();
|
||||||
private readonly string[] FileTypesToHandle = new[] { "tmb", "pap", "avfx", "atex", "sklb", "eid", "phyb", "scd", "skp" };
|
private readonly string[] FileTypesToHandle = new[] { "tmb", "pap", "avfx", "atex", "sklb", "eid", "phyb", "scd", "skp", "shpk" };
|
||||||
private string PersistentDataCache => Path.Combine(configurationDirectory, "PersistentTransientData.lst");
|
private string PersistentDataCache => Path.Combine(configurationDirectory, "PersistentTransientData.lst");
|
||||||
|
|
||||||
private ConcurrentDictionary<IntPtr, HashSet<string>> TransientResources { get; } = new();
|
private ConcurrentDictionary<IntPtr, HashSet<string>> TransientResources { get; } = new();
|
||||||
|
|||||||
Reference in New Issue
Block a user