Convert lobby checkboxes to new options backend.

This commit is contained in:
Paul Chote
2016-04-20 08:08:38 +02:00
parent 3e92c1944a
commit eb884ca76f
14 changed files with 134 additions and 328 deletions

View File

@@ -54,7 +54,8 @@ namespace OpenRA.Mods.Common.Traits
var map = init.World.Map;
// Explore map-placed actors if the "Explore Map" option is enabled
var exploredMap = !init.World.LobbyInfo.GlobalSettings.Shroud;
var shroudInfo = init.World.Map.Rules.Actors["player"].TraitInfo<ShroudInfo>();
var exploredMap = init.World.LobbyInfo.GlobalSettings.OptionOrDefault("explored", shroudInfo.ExploredMapEnabled);
startsRevealed = exploredMap && init.Contains<SpawnedByMapInit>() && !init.Contains<HiddenUnderFogInit>();
var footprintCells = FootprintUtils.FrozenUnderFogTiles(init.Self).ToList();
footprint = footprintCells.SelectMany(c => map.ProjectedCellsCovering(c.ToMPos(map))).ToArray();