mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-12 13:27:28 +08:00
[+] toggle the display of self-made charts
This commit is contained in:
34
AquaMai/Helpers/MusicDirHelper.cs
Normal file
34
AquaMai/Helpers/MusicDirHelper.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using HarmonyLib;
|
||||
using Manager;
|
||||
using MelonLoader;
|
||||
|
||||
namespace AquaMai.Helpers;
|
||||
|
||||
public class MusicDirHelper
|
||||
{
|
||||
private static Dictionary<int, string> _map = new();
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(Manager.MaiStudio.Serialize.MusicData), "AddPath")]
|
||||
private static void AddPath(Manager.MaiStudio.Serialize.MusicData __instance, string parentPath)
|
||||
{
|
||||
_map[__instance.GetID()] = parentPath;
|
||||
}
|
||||
|
||||
public static string LookupPath(int id)
|
||||
{
|
||||
return _map.GetValueOrDefault(id);
|
||||
}
|
||||
|
||||
public static string LookupPath(Manager.MaiStudio.Serialize.MusicData musicData)
|
||||
{
|
||||
return LookupPath(musicData.GetID());
|
||||
}
|
||||
|
||||
public static string LookupPath(Manager.MaiStudio.MusicData musicData)
|
||||
{
|
||||
return LookupPath(musicData.GetID());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user