add dropdown in editor for choosing owner of new actors

This commit is contained in:
Chris Forbes
2011-10-31 18:41:38 +13:00
parent 7bc7fbc006
commit a060d99780
5 changed files with 217 additions and 151 deletions

View File

@@ -22,10 +22,8 @@ namespace OpenRA.Editor
public void Preview(Surface surface, SGraphics g)
{
/* todo: include the player
* in the brush so we can color new buildings too */
surface.DrawActor(g, surface.GetBrushLocation(), Actor, null);
surface.DrawActor(g, surface.GetBrushLocation(), Actor,
surface.GetPaletteForPlayer(surface.NewActorOwner));
}
public void Apply(Surface surface)
@@ -33,7 +31,7 @@ namespace OpenRA.Editor
if (surface.Map.Actors.Value.Any(a => a.Value.Location() == surface.GetBrushLocation()))
return;
var owner = "Neutral";
var owner = surface.NewActorOwner;
var id = NextActorName(surface);
surface.Map.Actors.Value[id] = new ActorReference(Actor.Info.Name.ToLowerInvariant())
{