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

Method createTooltip

source/frontend/StarContainerInterface.cpp:211–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211PanePtr ContainerPane::createTooltip(Vec2I const& screenPosition) {
212 ItemPtr item;
213 if (auto child = getChildAt(screenPosition)) {
214 if (auto itemSlot = as<ItemSlotWidget>(child))
215 item = itemSlot->item();
216 if (auto itemGrid = as<ItemGridWidget>(child))
217 item = itemGrid->itemAt(screenPosition);
218 }
219 if (item)
220 return ItemTooltipBuilder::buildItemTooltip(item, m_player);
221 return {};
222}
223
224void ContainerPane::swapSlot(ItemGridWidget* grid) {
225 auto inv = m_player->inventory();

Callers

nothing calls this directly

Calls 2

itemMethod · 0.45
itemAtMethod · 0.45

Tested by

no test coverage detected