UI换了很多,spine主视觉停用
This commit is contained in:
@@ -7,7 +7,7 @@ using UnityEngine.UI;
|
||||
|
||||
public class rankingListPrefab : MonoBehaviour
|
||||
{
|
||||
private const string RoomRankingServerText = "根据房间成绩动态排名,所在服务端:雅莉梦璃高新产业园";
|
||||
private static string RoomRankingServerText => LocalizationService.Get("ranking.room_server", "根据房间成绩动态排名,所在服务端:雅莉梦璃高新产业园");
|
||||
|
||||
[Header("shutbutton")]
|
||||
public Button shutbutton;
|
||||
@@ -94,7 +94,7 @@ public class rankingListPrefab : MonoBehaviour
|
||||
|
||||
if (roomRankingData == null || roomRankingData.rankings == null || roomRankingData.rankings.Count == 0)
|
||||
{
|
||||
SetEmptyState(true, "房间排行榜暂无数据");
|
||||
SetEmptyState(true, LocalizationService.Get("ranking.room_no_data", "房间排行榜暂无数据"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class rankingListPrefab : MonoBehaviour
|
||||
NetworkManager nm = NetworkManager.Instance;
|
||||
if (nm == null)
|
||||
{
|
||||
SetEmptyState(true, "排行榜服务不可用");
|
||||
SetEmptyState(true, LocalizationService.Get("ranking.service_unavailable", "排行榜服务不可用"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -124,13 +124,13 @@ public class rankingListPrefab : MonoBehaviour
|
||||
}
|
||||
else
|
||||
{
|
||||
SetEmptyState(false, "正在拉取排行榜...");
|
||||
SetEmptyState(false, LocalizationService.Get("ranking.loading", "正在拉取排行榜..."));
|
||||
data = await nm.GetLeaderboard(currentSongId);
|
||||
}
|
||||
|
||||
if (data == null || data.rankings == null || data.rankings.Count == 0)
|
||||
{
|
||||
SetEmptyState(true, "排行榜暂无数据");
|
||||
SetEmptyState(true, LocalizationService.Get("ranking.no_data", "排行榜暂无数据"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ public class rankingListPrefab : MonoBehaviour
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"[rankingListPrefab] Failed to load leaderboard: {ex.Message}");
|
||||
SetEmptyState(true, "拉取排行榜失败");
|
||||
SetEmptyState(true, LocalizationService.Get("ranking.load_failed", "拉取排行榜失败"));
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -239,7 +239,9 @@ public class rankingListPrefab : MonoBehaviour
|
||||
{
|
||||
if (rankingListType != null)
|
||||
{
|
||||
rankingListType.text = isRoomRanking ? "房间排行榜" : "世界排行榜";
|
||||
rankingListType.text = isRoomRanking
|
||||
? LocalizationService.Get("ranking.room_title", "房间排行榜")
|
||||
: LocalizationService.Get("ranking.world_title", "世界排行榜");
|
||||
}
|
||||
|
||||
if (versionandServer != null)
|
||||
@@ -260,7 +262,7 @@ public class rankingListPrefab : MonoBehaviour
|
||||
|
||||
if (data == null || data.rankings == null || data.rankings.Count == 0 || string.IsNullOrWhiteSpace(roomRankingLocalSteamId))
|
||||
{
|
||||
yourPositionText.text = "您的得分为--,目前排名第<color=green>--</color>位";
|
||||
yourPositionText.text = LocalizationService.Get("ranking.your_position_empty", "您的得分为--,目前排名第<color=green>--</color>位");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -277,12 +279,11 @@ public class rankingListPrefab : MonoBehaviour
|
||||
|
||||
if (localEntry == null)
|
||||
{
|
||||
yourPositionText.text = "您的得分为--,目前排名第<color=green>--</color>位";
|
||||
yourPositionText.text = LocalizationService.Get("ranking.your_position_empty", "您的得分为--,目前排名第<color=green>--</color>位");
|
||||
return;
|
||||
}
|
||||
|
||||
yourPositionText.text =
|
||||
$"您的得分为{localEntry.total_score},目前排名第<color=green>{localEntry.rank}</color>位";
|
||||
yourPositionText.text = LocalizationService.GetFormat("ranking.your_position_value", localEntry.total_score, localEntry.rank);
|
||||
}
|
||||
|
||||
private static string FormatSubmitTime(LeaderboardEntry entry)
|
||||
|
||||
Reference in New Issue
Block a user