[+] Add options
Build AquaMai / build (SDEZ) (push) Has been cancelled Details
Build AquaMai / build (SDGA145) (push) Has been cancelled Details

pull/56/head
Clansty 2024-10-04 19:38:02 +08:00
parent 2cea66cba5
commit 12724cea56
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
7 changed files with 40 additions and 48 deletions

View File

@ -292,7 +292,6 @@ DEBUG</DefineConstants>
<Compile Include="Config.cs" /> <Compile Include="Config.cs" />
<Compile Include="CustomKeyMap\Enable.cs" /> <Compile Include="CustomKeyMap\Enable.cs" />
<Compile Include="CustomKeyMap\KeyCodeID.cs" /> <Compile Include="CustomKeyMap\KeyCodeID.cs" />
<Compile Include="CustomSkin\CustomNoteSkin.cs" />
<Compile Include="Fix\BasicFix.cs" /> <Compile Include="Fix\BasicFix.cs" />
<Compile Include="Fix\DebugFeature.cs" /> <Compile Include="Fix\DebugFeature.cs" />
<Compile Include="Fix\DisableReboot.cs" /> <Compile Include="Fix\DisableReboot.cs" />
@ -308,15 +307,14 @@ DEBUG</DefineConstants>
<Compile Include="Fix\I18nSingleAssemblyHook.cs" /> <Compile Include="Fix\I18nSingleAssemblyHook.cs" />
<Compile Include="Fix\RemoveEncryption.cs" /> <Compile Include="Fix\RemoveEncryption.cs" />
<Compile Include="Fix\SkipVersionCheck.cs" /> <Compile Include="Fix\SkipVersionCheck.cs" />
<Compile Include="Fix\SlideAutoPlayTweak.cs" />
<Compile Include="Fix\SlideJudgeTweak.cs" />
<Compile Include="Helpers\GuiSizes.cs" /> <Compile Include="Helpers\GuiSizes.cs" />
<Compile Include="Helpers\MessageHelper.cs" /> <Compile Include="Helpers\MessageHelper.cs" />
<Compile Include="Helpers\MusicDirHelper.cs" /> <Compile Include="Helpers\MusicDirHelper.cs" />
<Compile Include="Helpers\SharedInstances.cs" /> <Compile Include="Helpers\SharedInstances.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Main.cs" /> <Compile Include="Main.cs" />
<Compile Include="RenderTweak\SlideAutoPlayTweak.cs" />
<Compile Include="RenderTweak\SlideJudgeTweak.cs" />
<Compile Include="RenderTweak\TrackStartProcessTweak.cs" />
<Compile Include="Resources\Locale.Designer.cs"> <Compile Include="Resources\Locale.Designer.cs">
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
@ -339,6 +337,7 @@ DEBUG</DefineConstants>
<Compile Include="Utils\SelectionDetail.cs" /> <Compile Include="Utils\SelectionDetail.cs" />
<Compile Include="Utils\ShowNetErrorDetail.cs" /> <Compile Include="Utils\ShowNetErrorDetail.cs" />
<Compile Include="UX\CustomFont.cs" /> <Compile Include="UX\CustomFont.cs" />
<Compile Include="UX\CustomNoteSkin.cs" />
<Compile Include="UX\CustomPlaceName.cs" /> <Compile Include="UX\CustomPlaceName.cs" />
<Compile Include="UX\CustomVersionString.cs" /> <Compile Include="UX\CustomVersionString.cs" />
<Compile Include="UX\DemoMaster.cs" /> <Compile Include="UX\DemoMaster.cs" />
@ -354,6 +353,7 @@ DEBUG</DefineConstants>
<Compile Include="UX\RunCommandOnEvents.cs" /> <Compile Include="UX\RunCommandOnEvents.cs" />
<Compile Include="UX\SinglePlayer.cs" /> <Compile Include="UX\SinglePlayer.cs" />
<Compile Include="UX\TestProof.cs" /> <Compile Include="UX\TestProof.cs" />
<Compile Include="UX\TrackStartProcessTweak.cs" />
<Compile Include="WindowState\Enable.cs" /> <Compile Include="WindowState\Enable.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -374,9 +374,6 @@ DEBUG</DefineConstants>
<ItemGroup> <ItemGroup>
<Content Include="FodyWeavers.xml" /> <Content Include="FodyWeavers.xml" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Performance\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="packages\Fody.6.8.1\build\Fody.targets" Condition="Exists('packages\Fody.6.8.1\build\Fody.targets')" /> <Import Project="packages\Fody.6.8.1\build\Fody.targets" Condition="Exists('packages\Fody.6.8.1\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

