Move more files

Move VoxelNormalsPalette to TS
This commit is contained in:
penev92
2014-12-13 19:11:44 +02:00
parent 611e3038b2
commit 1e9535b63a
23 changed files with 43 additions and 39 deletions

View File

@@ -1,36 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System.Globalization;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Part of the unfinished group-movement system. Attach this to the player actor.")]
class ActorGroupProxyInfo : TraitInfo<ActorGroupProxy> { }
class ActorGroupProxy : IResolveOrder
{
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString == "CreateGroup")
{
/* create a group */
var actors = order.TargetString.Split(',')
.Select(id => uint.Parse(id, NumberStyles.Any, NumberFormatInfo.InvariantInfo))
.Select(id => self.World.Actors.FirstOrDefault(a => a.ActorID == id))
.Where(a => a != null);
new Group(actors);
}
}
}
}

View File

@@ -1,74 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.Common.Effects;
using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
public class PlaceBeaconInfo : ITraitInfo
{
public readonly int Duration = 30 * 25;
public readonly string NotificationType = "Sounds";
public readonly string Notification = "Beacon";
public readonly string PalettePrefix = "player";
public object Create(ActorInitializer init) { return new PlaceBeacon(init.self, this); }
}
public class PlaceBeacon : IResolveOrder
{
readonly PlaceBeaconInfo info;
readonly RadarPings radarPings;
Beacon playerBeacon;
RadarPing playerRadarPing;
public PlaceBeacon(Actor self, PlaceBeaconInfo info)
{
radarPings = self.World.WorldActor.TraitOrDefault<RadarPings>();
this.info = info;
}
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString != "PlaceBeacon")
return;
var pos = self.World.Map.CenterOfCell(order.TargetLocation);
self.World.AddFrameEndTask(w =>
{
if (playerBeacon != null)
self.World.Remove(playerBeacon);
playerBeacon = new Beacon(self.Owner, pos, info.Duration, info.PalettePrefix);
self.World.Add(playerBeacon);
if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
Sound.PlayNotification(self.World.Map.Rules, null, info.NotificationType, info.Notification,
self.World.RenderPlayer != null ? self.World.RenderPlayer.Country.Race : null);
if (radarPings != null)
{
if (playerRadarPing != null)
radarPings.Remove(playerRadarPing);
playerRadarPing = radarPings.Add(
() => self.Owner.IsAlliedWith(self.World.RenderPlayer),
pos,
self.Owner.Color.RGB,
info.Duration);
}
});
}
}
}