MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / updateSellTotal

Method updateSellTotal

source/frontend/StarMerchantInterface.cpp:333–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333void MerchantPane::updateSellTotal() {
334 m_sellTotal = 0;
335 for (auto item : m_itemBag->items()) {
336 if (item)
337 m_sellTotal += round(item->price() * m_sellFactor);
338 }
339 m_sellTotalLabel->setText(toString(m_sellTotal));
340 if (m_sellTotal > 0)
341 m_sellButton->enable();
342 else
343 m_sellButton->disable();
344}
345
346void MerchantPane::sell() {
347 if (m_sellTotal > 0) {

Callers

nothing calls this directly

Calls 7

roundFunction · 0.85
toStringFunction · 0.85
itemsMethod · 0.80
priceMethod · 0.45
setTextMethod · 0.45
enableMethod · 0.45
disableMethod · 0.45

Tested by

no test coverage detected