| 95 | } |
| 96 | |
| 97 | PanePtr ActionBar::createTooltip(Vec2I const& screenPosition) { |
| 98 | ItemPtr item; |
| 99 | auto tryItemWidget = [&](ItemSlotWidgetPtr const& isw) { |
| 100 | if (isw->screenBoundRect().contains(screenPosition)) |
| 101 | item = isw->item(); |
| 102 | }; |
| 103 | |
| 104 | for (auto const& p : m_customBarWidgets) { |
| 105 | tryItemWidget(p.left); |
| 106 | tryItemWidget(p.right); |
| 107 | } |
| 108 | |
| 109 | for (auto const& w : m_essentialBarWidgets) |
| 110 | tryItemWidget(w); |
| 111 | |
| 112 | if (!item) |
| 113 | return {}; |
| 114 | |
| 115 | return ItemTooltipBuilder::buildItemTooltip(item, m_player); |
| 116 | } |
| 117 | |
| 118 | bool ActionBar::sendEvent(InputEvent const& event) { |
| 119 | if (Pane::sendEvent(event)) |
nothing calls this directly
no test coverage detected