View File

@ -39,6 +39,8 @@ namespace AquaMai
public bool TestProof { get; set; } public bool TestProof { get; set; }
public bool HideSelfMadeCharts { get; set; } public bool HideSelfMadeCharts { get; set; }
public bool CustomFont { get; set; } public bool CustomFont { get; set; }
public bool CustomNoteSkin { get; set; }
public bool TrackStartProcessTweak { get; set; }
public string CustomVersionString { get; set; } = ""; public string CustomVersionString { get; set; } = "";
public string CustomPlaceName { get; set; } = ""; public string CustomPlaceName { get; set; } = "";
public string ExecOnIdle { get; set; } = ""; public string ExecOnIdle { get; set; } = "";
@ -55,6 +57,7 @@ namespace AquaMai
public int ExtendNotesPool { get; set; } public int ExtendNotesPool { get; set; }
public bool FrameRateLock { get; set; } public bool FrameRateLock { get; set; }
public bool FontFix { get; set; } public bool FontFix { get; set; }
public bool SlideJudgeTweak { get; set; }
} }
public class UtilsConfig public class UtilsConfig

View File

@ -3,14 +3,14 @@ using HarmonyLib;
using Manager; using Manager;
using Monitor; using Monitor;
namespace AquaMai.RenderTweak; namespace AquaMai.Fix;
public class SlideAutoPlayTweak public class SlideAutoPlayTweak
{ {
/* Patch bug: /* Patch bug:
* SlideFan AutoPlay , * SlideFan AutoPlay ,
* method : * method :
* *
* if (this.IsNoteCheckTimeStartIgnoreJudgeWait()) * if (this.IsNoteCheckTimeStartIgnoreJudgeWait())
* { * {
* // do something ... * // do something ...
@ -34,7 +34,7 @@ public class SlideAutoPlayTweak
* } * }
* // do something ... * // do something ...
* } * }
* *
* bug else for , 11.0 ( 11 ), SBGA 1.0 * 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 * method 5 ldc.r4 IL Code, 10.0, 11.0, 1.0, 1.0, 0.0
* bug 1.0 11.0, 使 Transpiler * bug 1.0 11.0, 使 Transpiler
@ -61,7 +61,7 @@ public class SlideAutoPlayTweak
} }
return instList; return instList;
} }
/* Patch Slide AutoPlay , ( this._hitIn ) /* Patch Slide AutoPlay , ( this._hitIn )
* method : * method :
* *
@ -98,5 +98,5 @@ public class SlideAutoPlayTweak
____hitIn = ____hitAreaList.Count * prop > ____hitIndex + 0.5f; ____hitIn = ____hitAreaList.Count * prop > ____hitIndex + 0.5f;
} }
} }
} }

View File

@ -5,7 +5,7 @@ using Monitor;
using Process; using Process;
using UnityEngine; using UnityEngine;
namespace AquaMai.RenderTweak; namespace AquaMai.Fix;
public class SlideJudgeTweak public class SlideJudgeTweak
{ {
@ -60,7 +60,7 @@ public class SlideJudgeTweak
} }
} }
} }
/* /*
* Patch Wifi Slide ( Wifi ), majdata * Patch Wifi Slide ( Wifi ), majdata
* bug SBGA Wifi EndButtonId * bug SBGA Wifi EndButtonId
@ -86,4 +86,4 @@ public class SlideJudgeTweak
} }
} }
} }
} }

View File

@ -4,10 +4,8 @@ using System.IO;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using AquaMai.CustomSkin;
using AquaMai.Fix; using AquaMai.Fix;
using AquaMai.Helpers; using AquaMai.Helpers;
using AquaMai.RenderTweak;
using AquaMai.Resources; using AquaMai.Resources;
using AquaMai.Utils; using AquaMai.Utils;
using AquaMai.UX; using AquaMai.UX;
@ -160,19 +158,14 @@ namespace AquaMai
Patch(typeof(ExtendNotesPool)); Patch(typeof(ExtendNotesPool));
Patch(typeof(FixCheckAuth)); Patch(typeof(FixCheckAuth));
Patch(typeof(DebugFeature)); Patch(typeof(DebugFeature));
Patch(typeof(FixConnSlide));
Patch(typeof(SlideAutoPlayTweak));
// UX // UX
Patch(typeof(CustomVersionString)); Patch(typeof(CustomVersionString));
Patch(typeof(CustomPlaceName)); Patch(typeof(CustomPlaceName));
Patch(typeof(RunCommandOnEvents)); Patch(typeof(RunCommandOnEvents));
// Utils // Utils
Patch(typeof(JudgeAdjust)); Patch(typeof(JudgeAdjust));
// My Patches
Patch(typeof(CustomNoteSkin));
Patch(typeof(SlideAutoPlayTweak));
Patch(typeof(TrackStartProcessTweak));
Patch(typeof(SlideJudgeTweak));
Patch(typeof(FixConnSlide));
# if DEBUG # if DEBUG
Patch(typeof(LogNetworkErrors)); Patch(typeof(LogNetworkErrors));
# endif # endif

View File

@ -1,7 +1,6 @@
using System; using System;
using System.IO;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.IO;
using HarmonyLib; using HarmonyLib;
using MelonLoader; using MelonLoader;
using Monitor; using Monitor;
@ -9,13 +8,13 @@ using Monitor.Game;
using Process; using Process;
using UnityEngine; using UnityEngine;
namespace AquaMai.CustomSkin; namespace AquaMai.UX;
public class CustomNoteSkin public class CustomNoteSkin
{ {
private static readonly List<string> ImageExts = [".jpg", ".png", ".jpeg"]; private static readonly List<string> ImageExts = [".jpg", ".png", ".jpeg"];
private static readonly List<string> SlideFanFields = ["_normalSlideFan", "_eachSlideFan", "_breakSlideFan", "_breakSlideFanEff"]; private static readonly List<string> SlideFanFields = ["_normalSlideFan", "_eachSlideFan", "_breakSlideFan", "_breakSlideFanEff"];
private static Sprite customOutline; private static Sprite customOutline;
private static Sprite[,] customSlideFan = new Sprite[4, 11]; private static Sprite[,] customSlideFan = new Sprite[4, 11];
@ -28,7 +27,7 @@ public class CustomNoteSkin
MelonLogger.Msg($"[CustomNoteSkin] Cannot found field {fieldName}"); MelonLogger.Msg($"[CustomNoteSkin] Cannot found field {fieldName}");
return false; return false;
} }
var fieldType = fieldTraverse.GetValueType(); var fieldType = fieldTraverse.GetValueType();
if (!idx1.HasValue) if (!idx1.HasValue)
{ {
@ -83,19 +82,19 @@ public class CustomNoteSkin
return true; return true;
} }
[HarmonyPostfix] [HarmonyPostfix]
[HarmonyPatch(typeof(GameNotePrefabContainer), "Initialize")] [HarmonyPatch(typeof(GameNotePrefabContainer), "Initialize")]
private static void LoadNoteSkin() private static void LoadNoteSkin()
{ {
if (!Directory.Exists(Path.Combine(Environment.CurrentDirectory, "Skins"))) return; if (!Directory.Exists(Path.Combine(Environment.CurrentDirectory, "Skins"))) return;
foreach (var laFile in Directory.EnumerateFiles(Path.Combine(Environment.CurrentDirectory, "Skins"))) foreach (var laFile in Directory.EnumerateFiles(Path.Combine(Environment.CurrentDirectory, "Skins")))
{ {
if (!ImageExts.Contains(Path.GetExtension(laFile).ToLowerInvariant())) continue; if (!ImageExts.Contains(Path.GetExtension(laFile).ToLowerInvariant())) continue;
var texture = new Texture2D(1, 1, TextureFormat.RGBA32, false); var texture = new Texture2D(1, 1, TextureFormat.RGBA32, false);
texture.LoadImage(File.ReadAllBytes(laFile)); texture.LoadImage(File.ReadAllBytes(laFile));
var name = Path.GetFileNameWithoutExtension(laFile); var name = Path.GetFileNameWithoutExtension(laFile);
var args = name.Split('_'); var args = name.Split('_');
// 文件名的格式是 XXXXXXXX_A_B 表示 GameNoteImageContainer._XXXXXXXX[A, B] // 文件名的格式是 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); int? idx2 = (args.Length < 3)? null : (int.TryParse(args[2], out temp) ? temp : null);
Traverse traverse; Traverse traverse;
if (fieldName == "_outline") if (fieldName == "_outline")
{ {
customOutline = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f), 1f); 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 0, SpriteMeshType.Tight, target.sprite.border
); );
target.sprite = custom; target.sprite = custom;
traverse = Traverse.Create(GameNotePrefabContainer.TouchTapC); traverse = Traverse.Create(GameNotePrefabContainer.TouchTapC);
noticeObject = traverse.Field<GameObject>("NoticeObject").Value; noticeObject = traverse.Field<GameObject>("NoticeObject").Value;
noticeObject.GetComponent<SpriteRenderer>().sprite = custom; noticeObject.GetComponent<SpriteRenderer>().sprite = custom;
MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}"); MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}");
continue; continue;
} }
if (fieldName == "_touchHold") if (fieldName == "_touchHold")
{ {
if (!idx1.HasValue) if (!idx1.HasValue)
@ -170,7 +169,7 @@ public class CustomNoteSkin
MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}"); MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}");
continue; continue;
} }
if (fieldName == "_normalTouchBorder") if (fieldName == "_normalTouchBorder")
{ {
if (!idx1.HasValue) if (!idx1.HasValue)
@ -192,7 +191,7 @@ public class CustomNoteSkin
MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}"); MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}");
continue; continue;
} }
if (fieldName == "_eachTouchBorder") if (fieldName == "_eachTouchBorder")
{ {
if (!idx1.HasValue) if (!idx1.HasValue)
@ -214,14 +213,14 @@ public class CustomNoteSkin
MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}"); MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}");
continue; continue;
} }
if (LoadIntoGameNoteImageContainer(fieldName, idx1, idx2, texture)) if (LoadIntoGameNoteImageContainer(fieldName, idx1, idx2, texture))
{ {
MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}"); MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}");
} }
} }
} }
[HarmonyPostfix] [HarmonyPostfix]
[HarmonyPatch(typeof(GameCtrl), "Initialize")] [HarmonyPatch(typeof(GameCtrl), "Initialize")]
private static void ChangeOutlineTexture(GameObject ____guideEndPointObj) private static void ChangeOutlineTexture(GameObject ____guideEndPointObj)
@ -231,7 +230,7 @@ public class CustomNoteSkin
____guideEndPointObj.GetComponent<SpriteRenderer>().sprite = customOutline; ____guideEndPointObj.GetComponent<SpriteRenderer>().sprite = customOutline;
} }
} }
[HarmonyPostfix] [HarmonyPostfix]
[HarmonyPatch(typeof(SlideFan), "Initialize")] [HarmonyPatch(typeof(SlideFan), "Initialize")]
private static void ChangeFanTexture( private static void ChangeFanTexture(
@ -251,7 +250,7 @@ public class CustomNoteSkin
position = ____spriteLines[2 * i].transform.localPosition; position = ____spriteLines[2 * i].transform.localPosition;
____spriteLines[2 * i].transform.localPosition = new Vector3(0, position.y, position.z); ____spriteLines[2 * i].transform.localPosition = new Vector3(0, position.y, position.z);
____spriteLines[2 * i].color = Color.white; ____spriteLines[2 * i].color = Color.white;
____spriteLines[2 * i + 1].sprite = sprite; ____spriteLines[2 * i + 1].sprite = sprite;
position = ____spriteLines[2 * i + 1].transform.localPosition; position = ____spriteLines[2 * i + 1].transform.localPosition;
____spriteLines[2 * i + 1].transform.localPosition = new Vector3(0, position.y, position.z); ____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; position = ____effectSprites[2 * i].transform.localPosition;
____effectSprites[2 * i].transform.localPosition = new Vector3(0, position.y, position.z); ____effectSprites[2 * i].transform.localPosition = new Vector3(0, position.y, position.z);
____effectSprites[2 * i].color = Color.white; ____effectSprites[2 * i].color = Color.white;
____effectSprites[2 * i + 1].sprite = sprite; ____effectSprites[2 * i + 1].sprite = sprite;
position = ____effectSprites[2 * i + 1].transform.localPosition; position = ____effectSprites[2 * i + 1].transform.localPosition;
____effectSprites[2 * i + 1].transform.localPosition = new Vector3(0, position.y, position.z); ____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; position = ____spriteLines[2 * i].transform.localPosition;
____spriteLines[2 * i].transform.localPosition = new Vector3(0, position.y, position.z); ____spriteLines[2 * i].transform.localPosition = new Vector3(0, position.y, position.z);
____spriteLines[2 * i].color = Color.white; ____spriteLines[2 * i].color = Color.white;
____spriteLines[2 * i + 1].sprite = sprite; ____spriteLines[2 * i + 1].sprite = sprite;
position = ____spriteLines[2 * i + 1].transform.localPosition; position = ____spriteLines[2 * i + 1].transform.localPosition;
____spriteLines[2 * i + 1].transform.localPosition = new Vector3(0, position.y, position.z); ____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; position = ____spriteLines[2 * i].transform.localPosition;
____spriteLines[2 * i].transform.localPosition = new Vector3(0, position.y, position.z); ____spriteLines[2 * i].transform.localPosition = new Vector3(0, position.y, position.z);
____spriteLines[2 * i].color = Color.white; ____spriteLines[2 * i].color = Color.white;
____spriteLines[2 * i + 1].sprite = sprite; ____spriteLines[2 * i + 1].sprite = sprite;
position = ____spriteLines[2 * i + 1].transform.localPosition; position = ____spriteLines[2 * i + 1].transform.localPosition;
____spriteLines[2 * i + 1].transform.localPosition = new Vector3(0, position.y, position.z); ____spriteLines[2 * i + 1].transform.localPosition = new Vector3(0, position.y, position.z);
@ -311,4 +310,4 @@ public class CustomNoteSkin
} }
} }
} }
} }

View File

@ -4,7 +4,7 @@ using Process;
using UI; using UI;
using UnityEngine; using UnityEngine;
namespace AquaMai.RenderTweak; namespace AquaMai.UX;
public class TrackStartProcessTweak public class TrackStartProcessTweak
{ {
@ -80,4 +80,4 @@ public class TrackStartProcessTweak
____musicTabObj[1].gameObject.SetActive(false); ____musicTabObj[1].gameObject.SetActive(false);
____musicTabObj[2].gameObject.SetActive(false); ____musicTabObj[2].gameObject.SetActive(false);
} }
} }