/branches/2.0
local ttHealth = ttSBar:CreateFontString("ttHealth", "OVERLAY") |
ttHealth:SetPoint("CENTER") |
local raidIcon = ttSBar:CreateTexture(nil, "OVERLAY") |
local BGPosition, color |
local BGPosition, color, font |
local qualColors = ITEM_QUALITY_COLORS |
local tooltips = { GameTooltip, |
ItemRefTooltip, |
tooltips[i]:SetBackdropColor(db.bgColor.r, db.bgColor.g, db.bgColor.b, db.alpha) |
tooltips[i]:SetBackdropBorderColor(db.borderColor.r, db.borderColor.g, db.borderColor.b, db.borderColor.a) |
end |
tt:SetBackdrop(nil) |
tt:SetFrameLevel(10) |
tt:SetBackdrop(nil) --make the tooltip transparent to see the TipTop frame behind it |
tt:SetFrameLevel(10) --make sure the tooltip isn't overlapped by the bg frame |
TipTop:SetFrameLevel(9) |
TipTop:SetScale(db.scale) |
TipTop:SetBackdrop({ |
bgFile = LSM:Fetch("background", db.bg), |
insets = {left=db.inset, right=db.inset, top=db.inset, bottom=db.inset}, |
if db.topBar then |
ttSBar:SetPoint("TOPRIGHT", tt, "TOPRIGHT", -7, 5) |
ttSBar:SetPoint("TOPLEFT", tt, "TOPLEFT", 10, 5) |
BGPosition = function() |
BGPosition = function() --make the TipTop bg frame resize around the health bar |
if ttSBar:IsShown() then |
TipTop:ClearAllPoints() |
TipTop:SetPoint("BOTTOMRIGHT", tt, "BOTTOMRIGHT") |
else |
ttSBar:SetPoint("BOTTOMRIGHT", tt, "BOTTOMRIGHT", -7, -5) |
ttSBar:SetPoint("BOTTOMLEFT", tt, "BOTTOMLEFT", 10, -5) |
BGPosition = function() |
BGPosition = function() --make the TipTop bg frame resize around the health bar |
if ttSBar:IsShown() then |
TipTop:ClearAllPoints() |
TipTop:SetPoint("TOPRIGHT", tt, "TOPRIGHT") |
end |
end |
local function FadedTip() --grays out tooltip if unit is tapped or dead |
local tapped = false |
if not UnitPlayerControlled("mouseover") then |
if UnitIsTapped("mouseover") and not UnitIsTappedByPlayer("mouseover") then |
tapped = true |
end |
end |
if UnitIsDead("mouseover") or tapped or not UnitIsConnected("mouseover") then |
local borderColor = db.borderColor |
TipTop:SetBackdropBorderColor(borderColor.r, borderColor.g, borderColor.b, borderColor.a) |
local bgColor = db.bgColor |
TipTop:SetBackdropColor(bgColor.r + .2, bgColor.g +.2, bgColor.b + .2, db.alpha-.1) |
end |
end |
local function Appendices() --appends info to the name of the mob |
local classif = UnitClassification("mouseover") |
if classif == "rare" or classif == "rareelite" then |
tt:AppendText(" (Rare)") |
end |
if UnitIsAFK("mouseover") then |
tt:AppendText(" (AFK)") |
end |
if UnitIsDND("mouseover") then |
tt:AppendText(" (DND)") |
end |
end |
local function BorderClassColor() |
if db.classColor then |
local _,class = UnitClass("mouseover") --or UnitClass(GameTooltip:GetUnit()) |
end |
end |
local function ItemQualityBorder(tip) |
local function ItemQualityBorder(tip) --tip is whatever tooltip called the OnTooltipSetItem script |
if db.itemColor then |
local _,item = tip:GetItem() |
local _,_,quality = GetItemInfo(item) |
local function MouseoverTargetUpdate() |
--min width for health text |
if tt:GetWidth() < 125 then |
if db.textformat == "100/100 (100%)" then |
if db.healthtext and db.textformat == "100/100 (100%)" then |
tt:SetWidth(175) |
else |
tt:SetWidth(125) |
CalcHealth() |
end |
RaidIconUpdate() |
Appendices() |
FadedTip() |
end |
local function TipShow() |
local borderColor = db.borderColor |
TipTop:SetBackdropBorderColor(borderColor.r, borderColor.g, borderColor.b, borderColor.a) |
end |
local bgColor = db.bgColor |
TipTop:SetBackdropColor(bgColor.r, bgColor.g, bgColor.b, db.alpha) |
BGPosition() |
end |