diff --git a/TradeSkillMaster_AuctionDB/Locale/enUS.lua b/TradeSkillMaster_AuctionDB/Locale/enUS.lua index 70e8b6e..d5c8bb8 100644 --- a/TradeSkillMaster_AuctionDB/Locale/enUS.lua +++ b/TradeSkillMaster_AuctionDB/Locale/enUS.lua @@ -75,6 +75,7 @@ L["Run Full Scan"] = true L["Run GetAll Scan"] = true L["Running query..."] = true L["Running query... Server not responding due to throttling? Try again later..."] = true +L["Scan Inventory & Bank"] = true L["Scan Selected Groups"] = true L["Scanning %d / %d (Page 1 / ?)"] = true L["Scanning %d / %d (Page %d / %d)"] = true @@ -87,10 +88,12 @@ L["Select whether to sort search results in ascending or descending order."] = t L["Shift-Right-Click to clear all data for this item from AuctionDB."] = true L["Show AuctionDB AH Tab (Requires Reload)"] = true L["Sort items by"] = true +L["This will scan items in your bags and bank (bank must be open) and update their AuctionDB prices. Soulbound items are skipped."] = true L["This determines how many items are shown per page in results area of the \"Search\" tab of the AuctionDB page in the main TSM window. You may enter a number between 5 and 500 inclusive. If the page lags, you may want to decrease this number."] = true L["This will do a slow auction house scan of every item in the selected groups and update their AuctionDB prices. This may take several minutes."] = true L["Use the search box and category filters above to search the AuctionDB data."] = true L["You can filter the results by item subtype by using this dropdown. For example, if you want to search for all herbs, you would select \"Trade Goods\" in the item type dropdown and \"Herbs\" in this dropdown."] = true L["You can filter the results by item type by using this dropdown. For example, if you want to search for all herbs, you would select \"Trade Goods\" in this dropdown and \"Herbs\" as the subtype filter."] = true L["You can use this page to lookup an item or group of items in the AuctionDB database. Note that this does not perform a live search of the AH."] = true -L["You have disabled GetAll scans via AuctionDB's options."] = true \ No newline at end of file +L["You have disabled GetAll scans via AuctionDB's options."] = true +L["No inventory items found."] = true diff --git a/TradeSkillMaster_AuctionDB/Modules/GUI.lua b/TradeSkillMaster_AuctionDB/Modules/GUI.lua index f34d7f1..c8430a4 100644 --- a/TradeSkillMaster_AuctionDB/Modules/GUI.lua +++ b/TradeSkillMaster_AuctionDB/Modules/GUI.lua @@ -98,12 +98,14 @@ function private:CreateStartScanContent(parent) if self.startGetAllButton then self.startGetAllButton:Enable() end self.startFullScanButton:Enable() self.startGroupScanButton:Enable() + self.startInventoryScanButton:Enable() end frame.Disable = function(self) if self.startGetAllButton then self.startGetAllButton:Disable() end self.startFullScanButton:Disable() self.startGroupScanButton:Disable() + self.startInventoryScanButton:Disable() end -- Top row: Auto updater. @@ -195,6 +197,22 @@ function private:CreateStartScanContent(parent) btn.tooltip = L["This will do a slow auction house scan of every item in the selected groups and update their AuctionDB prices. This may take several minutes."] frame.startGroupScanButton = btn + yOffset = yOffset - 40 + + TSMAPI.GUI:CreateHorizontalLine(buttonFrame, yOffset) + + yOffset = yOffset - 20 + + -- Row: Inventory Scan. + local btn = TSMAPI.GUI:CreateButton(buttonFrame, 18) + btn:SetPoint("TOPLEFT", 6, yOffset) + btn:SetPoint("TOPRIGHT", -6, yOffset) + btn:SetHeight(22) + btn:SetScript("OnClick", GUI.StartInventoryScan) + btn:SetText(L["Scan Inventory & Bank"]) + btn.tooltip = L["This will scan items in your bags and bank (bank must be open) and update their AuctionDB prices. Soulbound items are skipped."] + frame.startInventoryScanButton = btn + return frame end @@ -207,4 +225,25 @@ function GUI:StartGroupScan() end end TSM.Scan:StartGroupScan(items) -end \ No newline at end of file +end + +function GUI:StartInventoryScan() + local itemSet = {} + for _, _, itemString in TSMAPI:GetBagIterator(true) do + itemSet[itemString] = true + end + for _, _, itemString in TSMAPI:GetBankIterator(true) do + itemSet[itemString] = true + end + + local items = {} + for itemString in pairs(itemSet) do + tinsert(items, itemString) + end + if #items == 0 then + TSM:Print(L["No inventory items found."]) + return + end + + TSM.Scan:StartGroupScan(items) +end