Index: ps/trunk/binaries/data/mods/public/gui/common/gamedescription.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/common/gamedescription.js +++ ps/trunk/binaries/data/mods/public/gui/common/gamedescription.js @@ -397,6 +397,11 @@ }); titles.push({ + "label": translate("Allied View"), + "value": initAttributes.settings.AllyView + }); + + titles.push({ "label": translate("Cheats"), "value": initAttributes.settings.CheatsEnabled }); Index: ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json =================================================================== --- ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json +++ ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json @@ -125,6 +125,7 @@ { "nick": "Itms", "name": "Nicolas Auvray" }, { "nick": "Jaison", "name": "Marco tom Suden" }, { "nick": "jammus", "name": "James Scott" }, + { "nick": "Jammyjamjamman", "name": "James Sherratt" }, { "nick": "Janwas", "name": "Jan Wassenberg" }, { "nick": "javiergodas", "name": "Javier Godas Vieitez" }, { "nick": "JCWasmx86" }, Index: ps/trunk/binaries/data/mods/public/gui/gamesettings/attributes/MapExploration.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/gamesettings/attributes/MapExploration.js +++ ps/trunk/binaries/data/mods/public/gui/gamesettings/attributes/MapExploration.js @@ -4,6 +4,7 @@ { this.explored = false; this.revealed = false; + this.allied = false; this.settings.map.watch(() => this.onMapChange(), ["map"]); } @@ -12,12 +13,14 @@ { attribs.settings.RevealMap = this.revealed; attribs.settings.ExploreMap = this.explored; + attribs.settings.AllyView = this.allied; } fromInitAttributes(attribs) { this.explored = !!this.getLegacySetting(attribs, "ExploreMap"); this.revealed = !!this.getLegacySetting(attribs, "RevealMap"); + this.allied = !!this.getLegacySetting(attribs, "AllyView"); } onMapChange(mapData) @@ -26,6 +29,7 @@ return; this.setExplored(this.getMapSetting("ExploreMap")); this.setRevealed(this.getMapSetting("RevealMap")); + this.setAllied(this.getMapSetting("AllyView")); } setExplored(enabled) @@ -38,5 +42,12 @@ { this.explored = this.explored || enabled; this.revealed = enabled; + this.allied = this.allied || enabled; + } + + setAllied(enabled) + { + this.allied = enabled; + this.revealed = this.revealed && this.allied; } }; Index: ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/GameSettingsLayout.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/GameSettingsLayout.js +++ ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/GameSettingsLayout.js @@ -20,7 +20,8 @@ "Nomad", "Treasures", "ExploredMap", - "RevealedMap" + "RevealedMap", + "AlliedView" ] }, { Index: ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Checkboxes/AlliedView.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Checkboxes/AlliedView.js +++ ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Checkboxes/AlliedView.js @@ -0,0 +1,30 @@ +GameSettingControls.AlliedView = class AlliedView extends GameSettingControlCheckbox +{ + constructor(...args) + { + super(...args); + g_GameSettings.mapExploration.watch(() => this.render(), ["allied"]); + g_GameSettings.map.watch(() => this.render(), ["type"]); + this.render(); + } + + render() + { + this.setEnabled(g_GameSettings.map.type != "scenario"); + this.setChecked(g_GameSettings.mapExploration.allied); + } + + onPress(checked) + { + g_GameSettings.mapExploration.setAllied(checked); + this.gameSettingsController.setNetworkInitAttributes(); + } +}; + +// Translation: View what your allies can see. +GameSettingControls.AlliedView.prototype.TitleCaption = + translate("Allied View"); + +// Translation: Enable viewing what your allies can see from the start of the game. +GameSettingControls.AlliedView.prototype.Tooltip = + translate("Toggle allied view (see what your allies see)."); Index: ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/Panels/GameDescription.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/Panels/GameDescription.js +++ ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/Panels/GameDescription.js @@ -23,6 +23,7 @@ g_GameSettings.map.watch(update, ["map", "type"]); g_GameSettings.mapExploration.watch(update, ["explored"]); g_GameSettings.mapExploration.watch(update, ["revealed"]); + g_GameSettings.mapExploration.watch(update, ["allied"]); g_GameSettings.nomad.watch(update, ["enabled"]); g_GameSettings.population.watch(update, ["perPlayer", "cap", "useWorldPop"]); g_GameSettings.rating.watch(update, ["enabled"]); Index: ps/trunk/binaries/data/mods/public/simulation/helpers/InitGame.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/helpers/InitGame.js +++ ps/trunk/binaries/data/mods/public/simulation/helpers/InitGame.js @@ -68,6 +68,9 @@ if (settings.PopulationCap) cmpPlayer.SetMaxPopulation(settings.PopulationCap); + + if (settings.AllyView) + Engine.QueryInterface(cmpPlayer.entity, IID_TechnologyManager)?.ResearchTechnology(cmpPlayer.template.SharedLosTech); } if (settings.WorldPopulationCap) Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).SetMaxWorldPopulation(settings.WorldPopulationCap); Index: ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp =================================================================== --- ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp +++ ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp @@ -39,6 +39,7 @@ ID_MapName, ID_MapDescription, ID_MapReveal, + ID_MapAlly, ID_MapType, ID_MapPreview, ID_MapTeams, @@ -169,6 +170,7 @@ gridSizer->Add(Tooltipped(new wxTextCtrl(this, ID_MapPreview, wxEmptyString), _("Texture used for map preview")), wxSizerFlags().Expand()); CREATE_CHECKBOX(this, gridSizer, "Reveal map", "If checked, players won't need to explore", ID_MapReveal); + CREATE_CHECKBOX(this, gridSizer, "Ally view", "If checked, players will be able to see what their teammates see and won't need to research cartography", ID_MapAlly); CREATE_CHECKBOX(this, gridSizer, "Lock teams", "If checked, teams will be locked", ID_MapTeams); sizer->Add(gridSizer, wxSizerFlags().Expand()); @@ -233,6 +235,9 @@ // reveal map wxDynamicCast(FindWindow(ID_MapReveal), wxCheckBox)->SetValue(wxString::FromUTF8(m_MapSettings["RevealMap"]) == "true"); + // ally view + wxDynamicCast(FindWindow(ID_MapAlly), wxCheckBox)->SetValue(wxString::FromUTF8(m_MapSettings["AllyView"]) == "true"); + // victory conditions m_MapSettingsVictoryConditions.clear(); for (AtIter victoryCondition = m_MapSettings["VictoryConditions"]["item"]; victoryCondition.defined(); ++victoryCondition) @@ -364,6 +369,9 @@ // reveal map m_MapSettings.setBool("RevealMap", wxDynamicCast(FindWindow(ID_MapReveal), wxCheckBox)->GetValue()); + // ally view + m_MapSettings.setBool("AllyView", wxDynamicCast(FindWindow(ID_MapAlly), wxCheckBox)->GetValue()); + // victory conditions #define INSERT_VICTORY_CONDITION_CHECKBOX(name, ID) \ if (wxDynamicCast(FindWindow(ID), wxCheckBox)->GetValue()) \