Compare commits

...

4 Commits

  1. 4
      TradeSkillMaster/Auction/AuctionControl.lua
  2. 2
      TradeSkillMaster/TradeSkillMaster.toc
  3. 4
      TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc
  4. 6
      TradeSkillMaster_Auctioning/modules/Options.lua
  5. 21
      TradeSkillMaster_Crafting/Modules/CraftingGUI.lua
  6. 34
      TradeSkillMaster_Crafting/Modules/Gather.lua
  7. 36
      TradeSkillMaster_Crafting/Modules/Inventory.lua
  8. 1
      TradeSkillMaster_Shopping/TradeSkillMaster_Shopping.lua
  9. 4
      TradeSkillMaster_Shopping/modules/Destroying.lua
  10. 3
      TradeSkillMaster_Shopping/modules/Search.lua
  11. 6
      TradeSkillMaster_Shopping/modules/Util.lua
  12. 1
      TradeSkillMaster_Shopping/sidebar/Groups.lua

4
TradeSkillMaster/Auction/AuctionControl.lua

@ -203,7 +203,7 @@ function private:DoBuyout()
TSM:Print("Max restock quantity reached for this item.") TSM:Print("Max restock quantity reached for this item.")
return return
end 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.") TSM:Print("Max restock quantity reached for this item.")
return return
end end
@ -422,7 +422,7 @@ function private:ShowConfirmationWindow()
TSM:Print("Max restock quantity reached for this item.") TSM:Print("Max restock quantity reached for this item.")
return return
end 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.") TSM:Print("Max restock quantity reached for this item.")
return return
end end

2
TradeSkillMaster/TradeSkillMaster.toc

@ -2,7 +2,7 @@
## Title: |cff00fe00TradeSkillMaster: Revived|r ## Title: |cff00fe00TradeSkillMaster: Revived|r
## Notes: Core addon for the TradeSkillMaster suite, revived for Wrath of the Lich King. Does nothing without modules installed. ## Notes: Core addon for the TradeSkillMaster suite, revived for Wrath of the Lich King. Does nothing without modules installed.
## Author: Sapu94, Bart39, Gnomezilla [Warmane-Icecrown(A)], BlueAo [Warmane], andrew6180, Yoshiyuka, DimaSheiko, and other contributors... ## Author: Sapu94, Bart39, Gnomezilla [Warmane-Icecrown(A)], BlueAo [Warmane], andrew6180, Yoshiyuka, DimaSheiko, and other contributors...
## Version: 2.3.39 ## Version: 2.3.44
## SavedVariables: TradeSkillMasterAppDB, AscensionTSMDB ## SavedVariables: TradeSkillMasterAppDB, AscensionTSMDB
## OptionalDeps: AccurateTime, Ace3, LibDataBroker-1.1, LibDBIcon-1.0, LibExtraTip, TipHelper, LibParse, LibCompress, LibGraph-2.0, SharedMedia, TheUndermineJournal, TheUndermineJournalGE ## OptionalDeps: AccurateTime, Ace3, LibDataBroker-1.1, LibDBIcon-1.0, LibExtraTip, TipHelper, LibParse, LibCompress, LibGraph-2.0, SharedMedia, TheUndermineJournal, TheUndermineJournalGE
## X-Embeds: AccurateTime, Ace3, LibDataBroker-1.1, LibDBIcon-1.0, LibExtraTip, TipHelper, LibParse, LibCompress, LibGraph-2.0 ## X-Embeds: AccurateTime, Ace3, LibDataBroker-1.1, LibDBIcon-1.0, LibExtraTip, TipHelper, LibParse, LibCompress, LibGraph-2.0

4
TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc

@ -2,10 +2,10 @@
## Title: |cff00ff00TradeSkillMaster_AuctionDB|r ## Title: |cff00ff00TradeSkillMaster_AuctionDB|r
## Notes: Stores auction house data and calculates market prices. ## Notes: Stores auction house data and calculates market prices.
## Author: Sapu94, Bart39 ## Author: Sapu94, Bart39
## Version: 2.3.39 ## Version: 2.3.44
## SavedVariables: AscensionTSM_AuctionDB ## SavedVariables: AscensionTSM_AuctionDB
## Dependency: TradeSkillMaster ## Dependency: TradeSkillMaster
## X-Curse-Packaged-Version: 2.3.39 ## X-Curse-Packaged-Version: 2.3.44
## X-Curse-Project-Name: TradeSkillMaster_AuctionDB ## X-Curse-Project-Name: TradeSkillMaster_AuctionDB
## X-Curse-Project-ID: tradeskillmaster_auctiondb ## X-Curse-Project-ID: tradeskillmaster_auctiondb
## X-Curse-Repository-ID: wow/tradeskillmaster_auctiondb/mainline ## X-Curse-Repository-ID: wow/tradeskillmaster_auctiondb/mainline

