diff --git a/OpenRA.FileFormats/Map/Map.cs b/OpenRA.FileFormats/Map/Map.cs index fcad926d00..6b91d99a0f 100644 --- a/OpenRA.FileFormats/Map/Map.cs +++ b/OpenRA.FileFormats/Map/Map.cs @@ -134,12 +134,18 @@ namespace OpenRA.FileFormats { FieldInfo f = this.GetType().GetField(field); if (f.GetValue(this) == null) continue; - root.Add(field, new MiniYaml(FieldSaver.FormatValue(this, f), null)); - } - - root.Add("Actors", MiniYaml.FromDictionary(Actors)); - root.Add("Waypoints", MiniYaml.FromDictionary(Waypoints)); - root.Add("Smudges", MiniYaml.FromList(Smudges)); + root.Add(field, new MiniYaml(FieldSaver.FormatValue(this, f), null)); + } + + Dictionary playerYaml = new Dictionary(); + + foreach(var p in Players) + playerYaml.Add("PlayerReference@{0}".F(p.Key), FieldSaver.Save(p.Value)); + root.Add("Players",new MiniYaml(null, playerYaml)); + + root.Add("Actors", MiniYaml.FromDictionary(Actors)); + root.Add("Waypoints", MiniYaml.FromDictionary(Waypoints)); + root.Add("Smudges", MiniYaml.FromList(Smudges)); root.Add("Rules", new MiniYaml(null, Rules)); SaveBinaryData(Path.Combine(filepath, "map.bin")); root.WriteToFile(Path.Combine(filepath, "map.yaml")); diff --git a/OpenRA.FileFormats/Map/PlayerReference.cs b/OpenRA.FileFormats/Map/PlayerReference.cs index 04b8edfb88..512806dd15 100644 --- a/OpenRA.FileFormats/Map/PlayerReference.cs +++ b/OpenRA.FileFormats/Map/PlayerReference.cs @@ -26,7 +26,7 @@ namespace OpenRA.FileFormats public readonly string Palette; public readonly string Race; public readonly bool OwnsWorld = false; - public readonly bool isSpecial = false; + public readonly bool IsSpecial = false; public PlayerReference(MiniYaml my) { diff --git a/OpenRA.Game/Player.cs b/OpenRA.Game/Player.cs index 1453616681..e089d3c58a 100644 --- a/OpenRA.Game/Player.cs +++ b/OpenRA.Game/Player.cs @@ -41,7 +41,7 @@ namespace OpenRA public readonly string InternalName; public readonly CountryInfo Country; public readonly int Index; - public readonly bool isSpecial = false; + public readonly bool IsSpecial = false; public ShroudRenderer Shroud; public World World { get; private set; } @@ -57,7 +57,7 @@ namespace OpenRA Palette = pr.Palette; Color = world.PlayerColors().Where(c => c.Name == pr.Palette).FirstOrDefault().Color; PlayerName = InternalName = pr.Name; - isSpecial = pr.isSpecial; + IsSpecial = pr.IsSpecial; Country = world.GetCountries() .FirstOrDefault(c => pr.Race == c.Race); } diff --git a/OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs b/OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs index 5d86a67dbd..5863bf3fb5 100644 --- a/OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs @@ -57,7 +57,7 @@ namespace OpenRA.Widgets.Delegates y += 35; - foreach (var p in Game.world.players.Values.Where(a => a != Game.world.LocalPlayer && !a.isSpecial)) + foreach (var p in Game.world.players.Values.Where(a => a != Game.world.LocalPlayer && !a.IsSpecial)) { var pp = p; var label = new LabelWidget diff --git a/OpenRA.Game/Widgets/PostGameWidget.cs b/OpenRA.Game/Widgets/PostGameWidget.cs index c121a0feb7..52e58b927a 100644 --- a/OpenRA.Game/Widgets/PostGameWidget.cs +++ b/OpenRA.Game/Widgets/PostGameWidget.cs @@ -45,7 +45,7 @@ namespace OpenRA.Widgets if (world.players.Count > 2) /* more than just us + neutral */ { var conds = world.Queries.WithTrait() - .Where(c => !c.Actor.Owner.isSpecial); + .Where(c => !c.Actor.Owner.IsSpecial); if (conds.Any(c => c.Actor.Owner == world.LocalPlayer && c.Trait.HasLost)) DrawText("YOU ARE DEFEATED"); diff --git a/OpenRA.Game/Widgets/WorldTooltipWidget.cs b/OpenRA.Game/Widgets/WorldTooltipWidget.cs index 4728499804..cb5ed861cc 100644 --- a/OpenRA.Game/Widgets/WorldTooltipWidget.cs +++ b/OpenRA.Game/Widgets/WorldTooltipWidget.cs @@ -48,7 +48,7 @@ namespace OpenRA.Widgets ? actor.Info.Traits.Get().Description : actor.Info.Name; var text2 = (actor.Owner == world.LocalPlayer) - ? "" : (actor.Owner.isSpecial ? "{0}" : "{0} ({1})").F(actor.Owner.PlayerName, world.LocalPlayer.Stances[actor.Owner]); + ? "" : (actor.Owner.IsSpecial ? "{0}" : "{0} ({1})").F(actor.Owner.PlayerName, world.LocalPlayer.Stances[actor.Owner]); var renderer = Game.chrome.renderer; diff --git a/OpenRA.Mods.RA/ConquestVictoryConditions.cs b/OpenRA.Mods.RA/ConquestVictoryConditions.cs index e8958bc405..18fc3b4462 100644 --- a/OpenRA.Mods.RA/ConquestVictoryConditions.cs +++ b/OpenRA.Mods.RA/ConquestVictoryConditions.cs @@ -40,7 +40,7 @@ namespace OpenRA.Mods.RA var hasAnything = self.World.Queries.OwnedBy[self.Owner] .WithTrait().Any(); - var hasLost = !hasAnything && !self.Owner.isSpecial; + var hasLost = !hasAnything && !self.Owner.IsSpecial; if (hasLost && !HasLost) Surrender(self); diff --git a/mods/ra/maps/shellmap/map.yaml b/mods/ra/maps/shellmap/map.yaml index c858bd6722..6a3f197793 100644 --- a/mods/ra/maps/shellmap/map.yaml +++ b/mods/ra/maps/shellmap/map.yaml @@ -22,7 +22,7 @@ Players: Palette: neutral Race: allies OwnsWorld:true - isSpecial:true + IsSpecial:true PlayerReference@GoodGuy: Name: GoodGuy Palette: player1 diff --git a/mods/ra/maps/snowyridge/map.yaml b/mods/ra/maps/snowyridge/map.yaml index a6b44f91ce..ade58c837b 100644 --- a/mods/ra/maps/snowyridge/map.yaml +++ b/mods/ra/maps/snowyridge/map.yaml @@ -24,7 +24,7 @@ Players: Palette: neutral Race: allies OwnsWorld:true - isSpecial:true + IsSpecial:true Actors: Actor0: tc02 Neutral 25,39