Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js
Show First 20 Lines • Show All 354 Lines • ▼ Show 20 Lines | "map": [ | ||||
"numPlayers", | "numPlayers", | ||||
"mapSize" | "mapSize" | ||||
], | ], | ||||
"more": [ | "more": [ | ||||
"biome", | "biome", | ||||
"gameSpeed", | "gameSpeed", | ||||
"victoryCondition", | "victoryCondition", | ||||
"relicCount", | "relicCount", | ||||
"victoryDuration", | "relicDuration", | ||||
"wonderDuration", | |||||
"populationCap", | "populationCap", | ||||
"startingResources", | "startingResources", | ||||
"ceasefire", | "ceasefire", | ||||
"regicideGarrison", | "regicideGarrison", | ||||
"exploreMap", | "exploreMap", | ||||
"revealMap", | "revealMap", | ||||
"disableTreasures", | "disableTreasures", | ||||
"disableSpies", | "disableSpies", | ||||
▲ Show 20 Lines • Show All 221 Lines • ▼ Show 20 Lines | "relicCount": { | ||||
"get": () => g_GameAttributes.settings.RelicCount, | "get": () => g_GameAttributes.settings.RelicCount, | ||||
"select": (idx) => { | "select": (idx) => { | ||||
g_GameAttributes.settings.RelicCount = g_RelicCountList[idx]; | g_GameAttributes.settings.RelicCount = g_RelicCountList[idx]; | ||||
}, | }, | ||||
"hidden": () => g_GameAttributes.settings.GameType != "capture_the_relic", | "hidden": () => g_GameAttributes.settings.GameType != "capture_the_relic", | ||||
"enabled": () => g_GameAttributes.mapType != "scenario", | "enabled": () => g_GameAttributes.mapType != "scenario", | ||||
"initOrder": 1000 | "initOrder": 1000 | ||||
}, | }, | ||||
"victoryDuration": { | "relicDuration": { | ||||
"title": () => translate("Victory Duration"), | "title": () => translate("Relic Duration"), | ||||
"tooltip": (hoverIdx) => translate("Number of minutes until the player has won."), | "tooltip": (hoverIdx) => translate("Minutes until the player has achieved Relic Victory."), | ||||
"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.RelicDuration !== undefined, | ||||
"get": () => g_GameAttributes.settings.VictoryDuration, | "get": () => g_GameAttributes.settings.RelicDuration, | ||||
"select": (idx) => { | "select": (idx) => { | ||||
g_GameAttributes.settings.VictoryDuration = g_VictoryDurations.Duration[idx]; | g_GameAttributes.settings.RelicDuration = g_VictoryDurations.Duration[idx]; | ||||
}, | }, | ||||
"hidden": () => | "hidden": () => g_GameAttributes.settings.GameType != "capture_the_relic", | ||||
g_GameAttributes.settings.GameType != "wonder" && | "enabled": () => g_GameAttributes.mapType != "scenario", | ||||
g_GameAttributes.settings.GameType != "capture_the_relic", | "initOrder": 1000 | ||||
}, | |||||
"wonderDuration": { | |||||
"title": () => translate("Wonder Duration"), | |||||
"tooltip": (hoverIdx) => translate("Minutes until the player has achieved Wonder Victory."), | |||||
"labels": () => g_VictoryDurations.Title, | |||||
"ids": () => g_VictoryDurations.Duration, | |||||
"default": () => g_VictoryDurations.Default, | |||||
"defined": () => g_GameAttributes.settings.WonderDuration !== undefined, | |||||
"get": () => g_GameAttributes.settings.WonderDuration, | |||||
"select": (idx) => { | |||||
g_GameAttributes.settings.WonderDuration = g_VictoryDurations.Duration[idx]; | |||||
}, | |||||
"hidden": () => g_GameAttributes.settings.GameType != "wonder", | |||||
"enabled": () => g_GameAttributes.mapType != "scenario", | "enabled": () => g_GameAttributes.mapType != "scenario", | ||||
"initOrder": 1000 | "initOrder": 1000 | ||||
}, | }, | ||||
"gameSpeed": { | "gameSpeed": { | ||||
"title": () => translate("Game Speed"), | "title": () => translate("Game Speed"), | ||||
"tooltip": (hoverIdx) => translate("Select game speed."), | "tooltip": (hoverIdx) => translate("Select game speed."), | ||||
"labels": () => g_GameSpeeds.Title, | "labels": () => g_GameSpeeds.Title, | ||||
"ids": () => g_GameSpeeds.Speed, | "ids": () => g_GameSpeeds.Speed, | ||||
▲ Show 20 Lines • Show All 1,101 Lines • ▼ Show 20 Lines | function selectMap(name) | ||||
{ | { | ||||
let victoryIdx = g_VictoryConditions.Name.indexOf(mapSettings.GameType || "") != -1 ? g_VictoryConditions.Name.indexOf(mapSettings.GameType) : g_VictoryConditions.Default; | let victoryIdx = g_VictoryConditions.Name.indexOf(mapSettings.GameType || "") != -1 ? g_VictoryConditions.Name.indexOf(mapSettings.GameType) : g_VictoryConditions.Default; | ||||
g_GameAttributes.settings.GameType = g_VictoryConditions.Name[victoryIdx]; | g_GameAttributes.settings.GameType = g_VictoryConditions.Name[victoryIdx]; | ||||
g_GameAttributes.settings.VictoryScripts = g_VictoryConditions.Scripts[victoryIdx]; | g_GameAttributes.settings.VictoryScripts = g_VictoryConditions.Scripts[victoryIdx]; | ||||
} | } | ||||
if (g_GameAttributes.mapType == "scenario") | if (g_GameAttributes.mapType == "scenario") | ||||
{ | { | ||||
delete g_GameAttributes.settings.VictoryDuration; | delete g_GameAttributes.settings.RelicDuration; | ||||
delete g_GameAttributes.settings.WonderDuration; | |||||
delete g_GameAttributes.settings.LastManStanding; | delete g_GameAttributes.settings.LastManStanding; | ||||
delete g_GameAttributes.settings.RegicideGarrison; | delete g_GameAttributes.settings.RegicideGarrison; | ||||
} | } | ||||
if (mapSettings.PlayerData) | if (mapSettings.PlayerData) | ||||
sanitizePlayerData(mapSettings.PlayerData); | sanitizePlayerData(mapSettings.PlayerData); | ||||
// Copy any new settings | // Copy any new settings | ||||
▲ Show 20 Lines • Show All 679 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator