Fix some compiler warnings
This commit is contained in:
@@ -120,8 +120,6 @@ namespace OpenRA.Widgets
|
|||||||
};
|
};
|
||||||
|
|
||||||
Widget.RootWidget.AddChild(fullscreenMask);
|
Widget.RootWidget.AddChild(fullscreenMask);
|
||||||
|
|
||||||
var origin = w.RenderOrigin;
|
|
||||||
var dropDown = new ScrollPanelWidget
|
var dropDown = new ScrollPanelWidget
|
||||||
{
|
{
|
||||||
Bounds = new Rectangle(w.RenderOrigin.X, w.RenderOrigin.Y + w.Bounds.Height, w.Bounds.Width, 100),
|
Bounds = new Rectangle(w.RenderOrigin.X, w.RenderOrigin.Y + w.Bounds.Height, w.Bounds.Width, 100),
|
||||||
@@ -149,7 +147,6 @@ namespace OpenRA.Widgets
|
|||||||
|
|
||||||
foreach (var t in ts)
|
foreach (var t in ts)
|
||||||
{
|
{
|
||||||
var tt = t;
|
|
||||||
var ww = ft(t, dropDown.Bounds.Width);
|
var ww = ft(t, dropDown.Bounds.Width);
|
||||||
var origMouseUp = ww.OnMouseUp;
|
var origMouseUp = ww.OnMouseUp;
|
||||||
ww.OnMouseUp = mi => { var result = origMouseUp(mi); HideDropDown(); return result; };
|
ww.OnMouseUp = mi => { var result = origMouseUp(mi); HideDropDown(); return result; };
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ namespace OpenRA.Scripting
|
|||||||
{
|
{
|
||||||
var target = kv.First;
|
var target = kv.First;
|
||||||
var targetCell = kv.Second;
|
var targetCell = kv.Second;
|
||||||
System.Console.WriteLine("{0} {1}",target, targetCell);
|
|
||||||
|
|
||||||
var cs = target.Trait<Chronoshiftable>();
|
var cs = target.Trait<Chronoshiftable>();
|
||||||
if (cs.CanChronoshiftTo(target, targetCell))
|
if (cs.CanChronoshiftTo(target, targetCell))
|
||||||
target.Trait<Chronoshiftable>().Teleport(target,
|
target.Trait<Chronoshiftable>().Teleport(target,
|
||||||
|
|||||||
@@ -209,15 +209,16 @@ namespace OpenRA.Mods.RA
|
|||||||
foreach (var t in world.FindTilesInCircle(xy, range))
|
foreach (var t in world.FindTilesInCircle(xy, range))
|
||||||
sourceTile.DrawAt( wr, Game.CellSize * t, "terrain" );
|
sourceTile.DrawAt( wr, Game.CellSize * t, "terrain" );
|
||||||
|
|
||||||
// Unit tiles
|
// Unit previews
|
||||||
foreach (var unit in power.UnitsInRange(sourceLocation))
|
foreach (var unit in power.UnitsInRange(sourceLocation))
|
||||||
{
|
{
|
||||||
var targetCell = unit.Location + xy - sourceLocation;
|
var targetCell = unit.Location + xy - sourceLocation;
|
||||||
var canEnter = unit.Trait<Chronoshiftable>().CanChronoshiftTo(unit,targetCell);
|
|
||||||
foreach (var r in unit.Render())
|
foreach (var r in unit.Render())
|
||||||
r.Sprite.DrawAt(wr, r.Pos - Traits.Util.CenterOfCell(unit.Location) + Traits.Util.CenterOfCell(targetCell),
|
r.Sprite.DrawAt(wr, r.Pos - Traits.Util.CenterOfCell(unit.Location) + Traits.Util.CenterOfCell(targetCell),
|
||||||
r.Palette ?? unit.Owner.Palette);
|
r.Palette ?? unit.Owner.Palette);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unit tiles
|
||||||
foreach (var unit in power.UnitsInRange(sourceLocation))
|
foreach (var unit in power.UnitsInRange(sourceLocation))
|
||||||
{
|
{
|
||||||
var targetCell = unit.Location + xy - sourceLocation;
|
var targetCell = unit.Location + xy - sourceLocation;
|
||||||
|
|||||||
@@ -97,15 +97,10 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
IEnumerable<Order> OrderInner(World world, int2 xy, MouseInput mi)
|
IEnumerable<Order> OrderInner(World world, int2 xy, MouseInput mi)
|
||||||
{
|
{
|
||||||
if (mi.Button == MouseButton.Left)
|
if (mi.Button == MouseButton.Left && power.UnitsInRange(xy).Any() )
|
||||||
{
|
{
|
||||||
var targetUnits = power.UnitsInRange(xy);
|
world.CancelInputMode();
|
||||||
|
yield return new Order("IronCurtain", world.LocalPlayer.PlayerActor, false) { TargetLocation = xy };
|
||||||
if( targetUnits.Any() )
|
|
||||||
{
|
|
||||||
world.CancelInputMode();
|
|
||||||
yield return new Order("IronCurtain", world.LocalPlayer.PlayerActor, false) { TargetLocation = xy };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +117,6 @@ namespace OpenRA.Mods.RA
|
|||||||
public void RenderAfterWorld(WorldRenderer wr, World world)
|
public void RenderAfterWorld(WorldRenderer wr, World world)
|
||||||
{
|
{
|
||||||
var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos).ToInt2();
|
var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos).ToInt2();
|
||||||
var targetUnits = power.UnitsInRange(xy);
|
|
||||||
foreach (var unit in power.UnitsInRange(xy))
|
foreach (var unit in power.UnitsInRange(xy))
|
||||||
wr.DrawSelectionBox(unit, Color.Red);
|
wr.DrawSelectionBox(unit, Color.Red);
|
||||||
}
|
}
|
||||||
@@ -130,8 +124,7 @@ namespace OpenRA.Mods.RA
|
|||||||
public void RenderBeforeWorld(WorldRenderer wr, World world)
|
public void RenderBeforeWorld(WorldRenderer wr, World world)
|
||||||
{
|
{
|
||||||
var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos).ToInt2();
|
var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos).ToInt2();
|
||||||
var tiles = world.FindTilesInCircle(xy, range);
|
foreach (var t in world.FindTilesInCircle(xy, range))
|
||||||
foreach (var t in tiles)
|
|
||||||
tile.DrawAt( wr, Game.CellSize * t, "terrain" );
|
tile.DrawAt( wr, Game.CellSize * t, "terrain" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user