|
|
|
|
@ -15,6 +15,22 @@ local move = TSM:NewModule("move", "AceEvent-3.0")
|
|
|
|
|
local AceGUI = LibStub("AceGUI-3.0") -- load the AceGUI libraries |
|
|
|
|
local private = { shoppingItems = {} } |
|
|
|
|
|
|
|
|
|
local function GetSelectedGroupInfoFallback() |
|
|
|
|
local selection = TSM.db.profile.groupTreeSelectedGroupStatus and TSM.db.profile.groupTreeSelectedGroupStatus["Warehousing_Bank"] |
|
|
|
|
if not selection then return end |
|
|
|
|
local groupInfo = {} |
|
|
|
|
for groupPath, isSelected in pairs(selection) do |
|
|
|
|
if isSelected then |
|
|
|
|
local operations = TSM:GetGroupOperations(groupPath, "Warehousing") |
|
|
|
|
if operations then |
|
|
|
|
groupInfo[groupPath] = { operations = operations, items = TSM:GetGroupItems(groupPath) } |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
if next(groupInfo) == nil then return end |
|
|
|
|
return groupInfo |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
local function ShoppingNextSearch() |
|
|
|
|
if next(private.shoppingItems) then |
|
|
|
|
move:ShoppingSearch(private.shoppingItems[1].itemString, private.shoppingItems[1].quantity) |
|
|
|
|
@ -58,6 +74,14 @@ function move:restockGroupAuction(grpInfo)
|
|
|
|
|
return |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
if not grpInfo then |
|
|
|
|
grpInfo = GetSelectedGroupInfoFallback() |
|
|
|
|
end |
|
|
|
|
if not grpInfo or next(grpInfo) == nil then |
|
|
|
|
TSM:Print(L["No groups selected."]) |
|
|
|
|
return |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
local restockItems = TSM.data:unIndexRestockGroupTree(grpInfo) |
|
|
|
|
private.shoppingItems = {} |
|
|
|
|
for itemString, quantity in pairs(restockItems) do |
|
|
|
|
|