Skip to content

Commit

Permalink
[RF] Move some patches to visual
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Oct 27, 2024
1 parent 6945032 commit 7933d49
Show file tree
Hide file tree
Showing 16 changed files with 127 additions and 126 deletions.
5 changes: 5 additions & 0 deletions AquaMai/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ 试试使用 MaiChartManager 图形化配置 AquaMai 吧!
zh: "节省一些不知道有用没用的时间,跳过一些不必要的界面")]
public TimeSaving.Config TimeSaving { get; set; } = new();

[ConfigComment(
en: "Visual effects of notes and judgment display and some other textures",
zh: "音符和判定表示以及一些其他贴图的视觉效果调整")]
public Visual.Config Visual { get; set; } = new();

[ConfigComment(
zh: "窗口相关设置")]
public WindowState.Config WindowState { get; set; } = new();
Expand Down
22 changes: 0 additions & 22 deletions AquaMai/Fix/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,6 @@ 不可以和 CustomFont 一起使用
""")]
public bool FontFix { get; set; }

[ConfigComment(
en: """
Make the judgment display of Wifi Slide different in up and down (originally all Wifi judgment displays are towards the center), just like in majdata
The reason for this bug is that SEGA forgot to assign EndButtonId to Wifi
""",
zh: """
这个 Patch 让 Wifi Slide 的判定显示有上下的区别 (原本所有 Wifi 的判定显示都是朝向圆心的), 就像 majdata 里那样
这个 bug 产生的原因是 SBGA 忘记给 Wifi 的 EndButtonId 赋值了
""")]
public bool FanJudgeFlip { get; set; }

[ConfigComment(
en: """
This Patch makes the Critical judgment of BreakSlide also flicker like BreakTap
Recommended to use with custom skins (otherwise the visual effect may not be good)
""",
zh: """
这个 Patch 让 BreakSlide 的 Critical 判定也可以像 BreakTap 一样闪烁
推荐与自定义皮肤一起使用 (否则视觉效果可能并不好)
""")]
public bool BreakSlideJudgeBlink { get; set; }

[ConfigComment(
en: """
Make the AutoPlay random judgment mode really randomize all judgments (down to sub-judgments)
Expand Down
8 changes: 3 additions & 5 deletions AquaMai/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using AquaMai.Resources;
using AquaMai.Utils;
using AquaMai.UX;
using AquaMai.Visual;
using MelonLoader;
using Tomlet;
using UnityEngine;
Expand Down Expand Up @@ -166,22 +167,19 @@ public override void OnInitializeMelon()
Patch(typeof(FixCheckAuth));
Patch(typeof(DebugFeature));
Patch(typeof(FixConnSlide));
// Visual
Patch(typeof(FixSlideAutoPlay)); // Rename: SlideAutoPlayTweak -> FixSlideAutoPlay, 不过这个应该无副作用所以不需要改配置文件
Patch(typeof(FixCircleSlideJudge)); // 这个我觉得算无副作用, 可以常开
Patch(typeof(FixLevelDisplay));
Patch(typeof(CustomLogo));
// UX
Patch(typeof(CustomVersionString));
Patch(typeof(CustomPlaceName));
Patch(typeof(RunCommandOnEvents));
Patch(typeof(CustomLogo));
// Utils
Patch(typeof(JudgeAdjust));
Patch(typeof(TouchPanelBaudRate));

# if DEBUG
Patch(typeof(LogNetworkErrors));
# endif

// Apply patches based on the settings
ApplyPatches();

