mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-13 21:57:26 +08:00
[F] LoadJacketPng and RandomBgm crash when LocalAssets not exists
This commit is contained in:
@@ -18,6 +18,7 @@ namespace AquaMai.UX
|
||||
[HarmonyPatch(typeof(SoundManager), "Initialize")]
|
||||
public static void Init()
|
||||
{
|
||||
if (!Directory.Exists(Path.Combine(Environment.CurrentDirectory, "LocalAssets", "Mai2Cue"))) return;
|
||||
var files = Directory.EnumerateFiles(Path.Combine(Environment.CurrentDirectory, "LocalAssets", "Mai2Cue"));
|
||||
foreach (var file in files)
|
||||
{
|
||||
@@ -34,6 +35,7 @@ namespace AquaMai.UX
|
||||
public static void PrePlay(ref SoundManager.AcbID acbID, int cueID)
|
||||
{
|
||||
if (acbID != SoundManager.AcbID.Default) return;
|
||||
if (_acbs.Count == 0) return;
|
||||
var cueIndex = (Cue)cueID;
|
||||
switch (cueIndex)
|
||||
{
|
||||
@@ -69,4 +71,4 @@ namespace AquaMai.UX
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user