Merge branch 'master' of git://github.com/chrisforbes/OpenRA

This commit is contained in:
Paul Chote
2010-01-02 02:22:12 -08:00
4 changed files with 32 additions and 1 deletions

View File

@@ -71,6 +71,9 @@ namespace OpenRa.Game
{
get
{
if (Info != null && Info.SelectionSize != null)
return new float2(Info.SelectionSize[0], Info.SelectionSize[1]);
var firstSprite = Render().FirstOrDefault();
if (firstSprite.Sprite == null) return float2.Zero;
return firstSprite.Sprite.size;
@@ -107,6 +110,8 @@ namespace OpenRa.Game
{
var size = SelectedSize;
var loc = CenterLocation - 0.5f * size;
if (Info != null && Info.SelectionSize != null && Info.SelectionSize.Length > 2)
loc += new float2(Info.SelectionSize[2], Info.SelectionSize[3]);
if (useAltitude)
{

View File

@@ -54,6 +54,7 @@ namespace OpenRa.Game.GameRules
public readonly string LongDesc = null;
public readonly int OrePips = 0;
public readonly string Icon = null;
public readonly int[] SelectionSize = null;
public UnitInfo(string name) { Name = name; }
}