Skip to content

Commit

Permalink
Fix Bug: Label containing the keyboard shortcut was chosen.
Browse files Browse the repository at this point in the history
  • Loading branch information
Viir committed Dec 11, 2016
1 parent 24123ed commit a10d626
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Sanderling.ABot/Bot/BotExtension.cs
Expand Up @@ -43,8 +43,18 @@ static public int AttackPriorityIndexForOverviewEntryEWar(IEnumerable<EWarTypeEn
?.OrderBy(subsequenceTaskPath => 1 == subsequenceTaskPath?.Count(BotExtension.LastHasMotion))
?.LastOrDefault();

static public IUIElementText TitleElementText(this IModuleButtonTooltip tooltip) =>
tooltip?.LabelText?.OrderByCenterVerticalDown()?.FirstOrDefault();
static public IUIElementText TitleElementText(this IModuleButtonTooltip tooltip)
{
var tooltipHorizontalCenter = tooltip?.RegionCenter()?.A;

var setLabelIntersectingHorizontalCenter =
tooltip?.LabelText
?.Where(label => label?.Region.Min0 < tooltipHorizontalCenter && tooltipHorizontalCenter < label?.Region.Max0);

return
setLabelIntersectingHorizontalCenter
?.OrderByCenterVerticalDown()?.FirstOrDefault();
}

static public bool ShouldBeActivePermanent(this Accumulation.IShipUiModule module, Bot bot) =>
new[]
Expand Down

0 comments on commit a10d626

Please sign in to comment.