[+] Play Count in SelectionDetail
Build AquaMai / build (push) Has been cancelled Details

pull/84/head
Clansty 2024-11-16 00:53:22 +08:00
parent 6c5791b1fe
commit 0455a83ef1
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
4 changed files with 23 additions and 2 deletions

View File

@ -160,6 +160,15 @@ namespace AquaMai.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to 游玩次数:{0}.
/// </summary>
internal static string PlayCount {
get {
return ResourceManager.GetString("PlayCount", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to SSS+ =&gt; DXRating += {0}.
/// </summary>

View File

@ -101,4 +101,7 @@
<data name="CiBuildAlertContent" xml:space="preserve">
<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>
</data>
</root>

View File

@ -94,4 +94,7 @@
<data name="CiBuildAlertContent" xml:space="preserve">
<value>您正在使用的是 AquaMai CI 构建版本。由于该版本基于最新的主线代码构建,可能包含未通知的配置文件变更或潜在问题。</value>
</data>
<data name="PlayCount" xml:space="preserve">
<value>Play Count: {0}</value>
</data>
</root>

View File

@ -69,6 +69,7 @@ public class SelectionDetail
private abstract class Window : MonoBehaviour
{
protected abstract int player { get; }
private UserData userData => Singleton<UserDataManager>.Instance.GetUserData(player);
public void OnGUI()
{
@ -88,6 +89,12 @@ public class SelectionDetail
dataToShow.Add(string.Format(Locale.RatingUpWhenSSSp, rate));
}
var playCount = Shim.GetUserScoreList(userData)[difficulty[player]].FirstOrDefault(it => it.id == SelectData.MusicData.name.id)?.playcount ?? 0;
if (playCount > 0)
{
dataToShow.Add(string.Format(Locale.PlayCount, playCount));
}
var width = GuiSizes.FontSize * 15f;
var x = GuiSizes.PlayerCenter - width / 2f + GuiSizes.PlayerWidth * player;
@ -107,8 +114,7 @@ public class SelectionDetail
private uint CalcB50(MusicData musicData, int difficulty)
{
var newRate = new UserRate(musicData.name.id, difficulty, 1010000, (uint)musicData.version);
var user = Singleton<UserDataManager>.Instance.GetUserData(player);
var userLowRate = (newRate.OldFlag ? user.RatingList.RatingList : user.RatingList.NewRatingList).Last();
var userLowRate = (newRate.OldFlag ? userData.RatingList.RatingList : userData.RatingList.NewRatingList).Last();
if (newRate.SingleRate > userLowRate.SingleRate)
{