* Updates the quantity-strings of the selected item. */
| 573 | * Updates the quantity-strings of the selected item. |
| 574 | */ |
| 575 | void PurchaseState::updateItemStrings() |
| 576 | { |
| 577 | _txtPurchases->setText(tr("STR_COST_OF_PURCHASES").arg(Text::formatFunding(_total))); |
| 578 | std::wostringstream ss, ss5; |
| 579 | ss << _qtys[_sel]; |
| 580 | _lstItems->setCellText(_sel, 3, ss.str()); |
| 581 | if (_qtys[_sel] > 0) |
| 582 | { |
| 583 | _lstItems->setRowColor(_sel, Palette::blockOffset(13)); |
| 584 | } |
| 585 | else |
| 586 | { |
| 587 | _lstItems->setRowColor(_sel, Palette::blockOffset(13) + 10); |
| 588 | if (_sel > _itemOffset) |
| 589 | { |
| 590 | RuleItem *rule = _game->getRuleset()->getItem(_items[_sel - _itemOffset]); |
| 591 | if (rule->getBattleType() == BT_AMMO || (rule->getBattleType() == BT_NONE && rule->getClipSize() > 0)) |
| 592 | { |
| 593 | _lstItems->setRowColor(_sel, Palette::blockOffset(15) + 6); |
| 594 | } |
| 595 | } |
| 596 | } |
| 597 | ss5 << _base->getUsedStores(); |
| 598 | if (std::abs(_iQty) > 0.05) |
| 599 | { |
| 600 | ss5 << "("; |
| 601 | if (_iQty > 0.05) |
| 602 | ss5 << "+"; |
| 603 | ss5 << std::fixed << std::setprecision(1) << _iQty << ")"; |
| 604 | } |
| 605 | ss5 << ":" << _base->getAvailableStores(); |
| 606 | _txtSpaceUsed->setText(tr("STR_SPACE_USED").arg(ss5.str())); |
| 607 | } |
| 608 | |
| 609 | } |
nothing calls this directly
no test coverage detected