Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: frameSupport/skillet_support.lua
- ===================================================================
- --- frameSupport/skillet_support.lua (revision 72)
- +++ frameSupport/skillet_support.lua (working copy)
- @@ -65,8 +65,25 @@
- end
- + local function SortItemCount(tradeskill, a, b)
- + while a.subGroup and #a.subGroup.entries>0 do
- + a = a.subGroup.entries[1]
- + end
- + while b.subGroup and #b.subGroup.entries>0 do
- + b = b.subGroup.entries[1]
- + end
- + local itemCountA = LSW:GetItemOwned(a.recipeID)
- + local itemCountB = LSW:GetItemOwned(b.recipeID)
- +
- + itemCountA = itemCountA or 0
- + itemCountB = itemCountB or 0
- +
- + if (itemCountA > itemCountB) then return true; end
- + return false;
- + end
- +
- local function SortCompareItemValue(tradeskill, a, b)
- while a.subGroup and #a.subGroup.entries>0 do
- a = a.subGroup.entries[1]
- @@ -213,6 +230,7 @@
- Skillet:AddRecipeSorter("LSW: Item Value", SortCompareItemValue)
- Skillet:AddRecipeSorter("LSW: Reagent Cost", SortCompareReagentCost)
- Skillet:AddRecipeSorter("LSW: Profit", SortCompareProfit)
- + Skillet:AddRecipeSorter("LSW: Item Count", SortItemCount)
- else
- Skillet:AddRecipeSorter("LSW: Item Value", SortCompareItemValue_OLD)
- Skillet:AddRecipeSorter("LSW: Reagent Cost", SortCompareReagentCost_OLD)
- Index: lilsparkysworkshop.lua
- ===================================================================
- --- lilsparkysworkshop.lua (revision 72)
- +++ lilsparkysworkshop.lua (working copy)
- @@ -319,6 +319,20 @@
- local periodicTable
- + local function _GetItemCount(itemID)
- + if IsAddOnLoaded("Altoholic") then
- + local count = Altoholic:GetItemCount(itemID)
- + if count ~= 0 then
- + end
- + return count
- + else
- + return GetItemCount(itemID)
- + end
- + end
- +
- + function LSW:GetItemCount(itemID)
- + return _GetItemCount(itemID)
- + end
- local timerList = {}
- @@ -905,7 +919,18 @@
- end
- end
- -
- + local function UpdateItemOwned(itemID)
- + local cache = itemCache[itemID]
- + if cache then
- + local _, itemLink = GetItemInfo(itemID)
- + if cache.syncOwned ~= priceDataSync then
- + cache.syncOwned = priceDataSync
- + cache.owned = _GetItemCount(itemID)
- + end
- + end
- + return cache.owned
- + end
- +
- local function UpdateItemValue(itemID)
- local cache = itemCache[itemID]
- @@ -1109,6 +1134,7 @@
- for itemID in pairs(cache.craftResults) do
- UpdateItemCost(itemID)
- UpdateItemValue(itemID)
- + UpdateItemOwned(itemID)
- end
- end
- @@ -1277,7 +1303,19 @@
- return 0
- end
- -
- + function LSW:GetItemOwned(recipeID)
- + local rCache = recipeCache[recipeID]
- + if not rCache then
- + return
- + end
- + local total = 0
- + for itemID,numMade in pairs(rCache.craftResults) do
- + local cache = itemCache[itemID]
- + total = total + (cache.owned or 0)
- + end
- + return total
- + end
- +
- function LSW:GetSkillValue(recipeID, fate)
- if not fate then
- fate = globalFate
- @@ -1377,7 +1415,7 @@
- if itemFate == "a" and alt then
- local iCache = itemCache[itemID]
- - valueText = ((iCache and iCache.auctionValueCount) or 0).." ("..(GetItemCount(itemID) or 0)..")"
- + valueText = ((iCache and iCache.auctionValueCount) or 0).." ("..(_GetItemCount(itemID) or 0)..")"
- elseif itemFate == "a" and itemCache[itemID] and itemCache[itemID].BOP then
- valueText = BOP_STRING
- elseif itemFate == "d" and itemCache[itemID] and not itemCache[itemID].disenchantValue then
- @@ -1665,7 +1703,11 @@
- itemLink = GetSpellLink(recipeID)
- end
- + if not itemLink then
- + return
- + end
- +
- if LSWConfig.singleColumn then
- local totalCost = CostButton_OnEnter(button)
- LSWTooltip:AddLine(" ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement