From 36da87293280bc010e52ad78e8802cf69db9e1e8 Mon Sep 17 00:00:00 2001 From: Clansty Date: Sun, 27 Oct 2024 23:56:26 +0800 Subject: [PATCH] [O] Locale --- AquaMai/Attributes/GameVersionAttribute.cs | 1 + AquaMai/Main.cs | 2 +- AquaMai/Resources/Locale.Designer.cs | 27 ++++++++++++++++++++++ AquaMai/Resources/Locale.resx | 9 ++++++++ AquaMai/Resources/Locale.zh.resx | 9 ++++++++ AquaMai/UX/LoadLocalBga.cs | 2 +- AquaMai/Utils/PractiseMode.cs | 5 ++-- 7 files changed, 51 insertions(+), 4 deletions(-) diff --git a/AquaMai/Attributes/GameVersionAttribute.cs b/AquaMai/Attributes/GameVersionAttribute.cs index 5c61b7f7..b283849b 100644 --- a/AquaMai/Attributes/GameVersionAttribute.cs +++ b/AquaMai/Attributes/GameVersionAttribute.cs @@ -2,6 +2,7 @@ namespace AquaMai.Attributes; +[AttributeUsage(AttributeTargets.Class)] public class GameVersionAttribute(uint minVersion = 0, uint maxVersion = 0) : Attribute { public uint MinVersion { get; } = minVersion; diff --git a/AquaMai/Main.cs b/AquaMai/Main.cs index a64573b5..6ab962ec 100644 --- a/AquaMai/Main.cs +++ b/AquaMai/Main.cs @@ -44,7 +44,7 @@ namespace AquaMai { if (!isNested) { - MelonLogger.Warning($"> Skipping incompatible patch: {type}"); + MelonLogger.Warning(string.Format(Locale.SkipIncompatiblePatch, type)); } return; diff --git a/AquaMai/Resources/Locale.Designer.cs b/AquaMai/Resources/Locale.Designer.cs index 17a78c21..75e6ae87 100644 --- a/AquaMai/Resources/Locale.Designer.cs +++ b/AquaMai/Resources/Locale.Designer.cs @@ -151,6 +151,15 @@ namespace AquaMai.Resources { } } + /// + /// Looks up a localized string similar to Repeat end time cannot be less than repeat start time. + /// + internal static string RepeatEndTimeLessThenStartTime { + get { + return ResourceManager.GetString("RepeatEndTimeLessThenStartTime", resourceCulture); + } + } + /// /// Looks up a localized string similar to Loop Not Set. /// @@ -187,6 +196,15 @@ namespace AquaMai.Resources { } } + /// + /// Looks up a localized string similar to Please set repeat start time first. + /// + internal static string RepeatStartTimeNotSet { + get { + return ResourceManager.GetString("RepeatStartTimeNotSet", resourceCulture); + } + } + /// /// Looks up a localized string similar to Saving... Do not exit the game. /// @@ -223,6 +241,15 @@ namespace AquaMai.Resources { } } + /// + /// Looks up a localized string similar to > Skipping incompatible patch: {0}. + /// + internal static string SkipIncompatiblePatch { + get { + return ResourceManager.GetString("SkipIncompatiblePatch", resourceCulture); + } + } + /// /// Looks up a localized string similar to Speed. /// diff --git a/AquaMai/Resources/Locale.resx b/AquaMai/Resources/Locale.resx index 8e42de15..6358fab1 100644 --- a/AquaMai/Resources/Locale.resx +++ b/AquaMai/Resources/Locale.resx @@ -86,4 +86,13 @@ Skip + + > Skipping incompatible patch: {0} + + + Please set repeat start time first + + + Repeat end time cannot be less than repeat start time + diff --git a/AquaMai/Resources/Locale.zh.resx b/AquaMai/Resources/Locale.zh.resx index 1d6d4ead..194d5006 100644 --- a/AquaMai/Resources/Locale.zh.resx +++ b/AquaMai/Resources/Locale.zh.resx @@ -79,4 +79,13 @@ 跳过 + + > 已跳过加载不兼容的功能: {0} + + + 循环结束时间不能早于开始时间 + + + 请先设置循环开始时间 + diff --git a/AquaMai/UX/LoadLocalBga.cs b/AquaMai/UX/LoadLocalBga.cs index e1388ab9..2f26f422 100644 --- a/AquaMai/UX/LoadLocalBga.cs +++ b/AquaMai/UX/LoadLocalBga.cs @@ -17,7 +17,7 @@ public class LoadLocalBga var music = Singleton.Instance.GetMusic(GameManager.SelectMusicID[0]); if (music is null) return; - var moviePath = string.Format(Singleton.Instance.GetMovieDataPath($"{music.movieName.id:000000}") + ".dat"); + var moviePath = Singleton.Instance.GetMovieDataPath($"{music.movieName.id:000000}") + ".dat"; if (!moviePath.Contains("dummy")) return; var jacket = LoadAssetsPng.GetJacketTexture2D(music.movieName.id); diff --git a/AquaMai/Utils/PractiseMode.cs b/AquaMai/Utils/PractiseMode.cs index f9370494..14d09c04 100644 --- a/AquaMai/Utils/PractiseMode.cs +++ b/AquaMai/Utils/PractiseMode.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Reflection; using AquaMai.Fix; using AquaMai.Helpers; +using AquaMai.Resources; using HarmonyLib; using Manager; using Monitor; @@ -28,13 +29,13 @@ public class PractiseMode { if (repeatStart == -1) { - MessageHelper.ShowMessage("Please set repeat start time first"); + MessageHelper.ShowMessage(Locale.RepeatStartTimeNotSet); return; } if (time < repeatStart) { - MessageHelper.ShowMessage("Repeat end time cannot be less than repeat start time"); + MessageHelper.ShowMessage(Locale.RepeatEndTimeLessThenStartTime); return; }