Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/lobby/LobbyPage/GameList.js
Show First 20 Lines • Show All 91 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.ip] || undefined; | let game = this.games[stanza.hostUsername] || 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.ip] = game; | newGames[stanza.hostUsername] = 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 37 Lines | let selectedGameIndex = -1; | ||||
this.list_buddy[i] = displayData.buddy; | this.list_buddy[i] = displayData.buddy; | ||||
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.hostUsername == selectedGame.hostUsername && game.stanza.gameName == selectedGame.stanza.gameName) | |||||
if (selectedGame && game.stanza.ip == selectedGame.stanza.ip && game.stanza.port == selectedGame.stanza.port) | |||||
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 54 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator