small fixes for waiting

This commit is contained in:
Stanley Dimant
2022-09-03 23:54:26 +02:00
parent 2e3f7aad2b
commit 2f5159cd4b

View File

@@ -146,7 +146,6 @@ public class CharacterDataFactory
return;
}
//Logger.Verbose("Adding File Replacement for Material " + fileName);
var mtrlPath = fileName.Split("|")[2];
if (cache.FileReplacements.ContainsKey(objectKind))
@@ -185,8 +184,6 @@ public class CharacterDataFactory
{
if (varPath.IsNullOrEmpty()) return;
//Logger.Verbose("Adding File Replacement for Texture " + texPath);
if (cache.FileReplacements.ContainsKey(objectKind))
{
if (cache.FileReplacements[objectKind].Any(c => c.GamePaths.Contains(varPath)))
@@ -205,8 +202,6 @@ public class CharacterDataFactory
{
if (string.IsNullOrEmpty(texPath)) return;
//Logger.Verbose("Adding File Replacement for Texture " + texPath);
if (cache.FileReplacements.ContainsKey(objectKind))
{
if (cache.FileReplacements[objectKind].Any(c => c.GamePaths.Contains(texPath)))
@@ -243,7 +238,8 @@ public class CharacterDataFactory
Logger.Verbose("Character is null but it shouldn't be, waiting");
Thread.Sleep(50);
}
//_dalamudUtil.WaitWhileCharacterIsDrawing(charaPointer);
_dalamudUtil.WaitWhileCharacterIsDrawing(charaPointer);
Stopwatch st = Stopwatch.StartNew();
@@ -357,7 +353,11 @@ public class CharacterDataFactory
{
previousData.FileReplacements.Add(objectKind, new());
}
previousData.FileReplacements[objectKind].Add(item);
if (!previousData.FileReplacements[objectKind].Any(k => k.ResolvedPath == item.ResolvedPath))
{
previousData.FileReplacements[objectKind].Add(item);
}
}
transientResourceManager.PersistTransientResources(charaPointer, objectKind, CreateFileReplacement);