Differential D2577 Diff 11116 ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/Panels/MapPreview.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/Panels/MapPreview.js
class MapPreview | class MapPreview | ||||
{ | { | ||||
constructor(gameSettingsControl, mapCache) | constructor(setupWindow) | ||||
{ | { | ||||
this.gameSettingsControl = gameSettingsControl; | this.gameSettingsControl = setupWindow.controls.gameSettingsControl; | ||||
this.mapCache = mapCache; | this.mapCache = setupWindow.controls.mapCache; | ||||
this.mapInfoName = Engine.GetGUIObjectByName("mapInfoName"); | this.mapInfoName = Engine.GetGUIObjectByName("mapInfoName"); | ||||
this.mapPreview = Engine.GetGUIObjectByName("mapPreview"); | this.mapPreview = Engine.GetGUIObjectByName("mapPreview"); | ||||
gameSettingsControl.registerMapChangeHandler(this.onMapChange.bind(this)); | this.gameSettingsControl.registerMapChangeHandler(this.onMapChange.bind(this)); | ||||
gameSettingsControl.registerGameAttributesBatchChangeHandler(this.onGameAttributesBatchChange.bind(this)); | this.gameSettingsControl.registerGameAttributesBatchChangeHandler(this.onGameAttributesBatchChange.bind(this)); | ||||
} | } | ||||
onMapChange(mapData) | onMapChange(mapData) | ||||
{ | { | ||||
let preview = mapData && mapData.settings && mapData.settings.Preview; | let preview = mapData && mapData.settings && mapData.settings.Preview; | ||||
if (!g_GameAttributes.settings.Preview || g_GameAttributes.settings.Preview != preview) | if (!g_GameAttributes.settings.Preview || g_GameAttributes.settings.Preview != preview) | ||||
{ | { | ||||
g_GameAttributes.settings.Preview = preview; | g_GameAttributes.settings.Preview = preview; | ||||
Show All 16 Lines |
Wildfire Games · Phabricator