diff options
-rw-r--r-- | assets/opensb/interface/merchant/shine.png | bin | 866 -> 0 bytes | |||
-rw-r--r-- | assets/opensb/interface/windowconfig/crafting.config.patch | 12 | ||||
-rw-r--r-- | assets/opensb/interface/windowconfig/merchant.config.patch | 12 | ||||
-rw-r--r-- | source/frontend/StarCraftingInterface.cpp | 5 | ||||
-rw-r--r-- | source/frontend/StarCraftingInterface.hpp | 2 | ||||
-rw-r--r-- | source/frontend/StarMerchantInterface.cpp | 6 | ||||
-rw-r--r-- | source/frontend/StarMerchantInterface.hpp | 1 |
7 files changed, 30 insertions, 8 deletions
diff --git a/assets/opensb/interface/merchant/shine.png b/assets/opensb/interface/merchant/shine.png Binary files differdeleted file mode 100644 index 639bae9..0000000 --- a/assets/opensb/interface/merchant/shine.png +++ /dev/null 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 +} } diff --git a/assets/opensb/interface/windowconfig/merchant.config.patch b/assets/opensb/interface/windowconfig/merchant.config.patch new file mode 100644 index 0000000..fd483c2 --- /dev/null +++ b/assets/opensb/interface/windowconfig/merchant.config.patch @@ -0,0 +1,12 @@ +[ + { + "op" : "test", + "path" : "/paneLayout/bgShine/position/1", + "value" : -12 + }, + { + "op" : "replace", + "path" : "/paneLayout/bgShine/position/1", + "value" : -19 + } +] diff --git a/source/frontend/StarCraftingInterface.cpp b/source/frontend/StarCraftingInterface.cpp index 34e0265..c44ad2b 100644 --- a/source/frontend/StarCraftingInterface.cpp +++ b/source/frontend/StarCraftingInterface.cpp @@ -42,6 +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.getUInt("maxSpinCount", 1000); GuiReader reader; reader.registerCallback("spinCount.up", [=](Widget*) { @@ -752,14 +753,14 @@ List<ItemRecipe> 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<ItemDescriptor, uint64_t> 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; } 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<ItemDescriptor, ItemPtr> m_itemCache; 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; } 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; }; } |