Expand Down
59 changes: 0 additions & 59 deletions AquaMai/UX/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,70 +117,11 @@ 不可以和 FontFix 一起使用
""")]
public bool CustomFont { get; set; }

[ConfigComment(
en: """
Provide the ability to use custom skins (advanced feature)
Load skin textures from LocalAssets\Skins
""",
zh: """
提供自定义皮肤的能力(高级功能)
从 LocalAssets\Skins 中加载皮肤贴图
""")]
public bool CustomSkins { get; set; }

[ConfigComment(
en: """
More detailed judgment display
Requires CustomSkins to be enabled and the resource file to be downloaded
https://github.com/hykilpikonna/AquaDX/releases/download/nightly/JudgeDisplay4B.7z
""",
zh: """
更精细的判定表示
需开启 CustomSkins 并下载资源文件
https://github.com/hykilpikonna/AquaDX/releases/download/nightly/JudgeDisplay4B.7z
""")]
public bool JudgeDisplay4B { get; set; }

[ConfigComment(
en: """
Custom track start difficulty image (not really custom difficulty)
Requires CustomSkins to be enabled
Will load four image resources through custom skins: musicBase, musicTab, musicLvBase, musicLvText
""",
zh: """
自定义在歌曲开始界面上显示的难度贴图 (并不是真的自定义难度)
需要启用自定义皮肤功能
会通过自定义皮肤加载四个图片资源: musicBase, musicTab, musicLvBase, musicLvText
""")]
public bool CustomTrackStartDiff { get; set; }

[ConfigComment(
en: "Map touch actions to buttons",
zh: "映射触摸操作至实体按键")]
public bool TouchToButtonInput { get; set; }

[ConfigComment(
en: """
Delayed the animation of the song start screen
For recording chart confirmation
""",
zh: """
推迟了歌曲开始界面的动画
录制谱面确认用
""")]
public bool TrackStartProcessTweak { get; set; }

[ConfigComment(
en: """
Disable the TRACK X text, DX/Standard display box, and the derakkuma at the bottom of the screen in the song start screen
For recording chart confirmation
""",
zh: """
在歌曲开始界面, 把 TRACK X 字样, DX/标准谱面的显示框, 以及画面下方的滴蜡熊隐藏掉
录制谱面确认用
""")]
public bool DisableTrackStartTabs { get; set; }

[ConfigComment(
en: "Cannot be used together with HanabiFix",
zh: """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Monitor;
using UnityEngine;

namespace AquaMai.Fix;
namespace AquaMai.Visual;

public class BreakSlideJudgeBlink
{
Expand All @@ -21,4 +21,4 @@ private static void FixBreakSlideJudgeBlink(
float num = ___SpriteRenderAdd.color.r;
___SpriteRenderAdd.color = new Color(num, num, num, 1f);
}
}
}
87 changes: 87 additions & 0 deletions AquaMai/Visual/Config.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using AquaMai.Attributes;

namespace AquaMai.Visual;

public class Config
{
[ConfigComment(
en: """
Provide the ability to use custom skins (advanced feature)
Load skin textures from LocalAssets\Skins
""",
zh: """
提供自定义皮肤的能力(高级功能)
从 LocalAssets\Skins 中加载皮肤贴图
""")]
public bool CustomSkins { get; set; }

[ConfigComment(
en: """
More detailed judgment display
Requires CustomSkins to be enabled and the resource file to be downloaded
https://github.com/hykilpikonna/AquaDX/releases/download/nightly/JudgeDisplay4B.7z
""",
zh: """
更精细的判定表示
需开启 CustomSkins 并下载资源文件
https://github.com/hykilpikonna/AquaDX/releases/download/nightly/JudgeDisplay4B.7z
""")]
public bool JudgeDisplay4B { get; set; }

[ConfigComment(
en: """
Custom track start difficulty image (not really custom difficulty)
Requires CustomSkins to be enabled
Will load four image resources through custom skins: musicBase, musicTab, musicLvBase, musicLvText
""",
zh: """
自定义在歌曲开始界面上显示的难度贴图 (并不是真的自定义难度)
需要启用自定义皮肤功能
会通过自定义皮肤加载四个图片资源: musicBase, musicTab, musicLvBase, musicLvText
""")]
public bool CustomTrackStartDiff { get; set; }

[ConfigComment(
en: """
Delayed the animation of the song start screen
For recording chart confirmation
""",
zh: """
推迟了歌曲开始界面的动画
录制谱面确认用
""")]
public bool TrackStartProcessTweak { get; set; }

[ConfigComment(
en: """
Disable the TRACK X text, DX/Standard display box, and the derakkuma at the bottom of the screen in the song start screen
For recording chart confirmation
""",
zh: """
在歌曲开始界面, 把 TRACK X 字样, DX/标准谱面的显示框, 以及画面下方的滴蜡熊隐藏掉
录制谱面确认用
""")]
public bool DisableTrackStartTabs { get; set; }

[ConfigComment(
en: """
Make the judgment display of Wifi Slide different in up and down (originally all Wifi judgment displays are towards the center), just like in majdata
The reason for this bug is that SEGA forgot to assign EndButtonId to Wifi
""",
zh: """
这个 Patch 让 Wifi Slide 的判定显示有上下的区别 (原本所有 Wifi 的判定显示都是朝向圆心的), 就像 majdata 里那样
这个 bug 产生的原因是 SBGA 忘记给 Wifi 的 EndButtonId 赋值了
""")]
public bool FanJudgeFlip { get; set; }

[ConfigComment(
en: """
This Patch makes the Critical judgment of BreakSlide also flicker like BreakTap
Recommended to use with custom skins (otherwise the visual effect may not be good)
""",
zh: """
这个 Patch 让 BreakSlide 的 Critical 判定也可以像 BreakTap 一样闪烁
推荐与自定义皮肤一起使用 (否则视觉效果可能并不好)
""")]
public bool BreakSlideJudgeBlink { get; set; }
}
2 changes: 1 addition & 1 deletion AquaMai/UX/CustomLogo.cs → AquaMai/Visual/CustomLogo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using UnityEngine;
using UnityEngine.UI;

namespace AquaMai.UX;
namespace AquaMai.Visual;

public class CustomLogo
{
Expand Down
8 changes: 4 additions & 4 deletions AquaMai/UX/CustomSkins.cs → AquaMai/Visual/CustomSkins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Process;
using UnityEngine;

namespace AquaMai.UX;
namespace AquaMai.Visual;

public class CustomSkins
{
Expand All @@ -18,7 +18,7 @@ public class CustomSkins

private static Sprite customOutline;
private static Sprite[,] customSlideFan = new Sprite[4, 11];

public static readonly Sprite[,] CustomJudge = new Sprite[2, ((int)NoteJudge.ETiming.End + 1)];
public static readonly Sprite[,,,] CustomJudgeSlide = new Sprite[2, 3, 2, ((int)NoteJudge.ETiming.End + 1)];
public static readonly Texture2D[] CustomTrackStart = new Texture2D[4];
Expand Down Expand Up @@ -113,7 +113,7 @@ private static void LoadNoteSkin()
int? idx3 = (args.Length < 4) ? null : (int.TryParse(args[3], out temp) ? temp : null);

Traverse traverse;

if (CustomTrackStartFields.Contains(fieldName))
{
var i = CustomTrackStartFields.IndexOf(fieldName);
Expand Down Expand Up @@ -142,7 +142,7 @@ private static void LoadNoteSkin()
MelonLogger.Msg($"[CustomNoteSkin] Successfully loaded {name}");
continue;
}

if (fieldName == "_judgeSlideNormal" || fieldName == "_judgeSlideBreak")
{
if (!idx1.HasValue || !idx2.HasValue || !idx3.HasValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
using UnityEngine;
using UnityEngine.UI;

namespace AquaMai.UX;
namespace AquaMai.Visual;

public class CustomTrackStartDiff
{
// 自定义在歌曲开始界面上显示的难度 (并不是真的自定义难度)
// 需要启用自定义皮肤功能
// 会加载四个图片资源: musicBase, musicTab, musicLvBase, musicLvText

[HarmonyPostfix]
[HarmonyPatch(typeof(TrackStartMonitor), "SetTrackStart")]
private static void DisableTabs(
MultipleImage ____musicBaseImage,
MultipleImage ____musicTabImage,
SpriteCounter ____difficultySingle,
SpriteCounter ____difficultySingle,
SpriteCounter ____difficultyDouble,
Image ____levelTextImage,
List<ResultMonitor.SpriteSheet> ____musicLevelSpriteSheets,
Expand All @@ -31,7 +31,7 @@ TimelineRoot ____musicDetail
____musicBaseImage.MultiSprites[6] = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f), 100f);
____musicBaseImage.ChangeSprite(6);
}

texture = CustomSkins.CustomTrackStart[1];
if (texture != null)
{
Expand Down Expand Up @@ -63,4 +63,4 @@ TimelineRoot ____musicDetail
____levelTextImage.sprite = sheet[14];
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
using System.Collections.Generic;
using HarmonyLib;
using HarmonyLib;
using Monitor;
using UI;
using UnityEngine;
using UnityEngine.UI;

namespace AquaMai.UX;
namespace AquaMai.Visual;

public class DisableTrackStartTabs
{
// 在歌曲开始界面, 把 TRACK X 字样, DX/标准谱面的显示框, 以及画面下方的滴蜡熊隐藏掉, 让他看起来不那么 sinmai, 更像是 majdata

[HarmonyPostfix]
[HarmonyPatch(typeof(TrackStartMonitor), "SetTrackStart")]
private static void DisableTabs(
Expand All @@ -27,4 +25,4 @@ private static void DisableTabs(
____musicTabObj[2].gameObject.SetActive(false);
____derakkumaRoot.SetActive(false);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using HarmonyLib;
using Monitor;

namespace AquaMai.Fix;
namespace AquaMai.Visual;

public class FanJudgeFlip
{
Expand Down Expand Up @@ -29,4 +29,4 @@ private static void FixFanJudgeFilp(
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
using HarmonyLib;
using Manager;
using Monitor;
using Process;
using UnityEngine;

namespace AquaMai.Fix;
namespace AquaMai.Visual;

public class FixCircleSlideJudge
{
Expand Down Expand Up @@ -39,5 +38,5 @@ private static void FixJudgePosition(
}
}


}
File renamed without changes.
Loading

0 comments on commit 7933d49

Please sign in to comment.