Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/lobby/LobbyPage/ProfilePanel.js
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | class ProfilePanel | ||||
requestProfile(playerName) | requestProfile(playerName) | ||||
{ | { | ||||
this.profileArea.hidden = !playerName && !this.playernameText.caption; | this.profileArea.hidden = !playerName && !this.playernameText.caption; | ||||
this.requestedPlayer = playerName; | this.requestedPlayer = playerName; | ||||
if (!playerName) | if (!playerName) | ||||
return; | return; | ||||
this.playernameText.caption = PlayerColor.ColorPlayerName(escapeText(playerName)); | this.playernameText.caption = coloredText(escapeText(playerName), PlayerColor.ColorPlayerNameByRole(Engine.LobbyGetPlayerRole(playerName))); | ||||
Grapjas: zzz | |||||
this.updatePlayerRoleText(playerName); | this.updatePlayerRoleText(playerName); | ||||
this.rankText.caption = this.NotAvailable; | this.rankText.caption = this.NotAvailable; | ||||
this.highestRatingText.caption = this.NotAvailable; | this.highestRatingText.caption = this.NotAvailable; | ||||
this.totalGamesText.caption = this.NotAvailable; | this.totalGamesText.caption = this.NotAvailable; | ||||
this.winsText.caption = this.NotAvailable; | this.winsText.caption = this.NotAvailable; | ||||
this.lossesText.caption = this.NotAvailable; | this.lossesText.caption = this.NotAvailable; | ||||
this.ratioText.caption = this.NotAvailable; | this.ratioText.caption = this.NotAvailable; | ||||
Engine.SendGetProfile(playerName); | Engine.SendGetProfile(playerName); | ||||
} | } | ||||
onProfile() | onProfile() | ||||
{ | { | ||||
let attributes = Engine.GetProfile()[0]; | let attributes = Engine.GetProfile()[0]; | ||||
if (attributes.rating == "-2" || attributes.player != this.requestedPlayer) | if (attributes.rating == "-2" || attributes.player != this.requestedPlayer) | ||||
return; | return; | ||||
this.playernameText.caption = PlayerColor.ColorPlayerName(escapeText(attributes.player), attributes.rating); | this.playernameText.caption = coloredText(escapeText(attributes.player), PlayerColor.ColorPlayerNameByRole(Engine.LobbyGetPlayerRole(attributes.player))); | ||||
this.updatePlayerRoleText(attributes.player); | this.updatePlayerRoleText(attributes.player); | ||||
this.rankText.caption = attributes.rank; | this.rankText.caption = attributes.rank; | ||||
this.highestRatingText.caption = attributes.highestRating; | this.highestRatingText.caption = coloredText(attributes.highestRating, PlayerColor.GetColorByRating(attributes.highestRating)); | ||||
this.totalGamesText.caption = attributes.totalGamesPlayed; | this.totalGamesText.caption = attributes.totalGamesPlayed; | ||||
this.winsText.caption = attributes.wins; | this.winsText.caption = attributes.wins; | ||||
this.lossesText.caption = attributes.losses; | this.lossesText.caption = attributes.losses; | ||||
this.ratioText.caption = ProfilePanel.FormatWinRate(attributes); | this.ratioText.caption = ProfilePanel.FormatWinRate(attributes); | ||||
} | } | ||||
} | } | ||||
ProfilePanel.prototype.NotAvailable = translate("N/A"); | ProfilePanel.prototype.NotAvailable = translate("N/A"); | ||||
Show All 19 Lines |
Wildfire Games · Phabricator
zzz