Easier actor selection in game by actor bounds center
This commit is contained in:
@@ -267,11 +267,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
expectedButton = button;
|
||||
}
|
||||
|
||||
public IEnumerable<Order> Order(World world, CPos xy, MouseInput mi)
|
||||
public IEnumerable<Order> Order(World world, CPos cell, int2 worldPixel, MouseInput mi)
|
||||
{
|
||||
world.CancelInputMode();
|
||||
if (mi.Button == expectedButton && world.Map.Contains(xy))
|
||||
yield return new Order(order, manager.Self, false) { TargetLocation = xy, SuppressVisualFeedback = true };
|
||||
if (mi.Button == expectedButton && world.Map.Contains(cell))
|
||||
yield return new Order(order, manager.Self, false) { TargetLocation = cell, SuppressVisualFeedback = true };
|
||||
}
|
||||
|
||||
public virtual void Tick(World world)
|
||||
@@ -283,6 +283,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world) { yield break; }
|
||||
public IEnumerable<IRenderable> RenderAfterWorld(WorldRenderer wr, World world) { yield break; }
|
||||
public string GetCursor(World world, CPos xy, MouseInput mi) { return world.Map.Contains(xy) ? cursor : "generic-blocked"; }
|
||||
public string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi)
|
||||
{
|
||||
return world.Map.Contains(cell) ? cursor : "generic-blocked";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user