Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/common/settings.js
Show First 20 Lines • Show All 203 Lines • ▼ Show 20 Lines | return json.Times.map(timeout => ({ | ||||
"Default": timeout == json.Default, | "Default": timeout == json.Default, | ||||
"Title": timeout == 0 ? translateWithContext("ceasefire", "No ceasefire") : | "Title": timeout == 0 ? translateWithContext("ceasefire", "No ceasefire") : | ||||
sprintf(translatePluralWithContext("ceasefire", "%(minutes)s minute", "%(minutes)s minutes", timeout), { "minutes": timeout }) | sprintf(translatePluralWithContext("ceasefire", "%(minutes)s minute", "%(minutes)s minutes", timeout), { "minutes": timeout }) | ||||
})); | })); | ||||
} | } | ||||
/** | /** | ||||
* Hardcoded, as modding is not supported without major changes. | * Hardcoded, as modding is not supported without major changes. | ||||
* | |||||
* @returns {Array} | |||||
*/ | */ | ||||
function loadMapTypes() | function loadMapTypes() | ||||
{ | { | ||||
return [ | return [ | ||||
{ | { | ||||
"Name": "skirmish", | "Name": "skirmish", | ||||
"Title": translateWithContext("map", "Skirmish"), | "Title": translateWithContext("map", "Skirmish"), | ||||
"Description": translate("A map with a predefined landscape and number of players. Freely select the other gamesettings."), | "Description": translate("A map with a predefined landscape and number of players. Freely select the other gamesettings."), | ||||
"Default": true | "Default": true, | ||||
"Path": "maps/skirmishes/", | |||||
"Suffix": ".xml", | |||||
"GetData": Engine.LoadMapSettings | |||||
}, | }, | ||||
{ | { | ||||
"Name": "random", | "Name": "random", | ||||
"Title": translateWithContext("map", "Random"), | "Title": translateWithContext("map", "Random"), | ||||
"Description": translate("Create a unique map with a different resource distribution each time. Freely select the number of players and teams.") | "Description": translate("Create a unique map with a different resource distribution each time. Freely select the number of players and teams."), | ||||
"Path": "maps/random/", | |||||
"Suffix": ".json", | |||||
"GetData": mapPath => Engine.ReadJSONFile(mapPath + ".json") | |||||
}, | }, | ||||
{ | { | ||||
"Name": "scenario", | "Name": "scenario", | ||||
"Title": translateWithContext("map", "Scenario"), | "Title": translateWithContext("map", "Scenario"), | ||||
"Description": translate("A map with a predefined landscape and matchsettings.") | "Description": translate("A map with a predefined landscape and matchsettings."), | ||||
"Path": "maps/scenarios/", | |||||
"Suffix": ".xml", | |||||
"GetData": Engine.LoadMapSettings | |||||
} | } | ||||
]; | ]; | ||||
} | } | ||||
function loadBiomes() | function loadBiomes() | ||||
{ | { | ||||
return listFiles(g_BiomesDirectory, ".json", true).filter(biomeID => biomeID != "defaultbiome").map(biomeID => { | return listFiles(g_BiomesDirectory, ".json", true).filter(biomeID => biomeID != "defaultbiome").map(biomeID => { | ||||
let description = Engine.ReadJSONFile(g_BiomesDirectory + biomeID + ".json").Description; | let description = Engine.ReadJSONFile(g_BiomesDirectory + biomeID + ".json").Description; | ||||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator