mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
Colorize the playername with rating in the lobby user profile
Reviewed by: elexis Differential Revision: https://code.wildfiregames.com/D48 This was SVN commit r19185.
This commit is contained in:
parent
584ccd690e
commit
d2b9236388
1 changed files with 9 additions and 6 deletions
|
|
@ -436,10 +436,7 @@ function updateProfile()
|
|||
{
|
||||
let attributes = Engine.GetProfile()[0];
|
||||
|
||||
let user = sprintf(translate("%(nick)s (%(rating)s)"), {
|
||||
"nick": attributes.player,
|
||||
"rating": attributes.rating
|
||||
});
|
||||
let user = colorPlayerName(attributes.player, attributes.rating);
|
||||
|
||||
if (!Engine.GetGUIObjectByName("profileFetch").hidden)
|
||||
{
|
||||
|
|
@ -1114,11 +1111,17 @@ function getPlayerColor(playername)
|
|||
* Returns the given playername wrapped in an appropriate color-tag.
|
||||
*
|
||||
* @param {string} playername
|
||||
* @param {string} rating
|
||||
*/
|
||||
function colorPlayerName(playername)
|
||||
function colorPlayerName(playername, rating)
|
||||
{
|
||||
return '[color="' + getPlayerColor(playername.replace(g_ModeratorPrefix, "")) + '"]' +
|
||||
playername + '[/color]';
|
||||
(rating ? sprintf(
|
||||
translate("%(nick)s (%(rating)s)"), {
|
||||
"nick": playername,
|
||||
"rating": rating
|
||||
}) :
|
||||
playername) + '[/color]';
|
||||
}
|
||||
|
||||
function senderFont(text)
|
||||
|
|
|
|||
Loading…
Reference in a new issue