| 344 | } |
| 345 | |
| 346 | void MerchantPane::sell() { |
| 347 | if (m_sellTotal > 0) { |
| 348 | auto sellSummary = JsonObject{{"items", m_itemBag->toJson()}, {"total", m_sellTotal}}; |
| 349 | m_worldClient->sendEntityMessage(m_sourceEntityId, "onSell", {sellSummary}); |
| 350 | |
| 351 | m_player->inventory()->addCurrency("money", m_sellTotal); |
| 352 | m_itemBag->clearItems(); |
| 353 | updateSellTotal(); |
| 354 | |
| 355 | auto& guiContext = GuiContext::singleton(); |
| 356 | guiContext.playAudio(Root::singleton().assets()->json("/merchant.config:sellSound").toString()); |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | int MerchantPane::maxBuyCount() { |
| 361 | if (auto selected = m_itemGuiList->selectedWidget()) { |
nothing calls this directly
no test coverage detected