diff --git a/AquaMai/AquaMai.csproj b/AquaMai/AquaMai.csproj index 815e02d6..5dc03c43 100644 --- a/AquaMai/AquaMai.csproj +++ b/AquaMai/AquaMai.csproj @@ -268,6 +268,7 @@ + diff --git a/AquaMai/AquaMai.toml b/AquaMai/AquaMai.toml index bdbe445e..331473a6 100644 --- a/AquaMai/AquaMai.toml +++ b/AquaMai/AquaMai.toml @@ -13,4 +13,6 @@ SkipWarningScreen=true # Single player: Show 1P only, at the center of the screen SinglePlayer=true # !!EXPERIMENTAL!! Skip from the card-scanning screen directly to music selection screen -SkipToMusicSelection=false \ No newline at end of file +SkipToMusicSelection=false +# Set the version string displayed at the top-right corner of the screen +CustomVersionString="" \ No newline at end of file diff --git a/AquaMai/Config.cs b/AquaMai/Config.cs index a9b8fb56..f1a97d58 100644 --- a/AquaMai/Config.cs +++ b/AquaMai/Config.cs @@ -18,6 +18,7 @@ namespace AquaMai public bool SkipWarningScreen { get; set; } public bool SinglePlayer { get; set; } public bool SkipToMusicSelection { get; set; } + public string CustomVersionString { get; set; } } } } diff --git a/AquaMai/Main.cs b/AquaMai/Main.cs index a69e69aa..6a35b971 100644 --- a/AquaMai/Main.cs +++ b/AquaMai/Main.cs @@ -1,5 +1,6 @@ using System; using AquaMai.Fix; +using AquaMai.UX; using MelonLoader; using Tomlet; @@ -77,6 +78,7 @@ namespace AquaMai // Fixes that does not have side effects // These don't need to be configurable Patch(typeof(FixCharaCrash)); + Patch(typeof(CustomVersionString)); MelonLogger.Msg("Loaded!"); } diff --git a/AquaMai/UX/CustomVersionString.cs b/AquaMai/UX/CustomVersionString.cs new file mode 100644 index 00000000..78282ea9 --- /dev/null +++ b/AquaMai/UX/CustomVersionString.cs @@ -0,0 +1,24 @@ +using HarmonyLib; + +namespace AquaMai.UX +{ + public class CustomVersionString + { + /* + * Patch displayVersionString Property Getter + */ + [HarmonyPrefix] + [HarmonyPatch(typeof(MAI2System.Config), "displayVersionString", MethodType.Getter)] + public static bool GetDisplayVersionString(ref string __result) + { + if (string.IsNullOrEmpty(AquaMai.AppConfig.UX.CustomVersionString)) + { + return true; + } + + __result = AquaMai.AppConfig.UX.CustomVersionString; + // Return false to block the original method + return false; + } + } +} \ No newline at end of file