Closed AmmarTee closed 2 years ago
For the sorted names in dictionary override KillCountUpdated
function in the KillCounterPlayerList
like the following:
using System.Linq;
...
...
protected override void KillCountUpdated(Dictionary<int, int> killCounter)
{
string playerName;
string tmpString = "";
Dictionary<string, int> playerNameDictionary = new Dictionary<string, int>();
foreach (KeyValuePair<int, int> item in killCounter)
{
ClientConnection conn = ClientUtil.GetClientConnection(item.Key);
playerName = (conn == null || string.IsNullOrEmpty(conn.playerName)) ? item.Key.ToString() : conn.playerName;
playerNameDictionary.Add(playerName, item.Value);
}
foreach (KeyValuePair<string, int> item in playerNameDictionary.OrderByDescending(x => x.Key))
{
tmpString += $"{item.Key} : {item.Value}\n";
}
if (textComp) textComp.text = tmpString;
}
There might be a few mistakes in the above but I'm sure you can figure it out. If you want to learn more about the KillCounter
functions and prefabs read the documentation here: https://cyberbulletgames.com/easy-multiplayer-invector-ui-docs/Prefabs/KillCounter/KillCounter/
I have generated an example image and prefabs. I will be making tutorial videos and documentation for this before I release it. I might also spend some time making youtube tutorials for it as well.
Either way this has been completed and will be available in the next UI release v0.4.0
Next UI release is not currently available on Gumroad
Damage indicator would be amazing if player could see where the bullet came from. The damage indicator on the UI
Along with that:
If possible: it would be much nicer to have player name sorted by the kill count on the leaderboard :)