* Updates the quantity-strings of the selected alien. */
| 421 | * Updates the quantity-strings of the selected alien. |
| 422 | */ |
| 423 | void ManageAlienContainmentState::updateStrings() |
| 424 | { |
| 425 | std::wostringstream ss, ss2, ss3; |
| 426 | int qty = getQuantity() - _qtys[_sel]; |
| 427 | ss << qty; |
| 428 | ss2 << _qtys[_sel]; |
| 429 | |
| 430 | _lstAliens->setRowColor(_sel, (qty != 0)? _color2 : _color); |
| 431 | _lstAliens->setCellText(_sel, 1, ss.str()); |
| 432 | _lstAliens->setCellText(_sel, 2, ss2.str()); |
| 433 | |
| 434 | int aliens = _base->getUsedContainment() - _aliensSold - _researchedAliens; |
| 435 | int spaces = _base->getAvailableContainment() - _base->getUsedContainment() + _aliensSold; |
| 436 | bool enoughSpace = Options::storageLimitsEnforced ? spaces >= 0 : true; |
| 437 | |
| 438 | _btnCancel->setVisible(!_overCrowded); |
| 439 | _btnOk->setVisible(enoughSpace); |
| 440 | _txtAvailable->setText(tr("STR_SPACE_AVAILABLE").arg(spaces)); |
| 441 | _txtUsed->setText(tr("STR_SPACE_USED").arg(aliens)); |
| 442 | } |
| 443 | |
| 444 | } |
nothing calls this directly
no test coverage detected