diff options
author | SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> | 2024-12-18 01:49:23 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-18 01:49:23 -0600 |
commit | e875d5fccd1f5eb166c019bf2700b4ba8a6a2324 (patch) | |
tree | 48f86e14bf9e7f931e642b98160ae0e384f4dce9 /source/frontend/StarMerchantInterface.cpp | |
parent | de642ab8bfa00b35a9a56ec13a919e145ce6608c (diff) |
Allow changing maxBuyCount
Diffstat (limited to 'source/frontend/StarMerchantInterface.cpp')
-rw-r--r-- | source/frontend/StarMerchantInterface.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/frontend/StarMerchantInterface.cpp b/source/frontend/StarMerchantInterface.cpp index 51bccb6..166f996 100644 --- a/source/frontend/StarMerchantInterface.cpp +++ b/source/frontend/StarMerchantInterface.cpp @@ -38,6 +38,8 @@ MerchantPane::MerchantPane( m_itemBag = make_shared<ItemBag>(m_settings.getUInt("sellContainerSize")); + m_maxBuyCount = m_settings.getUInt("maxBuyCount"); + GuiReader reader; reader.registerCallback("spinCount.up", [=](Widget*) { if (m_selectedIndex != NPos) { @@ -360,8 +362,8 @@ int MerchantPane::maxBuyCount() { auto assets = Root::singleton().assets(); auto unitPrice = selected->data().toUInt(); if (unitPrice == 0) - return 1000; - return min(1000, (int)floor(m_player->currency("money") / unitPrice)); + return m_maxBuyCount; + return min(m_maxBuyCount, (int)floor(m_player->currency("money") / unitPrice)); } else { return 0; } |