Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesetup/gamesetup.js
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
); | ); | ||||
/** | /** | ||||
* Offer users to select playable civs only. | * Offer users to select playable civs only. | ||||
* Load unselectable civs as they could appear in scenario maps. | * Load unselectable civs as they could appear in scenario maps. | ||||
*/ | */ | ||||
var g_CivData = loadCivData(); | var g_CivData = loadCivData(); | ||||
/** | |||||
* Number of relics: [1, ..., NumCivs] | |||||
*/ | |||||
var g_RelicCountList = Object.keys(g_CivData).map((civ, i) => i + 1); | |||||
var g_PlayerCivList = g_CivData && prepareForDropdown([{ | var g_PlayerCivList = g_CivData && prepareForDropdown([{ | ||||
"name": '[color="' + g_ColorRandom + '"]' + translateWithContext("civilization", "Random") + '[/color]', | "name": '[color="' + g_ColorRandom + '"]' + translateWithContext("civilization", "Random") + '[/color]', | ||||
"code": "random" | "code": "random" | ||||
}].concat( | }].concat( | ||||
Object.keys(g_CivData).filter( | Object.keys(g_CivData).filter( | ||||
civ => g_CivData[civ].SelectableInGameSetup | civ => g_CivData[civ].SelectableInGameSetup | ||||
).map(civ => ({ | ).map(civ => ({ | ||||
"name": g_CivData[civ].Name, | "name": g_CivData[civ].Name, | ||||
▲ Show 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | "map": { | ||||
], | ], | ||||
"Checkbox": [ | "Checkbox": [ | ||||
], | ], | ||||
}, | }, | ||||
"more": { | "more": { | ||||
"Dropdown": [ | "Dropdown": [ | ||||
"gameSpeed", | "gameSpeed", | ||||
"victoryCondition", | "victoryCondition", | ||||
"relicCount", | |||||
"victoryDuration", | "victoryDuration", | ||||
"populationCap", | "populationCap", | ||||
"startingResources", | "startingResources", | ||||
"ceasefire", | "ceasefire", | ||||
], | ], | ||||
"Checkbox": [ | "Checkbox": [ | ||||
"exploreMap", | "exploreMap", | ||||
"revealMap", | "revealMap", | ||||
▲ Show 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | "victoryCondition": { | ||||
"get": () => g_GameAttributes.settings.GameType, | "get": () => g_GameAttributes.settings.GameType, | ||||
"select": (idx) => { | "select": (idx) => { | ||||
g_GameAttributes.settings.GameType = g_VictoryConditions.Name[idx]; | g_GameAttributes.settings.GameType = g_VictoryConditions.Name[idx]; | ||||
g_GameAttributes.settings.VictoryScripts = g_VictoryConditions.Scripts[idx]; | g_GameAttributes.settings.VictoryScripts = g_VictoryConditions.Scripts[idx]; | ||||
}, | }, | ||||
"enabled": () => g_GameAttributes.mapType != "scenario", | "enabled": () => g_GameAttributes.mapType != "scenario", | ||||
"autocomplete": true, | "autocomplete": true, | ||||
}, | }, | ||||
"relicCount": { | |||||
"title": () => translate("Relic Count"), | |||||
"tooltip": () => translate("Total number of relics spawned on the map."), | |||||
"labels": () => g_RelicCountList, | |||||
"ids": () => g_RelicCountList, | |||||
"default": () => g_RelicCountList.indexOf(5), | |||||
"defined": () => g_GameAttributes.settings.RelicCount !== undefined, | |||||
"get": () => g_GameAttributes.settings.RelicCount, | |||||
"select": (idx) => { | |||||
g_GameAttributes.settings.RelicCount = g_RelicCountList[idx]; | |||||
}, | |||||
"hidden": () => g_GameAttributes.settings.GameType != "capture_the_relic", | |||||
"enabled": () => g_GameAttributes.mapType != "scenario", | |||||
}, | |||||
"victoryDuration": { | "victoryDuration": { | ||||
"title": () => translate("Victory Duration"), | "title": () => translate("Victory Duration"), | ||||
"tooltip": () => translate("Number of minutes until the player has won."), | "tooltip": () => translate("Number of minutes until the player has won."), | ||||
"labels": () => g_VictoryDurations.Title, | "labels": () => g_VictoryDurations.Title, | ||||
"ids": () => g_VictoryDurations.Duration, | "ids": () => g_VictoryDurations.Duration, | ||||
"default": () => g_VictoryDurations.Default, | "default": () => g_VictoryDurations.Default, | ||||
"defined": () => g_GameAttributes.settings.VictoryDuration !== undefined, | "defined": () => g_GameAttributes.settings.VictoryDuration !== undefined, | ||||
"get": () => g_GameAttributes.settings.VictoryDuration, | "get": () => g_GameAttributes.settings.VictoryDuration, | ||||
▲ Show 20 Lines • Show All 1,598 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator