From 9b7f2b3a79567fb5021859b43e2073e326125893 Mon Sep 17 00:00:00 2001 From: Clansty Date: Sun, 8 Sep 2024 17:09:38 +0800 Subject: [PATCH] fix: Level display shift when level number not match display level --- AquaMai/Fix/BasicFix.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/AquaMai/Fix/BasicFix.cs b/AquaMai/Fix/BasicFix.cs index ca07cd10..b89c6009 100644 --- a/AquaMai/Fix/BasicFix.cs +++ b/AquaMai/Fix/BasicFix.cs @@ -2,6 +2,7 @@ using HarmonyLib; using Manager; using Manager.Operation; +using Monitor.MusicSelect.ChainList; using Net; using UnityEngine; @@ -73,4 +74,23 @@ private static bool CalcSpecialNum(ref int __result) __result = 1024; return false; } + + [HarmonyPostfix] + [HarmonyPatch(typeof(MusicChainCardObejct), "SetLevel")] + private static void FixLevelShift(MusicLevelID levelID, ref SpriteCounter ____digitLevel, ref SpriteCounter ____doubleDigitLevel) + { + switch (levelID) + { + case > MusicLevelID.Level9P: + ____digitLevel.gameObject.SetActive(value: false); + ____doubleDigitLevel.gameObject.SetActive(value: true); + ____doubleDigitLevel.ChangeText(levelID.GetLevelNum().PadRight(3)); + break; + case >= MusicLevelID.None: + ____digitLevel.gameObject.SetActive(value: true); + ____doubleDigitLevel.gameObject.SetActive(value: false); + ____digitLevel.ChangeText(levelID.GetLevelNum().PadRight(2)); + break; + } + } }