MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / createTooltip

Method createTooltip

source/frontend/StarActionBar.cpp:97–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97PanePtr 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
118bool ActionBar::sendEvent(InputEvent const& event) {
119 if (Pane::sendEvent(event))

Callers

nothing calls this directly

Calls 3

containsMethod · 0.45
screenBoundRectMethod · 0.45
itemMethod · 0.45

Tested by

no test coverage detected