Commit b2ce24c3 authored by SherryChaos's avatar SherryChaos

revert CardImageLoader.cs

parent 7bc5d9bb
...@@ -90,7 +90,7 @@ namespace MDPro3.Utility ...@@ -90,7 +90,7 @@ namespace MDPro3.Utility
Interlocked.Increment(ref entry.ReferenceCount); Interlocked.Increment(ref entry.ReferenceCount);
entry.IsPersistent |= persistent; entry.IsPersistent |= persistent;
} }
else if (!HasOverFrameArtFile(code)) else
Debug.LogError($"Art texture is null for code {code}"); Debug.LogError($"Art texture is null for code {code}");
return entry.Texture; return entry.Texture;
...@@ -115,7 +115,7 @@ namespace MDPro3.Utility ...@@ -115,7 +115,7 @@ namespace MDPro3.Utility
cachedArts.TryRemove(code, out _); cachedArts.TryRemove(code, out _);
throw ex; throw ex;
} }
if (newEntry.Texture == null && !HasOverFrameArtFile(code)) if (newEntry.Texture == null)
Debug.LogError($"{code} art is null"); Debug.LogError($"{code} art is null");
newEntry.LoadingTask = null; newEntry.LoadingTask = null;
...@@ -288,7 +288,6 @@ namespace MDPro3.Utility ...@@ -288,7 +288,6 @@ namespace MDPro3.Utility
cachedCardNames.Clear(); cachedCardNames.Clear();
ClearArtVideos(); ClearArtVideos();
knownOverFrameArts.Clear();
} }
#endregion #endregion
...@@ -324,7 +323,7 @@ namespace MDPro3.Utility ...@@ -324,7 +323,7 @@ namespace MDPro3.Utility
} }
if (art == null) if (art == null)
{ {
lastCardFoundArt = HasOverFrameArtFile(code); lastCardFoundArt = false;
return null; return null;
} }
...@@ -426,8 +425,7 @@ namespace MDPro3.Utility ...@@ -426,8 +425,7 @@ namespace MDPro3.Utility
if (art == null) if (art == null)
{ {
if (!HasOverFrameArtFile(data.Id)) Debug.LogError($"Get null from ArtLoad for Card {data.Id}:");
Debug.LogError($"Get null from ArtLoad for Card {data.Id}:");
art = TextureManager.container.unknownArt.texture; art = TextureManager.container.unknownArt.texture;
} }
...@@ -473,8 +471,7 @@ namespace MDPro3.Utility ...@@ -473,8 +471,7 @@ namespace MDPro3.Utility
if (art == null) if (art == null)
{ {
if (!HasOverFrameArtFile(data.Id)) Debug.LogError($"Get null from ArtLoad for Card {data.Id}:");
Debug.LogError($"Get null from ArtLoad for Card {data.Id}:");
art = TextureManager.container.unknownArt.texture; art = TextureManager.container.unknownArt.texture;
} }
...@@ -636,30 +633,6 @@ namespace MDPro3.Utility ...@@ -636,30 +633,6 @@ namespace MDPro3.Utility
#region Art File List Cache #region Art File List Cache
private static bool HasOverFrameArtFile(int code)
{
if (knownOverFrameArts.ContainsKey(code))
return true;
var fileName = code + Program.EXPANSION_PNG;
#if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS)
var overFramePath = Path.Combine(Application.persistentDataPath, "Picture", "OverFrame", fileName);
var overframePath = Path.Combine(Application.persistentDataPath, "Picture", "Overframe", fileName);
#elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX
var overFramePath = Path.Combine(Environment.CurrentDirectory, "Picture", "OverFrame", fileName);
var overframePath = Path.Combine(Environment.CurrentDirectory, "Picture", "Overframe", fileName);
#else
var overFramePath = Path.Combine(Environment.CurrentDirectory, "Picture", "OverFrame", fileName);
var overframePath = Path.Combine(Environment.CurrentDirectory, "Picture", "Overframe", fileName);
#endif
var exists = File.Exists(overFramePath) || File.Exists(overframePath);
if (exists)
knownOverFrameArts.TryAdd(code, 0);
return exists;
}
private static readonly List<int> artFileList = new(); private static readonly List<int> artFileList = new();
private static readonly Dictionary<int, string> artAltFileList = new(); private static readonly Dictionary<int, string> artAltFileList = new();
private static bool artFileListInitialized; private static bool artFileListInitialized;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment