From 0455a83ef1db169d051a0bfac40af0f33bd1f3c1 Mon Sep 17 00:00:00 2001 From: Clansty Date: Sat, 16 Nov 2024 00:53:22 +0800 Subject: [PATCH] [+] Play Count in SelectionDetail --- AquaMai/Resources/Locale.Designer.cs | 9 +++++++++ AquaMai/Resources/Locale.resx | 3 +++ AquaMai/Resources/Locale.zh.resx | 3 +++ AquaMai/Utils/SelectionDetail.cs | 10 ++++++++-- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/AquaMai/Resources/Locale.Designer.cs b/AquaMai/Resources/Locale.Designer.cs index 06c8962b..a3578c5d 100644 --- a/AquaMai/Resources/Locale.Designer.cs +++ b/AquaMai/Resources/Locale.Designer.cs @@ -160,6 +160,15 @@ internal static string Pause { } } + /// + /// Looks up a localized string similar to 游玩次数:{0}. + /// + internal static string PlayCount { + get { + return ResourceManager.GetString("PlayCount", resourceCulture); + } + } + /// /// Looks up a localized string similar to SSS+ => DXRating += {0}. /// diff --git a/AquaMai/Resources/Locale.resx b/AquaMai/Resources/Locale.resx index 080b297c..8c242166 100644 --- a/AquaMai/Resources/Locale.resx +++ b/AquaMai/Resources/Locale.resx @@ -101,4 +101,7 @@ 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} + diff --git a/AquaMai/Resources/Locale.zh.resx b/AquaMai/Resources/Locale.zh.resx index eee9d712..9b491581 100644 --- a/AquaMai/Resources/Locale.zh.resx +++ b/AquaMai/Resources/Locale.zh.resx @@ -94,4 +94,7 @@ 您正在使用的是 AquaMai CI 构建版本。由于该版本基于最新的主线代码构建,可能包含未通知的配置文件变更或潜在问题。 + + Play Count: {0} + diff --git a/AquaMai/Utils/SelectionDetail.cs b/AquaMai/Utils/SelectionDetail.cs index 7789cfa8..86677a0b 100644 --- a/AquaMai/Utils/SelectionDetail.cs +++ b/AquaMai/Utils/SelectionDetail.cs @@ -69,6 +69,7 @@ private class P2Window : Window private abstract class Window : MonoBehaviour { protected abstract int player { get; } + private UserData userData => Singleton.Instance.GetUserData(player); public void OnGUI() { @@ -88,6 +89,12 @@ public void OnGUI() 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 void OnGUI() private uint CalcB50(MusicData musicData, int difficulty) { var newRate = new UserRate(musicData.name.id, difficulty, 1010000, (uint)musicData.version); - var user = Singleton.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) {