From 54647362a079f9da8e49dda35fdc61920cbe02e4 Mon Sep 17 00:00:00 2001 From: SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> Date: Wed, 18 Dec 2024 01:47:22 -0600 Subject: [PATCH 01/11] Update StarCraftingInterface.cpp --- source/frontend/StarCraftingInterface.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/frontend/StarCraftingInterface.cpp b/source/frontend/StarCraftingInterface.cpp index 34e0265..d3f2259 100644 --- a/source/frontend/StarCraftingInterface.cpp +++ b/source/frontend/StarCraftingInterface.cpp @@ -41,6 +41,7 @@ CraftingPane::CraftingPane(WorldClientPtr worldClient, PlayerPtr player, Json co m_settings = jsonMerge(assets->json("/interface/windowconfig/crafting.config:default"), jsonMerge(assets->fetchJson(baseConfig), settings)); + m_maxSpinCount = m_settings.get("maxSpinCount", 1000); m_filter = StringSet::from(jsonToStringList(m_settings.get("filter", JsonArray()))); GuiReader reader; @@ -752,14 +753,14 @@ List CraftingPane::determineRecipes() { int CraftingPane::maxCraft() { if (m_player->isAdmin()) - return 1000; + return m_maxSpinCount; auto itemDb = Root::singleton().itemDatabase(); int res = 0; if (m_guiList->selectedItem() != NPos && m_guiList->selectedItem() < m_recipes.size()) { HashMap normalizedBag = m_player->inventory()->availableItems(); auto selectedRecipe = recipeFromSelectedWidget(); res = itemDb->maxCraftableInBag(normalizedBag, m_player->inventory()->availableCurrencies(), selectedRecipe); - res = std::min(res, 1000); + res = std::min(res, m_maxSpinCount); } return res; } From de642ab8bfa00b35a9a56ec13a919e145ce6608c Mon Sep 17 00:00:00 2001 From: SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> Date: Wed, 18 Dec 2024 01:47:58 -0600 Subject: [PATCH 02/11] Add maxSpinCount --- source/frontend/StarCraftingInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/frontend/StarCraftingInterface.cpp b/source/frontend/StarCraftingInterface.cpp index d3f2259..3e6b679 100644 --- a/source/frontend/StarCraftingInterface.cpp +++ b/source/frontend/StarCraftingInterface.cpp @@ -41,8 +41,8 @@ CraftingPane::CraftingPane(WorldClientPtr worldClient, PlayerPtr player, Json co m_settings = jsonMerge(assets->json("/interface/windowconfig/crafting.config:default"), jsonMerge(assets->fetchJson(baseConfig), settings)); - m_maxSpinCount = m_settings.get("maxSpinCount", 1000); m_filter = StringSet::from(jsonToStringList(m_settings.get("filter", JsonArray()))); + m_maxSpinCount = m_settings.get("maxSpinCount", 1000); GuiReader reader; reader.registerCallback("spinCount.up", [=](Widget*) { From e875d5fccd1f5eb166c019bf2700b4ba8a6a2324 Mon Sep 17 00:00:00 2001 From: SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> Date: Wed, 18 Dec 2024 01:49:23 -0600 Subject: [PATCH 03/11] Allow changing maxBuyCount --- source/frontend/StarMerchantInterface.cpp | 6 ++++-- 1 file 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(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; } From 476bdc619c6e9bc68307b5be7ff6c4dd2762bf63 Mon Sep 17 00:00:00 2001 From: SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> Date: Wed, 18 Dec 2024 01:49:41 -0600 Subject: [PATCH 04/11] Update StarCraftingInterface.cpp --- source/frontend/StarCraftingInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/frontend/StarCraftingInterface.cpp b/source/frontend/StarCraftingInterface.cpp index 3e6b679..f1c136d 100644 --- a/source/frontend/StarCraftingInterface.cpp +++ b/source/frontend/StarCraftingInterface.cpp @@ -42,7 +42,7 @@ CraftingPane::CraftingPane(WorldClientPtr worldClient, PlayerPtr player, Json co jsonMerge(assets->fetchJson(baseConfig), settings)); m_filter = StringSet::from(jsonToStringList(m_settings.get("filter", JsonArray()))); - m_maxSpinCount = m_settings.get("maxSpinCount", 1000); + m_maxSpinCount = m_settings.getInt("maxSpinCount", 1000); GuiReader reader; reader.registerCallback("spinCount.up", [=](Widget*) { From 79e2c90ee058c96e564c8c19af43f6114546d787 Mon Sep 17 00:00:00 2001 From: SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> Date: Wed, 18 Dec 2024 01:50:23 -0600 Subject: [PATCH 05/11] Update StarCraftingInterface.cpp --- source/frontend/StarCraftingInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/frontend/StarCraftingInterface.cpp b/source/frontend/StarCraftingInterface.cpp index f1c136d..c44ad2b 100644 --- a/source/frontend/StarCraftingInterface.cpp +++ b/source/frontend/StarCraftingInterface.cpp @@ -42,7 +42,7 @@ CraftingPane::CraftingPane(WorldClientPtr worldClient, PlayerPtr player, Json co jsonMerge(assets->fetchJson(baseConfig), settings)); m_filter = StringSet::from(jsonToStringList(m_settings.get("filter", JsonArray()))); - m_maxSpinCount = m_settings.getInt("maxSpinCount", 1000); + m_maxSpinCount = m_settings.getUInt("maxSpinCount", 1000); GuiReader reader; reader.registerCallback("spinCount.up", [=](Widget*) { From a57347c9b10637fc07a88c7ecdfcec5b59ba1498 Mon Sep 17 00:00:00 2001 From: SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> Date: Wed, 18 Dec 2024 01:50:56 -0600 Subject: [PATCH 06/11] Update StarMerchantInterface.cpp --- source/frontend/StarMerchantInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/frontend/StarMerchantInterface.cpp b/source/frontend/StarMerchantInterface.cpp index 166f996..178b645 100644 --- a/source/frontend/StarMerchantInterface.cpp +++ b/source/frontend/StarMerchantInterface.cpp @@ -38,7 +38,7 @@ MerchantPane::MerchantPane( m_itemBag = make_shared(m_settings.getUInt("sellContainerSize")); - m_maxBuyCount = m_settings.getUInt("maxBuyCount"); + m_maxBuyCount = m_settings.getUInt("maxBuyCount", 1000); GuiReader reader; reader.registerCallback("spinCount.up", [=](Widget*) { From 41cb7dfde4266ad9aef5de777cd903269d492c41 Mon Sep 17 00:00:00 2001 From: SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> Date: Wed, 18 Dec 2024 01:57:19 -0600 Subject: [PATCH 07/11] Update StarCraftingInterface.hpp --- source/frontend/StarCraftingInterface.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/frontend/StarCraftingInterface.hpp b/source/frontend/StarCraftingInterface.hpp index 58dd022..f422406 100644 --- a/source/frontend/StarCraftingInterface.hpp +++ b/source/frontend/StarCraftingInterface.hpp @@ -69,6 +69,8 @@ private: StringSet m_filter; + int m_maxSpinCount; + int m_recipeAutorefreshCooldown; HashMap m_itemCache; From a362aa867a3802fe27ddf52c32e809a3cc750f23 Mon Sep 17 00:00:00 2001 From: SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> Date: Wed, 18 Dec 2024 01:57:51 -0600 Subject: [PATCH 08/11] Update StarMerchantInterface.hpp --- source/frontend/StarMerchantInterface.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/frontend/StarMerchantInterface.hpp b/source/frontend/StarMerchantInterface.hpp index b717a61..967a2ce 100644 --- a/source/frontend/StarMerchantInterface.hpp +++ b/source/frontend/StarMerchantInterface.hpp @@ -76,6 +76,7 @@ private: ItemBagPtr m_itemBag; int m_buyCount; + int m_maxBuyCount; }; } From 621166242be1d2e562a7f1b347000c0fd03d3c45 Mon Sep 17 00:00:00 2001 From: SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> Date: Wed, 18 Dec 2024 02:24:50 -0600 Subject: [PATCH 09/11] Update StarMerchantInterface.cpp --- source/frontend/StarMerchantInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/frontend/StarMerchantInterface.cpp b/source/frontend/StarMerchantInterface.cpp index 178b645..7acd234 100644 --- a/source/frontend/StarMerchantInterface.cpp +++ b/source/frontend/StarMerchantInterface.cpp @@ -38,7 +38,7 @@ MerchantPane::MerchantPane( m_itemBag = make_shared(m_settings.getUInt("sellContainerSize")); - m_maxBuyCount = m_settings.getUInt("maxBuyCount", 1000); + m_maxBuyCount = assets->json("/interface/windowconfig/crafting.config:default").getUInt("maxSpinCount", 1000); GuiReader reader; reader.registerCallback("spinCount.up", [=](Widget*) { From ee918cb476391add2121c32ba5b294cdeaafa6dd Mon Sep 17 00:00:00 2001 From: SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> Date: Wed, 18 Dec 2024 02:26:43 -0600 Subject: [PATCH 10/11] Update crafting.config.patch --- .../interface/windowconfig/crafting.config.patch | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/assets/opensb/interface/windowconfig/crafting.config.patch b/assets/opensb/interface/windowconfig/crafting.config.patch index 0728507..9febcd4 100644 --- a/assets/opensb/interface/windowconfig/crafting.config.patch +++ b/assets/opensb/interface/windowconfig/crafting.config.patch @@ -4,7 +4,11 @@ // Disables the crafting timer if true. "disableTimer" : false, - // This is only used if the crafting timer is enabled. - // This is how many crafts are ran when the crafting timer wraps. - "craftCount" : 1 -} } \ No newline at end of file + // This is only used if the crafting timer is enabled. + // This is how many crafts are ran when the crafting timer wraps. + "craftCount" : 1, + + // This is how many of any item can be crafted at once. + // This is also used by merchants. + "maxSpinCount" : 9999 +} } From 28a8b54f43f10fde8c09f6efe91d1c1b3b09d5d4 Mon Sep 17 00:00:00 2001 From: SilverSokolova <80606782+SilverSokolova@users.noreply.github.com> Date: Wed, 18 Dec 2024 02:42:16 -0600 Subject: [PATCH 11/11] Update StarMerchantInterface.cpp --- source/frontend/StarMerchantInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/frontend/StarMerchantInterface.cpp b/source/frontend/StarMerchantInterface.cpp index 7acd234..196dba1 100644 --- a/source/frontend/StarMerchantInterface.cpp +++ b/source/frontend/StarMerchantInterface.cpp @@ -38,7 +38,7 @@ MerchantPane::MerchantPane( m_itemBag = make_shared(m_settings.getUInt("sellContainerSize")); - m_maxBuyCount = assets->json("/interface/windowconfig/crafting.config:default").getUInt("maxSpinCount", 1000); + m_maxBuyCount = m_settings.getUInt("maxSpinCount", assets->json("/interface/windowconfig/crafting.config:default").getUInt("maxSpinCount", 1000)); GuiReader reader; reader.registerCallback("spinCount.up", [=](Widget*) {