From ef759c0ed16b0bc5a65ea2381cf312e04e4b6844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20H=C3=BCskes?= Date: Sun, 22 Jan 2023 07:54:12 +0100 Subject: [PATCH] Restore Wrath compatibility --- module_bank.lua | 37 ++++++++++++----------- module_currency.lua | 10 ++----- module_guildbank.lua | 31 +++++++++++++------ module_mail.lua | 71 +++++++++++--------------------------------- module_void.lua | 39 ++++++++++++++++-------- moduls.lua | 15 ++++------ tooltip.lua | 50 +++++++++++++++---------------- 7 files changed, 120 insertions(+), 133 deletions(-) diff --git a/module_bank.lua b/module_bank.lua index cefd917..60276fe 100755 --- a/module_bank.lua +++ b/module_bank.lua @@ -124,13 +124,13 @@ function modul.Get(id) end --- function events:BANKFRAME_OPENED() --- BankIsOpen = true --- scanAllBankBags() --- end --- function events:BANKFRAME_CLOSED() --- BankIsOpen = false --- end +function events:BANKFRAME_OPENED() + BankIsOpen = true + scanAllBankBags() +end +function events:BANKFRAME_CLOSED() + BankIsOpen = false +end function events:PLAYERBANKBAGSLOTS_CHANGED(...) scanAllBankBags() end @@ -171,14 +171,15 @@ function modul:Delete(id, typ) self['db'][id] = nil end end -local skip = {} -local function MFOpen() - BankIsOpen = true - scanAllBankBags() -end -local function MFClose() - BankIsOpen = false -end +local skip = { + [WOW_PROJECT_WRATH_CLASSIC] = { + ['PLAYERREAGENTBANKSLOTS_CHANGED'] = true + }, + [WOW_PROJECT_MAINLINE] = { + ['BANKFRAME_OPENED'] = true, + ['BANKFRAME_CLOSED'] = true + } +} function modul:Enable() self['status'] = true local list = {} @@ -191,8 +192,10 @@ function modul:Enable() self['frame']:RegisterEvent(list[i]) end self['frame']:SetScript("OnEvent", OnEvent) - child:RegisterOpen(8, MFOpen) - child:RegisterClose(8, MFClose) + if(WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then + child:RegisterOpen(8, events.BANKFRAME_OPENED) + child:RegisterClose(8, events.BANKFRAME_CLOSED) + end end function modul:Disable() self['status'] = false diff --git a/module_currency.lua b/module_currency.lua index 728ebf8..7f64d0d 100755 --- a/module_currency.lua +++ b/module_currency.lua @@ -172,11 +172,6 @@ local skip = { ['CURRENCY_DISPLAY_UPDATE'] = true } } -if(WOW_PROJECT_BURNING_CRUSADE_CLASSIC) then - skip[WOW_PROJECT_BURNING_CRUSADE_CLASSIC] = { - ['PLAYERREAGENTBANKSLOTS_CHANGED'] = true - } -end function modul:Enable() if(child:IsRetail()) then self.status = true @@ -206,8 +201,9 @@ function modul:Disable() end end end -child:IgnoreClassic(modulname) -child:IgnoreBCC(modulname) +if(LE_EXPANSION_LEVEL_CURRENT 0 = item, 1 = spell - curItem = tooltipData.id - tooltip.zzInfo = true - child:setTT(curItem,tooltip) - tooltip:AddLine() - for name,b in pairs(child:Search(curItem)) do - local dname, drealm = strsplit(" - ",name) - local input,sum = child:output(b) - if(sum>0) then - tooltip:AddLine(format(L['tooltip_main_string'],child:getIcon(curItem),dname,sum,child:colorize(table.concat(input,', '),"ffffff"))) - end - input = nil +-- local tooltipData = tooltip:GetTooltipData() + if(tooltipData and tooltipData.id and tooltipData.type == 0) then -- type -> 0 = item, 1 = spell + curItem = tooltipData.id + tooltip.zzInfo = true + child:setTT(curItem,tooltip) + tooltip:AddLine() + for name,b in pairs(child:Search(curItem)) do + local dname, drealm = strsplit(" - ",name) + local input,sum = child:output(b) + if(sum>0) then + tooltip:AddLine(format(L['tooltip_main_string'],child:getIcon(curItem),dname,sum,child:colorize(table.concat(input,', '),"ffffff"))) end - child:specialoutput(tooltip, curItem) - if(db['showID']) then - tooltip:AddLine(format(L['tooltip_id_string'],curItem)) - end - GameTooltip_CalculatePadding(tooltip) - -- tooltip:Show() - elseif(tooltipData) then - + input = nil end + child:specialoutput(tooltip, curItem) + if(db['showID']) then + tooltip:AddLine(format(L['tooltip_id_string'],curItem)) + end + GameTooltip_CalculatePadding(tooltip) + -- tooltip:Show() + elseif(tooltipData) then + end -if(GameTooltip.OnTooltipSetItem) then - child.GameTooltip_OnTooltipSetItem = GameTooltip_OnTooltipSetItem - GameTooltip:HookScript("OnTooltipSetItem", GameTooltip_OnTooltipSetItem) -else +end +if(TooltipDataProcessor) then child.GameTooltip_OnTooltipSetItem = GameTooltip_OnTooltipSetItem2 TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Item, GameTooltip_OnTooltipSetItem2) +else + child.GameTooltip_OnTooltipSetItem = GameTooltip_OnTooltipSetItem + GameTooltip:HookScript("OnTooltipSetItem", GameTooltip_OnTooltipSetItem) end function events:TRADE_SKILL_LIST_UPDATE(event) child:updateTT()