Allow selection priority to be modified using a hotkey

This commit is contained in:
Ivaylo Draganov
2019-05-08 18:12:00 +03:00
committed by teinarss
parent 3e39ada304
commit c1fc0c1b74
5 changed files with 64 additions and 31 deletions

View File

@@ -218,6 +218,7 @@ namespace OpenRA.Mods.Common.Widgets
{
TooltipType = WorldTooltipType.None;
ActorTooltipExtra = null;
var modifiers = Game.GetModifierKeys();
var cell = worldRenderer.Viewport.ViewToWorld(Viewport.LastMousePos);
if (!world.Map.Contains(cell))
return;
@@ -231,7 +232,7 @@ namespace OpenRA.Mods.Common.Widgets
var worldPixel = worldRenderer.Viewport.ViewToWorldPx(Viewport.LastMousePos);
var underCursor = world.ScreenMap.ActorsAtMouse(worldPixel)
.Where(a => a.Actor.Info.HasTraitInfo<ITooltipInfo>() && !world.FogObscures(a.Actor))
.WithHighestSelectionPriority(worldPixel);
.WithHighestSelectionPriority(worldPixel, modifiers);
if (underCursor != null)
{
@@ -247,7 +248,7 @@ namespace OpenRA.Mods.Common.Widgets
var frozen = world.ScreenMap.FrozenActorsAtMouse(world.RenderPlayer, worldPixel)
.Where(a => a.TooltipInfo != null && a.IsValid && a.Visible && !a.Hidden)
.WithHighestSelectionPriority(worldPixel);
.WithHighestSelectionPriority(worldPixel, modifiers);
if (frozen != null)
{