diff --git a/TradeSkillMaster/Auction/AuctionControl.lua b/TradeSkillMaster/Auction/AuctionControl.lua index 2f01543..b891015 100644 --- a/TradeSkillMaster/Auction/AuctionControl.lua +++ b/TradeSkillMaster/Auction/AuctionControl.lua @@ -203,7 +203,7 @@ function private:DoBuyout() TSM:Print("Max restock quantity reached for this item.") return end - if private.module == "Shopping" and not ShoppingBuyoutAllowed(private.currentAuction.itemString, private.currentAuction.count, perItemBuyout) then + if private.module == "Shopping" and TSM.shoppingGroupSearchActive and not ShoppingBuyoutAllowed(private.currentAuction.itemString, private.currentAuction.count, perItemBuyout) then TSM:Print("Max restock quantity reached for this item.") return end @@ -422,7 +422,7 @@ function private:ShowConfirmationWindow() TSM:Print("Max restock quantity reached for this item.") return end - if private.module == "Shopping" and not ShoppingBuyoutAllowed(private.currentAuction.itemString, private.currentAuction.count, perItemBuyout) then + if private.module == "Shopping" and TSM.shoppingGroupSearchActive and not ShoppingBuyoutAllowed(private.currentAuction.itemString, private.currentAuction.count, perItemBuyout) then TSM:Print("Max restock quantity reached for this item.") return end diff --git a/TradeSkillMaster_Crafting/Modules/Gather.lua b/TradeSkillMaster_Crafting/Modules/Gather.lua index f6fb924..2248f65 100644 --- a/TradeSkillMaster_Crafting/Modules/Gather.lua +++ b/TradeSkillMaster_Crafting/Modules/Gather.lua @@ -186,23 +186,23 @@ function Gather:ShoppingSearch(itemString, need, ignoreMaxQty) TSMAPI:ModuleAPI("Shopping", "runDestroySearch", TSMAPI:GetSafeItemInfo(itemString) .. "/x" .. need, ShoppingCallback) end else - TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact/x" .. need, ShoppingCallback) + TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact/x" .. need, ShoppingCallback, true) end else TSM.Inventory.gatherItem = nil if ignoreMaxQty then - TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact", ShoppingCallback) + TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact", ShoppingCallback, true) else - TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact/x" .. need, ShoppingCallback) + TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact/x" .. need, ShoppingCallback, true) end end else TSM.Inventory.gatherItem = nil if ignoreMaxQty then - TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact", ShoppingCallback) + TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact", ShoppingCallback, true) else - TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact/x" .. need, ShoppingCallback) + TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact/x" .. need, ShoppingCallback, true) end end end diff --git a/TradeSkillMaster_Shopping/TradeSkillMaster_Shopping.lua b/TradeSkillMaster_Shopping/TradeSkillMaster_Shopping.lua index 7cd9e19..fbcda2f 100644 --- a/TradeSkillMaster_Shopping/TradeSkillMaster_Shopping.lua +++ b/TradeSkillMaster_Shopping/TradeSkillMaster_Shopping.lua @@ -95,6 +95,7 @@ end function TSM:StartFilterSearch(searchQuery, callback) if not TSMAPI:AHTabIsVisible("Shopping") then return end TSM.Search:StartFilterSearch(searchQuery, nil, true) + TSM.shoppingGroupSearchActive = nil TSM.moduleAPICallback = callback end diff --git a/TradeSkillMaster_Shopping/modules/Destroying.lua b/TradeSkillMaster_Shopping/modules/Destroying.lua index 2129d19..9f1d108 100644 --- a/TradeSkillMaster_Shopping/modules/Destroying.lua +++ b/TradeSkillMaster_Shopping/modules/Destroying.lua @@ -62,7 +62,9 @@ function Destroying:StartDestroyingSearch(target, filter, isCrafting) if not private.sources[target] then return TSM:Printf(L["Invalid destroy target: '%s'"], target) end TSM.isCrafting = isCrafting + TSM.shoppingGroupSearchActive = nil Destroying.maxQuantity = filter.maxQuantity + filter.maxQuantity = nil filter.maxPrice = nil if private.sources[target] == "mill" then private:TryStarting(private.StartMillingSearch, target, filter) @@ -271,4 +273,4 @@ function private.ScanCallback(event, ...) elseif event == "done" then TSM.Search:SetSearchBarDisabled(false) end -end \ No newline at end of file +end diff --git a/TradeSkillMaster_Shopping/modules/Search.lua b/TradeSkillMaster_Shopping/modules/Search.lua index 18fdf72..cfc01f1 100644 --- a/TradeSkillMaster_Shopping/modules/Search.lua +++ b/TradeSkillMaster_Shopping/modules/Search.lua @@ -325,6 +325,7 @@ end function Search:StartFilterSearch(filter, callback, isCrafting) TSM.isCrafting = isCrafting TSM.searchCallback = callback + TSM.shoppingGroupSearchActive = nil if strfind(filter, "item:([0-9]+):?([0-9]*):?([0-9]*):?([0-9]*):?([0-9]*):?([0-9]*):?%-?([0-9]*)$") then --or strfind(filter, "battlepet:([0-9]+):?([0-9]*):?([0-9]*):?([0-9]*):?([0-9]*):?([0-9]*):?([0-9]*)$") then filter = TSMAPI:GetSafeItemInfo(filter) or filter end @@ -524,7 +525,7 @@ local function GetSearchFilterOptions(searchTerm) minILevel = oldMaxILevel end - return true, queryString or "", class or 0, subClass or 0, minLevel or 0, maxLevel or 0, minILevel or 0, maxILevel or 0, rarity or -1, usableOnly or 0, exactOnly or nil, evenOnly or nil, maxQuantity or 0, maxPrice + return true, queryString or "", class or 0, subClass or 0, minLevel or 0, maxLevel or 0, minILevel or 0, maxILevel or 0, rarity or -1, usableOnly or 0, exactOnly or nil, evenOnly or nil, maxQuantity, maxPrice --return true, queryString or "", class or 0, subClass or 0, minLevel or 0, maxLevel or 0, minILevel or 0, maxILevel or 0, rarity or 0, usableOnly or 0, exactOnly or nil, evenOnly or nil, maxQuantity or 0, maxPrice end diff --git a/TradeSkillMaster_Shopping/modules/Util.lua b/TradeSkillMaster_Shopping/modules/Util.lua index 38c25c3..19f1b9e 100644 --- a/TradeSkillMaster_Shopping/modules/Util.lua +++ b/TradeSkillMaster_Shopping/modules/Util.lua @@ -151,6 +151,7 @@ function Util:HideSearchFrame(forceStop) TSMAPI.AuctionScan:ClearCache() TSM.searchCallback = nil TSM.groupBuyoutCheck = nil + TSM.shoppingGroupSearchActive = nil end @@ -199,6 +200,9 @@ function private:PrepareForScan(callback, isLastPageScan) private.isLastPageScan = isLastPageScan private.callback = callback wipe(private.auctions) + if not isLastPageScan and not TSM.shoppingGroupSearchActive then + TSM.groupBuyoutCheck = nil + end if private.isLastPageScan then private.searchFrame.statusBar:SetStatusText("Scanning last page...") else @@ -466,7 +470,7 @@ function private:RemoveAuction(auction, event, itemString) -- handle max quantities on queries local query = private.auctions[itemString].query if event == "OnBuyout" and query then - if private.mode == "normal" and (query.maxQuantity or 0) > 0 then + if private.mode == "normal" and query.maxQuantity and query.maxQuantity > 0 then query.maxQuantity = query.maxQuantity - auction.count if TSM.moduleAPICallback then TSM.moduleAPICallback(max(query.maxQuantity, 0), itemString, auction.count) end for item, auctionItem in pairs(private.auctions) do diff --git a/TradeSkillMaster_Shopping/sidebar/Groups.lua b/TradeSkillMaster_Shopping/sidebar/Groups.lua index be92ddb..da7dd7a 100644 --- a/TradeSkillMaster_Shopping/sidebar/Groups.lua +++ b/TradeSkillMaster_Shopping/sidebar/Groups.lua @@ -122,6 +122,7 @@ end function private.StartScan() TSMAPI:FireEvent("SHOPPING:GROUPS:STARTSCAN") + TSM.shoppingGroupSearchActive = true wipe(private.itemOperations) wipe(private.purchasedCounts) TSM.searchCallback = function(event, auction)