6
TradeSkillMaster_Auctioning/modules/Options.lua

@ -548,7 +548,7 @@ function Options:DrawOperationPost(container, operationName)
type = "EditBox", type = "EditBox",
label = L["Minimum Price"], label = L["Minimum Price"],
settingInfo = { operation, "minPrice" }, settingInfo = { operation, "minPrice" },
relativeWidth = 0.49, relativeWidth = 1,
acceptCustom = true, acceptCustom = true,
disabled = operation.relationships.minPrice, disabled = operation.relationships.minPrice,
tooltip = L["The lowest price you want an item to be posted for. Auctioning will not undercut auctions below this price."], tooltip = L["The lowest price you want an item to be posted for. Auctioning will not undercut auctions below this price."],
@ -566,7 +566,7 @@ function Options:DrawOperationPost(container, operationName)
type = "EditBox", type = "EditBox",
label = L["Maximum Price"], label = L["Maximum Price"],
settingInfo = { operation, "maxPrice" }, settingInfo = { operation, "maxPrice" },
relativeWidth = 0.49, relativeWidth = 1,
acceptCustom = true, acceptCustom = true,
disabled = operation.relationships.maxPrice, disabled = operation.relationships.maxPrice,
tooltip = L["The maximum price you want an item to be posted for. Auctioning will not undercut auctions above this price."], tooltip = L["The maximum price you want an item to be posted for. Auctioning will not undercut auctions above this price."],
@ -584,7 +584,7 @@ function Options:DrawOperationPost(container, operationName)
type = "EditBox", type = "EditBox",
label = L["Normal Price"], label = L["Normal Price"],
settingInfo = { operation, "normalPrice" }, settingInfo = { operation, "normalPrice" },
relativeWidth = 0.49, relativeWidth = 1,
acceptCustom = true, acceptCustom = true,
disabled = operation.relationships.normalPrice, disabled = operation.relationships.normalPrice,
tooltip = L["Price to post at if there are none of an item currently on the AH."], tooltip = L["Price to post at if there are none of an item currently on the AH."],

21
TradeSkillMaster_Crafting/Modules/CraftingGUI.lua

