AquaDX/AquaMai/Main.cs

57 lines
1.7 KiB
C#
Raw Normal View History

2024-02-07 15:38:36 +08:00
using AquaMai.UX;
using MelonLoader;
2024-02-07 17:06:58 +08:00
using Tomlet;
2024-02-07 13:45:47 +08:00
namespace AquaMai
{
public static class BuildInfo
{
public const string Name = "AquaMai";
public const string Description = "Mod for Sinmai";
public const string Author = "Aza";
public const string Company = null;
public const string Version = "1.0.0";
public const string DownloadLink = null;
}
public class AquaMai : MelonMod
{
2024-02-07 15:38:36 +08:00
public static Config AppConfig { get; private set; }
public override void OnInitializeMelon()
2024-02-07 13:45:47 +08:00
{
2024-02-07 16:53:13 +08:00
MelonLogger.Msg("Loading mod settings...");
2024-02-07 17:06:58 +08:00
// Check if AquaMai.toml exists
if (!System.IO.File.Exists("AquaMai.toml"))
{
MelonLogger.Error("AquaMai.toml not found! Please create it.");
return;
}
2024-02-07 17:06:58 +08:00
// Read AquaMai.toml to load settings
AppConfig = TomletMain.To<Config>(System.IO.File.ReadAllText("AquaMai.toml"));
2024-02-07 15:38:36 +08:00
if (AppConfig.UX.SkipWarningScreen)
{
2024-02-07 16:56:07 +08:00
MelonLogger.Msg("> Patching SkipWarningScreen");
2024-02-07 15:38:36 +08:00
HarmonyLib.Harmony.CreateAndPatchAll(typeof(SkipWarningScreen));
}
2024-02-07 16:53:13 +08:00
if (AppConfig.UX.SinglePlayer)
{
MelonLogger.Msg("> Patching SinglePlayer");
HarmonyLib.Harmony.CreateAndPatchAll(typeof(SinglePlayer));
}
if (AppConfig.UX.SkipToMusicSelection)
{
MelonLogger.Msg($"> Patching {nameof(SkipToMusicSelection)}");
HarmonyLib.Harmony.CreateAndPatchAll(typeof(SkipToMusicSelection));
}
2024-02-07 16:53:13 +08:00
MelonLogger.Msg("Loaded!");
2024-02-07 13:45:47 +08:00
}
}
}