Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
Show First 20 Lines • Show All 1,707 Lines • ▼ Show 20 Lines | function getFilteredMaps(filterFunc) | ||||
for (let mapFile of listFiles(g_GameAttributes.mapPath, g_GameAttributes.mapType == "random" ? ".json" : ".xml", false)) | for (let mapFile of listFiles(g_GameAttributes.mapPath, g_GameAttributes.mapType == "random" ? ".json" : ".xml", false)) | ||||
{ | { | ||||
if (mapFile.startsWith("_")) | if (mapFile.startsWith("_")) | ||||
continue; | continue; | ||||
let file = g_GameAttributes.mapPath + mapFile; | let file = g_GameAttributes.mapPath + mapFile; | ||||
let mapData = loadMapData(file); | let mapData = loadMapData(file); | ||||
if (!mapData.settings || filterFunc && !filterFunc(mapData.settings.Keywords || [])) | if (!mapData || !mapData.settings || filterFunc && !filterFunc(mapData.settings.Keywords || [])) | ||||
continue; | continue; | ||||
maps.push({ | maps.push({ | ||||
"file": file, | "file": file, | ||||
"name": translate(getMapDisplayName(file)), | "name": translate(getMapDisplayName(file)), | ||||
"color": g_ColorRegular, | "color": g_ColorRegular, | ||||
"description": translate(mapData.settings.Description) | "description": translate(mapData.settings.Description) | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 1,047 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator