mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-07 21:57:26 +08:00
[+] SinglePlayer support legacy game versions
This commit is contained in:
@@ -36,6 +36,7 @@ public static class GuiSizes
|
|||||||
GUI.backgroundColor = backgroundColor;
|
GUI.backgroundColor = backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPatch]
|
||||||
public class BoxBackground
|
public class BoxBackground
|
||||||
{
|
{
|
||||||
public static IEnumerable<MethodBase> TargetMethods()
|
public static IEnumerable<MethodBase> TargetMethods()
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using MAI2.Util;
|
using MAI2.Util;
|
||||||
using Manager;
|
using Manager;
|
||||||
@@ -14,13 +16,22 @@ namespace AquaMai.UX
|
|||||||
// Note: this is not my original work. I simply interpreted the code and rewrote it as a mod.
|
// 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]
|
||||||
[HarmonyPatch(typeof(Main.GameMain), "LateInitialize", new Type[] { typeof(MonoBehaviour), typeof(Transform), typeof(Transform) })]
|
public class WhateverInitialize
|
||||||
public static void LateInitialize(MonoBehaviour gameMainObject, ref Transform left, ref Transform right)
|
|
||||||
{
|
{
|
||||||
left.transform.position = Vector3.zero;
|
public static IEnumerable<MethodBase> TargetMethods()
|
||||||
right.localScale = Vector3.zero;
|
{
|
||||||
GameObject.Find("Mask").transform.position = new Vector3(540f, 0f, 0f);
|
var lateInitialize = AccessTools.Method(typeof(Main.GameMain), "LateInitialize", [typeof(MonoBehaviour), typeof(Transform), typeof(Transform)]);
|
||||||
|
if (lateInitialize is not null) return [lateInitialize];
|
||||||
|
return [AccessTools.Method(typeof(Main.GameMain), "Initialize", [typeof(MonoBehaviour), typeof(Transform), typeof(Transform)])];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Prefix(MonoBehaviour gameMainObject, ref Transform left, ref Transform right)
|
||||||
|
{
|
||||||
|
left.transform.position = Vector3.zero;
|
||||||
|
right.localScale = Vector3.zero;
|
||||||
|
GameObject.Find("Mask").transform.position = new Vector3(540f, 0f, 0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
|
|||||||
Reference in New Issue
Block a user