diff --git a/AquaMai/AquaMai.csproj b/AquaMai/AquaMai.csproj
index 74d23044..14c15867 100644
--- a/AquaMai/AquaMai.csproj
+++ b/AquaMai/AquaMai.csproj
@@ -292,7 +292,6 @@ DEBUG
-
@@ -308,15 +307,14 @@ DEBUG
+
+
-
-
-
True
True
@@ -339,6 +337,7 @@ DEBUG
+
@@ -354,6 +353,7 @@ DEBUG
+
@@ -374,9 +374,6 @@ DEBUG
-
-
-
diff --git a/AquaMai/Config.cs b/AquaMai/Config.cs
index 6c21f836..6c4eb180 100644
--- a/AquaMai/Config.cs
+++ b/AquaMai/Config.cs
@@ -39,6 +39,8 @@ namespace AquaMai
public bool TestProof { get; set; }
public bool HideSelfMadeCharts { get; set; }
public bool CustomFont { get; set; }
+ public bool CustomNoteSkin { get; set; }
+ public bool TrackStartProcessTweak { get; set; }
public string CustomVersionString { get; set; } = "";
public string CustomPlaceName { get; set; } = "";
public string ExecOnIdle { get; set; } = "";
@@ -55,6 +57,7 @@ namespace AquaMai
public int ExtendNotesPool { get; set; }
public bool FrameRateLock { get; set; }
public bool FontFix { get; set; }
+ public bool SlideJudgeTweak { get; set; }
}
public class UtilsConfig
diff --git a/AquaMai/RenderTweak/SlideAutoPlayTweak.cs b/AquaMai/Fix/SlideAutoPlayTweak.cs
similarity index 98%
rename from AquaMai/RenderTweak/SlideAutoPlayTweak.cs
rename to AquaMai/Fix/SlideAutoPlayTweak.cs
index 17017b6f..1e3b1916 100644
--- a/AquaMai/RenderTweak/SlideAutoPlayTweak.cs
+++ b/AquaMai/Fix/SlideAutoPlayTweak.cs
@@ -3,14 +3,14 @@ using HarmonyLib;
using Manager;
using Monitor;
-namespace AquaMai.RenderTweak;
+namespace AquaMai.Fix;
public class SlideAutoPlayTweak
{
/* 这个 Patch 用于修复以下 bug:
* SlideFan 在 AutoPlay 时, 只有第一个箭头会消失
* 原 method 逻辑如下:
- *
+ *
* if (this.IsNoteCheckTimeStartIgnoreJudgeWait())
* {
* // do something ...
@@ -34,7 +34,7 @@ public class SlideAutoPlayTweak
* }
* // do something ...
* }
- *
+ *
* 导致这个 bug 的原因是 else 分支的 for 循环终止条件写错了, 应该是 11.0 (因为有 11 个箭头), SBGA 写成了 1.0
* 这个 method 中一共只有 5 处 ldc.r4 的 IL Code, 依次为 10.0, 11.0, 1.0, 1.0, 0.0
* 修复 bug 需要把第三处的 1.0 更改为 11.0, 这里使用 Transpiler 解决
@@ -61,7 +61,7 @@ public class SlideAutoPlayTweak
}
return instList;
}
-
+
/* 这个 Patch 让 Slide 在 AutoPlay 的时候, 每个区仍然会分按下和松开两段进行推进 (加上 this._hitIn 的变化)
* 原 method 逻辑如下:
*
@@ -98,5 +98,5 @@ public class SlideAutoPlayTweak
____hitIn = ____hitAreaList.Count * prop > ____hitIndex + 0.5f;
}
}
-
-}
\ No newline at end of file
+
+}
diff --git a/AquaMai/RenderTweak/SlideJudgeTweak.cs b/AquaMai/Fix/SlideJudgeTweak.cs
similarity index 98%
rename from AquaMai/RenderTweak/SlideJudgeTweak.cs
rename to AquaMai/Fix/SlideJudgeTweak.cs
index 25377a11..d0a8a546 100644
--- a/AquaMai/RenderTweak/SlideJudgeTweak.cs
+++ b/AquaMai/Fix/SlideJudgeTweak.cs
@@ -5,7 +5,7 @@ using Monitor;
using Process;
using UnityEngine;
-namespace AquaMai.RenderTweak;
+namespace AquaMai.Fix;
public class SlideJudgeTweak
{
@@ -60,7 +60,7 @@ public class SlideJudgeTweak
}
}
}
-
+
/*
* 这个 Patch 让 Wifi Slide 的判定显示有上下的区别 (原本所有 Wifi 的判定显示都是朝向圆心的), 就像 majdata 里那样
* 这个 bug 产生的原因是 SBGA 忘记给 Wifi 的 EndButtonId 赋值了
@@ -86,4 +86,4 @@ public class SlideJudgeTweak
}
}
}
-}
\ No newline at end of file
+}
diff --git a/AquaMai/Main.cs b/AquaMai/Main.cs
index 97910f59..935a0c88 100644
--- a/AquaMai/Main.cs
+++ b/AquaMai/Main.cs
@@ -4,10 +4,8 @@ using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
-using AquaMai.CustomSkin;
using AquaMai.Fix;
using AquaMai.Helpers;
-using AquaMai.RenderTweak;
using AquaMai.Resources;
using AquaMai.Utils;
using AquaMai.UX;
@@ -160,19 +158,14 @@ namespace AquaMai
Patch(typeof(ExtendNotesPool));
Patch(typeof(FixCheckAuth));
Patch(typeof(DebugFeature));
+ Patch(typeof(FixConnSlide));
+ Patch(typeof(SlideAutoPlayTweak));
// UX
Patch(typeof(CustomVersionString));
Patch(typeof(CustomPlaceName));
Patch(typeof(RunCommandOnEvents));
// Utils
Patch(typeof(JudgeAdjust));
-
- // My Patches
- Patch(typeof(CustomNoteSkin));
- Patch(typeof(SlideAutoPlayTweak));
- Patch(typeof(TrackStartProcessTweak));
- Patch(typeof(SlideJudgeTweak));
- Patch(typeof(FixConnSlide));
# if DEBUG
Patch(typeof(LogNetworkErrors));
# endif
diff --git a/AquaMai/CustomSkin/CustomNoteSkin.cs b/AquaMai/UX/CustomNoteSkin.cs
similarity index 98%
rename from AquaMai/CustomSkin/CustomNoteSkin.cs
rename to AquaMai/UX/CustomNoteSkin.cs
index 24b0b891..603077d5 100644
--- a/AquaMai/CustomSkin/CustomNoteSkin.cs
+++ b/AquaMai/UX/CustomNoteSkin.cs
@@ -1,7 +1,6 @@
using System;
-using System.IO;
using System.Collections.Generic;
-using System.Reflection;
+using System.IO;
using HarmonyLib;
using MelonLoader;
using Monitor;
@@ -9,13 +8,13 @@ using Monitor.Game;
using Process;
using UnityEngine;
-namespace AquaMai.CustomSkin;
+namespace AquaMai.UX;
public class CustomNoteSkin
{
private static readonly List ImageExts = [".jpg", ".png", ".jpeg"];
private static readonly List SlideFanFields = ["_normalSlideFan", "_eachSlideFan", "_breakSlideFan", "_breakSlideFanEff"];
-
+
private static Sprite customOutline;
private static Sprite[,] customSlideFan = new Sprite[4, 11];
@@ -28,7 +27,7 @@ public class CustomNoteSkin
MelonLogger.Msg($"[CustomNoteSkin] Cannot found field {fieldName}");
return false;
}
-
+
var fieldType = fieldTraverse.GetValueType();
if (!idx1.HasValue)
{
@@ -83,19 +82,19 @@ public class CustomNoteSkin
return true;
}
-
+
[HarmonyPostfix]
[HarmonyPatch(typeof(GameNotePrefabContainer), "Initialize")]
private static void LoadNoteSkin()
{
if (!Directory.Exists(Path.Combine(Environment.CurrentDirectory, "Skins"))) return;
-
+
foreach (var laFile in Directory.EnumerateFiles(Path.Combine(Environment.CurrentDirectory, "Skins")))
{
if (!ImageExts.Contains(Path.GetExtension(laFile).ToLowerInvariant())) continue;
var texture = new Texture2D(1, 1, TextureFormat.RGBA32, false);
texture.LoadImage(File.ReadAllBytes(laFile));
-
+
var name = Path.GetFileNameWithoutExtension(laFile);
var args = name.Split('_');
// 文件名的格式是 XXXXXXXX_A_B 表示 GameNoteImageContainer._XXXXXXXX[A, B]
@@ -105,7 +104,7 @@ public class CustomNoteSkin
int? idx2 = (args.Length < 3)? null : (int.TryParse(args[2], out temp) ? temp : null);
Traverse traverse;
-
+
if (fieldName == "_outline")
{
customOutline = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f), 1f);
@@ -140,14 +139,14 @@ public class CustomNoteSkin
0, SpriteMeshType.Tight, target.sprite.border
);
target.sprite = custom;
-
+
traverse = Traverse.Create(GameNotePrefabContainer.TouchTapC);
noticeObject = traverse.Field("NoticeObject").Value;
noticeObject.GetComponent().sprite = custom;
MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}");
continue;
}
-
+
if (fieldName == "_touchHold")
{
if (!idx1.HasValue)
@@ -170,7 +169,7 @@ public class CustomNoteSkin
MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}");
continue;
}
-
+
if (fieldName == "_normalTouchBorder")
{
if (!idx1.HasValue)
@@ -192,7 +191,7 @@ public class CustomNoteSkin
MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}");
continue;
}
-
+
if (fieldName == "_eachTouchBorder")
{
if (!idx1.HasValue)
@@ -214,14 +213,14 @@ public class CustomNoteSkin
MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}");
continue;
}
-
+
if (LoadIntoGameNoteImageContainer(fieldName, idx1, idx2, texture))
{
MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}");
}
}
}
-
+
[HarmonyPostfix]
[HarmonyPatch(typeof(GameCtrl), "Initialize")]
private static void ChangeOutlineTexture(GameObject ____guideEndPointObj)
@@ -231,7 +230,7 @@ public class CustomNoteSkin
____guideEndPointObj.GetComponent().sprite = customOutline;
}
}
-
+
[HarmonyPostfix]
[HarmonyPatch(typeof(SlideFan), "Initialize")]
private static void ChangeFanTexture(
@@ -251,7 +250,7 @@ public class CustomNoteSkin
position = ____spriteLines[2 * i].transform.localPosition;
____spriteLines[2 * i].transform.localPosition = new Vector3(0, position.y, position.z);
____spriteLines[2 * i].color = Color.white;
-
+
____spriteLines[2 * i + 1].sprite = sprite;
position = ____spriteLines[2 * i + 1].transform.localPosition;
____spriteLines[2 * i + 1].transform.localPosition = new Vector3(0, position.y, position.z);
@@ -264,7 +263,7 @@ public class CustomNoteSkin
position = ____effectSprites[2 * i].transform.localPosition;
____effectSprites[2 * i].transform.localPosition = new Vector3(0, position.y, position.z);
____effectSprites[2 * i].color = Color.white;
-
+
____effectSprites[2 * i + 1].sprite = sprite;
position = ____effectSprites[2 * i + 1].transform.localPosition;
____effectSprites[2 * i + 1].transform.localPosition = new Vector3(0, position.y, position.z);
@@ -283,7 +282,7 @@ public class CustomNoteSkin
position = ____spriteLines[2 * i].transform.localPosition;
____spriteLines[2 * i].transform.localPosition = new Vector3(0, position.y, position.z);
____spriteLines[2 * i].color = Color.white;
-
+
____spriteLines[2 * i + 1].sprite = sprite;
position = ____spriteLines[2 * i + 1].transform.localPosition;
____spriteLines[2 * i + 1].transform.localPosition = new Vector3(0, position.y, position.z);
@@ -302,7 +301,7 @@ public class CustomNoteSkin
position = ____spriteLines[2 * i].transform.localPosition;
____spriteLines[2 * i].transform.localPosition = new Vector3(0, position.y, position.z);
____spriteLines[2 * i].color = Color.white;
-
+
____spriteLines[2 * i + 1].sprite = sprite;
position = ____spriteLines[2 * i + 1].transform.localPosition;
____spriteLines[2 * i + 1].transform.localPosition = new Vector3(0, position.y, position.z);
@@ -311,4 +310,4 @@ public class CustomNoteSkin
}
}
}
-}
\ No newline at end of file
+}
diff --git a/AquaMai/RenderTweak/TrackStartProcessTweak.cs b/AquaMai/UX/TrackStartProcessTweak.cs
similarity index 99%
rename from AquaMai/RenderTweak/TrackStartProcessTweak.cs
rename to AquaMai/UX/TrackStartProcessTweak.cs
index d547f595..a16655d4 100644
--- a/AquaMai/RenderTweak/TrackStartProcessTweak.cs
+++ b/AquaMai/UX/TrackStartProcessTweak.cs
@@ -4,7 +4,7 @@ using Process;
using UI;
using UnityEngine;
-namespace AquaMai.RenderTweak;
+namespace AquaMai.UX;
public class TrackStartProcessTweak
{
@@ -80,4 +80,4 @@ public class TrackStartProcessTweak
____musicTabObj[1].gameObject.SetActive(false);
____musicTabObj[2].gameObject.SetActive(false);
}
-}
\ No newline at end of file
+}