Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/maps/mapbrowser/MapBrowser.js
Show All 13 Lines | constructor(mapCache, mapFilters, setupWindow = undefined) | ||||
this.gridBrowser = new MapGridBrowser(this, setupWindow); | this.gridBrowser = new MapGridBrowser(this, setupWindow); | ||||
this.controls = new MapBrowserPageControls(this, this.gridBrowser); | this.controls = new MapBrowserPageControls(this, this.gridBrowser); | ||||
this.open = false; | this.open = false; | ||||
} | } | ||||
submitMapSelection() | submitMapSelection() | ||||
{ | { | ||||
let file = this.gridBrowser.getSelected(); | |||||
let type = this.controls.MapFiltering.getSelectedMapType(); | |||||
let filter = this.controls.MapFiltering.getSelectedMapFilter(); | |||||
if (file) | |||||
{ | |||||
type = file.mapType; | |||||
filter = file.filter; | |||||
file = file.file; | |||||
} | |||||
this.onSubmitMapSelection( | this.onSubmitMapSelection( | ||||
this.gridBrowser.getSelectedFile(), | file, | ||||
this.controls.MapFiltering.getSelectedMapType(), | type, | ||||
this.controls.MapFiltering.getSelectedMapFilter() | filter | ||||
); | ); | ||||
this.closePage(); | this.closePage(); | ||||
} | } | ||||
// TODO: this is mostly gamesetup specific stuff. | // TODO: this is mostly gamesetup specific stuff. | ||||
registerOpenPageHandler(handler) | registerOpenPageHandler(handler) | ||||
{ | { | ||||
this.openPageHandlers.add(handler); | this.openPageHandlers.add(handler); | ||||
Show All 25 Lines |
Wildfire Games · Phabricator