From d2960a499a29dc684e0151ebc19c33b9d5b37ed2 Mon Sep 17 00:00:00 2001 From: ckaotik Date: Sun, 17 Jan 2010 18:19:04 +0100 Subject: [PATCH] fixes for new lists --- core.lua | 9 +++++---- options.lua | 16 +++++++++------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/core.lua b/core.lua index e790dcf..f3f8ef4 100644 --- a/core.lua +++ b/core.lua @@ -426,8 +426,8 @@ function BrokerGarbage:Tooltip(wut) end -- add useful(?) information - if (BG_GlobalDB.showLost and BG_GlobalDB.moneyLostByDeleting ~= 0) - or (BG_GlobalDB.showEarned and BG_GlobalDB.moneyEarned ~= 0) then + if (BG_GlobalDB.showLost and BG_LocalDB.moneyLostByDeleting ~= 0) + or (BG_GlobalDB.showEarned and BG_LocalDB.moneyEarned ~= 0) then BrokerGarbage.tt:AddSeparator(2) if BG_LocalDB.moneyLostByDeleting ~= 0 then @@ -614,10 +614,11 @@ function BrokerGarbage:ScanInventory() select(2,GetItemInfo(itemID)))) end - if quality and (quality <= BG_GlobalDB.dropQuality + if quality and + (quality <= BG_GlobalDB.dropQuality or BG_GlobalDB.include[itemID] or BG_LocalDB.include[itemID] or BG_GlobalDB.autoSellList[itemID] or BG_LocalDB.autoSellList[itemID]) - and not BG_GlobalDB.exclude[itemID] then -- save excluded items!!! + and not BG_GlobalDB.exclude[itemID] and not BG_LocalDB.exclude[itemID] then -- save excluded items!!! local value, source = BrokerGarbage:GetItemValue(itemLink,count) -- make included items appear in tooltip list as "forced" diff --git a/options.lua b/options.lua index dd1555f..dec09af 100644 --- a/options.lua +++ b/options.lua @@ -26,9 +26,7 @@ BrokerGarbage.listButtons = { exclude = {}, } --- show me! -BrokerGarbage.options:SetScript("OnShow", function(frame) - +local function ShowOptions(frame) local title, subtitle = LibStub("tekKonfig-Heading").new(BrokerGarbage.options, addonName, BrokerGarbage.locale.subTitle) local autosell = LibStub("tekKonfig-Checkbox").new(BrokerGarbage.options, nil, BrokerGarbage.locale.autoSellTitle, "TOPLEFT", subtitle, "BOTTOMLEFT", -2, -4) @@ -357,7 +355,7 @@ BrokerGarbage.options:SetScript("OnShow", function(frame) button.itemID = itemID button.itemLink = itemLink button:SetNormalTexture(texture) - button:GetNormalTexture():SetDesaturated(globalList[itemID]) -- desaturate global list items + button:GetNormalTexture():SetDesaturated(globalList[itemID] or false) -- desaturate global list items button:SetChecked(false) button:Show() else @@ -376,7 +374,7 @@ BrokerGarbage.options:SetScript("OnShow", function(frame) tex:SetPoint("CENTER") tex:SetWidth(36/37*66) tex:SetHeight(36/37*66) - iconbutton:GetNormalTexture():SetDesaturated(globalList[itemID]) -- desaturate global list items + iconbutton:GetNormalTexture():SetDesaturated(globalList[itemID] or false) -- desaturate global list items iconbutton:SetScript("OnEnter", ShowTooltip) iconbutton:SetScript("OnLeave", HideTooltip) @@ -529,9 +527,13 @@ BrokerGarbage.options:SetScript("OnShow", function(frame) buttons = {} ListOptionsUpdate("include") ListOptionsUpdate("exclude") - frame:SetScript("OnShow", nil) + BrokerGarbage.options:SetScript("OnShow", nil) BrokerGarbage.listOptions:SetScript("OnShow", ListOptionsUpdate) -end) +end + +-- show me! +BrokerGarbage.options:SetScript("OnShow", ShowOptions) +BrokerGarbage.listOptions:SetScript("OnShow", ShowOptions) InterfaceOptions_AddCategory(BrokerGarbage.options) InterfaceOptions_AddCategory(BrokerGarbage.listOptions) -- 1.7.9.5