Index: binaries/data/mods/public/gui/common/gamedescription.js =================================================================== --- binaries/data/mods/public/gui/common/gamedescription.js +++ binaries/data/mods/public/gui/common/gamedescription.js @@ -39,6 +39,26 @@ var g_BuddySymbol = '•'; /** + * Denotes which players are a lobby the user + */ +var g_UserSymbol = "‣"; + +/** + * Singleplayer Name + */ +let g_UserSinglePlayer = Engine.ConfigDB_GetValue("user", "playername.singleplayer") || ""; + +/** + * Multiplayer Name + */ +let g_UserMultiPlayer = Engine.ConfigDB_GetValue("user", "playername.multiplayer") || ""; + +function isUser(nick) +{ + return (nick == g_UserMultiPlayer || nick == g_UserSinglePlayer); +} + +/** * Returns map description and preview image or placeholder. */ function getMapDescriptionAndPreview(mapType, mapName) @@ -159,7 +179,8 @@ (isAI ? "white" : getPlayerColor(playerData.Name)) : rgbToGuiColor(playerData.Color || g_Settings.PlayerDefaults[playerIdx].Color)) + '"]' + - (g_Buddies.indexOf(splitRatingFromNick(playerData.Name)[0]) != -1 ? g_BuddySymbol + " " : "") + + (isUser(splitRatingFromNick(playerData.Name)[0]) ? g_UserSymbol + " " : + g_Buddies.indexOf(splitRatingFromNick(playerData.Name)[0]) != -1 ? g_BuddySymbol + " " : "") + escapeText(playerData.Name) + "[/color]", Index: binaries/data/mods/public/gui/lobby/lobby.js =================================================================== --- binaries/data/mods/public/gui/lobby/lobby.js +++ binaries/data/mods/public/gui/lobby/lobby.js @@ -567,6 +567,7 @@ let cleanPlayerList = Engine.GetPlayerList().map(player => { player.isBuddy = g_Buddies.indexOf(player.name) != -1; + player.isUser = player.name.toLowerCase() == g_Username.toLowerCase(); return player; }).sort((a, b) => { let sortA, sortB; @@ -615,7 +616,8 @@ let coloredPresence = '[color="' + statusColor + '"]' + g_PlayerStatuses[presence].status + "[/color]"; let coloredRating = '[color="' + statusColor + '"]' + rating + "[/color]"; - buddyStatusList.push(player.isBuddy ? '[color="' + statusColor + '"]' + g_BuddySymbol + '[/color]' : ""); + buddyStatusList.push(player.isBuddy ? '[color="' + statusColor + '"]' + g_BuddySymbol + '[/color]' : + player.isUser ? '[color="' + statusColor + '"]' + g_UserSymbol + '[/color]' : ""); playerList.push(coloredName); presenceList.push(coloredPresence); ratingList.push(coloredRating); @@ -877,6 +879,8 @@ playerRatings.push(rating || g_DefaultLobbyRating); // Sort games with playing buddies above games with spectating buddies + if (nick.toLowerCase() == g_Username.toLowerCase()) + game.hasBuddies = player.Team == "observer" ? 3 : 4; if (game.hasBuddies < 2 && g_Buddies.indexOf(nick) != -1) game.hasBuddies = player.Team == "observer" ? 1 : 2; } @@ -939,7 +943,8 @@ if (game.ip == g_SelectedGameIP && game.port == g_SelectedGamePort) selectedGameIndex = +i; - list_buddy.push(game.hasBuddies ? '[color="' + g_GameColors[game.state] + '"]' + g_BuddySymbol + '[/color]' : ""); + list_buddy.push(game.hasBuddies > 2 ? '[color="' + g_GameColors[game.state] + '"]' + g_UserSymbol + '[/color]' : + game.hasBuddies > 0 ? '[color="' + g_GameColors[game.state] + '"]' + g_BuddySymbol + '[/color]': ""); list_name.push('[color="' + g_GameColors[game.state] + '"]' + gameName); list_mapName.push(translateMapTitle(game.niceMapName)); list_mapSize.push(translateMapSize(game.mapSize));