| 276 | } |
| 277 | |
| 278 | bool InventoryPane::sendEvent(InputEvent const& event) { |
| 279 | if (m_alwaysDisplayCosmetics) |
| 280 | return Pane::sendEvent(event); |
| 281 | |
| 282 | if (auto mousePosition = Widget::context()->mousePosition(event)) { |
| 283 | bool displayingCosmetics = false; |
| 284 | for (auto const& p : EquipmentSlotNames) { |
| 285 | if (auto itemSlot = fetchChild<ItemSlotWidget>(p.second)) { |
| 286 | if ((displayingCosmetics = itemSlot->inMember(*mousePosition))) |
| 287 | break; |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | if (m_displayingCosmetics != displayingCosmetics) { |
| 292 | for (auto const& p : EquipmentSlotNames) { |
| 293 | if (p.first >= EquipmentSlot::Cosmetic1) { |
| 294 | if (auto itemSlot = fetchChild<ItemSlotWidget>(p.second)) |
| 295 | itemSlot->setVisibility(displayingCosmetics); |
| 296 | } |
| 297 | } |
| 298 | m_displayingCosmetics = displayingCosmetics; |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | return Pane::sendEvent(event); |
| 303 | } |
| 304 | |
| 305 | bool InventoryPane::giveContainerResult(ContainerResult result) { |
| 306 | if (!m_expectingSwap) |
nothing calls this directly
no test coverage detected