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

Method updateItemStrings

src/Basescape/TransferItemsState.cpp:703–726  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

701 * Updates the quantity-strings of the selected item.
702 */
703void TransferItemsState::updateItemStrings()
704{
705 std::wostringstream ss1, ss2;
706 ss1 << _baseQty[_sel];
707 ss2 << _transferQty[_sel];
708 _lstItems->setCellText(_sel, 1, ss1.str());
709 _lstItems->setCellText(_sel, 2, ss2.str());
710 if (_transferQty[_sel] > 0)
711 {
712 _lstItems->setRowColor(_sel, Palette::blockOffset(13));
713 }
714 else
715 {
716 _lstItems->setRowColor(_sel, Palette::blockOffset(13) + 10);
717 if (_sel > _itemOffset)
718 {
719 RuleItem *rule = _game->getRuleset()->getItem(_items[_sel - _itemOffset]);
720 if (rule->getBattleType() == BT_AMMO || (rule->getBattleType() == BT_NONE && rule->getClipSize() > 0))
721 {
722 _lstItems->setRowColor(_sel, Palette::blockOffset(15) + 6);
723 }
724 }
725 }
726}
727
728/**
729 * Gets the total cost of the current transfer.

Callers

nothing calls this directly

Calls 6

setCellTextMethod · 0.80
setRowColorMethod · 0.80
getBattleTypeMethod · 0.80
getClipSizeMethod · 0.80
getItemMethod · 0.45
getRulesetMethod · 0.45

Tested by

no test coverage detected