Skip to content

Commit

Permalink
[O] Locale
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Nov 26, 2024
1 parent 2646f64 commit 0543523
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 15 deletions.
40 changes: 38 additions & 2 deletions AquaMai/AquaMai.Core/Resources/Locale.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion AquaMai/AquaMai.Core/Resources/Locale.resx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@
<value>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.</value>
</data>
<data name="PlayCount" xml:space="preserve">
<value>游玩次数:{0}</value>
<value>Play Count:{0}</value>
</data>
<data name="SelfMadeChartsHide" xml:space="preserve">
<value>Hide Self-Made Charts</value>
</data>
<data name="SelfMadeChartsShow" xml:space="preserve">
<value>Show Self-Made Charts</value>
</data>
<data name="UserAllUpsertError" xml:space="preserve">
<value>UserAll Upsert Error</value>
</data>
<data name="PlaylogSaveError" xml:space="preserve">
<value>Playlog save error</value>
</data>
</root>
14 changes: 13 additions & 1 deletion AquaMai/AquaMai.Core/Resources/Locale.zh.resx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@
<value>您正在使用的是 AquaMai CI 构建版本。由于该版本基于最新的主线代码构建,可能包含未通知的配置文件变更或潜在问题。</value>
</data>
<data name="PlayCount" xml:space="preserve">
<value>Play Count: {0}</value>
<value>游玩次数: {0}</value>
</data>
<data name="SelfMadeChartsHide" xml:space="preserve">
<value>已隐藏所有自制谱</value>
</data>
<data name="SelfMadeChartsShow" xml:space="preserve">
<value>已显示自制谱</value>
</data>
<data name="UserAllUpsertError" xml:space="preserve">
<value>保存 UserAll 失败</value>
</data>
<data name="PlaylogSaveError" xml:space="preserve">
<value>保存 Playlog 失败</value>
</data>
</root>
8 changes: 4 additions & 4 deletions AquaMai/AquaMai.Mods/UX/HideSelfMadeCharts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.",
Expand Down Expand Up @@ -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);
});
}

Expand Down Expand Up @@ -133,4 +133,4 @@ public static void EntryProcessOnStart(ref EntryProcess __instance)
// reset status on login
isShowSelfMadeCharts = true;
}
}
}
15 changes: 8 additions & 7 deletions AquaMai/AquaMai.Mods/UX/ImmediateSave.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ void CheckSaveDone()

for (int i = 0; i < 2; i++)
{
var j = i;
var userData = Singleton<UserDataManager>.Instance.GetUserData(i);
if (!userData.IsEntry || userData.IsGuest())
{
Expand All @@ -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)
Expand All @@ -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();
}));
}
Expand Down Expand Up @@ -237,4 +238,4 @@ public void OnGUI()
GUI.Label(rect, Locale.SavingDontExit);
}
}
}
}

0 comments on commit 0543523

Please sign in to comment.