Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/lobby/LobbyPage/GameList.js
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | rebuildGameList() | ||||
Engine.ProfileStop(); | Engine.ProfileStop(); | ||||
{ | { | ||||
Engine.ProfileStart("updateGames"); | Engine.ProfileStart("updateGames"); | ||||
let selectedColumn = this.gamesBox.selected_column; | let selectedColumn = this.gamesBox.selected_column; | ||||
let newGames = {}; | let newGames = {}; | ||||
for (let stanza of gameListData) | for (let stanza of gameListData) | ||||
{ | { | ||||
let game = this.games[stanza.hostUsername] || undefined; | let game = this.games[stanza.hostJID] || undefined; | ||||
let exists = !!game; | let exists = !!game; | ||||
if (!exists) | if (!exists) | ||||
game = new Game(this.mapCache); | game = new Game(this.mapCache); | ||||
game.update(stanza, selectedColumn); | game.update(stanza, selectedColumn); | ||||
newGames[stanza.hostUsername] = game; | newGames[stanza.hostJID] = game; | ||||
} | } | ||||
this.games = newGames; | this.games = newGames; | ||||
Engine.ProfileStop(); | Engine.ProfileStop(); | ||||
} | } | ||||
{ | { | ||||
Engine.ProfileStart("filterGameList"); | Engine.ProfileStart("filterGameList"); | ||||
this.gameList.length = 0; | this.gameList.length = 0; | ||||
Show All 39 Lines | let selectedGameIndex = -1; | ||||
this.list_private[i] = displayData.private; | this.list_private[i] = displayData.private; | ||||
this.list_gameName[i] = displayData.gameName; | this.list_gameName[i] = displayData.gameName; | ||||
this.list_mapName[i] = displayData.mapName; | this.list_mapName[i] = displayData.mapName; | ||||
this.list_mapSize[i] = displayData.mapSize; | this.list_mapSize[i] = displayData.mapSize; | ||||
this.list_mapType[i] = displayData.mapType; | this.list_mapType[i] = displayData.mapType; | ||||
this.list_maxnbp[i] = displayData.playerCount; | this.list_maxnbp[i] = displayData.playerCount; | ||||
this.list_gameRating[i] = game.gameRating; | this.list_gameRating[i] = game.gameRating; | ||||
this.list[i] = ""; | this.list[i] = ""; | ||||
if (selectedGame && game.stanza.hostUsername == selectedGame.stanza.hostUsername && game.stanza.name == selectedGame.stanza.name) | if (selectedGame && game.stanza.hostJID == selectedGame.stanza.hostJID && game.stanza.name == selectedGame.stanza.name) | ||||
selectedGameIndex = i; | selectedGameIndex = i; | ||||
}); | }); | ||||
Engine.ProfileStop(); | Engine.ProfileStop(); | ||||
} | } | ||||
{ | { | ||||
Engine.ProfileStart("copyToGUI"); | Engine.ProfileStart("copyToGUI"); | ||||
let gamesBox = this.gamesBox; | let gamesBox = this.gamesBox; | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator