MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / updateStrings

Method updateStrings

src/Basescape/ManageAlienContainmentState.cpp:423–442  ·  view source on GitHub ↗

* Updates the quantity-strings of the selected alien. */

Source from the content-addressed store, hash-verified

421 * Updates the quantity-strings of the selected alien.
422 */
423void 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}

Callers

nothing calls this directly

Calls 7

setRowColorMethod · 0.80
setCellTextMethod · 0.80
getUsedContainmentMethod · 0.80
argMethod · 0.60
setVisibleMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected