Easier actor selection in game by actor bounds center

This commit is contained in:
atlimit8
2015-11-15 11:30:40 -06:00
parent 387d0d0e3f
commit b07cd683e8
17 changed files with 100 additions and 75 deletions

View File

@@ -128,9 +128,10 @@ namespace OpenRA.Mods.Common.Widgets
return;
}
var underCursor = world.ScreenMap.ActorsAt(worldRenderer.Viewport.ViewToWorldPx(Viewport.LastMousePos))
var worldPixel = worldRenderer.Viewport.ViewToWorldPx(Viewport.LastMousePos);
var underCursor = world.ScreenMap.ActorsAt(worldPixel)
.Where(a => !world.FogObscures(a) && a.Info.HasTraitInfo<ITooltipInfo>())
.WithHighestSelectionPriority();
.WithHighestSelectionPriority(worldPixel);
if (underCursor != null)
{
@@ -140,9 +141,9 @@ namespace OpenRA.Mods.Common.Widgets
return;
}
var frozen = world.ScreenMap.FrozenActorsAt(world.RenderPlayer, worldRenderer.Viewport.ViewToWorldPx(Viewport.LastMousePos))
var frozen = world.ScreenMap.FrozenActorsAt(world.RenderPlayer, worldPixel)
.Where(a => a.TooltipInfo != null && a.IsValid)
.WithHighestSelectionPriority();
.WithHighestSelectionPriority(worldPixel);
if (frozen != null)
{