| 599 | } |
| 600 | |
| 601 | void 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 | |
| 620 | void CraftingPane::countChanged() { |
| 621 | if (m_textBox) |