Disable hide map crate if explored map is enabled.

This commit is contained in:
Paul Chote
2016-06-18 14:18:05 +01:00
parent e70590fd94
commit 9edf4be229
2 changed files with 5 additions and 4 deletions

View File

@@ -77,6 +77,7 @@ namespace OpenRA.Traits
bool fogEnabled; bool fogEnabled;
public bool FogEnabled { get { return !Disabled && fogEnabled; } } public bool FogEnabled { get { return !Disabled && fogEnabled; } }
public bool ExploreMapEnabled { get; private set; }
public int Hash { get; private set; } public int Hash { get; private set; }
@@ -96,8 +97,8 @@ namespace OpenRA.Traits
var gs = self.World.LobbyInfo.GlobalSettings; var gs = self.World.LobbyInfo.GlobalSettings;
fogEnabled = gs.OptionOrDefault("fog", info.FogEnabled); fogEnabled = gs.OptionOrDefault("fog", info.FogEnabled);
var exploreMap = gs.OptionOrDefault("explored", info.ExploredMapEnabled); ExploreMapEnabled = gs.OptionOrDefault("explored", info.ExploredMapEnabled);
if (exploreMap) if (ExploreMapEnabled)
self.World.AddFrameEndTask(w => ExploreAll()); self.World.AddFrameEndTask(w => ExploreAll());
} }

View File

@@ -32,8 +32,8 @@ namespace OpenRA.Mods.Common.Traits
public override int GetSelectionShares(Actor collector) public override int GetSelectionShares(Actor collector)
{ {
// Don't ever hide the map for people who have GPS. // Don't hide the map if the shroud is force-revealed
if (collector.Owner.HasFogVisibility) if (collector.Owner.HasFogVisibility || collector.Owner.Shroud.ExploreMapEnabled)
return 0; return 0;
return base.GetSelectionShares(collector); return base.GetSelectionShares(collector);