mirror of https://github.com/hykilpikonna/AquaDX
[+] SinglePlayer support legacy game versions
Build AquaMai / build (push) Has been cancelled
Details
Build AquaMai / build (push) Has been cancelled
Details
parent
906bdfa15e
commit
c074de5876
|
@ -36,6 +36,7 @@ public static class GuiSizes
|
|||
GUI.backgroundColor = backgroundColor;
|
||||
}
|
||||
|
||||
[HarmonyPatch]
|
||||
public class BoxBackground
|
||||
{
|
||||
public static IEnumerable<MethodBase> TargetMethods()
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using MAI2.Util;
|
||||
using Manager;
|
||||
|
@ -14,14 +16,23 @@ namespace AquaMai.UX
|
|||
// Note: this is not my original work. I simply interpreted the code and rewrote it as a mod.
|
||||
public class SinglePlayer
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(Main.GameMain), "LateInitialize", new Type[] { typeof(MonoBehaviour), typeof(Transform), typeof(Transform) })]
|
||||
public static void LateInitialize(MonoBehaviour gameMainObject, ref Transform left, ref Transform right)
|
||||
[HarmonyPatch]
|
||||
public class WhateverInitialize
|
||||
{
|
||||
public static IEnumerable<MethodBase> TargetMethods()
|
||||
{
|
||||
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]
|
||||
[HarmonyPatch(typeof(MeshButton), "IsPointInPolygon", new Type[] { typeof(Vector2[]), typeof(Vector2) })]
|
||||
|
|
Loading…
Reference in New Issue