allow the probabilistic recipe output of the reprocessing plant to yield more than 1 item of a type per cycle
This commit is contained in:
@@ -75,7 +75,7 @@ BufferedBuildingContent::BufferedBuildingContent(const SelectionContext& context
|
||||
|
||||
m_production = new ProductionSection(this);
|
||||
|
||||
m_outputSection = new SectionBox(tr("Output buffer"), this);
|
||||
m_outputSection = new SectionBox(tr("Output buffers"), this);
|
||||
m_outputChips = new ItemChipRow(context, m_outputSection);
|
||||
m_outputSection->getContentLayout()->addWidget(m_outputChips);
|
||||
|
||||
@@ -200,11 +200,16 @@ std::vector<ItemChipRow::Entry> BufferedBuildingContent::buildOutputEntries(
|
||||
|
||||
ItemChipRow::Entry chip;
|
||||
chip.itemId = itemId;
|
||||
// Counted against the buffer's capacity, which is what production stops at
|
||||
// (REQ-MAT-OUTPUT-BUFFER).
|
||||
chip.countText = building.outputBuffer.capacity > 0
|
||||
? tr("%1 / %2").arg(lookUp(buffered, itemId))
|
||||
.arg(building.outputBuffer.capacity)
|
||||
// Counted against this item's own buffer capacity, which is what production
|
||||
// stops at (REQ-MAT-OUTPUT-BUFFER, REQ-UI-SINGLE-SELECTION). A chip for an item
|
||||
// the building has no buffer for -- one left over from a previous recipe --
|
||||
// carries the bare count, as an unsized buffer has no denominator to state.
|
||||
const std::map<ItemType, int>::const_iterator capIt =
|
||||
building.outputBuffer.caps.find(ItemType{itemId});
|
||||
const int cap =
|
||||
(capIt != building.outputBuffer.caps.end()) ? capIt->second : 0;
|
||||
chip.countText = cap > 0
|
||||
? tr("%1 / %2").arg(lookUp(buffered, itemId)).arg(cap)
|
||||
: QString::number(lookUp(buffered, itemId));
|
||||
chip.subLine = QString::fromStdString(toDisplayName(itemId));
|
||||
entries.push_back(chip);
|
||||
|
||||
Reference in New Issue
Block a user