| 263 | } |
| 264 | |
| 265 | void MerchantPane::updateSelection() { |
| 266 | if (m_selectedIndex != m_itemGuiList->selectedItem()) { |
| 267 | m_selectedIndex = m_itemGuiList->selectedItem(); |
| 268 | |
| 269 | if (m_selectedIndex != NPos) { |
| 270 | auto itemConfig = m_itemList.get(m_selectedIndex); |
| 271 | m_selectedItem = Root::singleton().itemDatabase()->itemShared(ItemDescriptor(itemConfig.get("item"))); |
| 272 | findChild<ButtonWidget>("spinCount.up")->enable(); |
| 273 | findChild<ButtonWidget>("spinCount.down")->enable(); |
| 274 | m_countTextBox->setColor(Color::White); |
| 275 | m_buyCount = 1; |
| 276 | } else { |
| 277 | findChild<ButtonWidget>("spinCount.up")->disable(); |
| 278 | findChild<ButtonWidget>("spinCount.down")->disable(); |
| 279 | m_countTextBox->setColor(Color::Gray); |
| 280 | m_buyCount = 0; |
| 281 | } |
| 282 | |
| 283 | countChanged(); |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | void MerchantPane::updateBuyTotal() { |
| 288 | if (auto selected = m_itemGuiList->selectedWidget()) |
nothing calls this directly
no test coverage detected