Commit 6cfab698 authored by mercury233's avatar mercury233

load expansions/pics

parent 8da46df5
Pipeline #27034 passed with stages
in 55 minutes and 20 seconds
......@@ -89,6 +89,7 @@ public class GameTextureManager
{
if (code == 0) return zero;
if (loadedPicture.TryGetValue(code, out var cached)) return await cached;
var SupportedExtensions = new[] {".png", ".jpg"};
foreach (ZipFile zip in GameZipManager.Zips)
{
......@@ -96,7 +97,7 @@ public class GameTextureManager
continue;
foreach (string file in zip.EntryFileNames)
{
foreach (var extname in new[] { ".png", ".jpg" })
foreach (var extname in SupportedExtensions)
{
var path = $"pics/{code}{extname}";
if (file.ToLower() == path)
......@@ -109,7 +110,18 @@ public class GameTextureManager
}
}
foreach (var extname in new[] {".png", ".jpg"})
foreach (var extname in SupportedExtensions)
{
var path = $"expansions/pics/{code}{extname}";
if (File.Exists(path))
{
var result = UIHelper.GetTexture2DAsync(path);
loadedPicture.Add(code, result);
return await result;
}
}
foreach (var extname in SupportedExtensions)
{
var path = $"picture/card/{code}{extname}";
if (File.Exists(path))
......
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