[+] Mark supported game versions with attributes

This commit is contained in:
Clansty
2024-10-27 23:34:41 +08:00
parent 6bb2685e03
commit ff2ed50dea
9 changed files with 54 additions and 23 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using AquaMai.Attributes;
using HarmonyLib;
using MAI2.Util;
using Manager;
@@ -9,6 +10,7 @@ using UnityEngine;
namespace AquaMai.Fix;
[GameVersion(23000)]
public class ExtendNotesPool
{
[HarmonyPostfix]

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Reflection;
using AquaMai.Attributes;
using HarmonyLib;
using Manager;
using MelonLoader;
@@ -7,12 +8,13 @@ using Monitor;
namespace AquaMai.Fix;
[GameVersion(23000)]
public class FixConnSlide
{
/* 这个 Patch 用于修复以下 bug:
* 非 ConnSlide 被错误解析为 ConnSlide (Fes 首日刹那旅程爆机 bug)
* 原 method 逻辑如下:
*
*
* if (this.IsSlideAll(noteData1.type) && (index1 + 1 < this._note._noteData.Count ? 1 : 0) != 0)
* {
* int targetNote = noteData1.slideData.targetNote;
@@ -31,7 +33,7 @@ public class FixConnSlide
* }
* }
* }
*
*
* 修复 bug 需要把第二次调用 this.IsSlideAll() 更改为 this.IsConnectNote(), 这里使用 Transpiler 解决
*/
[HarmonyTranspiler]
@@ -42,7 +44,7 @@ public class FixConnSlide
bool found = false;
MethodInfo methodIsSlideAll = AccessTools.Method(typeof(NotesReader), "IsSlideAll");
MethodInfo methodIsConnectNote = AccessTools.Method(typeof(NotesReader), "IsConnectNote");
for (int i = 0; i < instList.Count; i++)
{
CodeInstruction inst = instList[i];
@@ -61,4 +63,4 @@ public class FixConnSlide
}
return instList;
}
}
}

View File

@@ -1,4 +1,5 @@
using HarmonyLib;
using AquaMai.Attributes;
using HarmonyLib;
using MAI2.Util;
using Manager;
using Monitor;
@@ -7,6 +8,7 @@ using UnityEngine;
namespace AquaMai.Fix;
[GameVersion(24000)]
public class FixLevelDisplay
{
[HarmonyPostfix]