mirror of https://github.com/hykilpikonna/AquaDX
[+] Load jacket with higher resolution
parent
0f701ad2d3
commit
8b72214780
|
@ -18,7 +18,7 @@ namespace AquaMai.UX
|
|||
return new[] { AM.GetMethod("GetJacketThumbTexture2D", new[] { typeof(string) }), AM.GetMethod("GetJacketTexture2D", new[] { typeof(string) }) };
|
||||
}
|
||||
|
||||
public static bool Prefix(string filename, ref Texture2D __result)
|
||||
public static bool Prefix(string filename, ref Texture2D __result, AssetManager __instance)
|
||||
{
|
||||
var matches = Regex.Matches(filename, @"UI_Jacket_(\d+)(_s)?\.png");
|
||||
if (matches.Count < 1)
|
||||
|
@ -36,12 +36,17 @@ namespace AquaMai.UX
|
|||
}
|
||||
|
||||
var localPath = Path.Combine(Environment.CurrentDirectory, "LocalAssets", filename);
|
||||
if (!File.Exists(localPath)) return true;
|
||||
|
||||
if (File.Exists(localPath))
|
||||
{
|
||||
__result = new Texture2D(1, 1);
|
||||
ImageConversion.LoadImage(__result, File.ReadAllBytes(localPath));
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
__result = __instance.LoadAsset<Texture2D>($"Jacket/UI_Jacket_{id}.png");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue