Mercurial > wow > itemauditor
changeset 86:8d5ad3b71f6f
Removed references to Skillet in core functionality. Skillet really should be optional.
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Sat, 07 Aug 2010 11:16:21 -0700 |
parents | a425f8345087 |
children | 26f45b6e8d4d |
files | .pkgmeta CHANGELOG.txt Core.lua Modules/Crafting.lua Modules/QuickAuctions.lua Modules/Utils.lua embeds.xml |
diffstat | 7 files changed, 31 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/.pkgmeta Fri Aug 06 05:59:29 2010 -0700 +++ b/.pkgmeta Sat Aug 07 11:16:21 2010 -0700 @@ -32,6 +32,10 @@ Libs/lib-st: url: svn://svn.wowace.com/wow/lib-st/mainline/trunk tag: latest + Libs/LibPeriodicTable-3.1: + url: svn://svn.wowace.com/wow/libperiodictable-3-1/mainline/trunk/LibPeriodicTable-3.1 + tag: latest + required-dependencies: Altoholic
--- a/CHANGELOG.txt Fri Aug 06 05:59:29 2010 -0700 +++ b/CHANGELOG.txt Sat Aug 07 11:16:21 2010 -0700 @@ -1,3 +1,7 @@ +2010-08-07 Asa Ayers <Asa.Ayers@Gmail.com> + +- Removed references to Skillet in core functionality. Skillet really should be optional. + 2010-08-03 Asa Ayers <Asa.Ayers@Gmail.com> - Fixed a bug introduced last night where in some cases there was an error caused by DataStore:GetAuctionHouseItemCount returning nil instead of 0 as I expected.
--- a/Core.lua Fri Aug 06 05:59:29 2010 -0700 +++ b/Core.lua Sat Aug 07 11:16:21 2010 -0700 @@ -75,6 +75,8 @@ LibStub("AceConfig-3.0"):RegisterOptionsTable("ItemAuditor", ItemAuditor.Options, {"ia"}) ItemAuditor:RegisterFrame(ItemAuditor_DebugFrame) + LibStub("AceConsole-3.0"):RegisterChatCommand('rl', ReloadUI) + --@debug@ -- ItemAuditor_DebugFrame:Show() -- self:CreateFrame('tab_crafting')
--- a/Modules/Crafting.lua Fri Aug 06 05:59:29 2010 -0700 +++ b/Modules/Crafting.lua Sat Aug 07 11:16:21 2010 -0700 @@ -1,6 +1,8 @@ local ItemAuditor = select(2, ...) local Crafting = ItemAuditor:NewModule("Crafting") +local Utils = ItemAuditor:GetModule("Utils") + local AceGUI = LibStub("AceGUI-3.0") local ScrollingTable = LibStub("ScrollingTable") @@ -342,10 +344,6 @@ self:Print("This feature requires LilSparky's Workshop.") return end - if Skillet == nil then - self:Print("This feature requires Skillet.") - return - end if GetAuctionBuyout ~= nil then elseif AucAdvanced and AucAdvanced.Version then else @@ -362,7 +360,7 @@ for i = 1, GetNumTradeSkills() do local itemLink = GetTradeSkillItemLink(i) - local itemId = Skillet:GetItemIDFromLink(itemLink) + local itemId = Utils.GetItemID(itemLink) --Figure out if its an enchant or not _, _, _, _, altVerb = GetTradeSkillInfo(i)
--- a/Modules/QuickAuctions.lua Fri Aug 06 05:59:29 2010 -0700 +++ b/Modules/QuickAuctions.lua Sat Aug 07 11:16:21 2010 -0700 @@ -3,6 +3,8 @@ local Crafting = ItemAuditor:GetModule("Crafting") local Utils = ItemAuditor:GetModule("Utils") +local PT = LibStub("LibPeriodicTable-3.1") + --[[ This is simply for compatibility while I change the QA API. Once my changes get merged into the main project, this can go away. @@ -136,7 +138,7 @@ function ItemAuditor:GetReagentCost(link, total) local totalCost = 0 - if Skillet:VendorSellsReagent(link) then + if PT:ItemInSet(link,"Tradeskill.Mat.BySource.Vendor") then local _, _, _, _, _, _, _, _, _, _, itemVendorPrice = GetItemInfo (link); totalCost = itemVendorPrice * total total = 0
--- a/Modules/Utils.lua Fri Aug 06 05:59:29 2010 -0700 +++ b/Modules/Utils.lua Sat Aug 07 11:16:21 2010 -0700 @@ -65,27 +65,33 @@ local tmp_item_cache = {} -function Utils.GetItemID(itemName) - if tmp_item_cache[itemName] == nil then - local _, itemLink = GetItemInfo (itemName); +function Utils.GetItemID(item) + if not item then + return nil + end + + if tmp_item_cache[item] == nil then + -- Whether item is a link or a name, both should return the full link + DevTools_Dump(item) + local _, itemLink = GetItemInfo (item); if itemLink ~= nil then local _, _, _, _, itemID = string.find(itemLink, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?") - tmp_item_cache[itemName] = tonumber(itemID) + tmp_item_cache[item] = tonumber(itemID) end end - if tmp_item_cache[itemName] == nil then + if tmp_item_cache[item] == nil then for link, data in pairs(ItemAuditor.db.factionrealm.items) do local name, itemLink = GetItemInfo (link); - if name == itemName then + if name == item then local _, _, _, _, itemID = string.find(itemLink, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?") - tmp_item_cache[itemName] = tonumber(itemID) + tmp_item_cache[item] = tonumber(itemID) end end end - return tmp_item_cache[itemName] + return tmp_item_cache[item] end
--- a/embeds.xml Fri Aug 06 05:59:29 2010 -0700 +++ b/embeds.xml Sat Aug 07 11:16:21 2010 -0700 @@ -10,4 +10,5 @@ <Include file="Libs\AceBucket-3.0\AceBucket-3.0.xml"/> <Include file="Libs\AceTimer-3.0\AceTimer-3.0.xml"/> <Include file="Libs\lib-st\lib-st.xml"/> + <Script file="Libs\LibPeriodicTable-3.1\LibPeriodicTable-3.1.lua"/> </Ui>