Differential D2412 Diff 10323 binaries/data/mods/public/gui/lobby/LobbyPage/GameListFilters/PlayerCount.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/lobby/LobbyPage/GameListFilters/PlayerCount.js
- This file was added.
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
GameListFilters.PlayerCount = class | |||||
{ | |||||
constructor(onFilterChange) | |||||
{ | |||||
let playersArray = Array(g_MaxPlayers).fill(0).map((v, i) => i + 1); // 1, 2, ... MaxPlayers | |||||
this.playersNumberFilter = Engine.GetGUIObjectByName("playersNumberFilter"); | |||||
this.playersNumberFilter.list = [translateWithContext("player number", "Any")].concat(playersArray); | |||||
this.playersNumberFilter.list_data = [""].concat(playersArray); | |||||
this.playersNumberFilter.selected = 0; | |||||
Freagarach: Comment on top? | |||||
Done Inline Actionsy thx elexis: y thx | |||||
Done Inline Actionsactually none of the gamelist filters have a comment, and I dont know what to write there that isnt already obvious enough from this small class. There is already this comment for the container class: /** * Each property of this class handles one specific map filter and is defined in external files. */ class GameListFilters { } elexis: actually none of the gamelist filters have a comment, and I dont know what to write there that… | |||||
this.playersNumberFilter.onSelectionChange = onFilterChange; | |||||
} | |||||
filter(game) | |||||
{ | |||||
return this.playersNumberFilter.selected == 0 || | |||||
game.maxnbp == this.playersNumberFilter.list_data[this.playersNumberFilter.selected]; | |||||
} | |||||
}; |
Wildfire Games · Phabricator
Comment on top?