Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/gamesetup/Panels/MapPreview.js
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
class MapPreview | |||||
{ | |||||
constructor(gameSettingsControl, mapCache) | |||||
{ | |||||
this.mapCache = mapCache; | |||||
this.mapInfoName = Engine.GetGUIObjectByName("mapInfoName"); | |||||
this.mapPreview = Engine.GetGUIObjectByName("mapPreview"); | |||||
gameSettingsControl.registerGameAttributesBatchChangeHandler(this.onGameAttributesBatchChange.bind(this)); | |||||
} | |||||
onGameAttributesBatchChange() | |||||
{ | |||||
if (!g_GameAttributes.map || !g_GameAttributes.mapType) | |||||
return; | |||||
this.mapInfoName.caption = this.mapCache.translateMapName( | |||||
this.mapCache.getTranslatableMapName(g_GameAttributes.mapType, g_GameAttributes.map)); | |||||
this.mapPreview.sprite = | |||||
this.mapCache.getMapPreview(g_GameAttributes.mapType, g_GameAttributes.map, g_GameAttributes); | |||||
} | |||||
} |
Wildfire Games · Phabricator