diff --git a/src/Sanderling.ABot/Bot/BotExtension.cs b/src/Sanderling.ABot/Bot/BotExtension.cs index 84f6a6d..5212df1 100644 --- a/src/Sanderling.ABot/Bot/BotExtension.cs +++ b/src/Sanderling.ABot/Bot/BotExtension.cs @@ -43,8 +43,18 @@ static public int AttackPriorityIndexForOverviewEntryEWar(IEnumerable 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[]