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

Method countTextChanged

source/frontend/StarCraftingInterface.cpp:601–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

599}
600
601void CraftingPane::countTextChanged() {
602 if (m_textBox) {
603 int appropriateDefaultCount = 1;
604 try {
605 if (!m_textBox->getText().replace("x", "").size()) {
606 m_count = appropriateDefaultCount;
607 } else {
608 m_count = clamp<int>(lexicalCast<int>(m_textBox->getText().replace("x", "")), appropriateDefaultCount, maxCraft());
609 countChanged();
610 }
611 } catch (BadLexicalCast const&) {
612 m_count = appropriateDefaultCount;
613 countChanged();
614 }
615 } else {
616 m_count = 1;
617 }
618}
619
620void CraftingPane::countChanged() {
621 if (m_textBox)

Callers

nothing calls this directly

Calls 3

getTextMethod · 0.80
sizeMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected