start reworking player setup

This commit is contained in:
Chris Forbes
2011-05-21 12:05:26 +12:00
parent cf5d49a328
commit b792d07c8c
2 changed files with 45 additions and 91 deletions

View File

@@ -87,13 +87,7 @@ namespace OpenRA.Editor
// upgrade maps that have no player definitions. editor doesnt care,
// but this breaks the game pretty badly.
if (map.Players.Count == 0)
map.Players.Add("Neutral", new PlayerReference
{
Name = "Neutral",
Race = Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race,
OwnsWorld = true,
NonCombatant = true
});
map.MakeDefaultPlayers();
PrepareMapResources(Game.modData.Manifest, map);
@@ -326,21 +320,8 @@ namespace OpenRA.Editor
map.Resize((int)nmd.width.Value, (int)nmd.height.Value);
map.ResizeCordon((int)nmd.cordonLeft.Value, (int)nmd.cordonTop.Value,
(int)nmd.cordonRight.Value, (int)nmd.cordonBottom.Value);
map.Players.Add("Neutral", new PlayerReference
{
Name = "Neutral",
Race = Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race,
OwnsWorld = true,
NonCombatant = true
});
map.Players.Add("Creeps", new PlayerReference
{
Name = "Creeps",
Race = Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race,
NonCombatant = true
});
map.MakeDefaultPlayers();
NewMap(map);
}
@@ -395,22 +376,8 @@ namespace OpenRA.Editor
if (errors.Count > 0)
using (var eld = new ErrorListDialog(errors))
eld.ShowDialog();
if (!map.Players.ContainsKey("Neutral"))
map.Players.Add("Neutral", new PlayerReference
{
Name = "Neutral",
Race = Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race,
OwnsWorld = true,
NonCombatant = true
});
map.Players.Add("Creeps", new PlayerReference
{
Name = "Creeps",
Race = Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race,
NonCombatant = true
});
map.MakeDefaultPlayers();
map.Save(savePath);
LoadMap(savePath);