Index: binaries/data/mods/public/gui/lobby/LobbyPage/ProfilePanel.js =================================================================== --- binaries/data/mods/public/gui/lobby/LobbyPage/ProfilePanel.js +++ binaries/data/mods/public/gui/lobby/LobbyPage/ProfilePanel.js @@ -72,7 +72,7 @@ if (!playerName) return; - this.playernameText.caption = playerName; + this.playernameText.caption = PlayerColor.ColorPlayerName(escapeText(playerName)); this.updatePlayerRoleText(playerName); this.rankText.caption = this.NotAvailable; @@ -91,7 +91,7 @@ if (attributes.rating == "-2" || attributes.player != this.requestedPlayer) return; - this.playernameText.caption = attributes.player; + this.playernameText.caption = PlayerColor.ColorPlayerName(escapeText(attributes.player), attributes.rating); this.updatePlayerRoleText(attributes.player); this.rankText.caption = attributes.rank; Index: binaries/data/mods/public/gui/lobby/ProfilePage/ProfilePage.js =================================================================== --- binaries/data/mods/public/gui/lobby/ProfilePage/ProfilePage.js +++ binaries/data/mods/public/gui/lobby/ProfilePage/ProfilePage.js @@ -12,6 +12,7 @@ this.fetchInput = Engine.GetGUIObjectByName("fetchInput"); this.fetchInput.onPress = this.onPressLookup.bind(this); + this.fetchInput.onTab = this.autocomplete.bind(this); Engine.GetGUIObjectByName("viewProfileButton").onPress = this.onPressLookup.bind(this); Engine.GetGUIObjectByName("profileBackButton").onPress = this.onPressClose.bind(this, true); @@ -38,6 +39,7 @@ { this.profilePage.hidden = false; Engine.SetGlobalHotkey("cancel", "Press", this.onPressClose.bind(this)); + Engine.SendGetBoardList(); } onPressLookup() @@ -46,6 +48,17 @@ Engine.SendGetProfile(this.requestedPlayer); } + autocomplete() + { + const listPlayerNames = Engine.GetPlayerList().map(player => escapeText(player.name)); + Engine.GetBoardList().forEach((entry, i) => { + if (listPlayerNames.indexOf(escapeText(entry.name)) == -1) listPlayerNames.push(escapeText(entry.name)); + }); + autoCompleteText( + this.fetchInput, + listPlayerNames); + } + onPressClose() { this.profilePage.hidden = true; @@ -73,7 +86,7 @@ return; } - this.profilePlayernameText.caption = escapeText(attributes.player); + this.profilePlayernameText.caption = PlayerColor.ColorPlayerName(escapeText(attributes.player), attributes.rating); this.profileRankText.caption = attributes.rank; this.profileHighestRatingText.caption = attributes.highestRating; this.profileTotalGamesText.caption = attributes.totalGamesPlayed;