| 181 | } |
| 182 | |
| 183 | bool ContainerPane::giveContainerResult(ContainerResult result) { |
| 184 | if (m_expectingSwap == ExpectingSwap::None) |
| 185 | return false; |
| 186 | |
| 187 | for (auto item : result) { |
| 188 | auto inv = m_player->inventory(); |
| 189 | m_player->triggerPickupEvents(item); |
| 190 | |
| 191 | if (m_expectingSwap == ExpectingSwap::SwapSlot) { |
| 192 | m_player->clearSwap(); |
| 193 | inv->setSwapSlotItem(item); |
| 194 | } else if (m_expectingSwap == ExpectingSwap::SwapSlotStack) { |
| 195 | auto swapItem = inv->swapSlotItem(); |
| 196 | if (swapItem && swapItem->stackWith(item)) { |
| 197 | continue; |
| 198 | } else { |
| 199 | inv->clearSwap(); |
| 200 | inv->setSwapSlotItem(item); |
| 201 | } |
| 202 | } else { |
| 203 | m_containerInteractor->addToContainer(inv->addItems(item)); |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | m_expectingSwap = ExpectingSwap::None; |
| 208 | return true; |
| 209 | } |
| 210 | |
| 211 | PanePtr ContainerPane::createTooltip(Vec2I const& screenPosition) { |
| 212 | ItemPtr item; |
nothing calls this directly
no test coverage detected