Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarCraftingInterface.cpp
diff options
context:
space:
mode:
authorSilverSokolova <80606782+SilverSokolova@users.noreply.github.com>2024-12-18 01:47:22 -0600
committerGitHub <noreply@github.com>2024-12-18 01:47:22 -0600
commit54647362a079f9da8e49dda35fdc61920cbe02e4 (patch)
tree864a2859189f5e4bec4fd8b7f39e9946fd24522b /source/frontend/StarCraftingInterface.cpp
parenta52c213ebef8cd2ba80e47a797f8bf3215e4f61a (diff)
Update StarCraftingInterface.cpp
Diffstat (limited to 'source/frontend/StarCraftingInterface.cpp')
-rw-r--r--source/frontend/StarCraftingInterface.cpp5
1 files 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<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;
}