diff --git a/AquaMai/AquaMai.Core/Resources/Locale.Designer.cs b/AquaMai/AquaMai.Core/Resources/Locale.Designer.cs index 5237bcdd..5a3fba47 100644 --- a/AquaMai/AquaMai.Core/Resources/Locale.Designer.cs +++ b/AquaMai/AquaMai.Core/Resources/Locale.Designer.cs @@ -28,7 +28,7 @@ public class Locale { private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public Locale() { + internal Locale() { } /// @@ -161,7 +161,7 @@ public static string Pause { } /// - /// Looks up a localized string similar to 游玩次数:{0}. + /// Looks up a localized string similar to Play Count:{0}. /// public static string PlayCount { get { @@ -169,6 +169,15 @@ public static string PlayCount { } } + /// + /// Looks up a localized string similar to Playlog save error. + /// + public static string PlaylogSaveError { + get { + return ResourceManager.GetString("PlaylogSaveError", resourceCulture); + } + } + /// /// Looks up a localized string similar to SSS+ => DXRating += {0}. /// @@ -259,6 +268,24 @@ public static string SeekForward { } } + /// + /// Looks up a localized string similar to Hide Self-Made Charts. + /// + public static string SelfMadeChartsHide { + get { + return ResourceManager.GetString("SelfMadeChartsHide", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show Self-Made Charts. + /// + public static string SelfMadeChartsShow { + get { + return ResourceManager.GetString("SelfMadeChartsShow", resourceCulture); + } + } + /// /// Looks up a localized string similar to Skip. /// @@ -312,5 +339,14 @@ public static string SpeedUp { return ResourceManager.GetString("SpeedUp", resourceCulture); } } + + /// + /// Looks up a localized string similar to UserAll Upsert Error. + /// + public static string UserAllUpsertError { + get { + return ResourceManager.GetString("UserAllUpsertError", resourceCulture); + } + } } } diff --git a/AquaMai/AquaMai.Core/Resources/Locale.resx b/AquaMai/AquaMai.Core/Resources/Locale.resx index 8c242166..8eb37db8 100644 --- a/AquaMai/AquaMai.Core/Resources/Locale.resx +++ b/AquaMai/AquaMai.Core/Resources/Locale.resx @@ -102,6 +102,18 @@ You are using AquaMai CI build version. This version is built from the latest mainline code and may contain undocumented configuration changes or potential issues. - 游玩次数:{0} + Play Count:{0} + + + Hide Self-Made Charts + + + Show Self-Made Charts + + + UserAll Upsert Error + + + Playlog save error diff --git a/AquaMai/AquaMai.Core/Resources/Locale.zh.resx b/AquaMai/AquaMai.Core/Resources/Locale.zh.resx index 9b491581..e6a8916d 100644 --- a/AquaMai/AquaMai.Core/Resources/Locale.zh.resx +++ b/AquaMai/AquaMai.Core/Resources/Locale.zh.resx @@ -95,6 +95,18 @@ 您正在使用的是 AquaMai CI 构建版本。由于该版本基于最新的主线代码构建,可能包含未通知的配置文件变更或潜在问题。 - Play Count: {0} + 游玩次数: {0} + + + 已隐藏所有自制谱 + + + 已显示自制谱 + + + 保存 UserAll 失败 + + + 保存 Playlog 失败 diff --git a/AquaMai/AquaMai.Mods/UX/HideSelfMadeCharts.cs b/AquaMai/AquaMai.Mods/UX/HideSelfMadeCharts.cs index 38e2f1b6..6a244382 100644 --- a/AquaMai/AquaMai.Mods/UX/HideSelfMadeCharts.cs +++ b/AquaMai/AquaMai.Mods/UX/HideSelfMadeCharts.cs @@ -6,6 +6,7 @@ using AquaMai.Config.Attributes; using AquaMai.Config.Types; using AquaMai.Core.Helpers; +using AquaMai.Core.Resources; using HarmonyLib; using MAI2.Util; using Manager; @@ -25,8 +26,7 @@ public class HideSelfMadeCharts zh: "切换自制谱显示的按键")] public static readonly KeyCodeOrName key = KeyCodeOrName.Test; - [ConfigEntry] - public static readonly bool longPress = false; + [ConfigEntry] public static readonly bool longPress = false; [ConfigEntry( en: "One user ID per line in the file. Hide self-made charts when these users login.", @@ -86,7 +86,7 @@ public static void MusicSelectProcessOnUpdate(ref MusicSelectProcess __instance) Task.Run(async () => { await Task.Delay(1000); - MessageHelper.ShowMessage($"{(isShowSelfMadeCharts ? "Show" : "Hide")} Self-Made Charts"); + MessageHelper.ShowMessage(isShowSelfMadeCharts ? Locale.SelfMadeChartsShow : Locale.SelfMadeChartsHide); }); } @@ -133,4 +133,4 @@ public static void EntryProcessOnStart(ref EntryProcess __instance) // reset status on login isShowSelfMadeCharts = true; } -} +} \ No newline at end of file diff --git a/AquaMai/AquaMai.Mods/UX/ImmediateSave.cs b/AquaMai/AquaMai.Mods/UX/ImmediateSave.cs index 03e71d79..c4b918b4 100644 --- a/AquaMai/AquaMai.Mods/UX/ImmediateSave.cs +++ b/AquaMai/AquaMai.Mods/UX/ImmediateSave.cs @@ -53,6 +53,7 @@ void CheckSaveDone() for (int i = 0; i < 2; i++) { + var j = i; var userData = Singleton.Instance.GetUserData(i); if (!userData.IsEntry || userData.IsGuest()) { @@ -74,10 +75,10 @@ void CheckSaveDone() }, delegate(PacketStatus err) { - SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, i); + SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, j); MelonLogger.Error("[ImmediateSave] Playlog save error"); MelonLogger.Error(err); - MessageHelper.ShowMessage("Playlog save error"); + MessageHelper.ShowMessage(Locale.PlaylogSaveError); CheckSaveDone(); })); PacketHelper.StartPacket(Shim.CreatePacketUpsertUserAll(i, userData, delegate(int code) @@ -89,18 +90,18 @@ void CheckSaveDone() } else { - SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, i); + SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, j); MelonLogger.Error("[ImmediateSave] UserAll upsert error"); MelonLogger.Error(code); - MessageHelper.ShowMessage("UserAll upsert error"); + MessageHelper.ShowMessage(Locale.UserAllUpsertError); CheckSaveDone(); } }, delegate(PacketStatus err) { - SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, i); + SoundManager.PlaySE(Mai2.Mai2Cue.Cue.SE_ENTRY_AIME_ERROR, j); MelonLogger.Error("[ImmediateSave] UserAll upsert error"); MelonLogger.Error(err); - MessageHelper.ShowMessage("UserAll upsert error"); + MessageHelper.ShowMessage(Locale.UserAllUpsertError); CheckSaveDone(); })); } @@ -237,4 +238,4 @@ public void OnGUI() GUI.Label(rect, Locale.SavingDontExit); } } -} +} \ No newline at end of file