| 125 | } |
| 126 | |
| 127 | PanePtr MerchantPane::createTooltip(Vec2I const& screenPosition) { |
| 128 | if (m_tabSet->selectedTab() == 0) { |
| 129 | for (size_t i = 0; i < m_itemGuiList->numChildren(); ++i) { |
| 130 | auto entry = m_itemGuiList->itemAt(i); |
| 131 | if (entry->getChildAt(screenPosition)) { |
| 132 | auto itemConfig = m_itemList.get(i); |
| 133 | ItemPtr item = Root::singleton().itemDatabase()->itemShared(ItemDescriptor(itemConfig.get("item"))); |
| 134 | return ItemTooltipBuilder::buildItemTooltip(item, m_player); |
| 135 | } |
| 136 | } |
| 137 | } else { |
| 138 | if (auto item = m_itemGrid->itemAt(screenPosition)) |
| 139 | return ItemTooltipBuilder::buildItemTooltip(item, m_player); |
| 140 | } |
| 141 | return {}; |
| 142 | } |
| 143 | |
| 144 | void MerchantPane::update(float dt) { |
| 145 | Pane::update(dt); |
nothing calls this directly
no test coverage detected