Hi all. I'm trying to remove the border and backdrop from Cork. I can do it no problem with the anchor tooltip, but can't for the info tooltip. Any tips on what to do?
Assuming I need to modify something in this code, which shows the tooltip containing the needed buffs/etc.
Code:
-----------------------
-- Tooltip --
-----------------------
tooltip = CreateFrame("GameTooltip", "Corkboard", UIParent, "GameTooltipTemplate")
tooltip:SetFrameStrata("MEDIUM")
CorkboardTextLeft1:SetFontObject(GameTooltipTextSmall)
CorkboardTextRight1:SetFontObject(GameTooltipTextSmall)
local function GetTipAnchor(frame)
local x,y = frame:GetCenter()
if not x or not y then return "TOPLEFT", frame, "BOTTOMLEFT" end
local hhalf = (x > UIParent:GetWidth()*2/3) and "RIGHT" or (x < UIParent:GetWidth()/3) and "LEFT" or ""
local vhalf = (y > UIParent:GetHeight()/2) and "TOP" or "BOTTOM"
return vhalf..hhalf, frame, (vhalf == "TOP" and "BOTTOM" or "TOP")..hhalf
end
local raidunits = {player = true}
for i=1,4 do raidunits["party"..i] = true end
for i=1,40 do raidunits["raid"..i] = true end
function Cork.Update(event, name, attr, value, dataobj)
if Cork.keyblist[attr] then return end
tooltip:ClearLines()
tooltip:SetOwner(anchor, "ANCHOR_NONE")
tooltip:SetPoint(GetTipAnchor(anchor))
if Cork.db.showbg or (GetZoneText() ~= "Wintergrasp" and select(2, IsInInstance()) ~= "pvp") then
local count = 0
for name,dataobj in pairs(Cork.corks) do
local inneed, numr = 0, GetNumRaidMembers()
for i=1,numr do if dataobj.RaidLine and dataobj["raid"..i] then inneed = inneed + 1 end end
if dataobj.RaidLine and numr > 0 and dataobj["player"] then inneed = inneed + 1 end
if inneed > 0 and count < Cork.dbpc.tooltiplimit then
if Cork.db.showunit then tooltip:AddDoubleLine(string.format(dataobj.RaidLine, inneed), "raid") else tooltip:AddLine(string.format(dataobj.RaidLine, inneed)) end
count = count + 1
end
for i,v in ldb:pairs(dataobj) do
if not Cork.keyblist[i] and (inneed == 0 or not raidunits[i]) and count < Cork.dbpc.tooltiplimit then
if Cork.db.showunit then tooltip:AddDoubleLine(v, i) else tooltip:AddLine(v) end
count = count + 1
end
end
end
end
if tooltip:NumLines() > 0 and not onTaxi then tooltip:Show() end
end