Changeset View
Standalone View
binaries/data/mods/public/gui/gamesetup/gamesetup.js
Context not available. | |||||
"ExploreMap": "exploreMap", | "ExploreMap": "exploreMap", | ||||
"DisableTreasures": "disableTreasures", | "DisableTreasures": "disableTreasures", | ||||
"LockTeams": "lockTeams", | "LockTeams": "lockTeams", | ||||
"LastManStanding" : "lastManStanding", | "LastManStanding": "lastManStanding", | ||||
"RegicideGarrison": "regicideGarrison", | |||||
"CheatsEnabled": "enableCheats" | "CheatsEnabled": "enableCheats" | ||||
}; | }; | ||||
elexis: (This will keep the setting saved even if the victory condition is changed again, but fixing… | |||||
Not Done Inline Actions(Yes, also an issue for RelicCount and VictoryDuration, and it's not so nice when these are written to the commands.txt for no reason.) Sandarac: (Yes, also an issue for `RelicCount` and `VictoryDuration`, and it's not so nice when these are… | |||||
Context not available. | |||||
{ | { | ||||
delete g_GameAttributes.settings.WonderDuration; | delete g_GameAttributes.settings.WonderDuration; | ||||
delete g_GameAttributes.settings.LastManStanding; | delete g_GameAttributes.settings.LastManStanding; | ||||
delete g_GameAttributes.settings.RegicideGarrison; | |||||
leperUnsubmitted Not Done Inline Actionsdelete is slow and messes up some structure information internally, if we have to do that (which I think we do here, but this diff is lacking context) we might want to reorder the structure so we delete the last property added (or defined). leper: `delete` is slow and messes up some structure information internally, if we have to do that… | |||||
elexisUnsubmitted Not Done Inline ActionsContext should be clear, when changing the map, these settings can be persisted unless it is a scenario map. elexis: Context should be clear, when changing the map, these settings can be persisted unless it is a… | |||||
} | } | ||||
if (mapSettings.PlayerData) | if (mapSettings.PlayerData) | ||||
Context not available. | |||||
setGUIBoolean("revealMap", "revealMapText", !!mapSettings.RevealMap); | setGUIBoolean("revealMap", "revealMapText", !!mapSettings.RevealMap); | ||||
setGUIBoolean("lockTeams", "lockTeamsText", !!mapSettings.LockTeams); | setGUIBoolean("lockTeams", "lockTeamsText", !!mapSettings.LockTeams); | ||||
setGUIBoolean("lastManStanding", "lastManStandingText", !!mapSettings.LastManStanding); | setGUIBoolean("lastManStanding", "lastManStandingText", !!mapSettings.LastManStanding); | ||||
setGUIBoolean("regicideGarrison", "regicideGarrisonText", !!mapSettings.RegicideGarrison); | |||||
setGUIBoolean("enableRating", "enableRatingText", !!mapSettings.RatingEnabled); | setGUIBoolean("enableRating", "enableRatingText", !!mapSettings.RatingEnabled); | ||||
Engine.GetGUIObjectByName("optionWonderDuration").hidden = | Engine.GetGUIObjectByName("optionWonderDuration").hidden = | ||||
g_GameAttributes.settings.GameType && | g_GameAttributes.settings.GameType && | ||||
g_GameAttributes.settings.GameType != "wonder"; | g_GameAttributes.settings.GameType != "wonder"; | ||||
Engine.GetGUIObjectByName("optionRegicideGarrison").hidden = | |||||
g_GameAttributes.settings.GameType && | |||||
g_GameAttributes.settings.GameType != "regicide"; | |||||
Engine.GetGUIObjectByName("cheatWarningText").hidden = !g_IsNetworked || !mapSettings.CheatsEnabled; | Engine.GetGUIObjectByName("cheatWarningText").hidden = !g_IsNetworked || !mapSettings.CheatsEnabled; | ||||
Context not available. | |||||
for (let ctrl of ["victoryCondition", "wonderDuration", "populationCap", | for (let ctrl of ["victoryCondition", "wonderDuration", "populationCap", | ||||
"startingResources", "ceasefire", "revealMap", | "startingResources", "ceasefire", "revealMap", | ||||
"exploreMap", "disableTreasures", "lockTeams", "lastManStanding"]) | "exploreMap", "disableTreasures", "lockTeams", | ||||
"lastManStanding", "regicideGarrison"]) | |||||
hideControl(ctrl, ctrl + "Text", notScenario); | hideControl(ctrl, ctrl + "Text", notScenario); | ||||
Engine.GetGUIObjectByName("civResetButton").hidden = !notScenario; | Engine.GetGUIObjectByName("civResetButton").hidden = !notScenario; | ||||
Context not available. | |||||
Not Done Inline Actions(Correct, must be in this check because it's a user setting, as opposed to the properties deleted in the loop above.) elexis: (Correct, must be in this check because it's a user setting, as opposed to the properties… |
(This will keep the setting saved even if the victory condition is changed again, but fixing this is out-of-scope as it isn't trivial.)