Differential D2412 Diff 10357 binaries/data/mods/public/gui/lobby/LobbyPage/GameListFilters/MapType.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/lobby/LobbyPage/GameListFilters/MapType.js
- This file was added.
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
GameListFilters.MapType = class | |||||
{ | |||||
constructor(onFilterChange) | |||||
{ | |||||
this.selected = ""; | |||||
this.onFilterChange = onFilterChange; | |||||
this.mapTypeFilter = Engine.GetGUIObjectByName("mapTypeFilter"); | |||||
this.mapTypeFilter.list = [translateWithContext("map", "Any")].concat(g_MapTypes.Title); | |||||
this.mapTypeFilter.list_data = [""].concat(g_MapTypes.Name); | |||||
this.mapTypeFilter.selected = g_MapTypes.Default; | |||||
this.mapTypeFilter.onSelectionChange = this.onSelectionChange.bind(this); | |||||
} | |||||
onSelectionChange() | |||||
{ | |||||
this.selected = this.mapTypeFilter.list_data[this.mapTypeFilter.selected]; | |||||
this.onFilterChange(); | |||||
} | |||||
filter(game) | |||||
{ | |||||
return !this.selected || game.stanza.mapType == this.selected; | |||||
} | |||||
}; |
Wildfire Games · Phabricator