Index: binaries/data/mods/public/gui/common/gamedescription.js =================================================================== --- binaries/data/mods/public/gui/common/gamedescription.js +++ binaries/data/mods/public/gui/common/gamedescription.js @@ -396,6 +396,11 @@ "value": initAttributes.settings.RevealMap }); + titles.push({ + "label": translate("Allied View"), + "value": initAttributes.settings.AllyView + }); + titles.push({ "label": translate("Cheats"), "value": initAttributes.settings.CheatsEnabled Index: binaries/data/mods/public/gui/credits/texts/programming.json =================================================================== --- binaries/data/mods/public/gui/credits/texts/programming.json +++ 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: binaries/data/mods/public/gui/gamesettings/attributes/MapExploration.js =================================================================== --- binaries/data/mods/public/gui/gamesettings/attributes/MapExploration.js +++ 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.setRevealed(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: binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/GameSettingsLayout.js =================================================================== --- binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/GameSettingsLayout.js +++ binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/GameSettingsLayout.js @@ -20,7 +20,8 @@ "Nomad", "Treasures", "ExploredMap", - "RevealedMap" + "RevealedMap", + "AlliedView" ] }, { Index: binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Checkboxes/AlliedView.js =================================================================== --- /dev/null +++ binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Checkboxes/AlliedView.js @@ -0,0 +1,28 @@ +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(); + } +}; + +GameSettingControls.AlliedView.prototype.TitleCaption = + translate("Allied View"); + +GameSettingControls.AlliedView.prototype.Tooltip = + translate("Toggle allied view (see what your allies see)."); Index: binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/Panels/GameDescription.js =================================================================== --- binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/Panels/GameDescription.js +++ 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: binaries/data/mods/public/l10n/en_GB.public-gui-gamesetup.po =================================================================== --- binaries/data/mods/public/l10n/en_GB.public-gui-gamesetup.po +++ binaries/data/mods/public/l10n/en_GB.public-gui-gamesetup.po @@ -236,6 +236,18 @@ msgid "Toggle explored map (see initial map)." msgstr "Toggle explored map (see initial map)." +#. Translation: Make sure to differentiate between the revealed map and +#. ally view settings! +#: gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Checkboxes/AlliedView.js:25 +msgid "Ally View" +msgstr "Ally View" + +#. Translation: Make sure to differentiate between the revealed map and +#. ally view settings! +#: gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Checkboxes/AlliedView.js:28 +msgid "Toggle allied view (see everything you + allies can see)." +msgstr "Toggle allied view (see everything you + allies can see)." + #: gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Checkboxes/LastManStanding.js:26 msgid "Last Man Standing" msgstr "Last Man Standing" Index: binaries/data/mods/public/simulation/helpers/InitGame.js =================================================================== --- binaries/data/mods/public/simulation/helpers/InitGame.js +++ binaries/data/mods/public/simulation/helpers/InitGame.js @@ -41,6 +41,20 @@ cmpRangeManager.ExploreMap(i); } + if (settings.AllyView) + { + for (let i = 1; i < settings.PlayerData.length; ++i) + { + let cmpPlayer = QueryPlayerIDInterface(i); + let cmpTechnologyManager = Engine.QueryInterface(cmpPlayer.entity, IID_TechnologyManager); + if (cmpTechnologyManager) + { + cmpTechnologyManager.ResearchTechnology(cmpPlayer.template.SharedLosTech); + cmpPlayer.UpdateSharedLos(); + } + } + } + // Sandbox, Very Easy, Easy, Medium, Hard, Very Hard // rate apply on resource stockpiling as gathering and trading // time apply on building, upgrading, packing, training and technologies