mirror of
https://github.com/MewoLab/AquaDX.git
synced 2025-10-26 04:22:38 +00:00
[F] LoadJacketPng and RandomBgm crash when LocalAssets not exists
This commit is contained in:
parent
84c59e2c8b
commit
9f57d393bf
@ -59,12 +59,13 @@ namespace AquaMai.UX
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var laFile in Directory.EnumerateFiles(Path.Combine(Environment.CurrentDirectory, "LocalAssets")))
|
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;
|
var match = localAssetsJacketExt.Match(Path.GetFileName(laFile));
|
||||||
jacketPaths[match.Groups[1].Value] = laFile;
|
if (!match.Success) continue;
|
||||||
}
|
jacketPaths[match.Groups[1].Value] = laFile;
|
||||||
|
}
|
||||||
|
|
||||||
MelonLogger.Msg($"Loaded {jacketPaths.Count} custom jacket images.");
|
MelonLogger.Msg($"Loaded {jacketPaths.Count} custom jacket images.");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ namespace AquaMai.UX
|
|||||||
[HarmonyPatch(typeof(SoundManager), "Initialize")]
|
[HarmonyPatch(typeof(SoundManager), "Initialize")]
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
if (!Directory.Exists(Path.Combine(Environment.CurrentDirectory, "LocalAssets", "Mai2Cue"))) return;
|
||||||
var files = Directory.EnumerateFiles(Path.Combine(Environment.CurrentDirectory, "LocalAssets", "Mai2Cue"));
|
var files = Directory.EnumerateFiles(Path.Combine(Environment.CurrentDirectory, "LocalAssets", "Mai2Cue"));
|
||||||
foreach (var file in files)
|
foreach (var file in files)
|
||||||
{
|
{
|
||||||
@ -34,6 +35,7 @@ namespace AquaMai.UX
|
|||||||
public static void PrePlay(ref SoundManager.AcbID acbID, int cueID)
|
public static void PrePlay(ref SoundManager.AcbID acbID, int cueID)
|
||||||
{
|
{
|
||||||
if (acbID != SoundManager.AcbID.Default) return;
|
if (acbID != SoundManager.AcbID.Default) return;
|
||||||
|
if (_acbs.Count == 0) return;
|
||||||
var cueIndex = (Cue)cueID;
|
var cueIndex = (Cue)cueID;
|
||||||
switch (cueIndex)
|
switch (cueIndex)
|
||||||
{
|
{
|
||||||
@ -69,4 +71,4 @@ namespace AquaMai.UX
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user