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

Method countTextChanged

source/frontend/StarMerchantInterface.cpp:377–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377void MerchantPane::countTextChanged() {
378 if (m_selectedIndex == NPos) {
379 m_buyCount = 0;
380 countChanged();
381 } else {
382 try {
383 auto countString = m_countTextBox->getText().replace("x", "");
384 if (countString.size()) {
385 m_buyCount = clamp<int>(lexicalCast<int>(countString), 1, maxBuyCount());
386 countChanged();
387 }
388 } catch (BadLexicalCast const&) {
389 m_buyCount = 1;
390 countChanged();
391 }
392 }
393}
394
395}

Callers

nothing calls this directly

Calls 3

getTextMethod · 0.80
replaceMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected