diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-12-19 19:07:34 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-19 19:07:34 +1100 |
commit | 157eb7c1416cef650525321ff78ed98ff2ac9d77 (patch) | |
tree | 8549a5ac23fa7a6e9b22a1884b3493789e4761f7 /source/frontend/StarMerchantInterface.cpp | |
parent | 7d98cc8e042fe2af1a5652a6106f5630f6faeaf8 (diff) | |
parent | 28a8b54f43f10fde8c09f6efe91d1c1b3b09d5d4 (diff) |
Merge pull request #155 from SilverSokolova/main
Allow buying/crafting more than 1000 items at once [skip ci]
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..196dba1 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("maxSpinCount", assets->json("/interface/windowconfig/crafting.config:default").getUInt("maxSpinCount", 1000)); + 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; } |