Browse Source

add ah restock command

dev
Jørgen Lien Sellæg 4 months ago
parent
commit
51a389d780
  1. 2
      TradeSkillMaster/TradeSkillMaster.toc
  2. 4
      TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc
  3. 2
      TradeSkillMaster_Warehousing/Locale/enUS.lua
  4. 24
      TradeSkillMaster_Warehousing/Modules/move.lua
  5. 7
      TradeSkillMaster_Warehousing/TradeSkillMaster_Warehousing.lua

2
TradeSkillMaster/TradeSkillMaster.toc

@ -2,7 +2,7 @@
## Title: |cff00fe00TradeSkillMaster: Revived|r
## 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...
## Version: 2.3.23
## Version: 2.3.24
## SavedVariables: TradeSkillMasterAppDB, AscensionTSMDB
## 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

4
TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc

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

2
TradeSkillMaster_Warehousing/Locale/enUS.lua

@ -66,10 +66,12 @@ L["Puts items matching the itemstring, itemID or partial text entered into the b
L["Relationships"] = true
L["Restock Bags"] = true
L["Restock from AH"] = true
L["Restocks items from the AH based on your Warehousing group selections."] = true
L["Restock Quantity"] = true
L["Restock Settings"] = true
L["Restock Settings"] = true
L["Restocking"] = true
L["No groups selected."] = true
L["Restore Bags"] = true
L["Set Keep in Bags Quantity"] = true
L["Set Keep in Bank Quantity"] = true

24
TradeSkillMaster_Warehousing/Modules/move.lua

@ -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

7
TradeSkillMaster_Warehousing/TradeSkillMaster_Warehousing.lua

@ -89,6 +89,7 @@ function TSM:RegisterModule()
{ key = "movedata", label = L["Displays realtime move data."], callback = "SetLogFlag" },
{ key = "get", label = L["Gets items from the bank or guild bank matching the itemstring, itemID or partial text entered."], callback = "GetItem" },
{ key = "put", label = L["Puts items matching the itemstring, itemID or partial text entered into the bank or guild bank."], callback = "PutItem" },
{ key = "restockah", label = L["Restocks items from the AH based on your Warehousing group selections."], callback = "RestockFromAH" },
}
TSM.operations = { maxOperations = 1, callbackOptions = "Options:Load", callbackInfo = "GetOperationInfo" }
TSM.bankUiButton = { callback = "bankui:createTab" }
@ -237,4 +238,8 @@ function TSM:PutItem(args)
else
TSM:Print(L["Invalid criteria entered."])
end
end
end
function TSM:RestockFromAH()
TSM.move:restockGroupAuction()
end

Loading…
Cancel
Save