mirror of https://github.com/hykilpikonna/AquaDX
Merge branch 'master' into tc21/skip-to-music
commit
abe1d3ad29
|
@ -263,7 +263,9 @@
|
|||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Cheat\TicketUnlock.cs" />
|
||||
<Compile Include="Config.cs" />
|
||||
<Compile Include="Fix\FixCharaCrash.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="UX\SinglePlayer.cs" />
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
|
||||
# ===================================
|
||||
# Cheat: You control the buttons you press
|
||||
[Cheat]
|
||||
# Unlock normally event-only tickets
|
||||
TicketUnlock=true
|
||||
|
||||
# ===================================
|
||||
# UX: User Experience Improvements
|
||||
[UX]
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
using Manager.MaiStudio;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace AquaMai.Cheat
|
||||
{
|
||||
/**
|
||||
* Unlock tickets that are typically locked unless a specific event is open.
|
||||
*/
|
||||
public class TicketUnlock
|
||||
{
|
||||
// For any ticket, return the event ID 1 to unlock it
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TicketData), "get_ticketEvent")]
|
||||
public static bool get_ticketEvent(ref StringID __result)
|
||||
{
|
||||
var id = new Manager.MaiStudio.Serialize.StringID
|
||||
{
|
||||
id = 1,
|
||||
str = "無期限常時解放"
|
||||
};
|
||||
|
||||
var sid = new StringID();
|
||||
sid.Init(id);
|
||||
|
||||
__result = sid;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Modify the maxTicketNum to 0
|
||||
// this is because TicketManager.GetTicketData adds the ticket to the list if either
|
||||
// the player owns at least one ticket or the maxTicketNum = 0
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TicketData), "get_maxCount")]
|
||||
public static bool get_maxCount(ref int __result)
|
||||
{
|
||||
__result = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,6 +6,12 @@ namespace AquaMai
|
|||
public class Config
|
||||
{
|
||||
public UXConfig UX { get; set; }
|
||||
public CheatConfig Cheat { get; set; }
|
||||
|
||||
public class CheatConfig
|
||||
{
|
||||
public bool TicketUnlock { get; set; }
|
||||
}
|
||||
|
||||
public class UXConfig
|
||||
{
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
using HarmonyLib;
|
||||
using Process;
|
||||
using Util;
|
||||
|
||||
namespace AquaMai.Fix
|
||||
{
|
||||
/**
|
||||
* Fix character selection crashing because get map color returns null
|
||||
*/
|
||||
public class FixCharaCrash
|
||||
{
|
||||
// Check if the return is null. If it is, make up a color
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(CharacterSelectProces), "GetMapColorData")]
|
||||
public static void GetMapColorData(ref CharacterSelectProces __instance, ref CharacterMapColorData __result)
|
||||
{
|
||||
if (__result != null) return;
|
||||
|
||||
// 1 is a color that definitely exists
|
||||
if (MapMaster.GetSlotData(1) == null)
|
||||
{
|
||||
MapMaster.GetSlotData(1).Load();
|
||||
}
|
||||
__result = MapMaster.GetSlotData(1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,4 +1,7 @@
|
|||
using AquaMai.UX;
|
||||
using System;
|
||||
using AquaMai.Cheat;
|
||||
using AquaMai.Fix;
|
||||
using AquaMai.UX;
|
||||
using MelonLoader;
|
||||
using Tomlet;
|
||||
|
||||
|
@ -18,6 +21,12 @@ namespace AquaMai
|
|||
{
|
||||
public static Config AppConfig { get; private set; }
|
||||
|
||||
private void Patch(Type type)
|
||||
{
|
||||
MelonLogger.Msg($"> Patching {type}");
|
||||
HarmonyLib.Harmony.CreateAndPatchAll(type);
|
||||
}
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
MelonLogger.Msg("Loading mod settings...");
|
||||
|
@ -33,23 +42,24 @@ namespace AquaMai
|
|||
AppConfig = TomletMain.To<Config>(System.IO.File.ReadAllText("AquaMai.toml"));
|
||||
|
||||
if (AppConfig.UX.SkipWarningScreen)
|
||||
{
|
||||
MelonLogger.Msg("> Patching SkipWarningScreen");
|
||||
HarmonyLib.Harmony.CreateAndPatchAll(typeof(SkipWarningScreen));
|
||||
}
|
||||
Patch(typeof(SkipWarningScreen));
|
||||
|
||||
if (AppConfig.UX.SinglePlayer)
|
||||
{
|
||||
MelonLogger.Msg("> Patching SinglePlayer");
|
||||
HarmonyLib.Harmony.CreateAndPatchAll(typeof(SinglePlayer));
|
||||
}
|
||||
Patch(typeof(SinglePlayer));
|
||||
|
||||
if (AppConfig.Cheat.TicketUnlock)
|
||||
Patch(typeof(TicketUnlock));
|
||||
|
||||
|
||||
if (AppConfig.UX.SkipToMusicSelection)
|
||||
{
|
||||
MelonLogger.Msg($"> Patching {nameof(SkipToMusicSelection)}");
|
||||
HarmonyLib.Harmony.CreateAndPatchAll(typeof(SkipToMusicSelection));
|
||||
Patch(typeof(SkipToMusicSelection));
|
||||
}
|
||||
|
||||
// Fixes that does not have side effects
|
||||
// These don't need to be configurable
|
||||
Patch(typeof(FixCharaCrash));
|
||||
|
||||
MelonLogger.Msg("Loaded!");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,15 +2,15 @@ using System;
|
|||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AquaMai.UX
|
||||
namespace AquaMai.UX
|
||||
{
|
||||
// Hides the 2p (right hand side) UI.
|
||||
// Note: this is not my original work. I simply interpreted the code and rewrote it as a mod.
|
||||
public class SinglePlayer
|
||||
public class SinglePlayer
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(Main.GameMain), "LateInitialize", new Type[] { typeof(MonoBehaviour), typeof(Transform), typeof(Transform) })]
|
||||
public static bool LateInitialize(MonoBehaviour gameMainObject, ref Transform left, ref Transform right)
|
||||
public static bool LateInitialize(MonoBehaviour gameMainObject, ref Transform left, ref Transform right)
|
||||
{
|
||||
left.transform.position = Vector3.zero;
|
||||
right.localScale = Vector3.zero;
|
||||
|
|
Loading…
Reference in New Issue