|
2 | 2 | using System.Collections.Generic;
|
3 | 3 | using System.Threading;
|
4 | 4 | using TNRD.Zeepkist.GTR.Messaging;
|
| 5 | +using ZeepkistClient; |
5 | 6 | using ZeepSDK.External.Cysharp.Threading.Tasks;
|
6 | 7 | using ZeepSDK.External.FluentResults;
|
7 | 8 | using ZeepSDK.Level;
|
| 9 | +using ZeepSDK.Utilities; |
8 | 10 |
|
9 | 11 | namespace TNRD.Zeepkist.GTR.Leaderboard;
|
10 | 12 |
|
@@ -75,11 +77,27 @@ private async UniTaskVoid LoadRecords(CancellationToken ct = default)
|
75 | 77 |
|
76 | 78 | protected override void OnDrawItem(GUI_OnlineLeaderboardPosition gui, LeaderboardRecord item, int index)
|
77 | 79 | {
|
| 80 | + ZeepkistNetwork.TryGetPlayer( Convert.ToUInt64(item.SteamId), out gui.thePlayer); |
| 81 | + |
78 | 82 | gui.position.gameObject.SetActive(true);
|
79 | 83 | gui.position.text = (index + 1).ToString();
|
80 | 84 | gui.position.color = PlayerManager.Instance.GetColorFromPosition(index + 1);
|
81 | 85 | gui.favoriteButton.gameObject.SetActive(false);
|
82 |
| - gui.player_name.text = $"<link=\"{item.SteamId}\">{item.SteamName}</link>"; |
| 86 | + UnityEngine.ColorUtility.ToHtmlStringRGB(PlayerManager.Instance.GetChatColor()); |
| 87 | + |
| 88 | + if (ZeepkistNetwork.LocalPlayer.SteamID.ToString() == item.SteamId) |
| 89 | + { |
| 90 | + string playerColor = UnityEngine.ColorUtility.ToHtmlStringRGB(ZeepkistNetwork.LocalPlayer.chatColor); |
| 91 | + gui.player_name.text = $"<color=#{playerColor}><link=\"{item.SteamId}\">{item.SteamName}</link></color>"; |
| 92 | + } |
| 93 | + else if (gui.thePlayer != null && gui.thePlayer.SteamID.ToString() == item.SteamId) |
| 94 | + { |
| 95 | + string playerColor = UnityEngine.ColorUtility.ToHtmlStringRGB(gui.thePlayer.chatColor); |
| 96 | + gui.player_name.text = $"<color=#{playerColor}><link=\"{item.SteamId}\">{item.SteamName}</link></color>"; |
| 97 | + } |
| 98 | + else |
| 99 | + gui.player_name.text = $"<link=\"{item.SteamId}\">{item.SteamName}</link>"; |
| 100 | + |
83 | 101 | gui.time.text = item.Time.GetFormattedTime();
|
84 | 102 |
|
85 | 103 | int placementPoints = Math.Max(0, Count - index);
|
|
0 commit comments