mirror of https://github.com/hykilpikonna/AquaDX
[F] LoadJacketPng and RandomBgm crash when LocalAssets not exists
parent
84c59e2c8b
commit
9f57d393bf
|
@ -59,12 +59,13 @@ namespace AquaMai.UX
|
|||
}
|
||||
}
|
||||
|
||||
foreach (var laFile in Directory.EnumerateFiles(Path.Combine(Environment.CurrentDirectory, "LocalAssets")))
|
||||
{
|
||||
var match = localAssetsJacketExt.Match(Path.GetFileName(laFile));
|
||||
if (!match.Success) continue;
|
||||
jacketPaths[match.Groups[1].Value] = laFile;
|
||||
}
|
||||
if (Directory.Exists(Path.Combine(Environment.CurrentDirectory, "LocalAssets")))
|
||||
foreach (var laFile in Directory.EnumerateFiles(Path.Combine(Environment.CurrentDirectory, "LocalAssets")))
|
||||
{
|
||||
var match = localAssetsJacketExt.Match(Path.GetFileName(laFile));
|
||||
if (!match.Success) continue;
|
||||
jacketPaths[match.Groups[1].Value] = laFile;
|
||||
}
|
||||
|
||||
MelonLogger.Msg($"Loaded {jacketPaths.Count} custom jacket images.");
|
||||
}
|
||||
|
|
|
@ -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
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue