Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/lobby/LobbyPage/Game.js
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | let players; | ||||
if (player.Team == "observer") | if (player.Team == "observer") | ||||
++observerCount; | ++observerCount; | ||||
else | else | ||||
playerRatingTotal += playerNickRating.rating || g_DefaultLobbyRating; | playerRatingTotal += playerNickRating.rating || g_DefaultLobbyRating; | ||||
// Sort games with playing buddies above games with spectating buddies | // Sort games with playing buddies above games with spectating buddies | ||||
if (hasBuddies < 2 && g_Buddies.indexOf(playerNickRating.nick) != -1) | if (hasBuddies < 2 && g_Buddies.indexOf(playerNickRating.nick) != -1) | ||||
hasBuddies = player.Team == "observer" ? 1 : 2; | hasBuddies = player.Team == "observer" ? 1 : 2; | ||||
} | } | ||||
GrapjasAuthorUnsubmitted Not Done Inline ActionsGrapjas: ```
++playerCount;
``` | |||||
this.observerCount = observerCount; | this.observerCount = observerCount; | ||||
this.hasBuddies = hasBuddies; | this.hasBuddies = hasBuddies; | ||||
let displayData = this.displayData; | let displayData = this.displayData; | ||||
let sortValues = this.sortValues; | let sortValues = this.sortValues; | ||||
displayData.buddy = this.hasBuddies ? setStringTags(g_BuddySymbol, displayData.tags) : ""; | displayData.buddy = this.hasBuddies ? setStringTags(g_BuddySymbol, displayData.tags) : ""; | ||||
Done Inline ActionsDuplication is bad, should be a constant like g_BuddySymbol. vladislavbelov: Duplication is bad, should be a constant like `g_BuddySymbol`. | |||||
sortValues.hasBuddyString = String(hasBuddies); | sortValues.hasBuddyString = String(hasBuddies); | ||||
sortValues.buddy = sortValues.hasBuddyString + sortValues.gameName; | sortValues.buddy = sortValues.hasBuddyString + sortValues.gameName; | ||||
let playerCount = players.length - observerCount; | let playerCount = players.length - observerCount; | ||||
let gameRating = | let gameRating = | ||||
playerCount ? | playerCount ? | ||||
Math.round(playerRatingTotal / playerCount) : | Math.round(playerRatingTotal / playerCount) : | ||||
g_DefaultLobbyRating; | g_DefaultLobbyRating; | ||||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | |||||
// Translation: The number of players in this game | // Translation: The number of players in this game | ||||
Game.prototype.PlayerCountNoObservers = translate("%(current)s/%(max)s"); | Game.prototype.PlayerCountNoObservers = translate("%(current)s/%(max)s"); | ||||
/** | /** | ||||
* Compatible games will be listed in these colors. | * Compatible games will be listed in these colors. | ||||
*/ | */ | ||||
Game.prototype.StateTags = { | Game.prototype.StateTags = { | ||||
"init": { | "init": { | ||||
"color": "0 219 0" | "color": "255 255 255" | ||||
}, | }, | ||||
"waiting": { | "waiting": { | ||||
"color": "255 127 0" | "color": "255 127 0" | ||||
}, | }, | ||||
"running": { | "running": { | ||||
"color": "219 0 0" | "color": "219 0 0" | ||||
} | } | ||||
}; | }; | ||||
Show All 22 Lines |
Wildfire Games · Phabricator