WoWInterface SVN TipTop

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /branches/2.0
    from Rev 50 to Rev 51
    Reverse comparison

Rev 50 → Rev 51

tiptop.lua
36,13 → 36,16
TipTop = CreateFrame("FRAME", nil, GameTooltip)
local TipTop = TipTop
local LSM = LibStub("LibSharedMedia-3.0")
local player = UnitName("player")
local server = GetRealmName()
local tt = GameTooltip
local ttSBar = GameTooltipStatusBar
local ttSBarBG = CreateFrame("Frame", nil, ttSBar)
local ttHealth = ttSBar:CreateFontString("ttHealth", "OVERLAY")
ttHealth:SetPoint("CENTER")
local raidIcon = ttSBar:CreateTexture(nil, "OVERLAY")
local BGPosition, color, font
local _, BGPosition, color, font, target, tclass, tserver, targetLine
local talents = {}
local qualColors = ITEM_QUALITY_COLORS
local tooltips = { GameTooltip,
ItemRefTooltip,
243,6 → 246,41
end
end
 
local function TargetTextUpdate()
target, tserver = UnitName("mouseovertarget")
_,tclass = UnitClass("mouseovertarget")
if target and target ~= UNKNOWN then
for i=1, GameTooltip:NumLines() do
local left, right, leftText, rightText
left = getglobal(GameTooltip:GetName().."TextLeft"..i)
leftText = left:GetText()
right = getglobal(GameTooltip:GetName().."TextRight"..i)
if leftText == "Target:" then
if db.you and target == player and (tserver == nil or tserver == server) then
right:SetText("<<YOU>>")
right:SetTextColor(.9, 0, .1)
else
right:SetText(target)
right:SetTextColor(color[tclass].r,color[tclass].g,color[tclass].b)
end
tt:Show()
targetLine = true
end
end
if targetLine ~= true then
if db.you and target == player and (tserver == nil or tserver == server) then
tt:AddDoubleLine("Target:", "<<YOU>>", nil, nil, nil, .9, 0, .1)
else
local tcolor = color[tclass]
tt:AddDoubleLine("Target:", target, nil,nil,nil,tcolor.r,tcolor.g,tcolor.b)
end
tt:Show()
else
targetLine = false
end
end
end
 
local function MouseoverTargetUpdate()
--min width for health text
if tt:GetWidth() < 125 then
296,6 → 334,9
if db.healthText then
ttSBar:HookScript("OnValueChanged", CalcHealth)
end
if db.showTargetText then
ttSBar:HookScript("OnUpdate", TargetTextUpdate)
end
end