From 94d00cf11cf12f3c027babb40fa1bea62c9a65af Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 29 Sep 2018 01:19:17 +0200 Subject: [PATCH] tbc: add further compatibility code * friends button name changed * use proper hooksecurefunc * make use of tbc cooldown frames * adjust unit debuf return values * disable autoshift module --- api/tbc.lua | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/api/tbc.lua b/api/tbc.lua index 6029f737..c758a5ae 100644 --- a/api/tbc.lua +++ b/api/tbc.lua @@ -9,14 +9,36 @@ setfenv(1, pfUI:GetEnvironment()) pfUI.api.MiniMapTrackingFrame = _G.MiniMapTracking pfUI.api.UIOptionsFrame = _G.InterfaceOptionsFrame +-- tbc name of the friendlist button has changed +for i=1, FRIENDS_TO_DISPLAY do + _G["FriendsFrameFriendButton"..i.."ButtonTextNameLocation"] = _G["FriendsFrameFriendButton"..i.."ButtonTextLocation"] +end + -- gfind got replaced by gmatch pfUI.api.gfind = string.gmatch -- blacklist pfUI functions -pfUI.api.hooksecurefunc = nil -pfUI.api.select = nil +pfUI.api.hooksecurefunc = _G.hooksecurefunc -- tbc removed the offset of -1 function pfUI.api.GetPlayerBuff(id, btype) return _G.GetPlayerBuff(id+1, btype) end + +-- tbc uses a "Cooldown" frametype +function pfUI.api.CreateFrame(f, n, p, t) + if f == "Model" and t == "CooldownFrameTemplate" then + return _G.CreateFrame("Cooldown", n, p, t) + else + return _G.CreateFrame(f, n, p, t) + end +end + +-- tbc changed the return values +function pfUI.api.UnitBuff(unitstr, i) + local name, rank, icon, count = _G.UnitBuff(unitstr, i) + return icon, count +end + +-- blacklist unrequired modules +pfUI.module.autoshift = true