@ -17,6 +17,17 @@ private.gather = {}
private.shown = {} private.shown = {}
private.eventObj = nil private.eventObj = nil
local function IsCrafterPlayer(crafter)
if not crafter then return false end
local player = UnitName("player")
if not player then return false end
if strlower(crafter) == strlower(player) then
return true
end
local baseName = strmatch(crafter, "^[^-]+")
return baseName and strlower(baseName) == strlower(player) or false
end
-- list of profession skills that do not have crafting. used by UpdateTradeSkills -- list of profession skills that do not have crafting. used by UpdateTradeSkills
local invalidTrade = { local invalidTrade = {
["Herbalism"] = true, ["Herbalism"] = true,
@ -2816,9 +2827,9 @@ function GUI:UpdateGathering()
local crafterMail = TSMAPI:ModuleAPI("ItemTracker", "playermail", crafter) or {} local crafterMail = TSMAPI:ModuleAPI("ItemTracker", "playermail", crafter) or {}
for itemString, quantity in pairs(neededMats) do for itemString, quantity in pairs(neededMats) do
local need = quantity - (crafterBags[itemString] or 0) local need = quantity - (crafterBags[itemString] or 0)
if UnitName("player") ~= crafter then if not IsCrafterPlayer(crafter) then
need = need - (crafterMail[itemString] or 0) need = need - (crafterMail[itemString] or 0)
end end
if need > 0 then if need > 0 then
if next(sources) then if next(sources) then
for _, source in ipairs(sources) do for _, source in ipairs(sources) do
@ -2836,7 +2847,7 @@ function GUI:UpdateGathering()
end end
if task.taskType == L["Mail Items"] or task.taskType == L["Collect Mail"] then if task.taskType == L["Mail Items"] or task.taskType == L["Collect Mail"] then
availQty = min(need, taskQuantity) availQty = min(need, taskQuantity)
elseif not crafter == UnitName("player") then elseif not IsCrafterPlayer(crafter) then
availQty = min(need, taskQuantity) - (playerBags[itemString] or 0) availQty = min(need, taskQuantity) - (playerBags[itemString] or 0)
else else
availQty = min(need, taskQuantity) -- (crafterBags[itemString] or 0) availQty = min(need, taskQuantity) -- (crafterBags[itemString] or 0)
@ -2922,7 +2933,7 @@ function GUI:GatheringEventHandler(event)
elseif event == "MAIL_SHOW" then elseif event == "MAIL_SHOW" then
private.currentSource = UnitName("player") private.currentSource = UnitName("player")
local crafter = TSM.db.realm.gathering.crafter local crafter = TSM.db.realm.gathering.crafter
if crafter and crafter == UnitName("player") then if IsCrafterPlayer(crafter) then
private.currentTask = L["Collect Mail"] private.currentTask = L["Collect Mail"]
else else
private.currentTask = L["Mail Items"] private.currentTask = L["Mail Items"]

34
TradeSkillMaster_Crafting/Modules/Gather.lua

@ -14,15 +14,32 @@ local L = LibStub("AceLocale-3.0"):GetLocale("TradeSkillMaster_Crafting") -- loa
local next = next local next = next
local private = { shoppingItems = {} } local private = { shoppingItems = {} }
local function IsCrafterPlayer(crafter)
if not crafter then return false end
local player = UnitName("player")
if not player then return false end
if strlower(crafter) == strlower(player) then
return true
end
local baseName = strmatch(crafter, "^[^-]+")
return baseName and strlower(baseName) == strlower(player) or false
end
function Gather:BuyFromMerchant(neededMats) function Gather:BuyFromMerchant(neededMats)
for i = 1, GetMerchantNumItems() do for i = 1, GetMerchantNumItems() do
local itemString = TSMAPI:GetItemString(GetMerchantItemLink(i)) local itemString = TSMAPI:GetItemString(GetMerchantItemLink(i))
if neededMats[itemString] then if neededMats[itemString] then
local _, _, _, quantity = GetMerchantItemInfo(i)
local maxStack = GetMerchantItemMaxStack(i) local maxStack = GetMerchantItemMaxStack(i)
quantity = max(quantity or 1, 1)
local toBuy = neededMats[itemString] local toBuy = neededMats[itemString]
while toBuy > 0 do while toBuy > 0 do
BuyMerchantItem(i, math.min(toBuy, maxStack)) local buyCount = math.ceil(toBuy / quantity)
toBuy = toBuy - maxStack if maxStack and maxStack > 0 then
buyCount = math.min(buyCount, maxStack)
end
BuyMerchantItem(i, buyCount)
toBuy = toBuy - (buyCount * quantity)
TSM.db.realm.gathering.gatheredMats = true TSM.db.realm.gathering.gatheredMats = true
end end
end end
@ -31,12 +48,13 @@ end
function Gather:gatherItems(source, task) function Gather:gatherItems(source, task)
local items = TSM.db.realm.gathering.availableMats local items = TSM.db.realm.gathering.availableMats
local crafter = TSM.db.realm.gathering.crafter
if source == L["Vendor"] then if source == L["Vendor"] then
Gather:BuyFromMerchant(items) Gather:BuyFromMerchant(items)
elseif source == UnitName("player") and (task == L["Visit Bank"] or task == L["Visit Guild Bank"]) then elseif source == UnitName("player") and (task == L["Visit Bank"] or task == L["Visit Guild Bank"]) then
Gather:GatherBank(items) Gather:GatherBank(items)
elseif source == UnitName("player") and task == L["Collect Mail"] then elseif source == UnitName("player") and (task == L["Collect Mail"] or (task == L["Mail Items"] and IsCrafterPlayer(crafter))) then
TSMAPI:ModuleAPI("Mailing", "collectItems", items, Gather.PrintMsg) TSMAPI:ModuleAPI("Mailing", "collectItems", items, Gather.PrintMsg)
elseif source == UnitName("player") and task == L["Mail Items"] then elseif source == UnitName("player") and task == L["Mail Items"] then
Gather:MailItems(items) Gather:MailItems(items)
@ -168,23 +186,23 @@ function Gather:ShoppingSearch(itemString, need, ignoreMaxQty)
TSMAPI:ModuleAPI("Shopping", "runDestroySearch", TSMAPI:GetSafeItemInfo(itemString) .. "/x" .. need, ShoppingCallback) TSMAPI:ModuleAPI("Shopping", "runDestroySearch", TSMAPI:GetSafeItemInfo(itemString) .. "/x" .. need, ShoppingCallback)
end end
else 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 else
TSM.Inventory.gatherItem = nil TSM.Inventory.gatherItem = nil
if ignoreMaxQty then if ignoreMaxQty then
TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact", ShoppingCallback) TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact", ShoppingCallback, true)
else 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 end
else else
TSM.Inventory.gatherItem = nil TSM.Inventory.gatherItem = nil
if ignoreMaxQty then if ignoreMaxQty then
TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact", ShoppingCallback) TSMAPI:ModuleAPI("Shopping", "runSearch", TSMAPI:GetSafeItemInfo(itemString) .. "/exact", ShoppingCallback, true)
else 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 end
end end

36
TradeSkillMaster_Crafting/Modules/Inventory.lua

@ -110,6 +110,15 @@
return count return count
end end
local function IsSamePlayer(a, b)
if not a or not b then return false end
local function Normalize(name)
local base = strmatch(name, "^[^-]+") or name
return strlower(base)
end
return Normalize(a) == Normalize(b)
end
function Inventory:GetItemSources(crafter, neededMats) function Inventory:GetItemSources(crafter, neededMats)
if not neededMats then return end if not neededMats then return end
@ -161,7 +170,7 @@
-- add bags/bank/mail "tasks" for needed items of all non-ignored characters (always include crafter) -- add bags/bank/mail "tasks" for needed items of all non-ignored characters (always include crafter)
for _, player in pairs(TSMAPI:ModuleAPI("ItemTracker", "playerlist") or {}) do for _, player in pairs(TSMAPI:ModuleAPI("ItemTracker", "playerlist") or {}) do
if player == crafter or not TSM.db.global.ignoreCharacters[player] then if IsSamePlayer(player, crafter) or not TSM.db.global.ignoreCharacters[player] then
local task = {} local task = {}
local bags = TSMAPI:ModuleAPI("ItemTracker", "playerbags", player) or {} local bags = TSMAPI:ModuleAPI("ItemTracker", "playerbags", player) or {}
local bank = TSMAPI:ModuleAPI("ItemTracker", "playerbank", player) or {} local bank = TSMAPI:ModuleAPI("ItemTracker", "playerbank", player) or {}
@ -182,24 +191,21 @@
soulboundBagCount = GetItemCount(itemString) soulboundBagCount = GetItemCount(itemString)
soulboundBankCount = GetItemCount(itemString, true) - soulboundBagCount soulboundBankCount = GetItemCount(itemString, true) - soulboundBagCount
end end
if (bank[itemString] or (soulboundBankCount and soulboundBankCount > 0)) and shortItems[itemString] then local remainingNeed = shortItems[itemString] and shortItems[itemString] - (crafterMail[itemString] or 0) or 0
if shortItems[itemString] - (crafterMail[itemString] or 0) - (player ~= crafter and bags[itemString] or 0) > 0 then if remainingNeed > 0 then
bankItems[itemString] = bank[itemString] or soulboundBankCount if (bank[itemString] or (soulboundBankCount and soulboundBankCount > 0)) then
bankItems[itemString] = min(bank[itemString] or soulboundBankCount, remainingNeed)
end end
end if gbank[itemString] then
if gbank[itemString] and shortItems[itemString] then gbankItems[itemString] = min(gbank[itemString], remainingNeed)
if shortItems[itemString] - (crafterMail[itemString] or 0) - (player ~= crafter and bags[itemString] or 0) > 0 then
gbankItems[itemString] = gbank[itemString]
end end
end end
if mail[itemString] and shortItems[itemString] then if mail[itemString] and shortItems[itemString] then
mailItems[itemString] = mail[itemString] mailItems[itemString] = mail[itemString]
end end
if bags[itemString] and shortItems[itemString] then if bags[itemString] and shortItems[itemString] and not IsSamePlayer(player, crafter) then
if player ~= crafter then if remainingNeed > 0 then
if shortItems[itemString] - (crafterMail[itemString] or 0) > 0 then bagItems[itemString] = min(bags[itemString], remainingNeed)
bagItems[itemString] = bags[itemString]
end
end end
end end
end end
@ -223,7 +229,7 @@
tinsert(task, { taskType = L["Mail Items"], items = bagItems }) tinsert(task, { taskType = L["Mail Items"], items = bagItems })
end end
if next(task) then if next(task) then
tinsert(sources, { sourceName = player, isCrafter = player == crafter, isVendor = false, isAH = false, tasks = task, isCurrent = (player == UnitName("player")) }) tinsert(sources, { sourceName = player, isCrafter = IsSamePlayer(player, crafter), isVendor = false, isAH = false, tasks = task, isCurrent = (player == UnitName("player")) })
end end
end end
end end
@ -337,4 +343,4 @@
if itemString and not TSMAPI.DisenchantingData.notDisenchantable[itemString] and (iType == ARMOR or iType == WEAPON) then if itemString and not TSMAPI.DisenchantingData.notDisenchantable[itemString] and (iType == ARMOR or iType == WEAPON) then
return true return true
end end
end end

1
TradeSkillMaster_Shopping/TradeSkillMaster_Shopping.lua

@ -95,6 +95,7 @@ end
function TSM:StartFilterSearch(searchQuery, callback) function TSM:StartFilterSearch(searchQuery, callback)
if not TSMAPI:AHTabIsVisible("Shopping") then return end if not TSMAPI:AHTabIsVisible("Shopping") then return end
TSM.Search:StartFilterSearch(searchQuery, nil, true) TSM.Search:StartFilterSearch(searchQuery, nil, true)
TSM.shoppingGroupSearchActive = nil
TSM.moduleAPICallback = callback TSM.moduleAPICallback = callback
end end

4
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 if not private.sources[target] then return TSM:Printf(L["Invalid destroy target: '%s'"], target) end
TSM.isCrafting = isCrafting TSM.isCrafting = isCrafting
TSM.shoppingGroupSearchActive = nil
Destroying.maxQuantity = filter.maxQuantity Destroying.maxQuantity = filter.maxQuantity
filter.maxQuantity = nil
filter.maxPrice = nil filter.maxPrice = nil
if private.sources[target] == "mill" then if private.sources[target] == "mill" then
private:TryStarting(private.StartMillingSearch, target, filter) private:TryStarting(private.StartMillingSearch, target, filter)
@ -271,4 +273,4 @@ function private.ScanCallback(event, ...)
elseif event == "done" then elseif event == "done" then
TSM.Search:SetSearchBarDisabled(false) TSM.Search:SetSearchBarDisabled(false)
end end
end end

3
TradeSkillMaster_Shopping/modules/Search.lua

@ -325,6 +325,7 @@ end
function Search:StartFilterSearch(filter, callback, isCrafting) function Search:StartFilterSearch(filter, callback, isCrafting)
TSM.isCrafting = isCrafting TSM.isCrafting = isCrafting
TSM.searchCallback = callback 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 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 filter = TSMAPI:GetSafeItemInfo(filter) or filter
end end
@ -524,7 +525,7 @@ local function GetSearchFilterOptions(searchTerm)
minILevel = oldMaxILevel minILevel = oldMaxILevel
end 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 --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 end

6
TradeSkillMaster_Shopping/modules/Util.lua

@ -151,6 +151,7 @@ function Util:HideSearchFrame(forceStop)
TSMAPI.AuctionScan:ClearCache() TSMAPI.AuctionScan:ClearCache()
TSM.searchCallback = nil TSM.searchCallback = nil
TSM.groupBuyoutCheck = nil TSM.groupBuyoutCheck = nil
TSM.shoppingGroupSearchActive = nil
end end
@ -199,6 +200,9 @@ function private:PrepareForScan(callback, isLastPageScan)
private.isLastPageScan = isLastPageScan private.isLastPageScan = isLastPageScan
private.callback = callback private.callback = callback
wipe(private.auctions) wipe(private.auctions)
if not isLastPageScan and not TSM.shoppingGroupSearchActive then
TSM.groupBuyoutCheck = nil
end
if private.isLastPageScan then if private.isLastPageScan then
private.searchFrame.statusBar:SetStatusText("Scanning last page...") private.searchFrame.statusBar:SetStatusText("Scanning last page...")
else else
@ -466,7 +470,7 @@ function private:RemoveAuction(auction, event, itemString)
-- handle max quantities on queries -- handle max quantities on queries
local query = private.auctions[itemString].query local query = private.auctions[itemString].query
if event == "OnBuyout" and query then 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 query.maxQuantity = query.maxQuantity - auction.count
if TSM.moduleAPICallback then TSM.moduleAPICallback(max(query.maxQuantity, 0), itemString, auction.count) end if TSM.moduleAPICallback then TSM.moduleAPICallback(max(query.maxQuantity, 0), itemString, auction.count) end
for item, auctionItem in pairs(private.auctions) do for item, auctionItem in pairs(private.auctions) do

1
TradeSkillMaster_Shopping/sidebar/Groups.lua

@ -122,6 +122,7 @@ end
function private.StartScan() function private.StartScan()
TSMAPI:FireEvent("SHOPPING:GROUPS:STARTSCAN") TSMAPI:FireEvent("SHOPPING:GROUPS:STARTSCAN")
TSM.shoppingGroupSearchActive = true
wipe(private.itemOperations) wipe(private.itemOperations)
wipe(private.purchasedCounts) wipe(private.purchasedCounts)
TSM.searchCallback = function(event, auction) TSM.searchCallback = function(event, auction)

Loading…
Cancel
Save