Ouf und sTooltip kleines Problem

wertzû

Welt-Boss
Mitglied seit
12.01.2008
Beiträge
2.803
Reaktionspunkte
20
Kommentare
76
Bei Ouf wird mir kein ToT mehr angezeigt.

Hier mal den .Lua code
Code:
--[[
	
oUF Karu

Credits:	so many... this is a compilation of codes from LOTS of layouts. i suck at lua coding myself and has taught myself some of the basics.. but i can't code from scratch.. Main layout of code is from LYN!  to name a couple others that has been a big inspiration =

Neal, Obble ,tek, Shantalya , caellian, manuet, lolzen ..  probably forgetting someone.. sorry :'(

--]]




--YARR

local select = select
local UnitClass = UnitClass
local UnitIsDead = UnitIsDead
local UnitIsPVP = UnitIsPVP
local UnitIsGhost = UnitIsGhost
local UnitIsPlayer = UnitIsPlayer
local UnitReaction = UnitReaction
local UnitIsConnected = UnitIsConnected
local UnitCreatureType = UnitCreatureType
local UnitClassification = UnitClassification
local UnitReactionColor = UnitReactionColor
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
local _, class = UnitClass('player')
local playerClass = select(2, UnitClass("player"))
local statusbarcolor = {75/255, 75/255, 75/255}
local focuscolor = {255/255, 0/255, 255/255}
local ColorGradient = oUF.ColorGradient  

-- ZE FONT AND TEXTURES

local font = "Interface\\AddOns\\!media\\fonts\\font.ttf"
local fontsize = 14
local bartex = "Interface\\AddOns\\oUf Karu\\textures\\Minimalist"
local bufftex = "Interface\\AddOns\\!media\\textures\\bufftex"
local border = "Interface\\AddOns\\oUF Karu\\textures\\border"

-- CASTBAR POS

local playerCastBar_x = 0
local playerCastBar_y = -350
local targetCastBar_x = 0
local targetCastBar_y = 55
local focusCastBar_x = 0
local focusCastBar_y = 40

-- RIGHT CLICK

local menu = function(self)
local unit = self.unit:sub(1, -2)
local cunit = self.unit:gsub("(.)", string.upper, 1)

if(unit == "party" or unit == "partypet") then
ToggleDropDownMenu(1, nil, _G["PartyMemberFrame"..self.id.."DropDown"], "cursor", 0, 0)
	
elseif(_G[cunit.."FrameDropDown"]) then
ToggleDropDownMenu(1, nil, _G[cunit.."FrameDropDown"], "cursor", 0, 0)
end
end

-- SHIBBY

local numberize = function(v)
if v <= 9999 then return v end
if v >= 1000000 then
local value = string.format("%.1fm", v/1000000)
return value

elseif v >= 10000 then
local value = string.format("%.1f", v/1000)
return value
end
end

local numberize_raid = function(v)
if v <= 999 then return v end
if v >= 1000000 then
local value = string.format("%.1fm", v/1000000)
return value
	
elseif v >= 1000 then
local value = string.format("%.1f", v/1000)
return value
end
end

-- LEVEL UPDATE

local updateLevel = function(self, unit, name)
local lvl = UnitLevel(unit)
local typ = UnitClassification(unit)
local color = GetQuestDifficultyColor(lvl) 
		
if lvl <= 0 then	lvl = "??" end
			
if typ=="worldboss" then
self.Level:SetText("|cffff0000"..lvl.."b|r")
	
elseif typ=="rareelite" then
self.Level:SetText(lvl.."r")
self.Level:SetTextColor(color.r, color.g, color.b)
	
elseif typ=="elite" then
self.Level:SetText(lvl.."")
self.Level:SetTextColor(color.r, color.g, color.b)
	
elseif typ=="rare" then
self.Level:SetText(lvl.."r")
self.Level:SetTextColor(color.r, color.g, color.b)
	
else
if UnitIsConnected(unit) == 1 then
self.Level:SetText(lvl)
		
else
self.Level:SetText("??")
end
		
if(not UnitIsPlayer(unit)) then  
self.Level:SetTextColor(color.r, color.g, color.b)
		
else
local _, class = UnitClass(unit) 
color = self.colors.class[class] 
self.Level:SetTextColor(color[1], color[2], color[3])  
end			
end
end

-- NAME UPDATE

local updateName = function(self, event, unit)
if(self.unit ~= unit) then return end
local name = UnitName(unit)
self.Name:SetText(name)	

if unit=="target" or unit=="targettarget" or unit=="pet" then
self.Name:SetTextColor(1,1,1)

elseif(unit == "focus") then
self.Name:SetTextColor(1,1,1)


end 
   
if unit=="target" or unit=="targettarget" or unit=="focus" then 
updateLevel(self, unit, name)			 
end
end

-- HEALTH UPDATE

local updateHealth = function(self, event, unit, bar, min, max)  
local cur, maxhp = min, max
local missing = maxhp-cur
local d = floor(cur/maxhp*100)
if(max ~= 0) then 
r, g, b = ColorGradient(min/max, 1,0,0, 1,1,0, 0,1,0)	  
	
if(UnitIsDead(unit)) then
bar:SetValue(0)
bar.value:SetText"DEAD"

elseif(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
bar.value:SetText"|cFFC41F3BTAPPED"
	
elseif(UnitIsGhost(unit)) then
bar:SetValue(0)
bar.value:SetText"GHOST"

elseif(not UnitIsConnected(unit)) then
bar.value:SetText"D|cFFC41F3B/|rC"

elseif(unit == "player") then
bar.value:SetText("|cff3DF500"..numberize(cur))
	
elseif(unit == "targettarget" or unit=="target") then
if(min~=max) then
bar.value:SetFormattedText('|cff3DF500%s|r |cffffffff[|r|cff%02x%02x%02x%d%%|cffffffff]|r',numberize(cur), r*255, g*255, b*255, (min/max)*100)
else
bar.value:SetText("|cff3DF500"..numberize(cur))
end
		
elseif(unit == "focus") then
if(min~=max) then
bar.value:SetFormattedText('|cff3DF500%s|r|cff%02x%02x%02x%d%%|r',"", r*255, g*255, b*255, (min/max)*100)
else
bar.value:SetText("|cff3DF500"..numberize(cur))
end

elseif(unit == "pet") then
if(min~=max) then
bar.value:SetFormattedText('|cff3DF500%s|r|cff%02x%02x%02x%d%%|r',"", r*255, g*255, b*255, (min/max)*100)

else

bar.value:SetText("|cff3DF500"..numberize(cur))
end

else

bar.value:SetText("|cff3DF500"..numberize(cur))
end	
end
self:UNIT_NAME_UPDATE(event, unit,bar)
end

-- POWER UPDATE

local updatePower = function(self, event, unit, bar, min, max)  
local _, ptype = UnitPowerType(unit)
local color = oUF.colors.power[ptype]
		
if(UnitIsDead(unit) or UnitIsGhost(unit)) then
bar:SetValue(0)
			
elseif unit=="player" then 
bar.value:SetText(numberize(min))

if color then
bar.value:SetTextColor(color[1], color[2], color[3])
				
else

bar.value:SetTextColor(1,1,1)
end
end 
end

-- AURA SKIN

local auraIcon = function(self, button, icons)
icons.showDebuffType = true -- show debuff border type color  
	
button.icon:SetTexCoord(.07, .93, .07, .93)
button.icon:SetPoint("TOPLEFT", button, "TOPLEFT", 1, -2)
button.icon:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -1, 2)
	
button.overlay:SetTexture(bufftex)
button.overlay:SetTexCoord(0,1,0,1)
button.overlay.Hide = function(self) self:SetVertexColor(0, 0, 0) end
	
button.cd:SetReverse()
button.cd:SetPoint("TOPLEFT", button, "TOPLEFT", 1, -1) 
button.cd:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -1, 1)	 
end

-- MEOW

local func = function(self, unit)
self.menu = menu -- Enable the menus

self:SetScript("OnEnter", UnitFrame_OnEnter)
self:SetScript("OnLeave", UnitFrame_OnLeave)
	
self:RegisterForClicks"anyup"
self:SetAttribute("*type2", "menu")

-- MOVABLE FRAMES -_-v
 
self.MoveableFrames = true

-- HEALTH BAR

self.Health = CreateFrame"StatusBar"
self.Health:SetHeight(10)
self.Health:SetStatusBarTexture(bartex)
self.Health:SetParent(self)
self.Health:SetPoint"TOP"
self.Health:SetPoint"LEFT"
self.Health:SetPoint"RIGHT"
self.Health:SetFrameLevel(1)
self.Health:SetStatusBarColor(statusbarcolor[1],statusbarcolor[2],statusbarcolor
[3])

-- HEALTHBAR BG

self.Health.bg = self.Health:CreateTexture(nil, "BORDER")
self.Health.bg:SetAllPoints(self.Health)
self.Health.bg:SetTexture(bartex)
self.Health.bg:SetAlpha(0.45)
self.Health.bg:SetVertexColor(.2,.2,.2)

-- HEALTHBAR TEXT

self.Health.value = self.Health:CreateFontString(nil, "OVERLAY")
self.Health.value:SetPoint("TOPRIGHT", self.Health, 0, 0)
self.Health.value:SetFont(font, fontsize, "OUTLINE")
self.Health.value:SetTextColor(1,1,1)

-- HEALTHBAR FUNCTION

self.Health.frequentUpdates = true
self.Health.colorClass = false
self.Health.colorDisconnected = false 
self.Health.colorTapping = false 
self.PostUpdateHealth = updateHealth 
self.Health.Smooth = true

-- POWERBAR

self.Power = CreateFrame"StatusBar"
self.Power:SetHeight(2.5)
self.Power:SetStatusBarTexture(bartex)
self.Power:SetParent(self)
self.Power:SetPoint"LEFT"
self.Power:SetPoint"RIGHT"
self.Power:SetPoint("TOP", self.Health, "BOTTOM", 0, -0.75) 
self.Power:SetFrameLevel(1)
self.Power.frequentUpdates = true

-- POWERBAR BG

self.Power.bg = self.Power:CreateTexture(nil, "BORDER")
self.Power.bg:SetAllPoints(self.Power)
self.Power.bg:SetTexture(bartex)
self.Power.bg:SetAlpha(0.45)  

-- POWERBAR TEXT

self.Power.value = self.Power:CreateFontString(nil, "OVERLAY")
self.Power.value:SetPoint("TOPLEFT", self.Health, 0, 0)
self.Power.value:SetFont(font, fontsize, "OUTLINE")
self.Power.value:SetTextColor(1,1,1)
self.Power.value:Hide()
	
-- POWERBAR FUNCTION

self.Power.colorTapping = false 
self.Power.colorDisconnected = true 
self.Power.colorClass = false 
self.Power.colorPower = true 
self.Power.colorHappiness = false  
self.PostUpdatePower = updatePower  
self.Power.colorReaction = false

-- NAMES

self.Name = self.Health:CreateFontString(nil, "OVERLAY")
self.Name:SetPoint("TOPLEFT", self.Health, 0, 0)
self.Name:SetJustifyH("LEFT")
self.Name:SetFont(font, fontsize, "OUTLINE")
self.UNIT_NAME_UPDATE = updateName



-- LEVEL

self.Level = self.Health:CreateFontString(nil, "OVERLAY")
self.Level:SetPoint("center", self.Health, 0, 0)
self.Level:SetJustifyH("LEFT")
self.Level:SetFont(font, fontsize, outline)
self.Level:SetTextColor(1,1,1)
self.UNIT_LEVEL = updateLevel

-- PLAYER

if unit=="player" then

self:SetWidth(250)
self:SetHeight(15)
self.Name:Hide()
self.Health.value:SetPoint("LEFT", self.Health, -210, -30)
self.Power.value:Show()
self.Power.value:SetPoint("RIGHT", self.Health, 210, -210)
self.Level:Hide()
self.Health:SetHeight(12)
self.Power:SetHeight(2.5)
self.Health.value:Show()
self.Health.value:SetFont(font, 12, "OUTLINE")
self.Power.value:SetFont(font, 12, "OUTLINE")
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
self:SetBackdropColor(0,0,0,1)

-- PLAYER DEBUFF
		
self.Debuffs = CreateFrame("Frame", nil, self)
self.Debuffs.size = 22
self.Debuffs:SetHeight(self.Debuffs.size)
self.Debuffs:SetWidth(self.Debuffs.size * 6)
self.Debuffs:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 23, -5)
self.Debuffs.initialAnchor = "BOTTOMRIGHT"
self.Debuffs["growth-y"] = "DOWN"
self.Debuffs["growth-x"] = "RIGHT"
self.Debuffs.num = 7
self.Debuffs.spacing = 3

-- LEADER ICON
		
self.Leader = self.Health:CreateTexture(nil, "OVERLAY")
self.Leader:SetHeight(10)
self.Leader:SetWidth(10)
self.Leader:SetPoint("center", self, 0, 2)
self.Leader:SetTexture"Interface\\GroupFrame\\UI-Group-LeaderIcon"
end
				
-- PET 

if unit=="pet" then
self:SetWidth(120)
self:SetHeight(15)
self.Name:Hide()
self.Power.value:Hide()
self.Health.value:SetPoint("TOPRIGHT", self.Health, -3, 12)
self.Name:SetPoint("TOPLEFT", self.Health,  2,11)
self.Name:SetWidth(70)		
self.Health.value:SetHeight(fontsize)
self.Health.value:Hide()
self.Health:SetHeight(12)
self.Level:Hide()
self.Name:SetFont(font, 14, "OUTLINE")
self.Health.value:SetFont(font, 1, "OUTLINE")
self.Name:SetHeight(fontsize)
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
self:SetBackdropColor(0,0,0,1)
		  
if playerClass=="HUNTER" then
self.Health.colorReaction = false
self.Health.colorClass = false
self.Health.colorHappiness = false  
end
end

-- TARGET
if unit=="target" then
self:SetWidth(250)
self:SetHeight(15)
self.Power.value:Hide()
self.Health.value:SetPoint("TOPRIGHT", self.Health, -3, 1)
self.Name:SetPoint("TOPLEFT", self.Health,  2,1)
self.Name:SetWidth(90)		
self.Name:SetHeight(fontsize)
self.Health.value:SetHeight(fontsize)
self.Health:SetHeight(13)
self.Power:SetHeight(2)
self.Level:Hide()
self.Name:SetFont(font, 12, "OUTLINE")
self.Health.value:SetFont(font, 12,"OUTLINE")
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = -2},
}
self:SetBackdropColor(0,0,0,1)


-- TARGET DEBUFF
			
self.Buffs = CreateFrame("Frame", nil, self)
self.Buffs.size = 25
self.Buffs.gap = false
self.Buffs:SetHeight(self.Buffs.size)
self.Buffs:SetWidth(self.Buffs.size * 8)
self.Buffs:SetPoint("BOTTOMLEFT", self, "TOPRiGHT", 2, -23)
self.Buffs.initialAnchor = "TOPLEFT"
self.Buffs["growth-y"] = "DOWN"
self.Buffs["growth-x"] = "RIGHT"
self.Buffs.numBuffs = 5
self.Buffs.spacing = 3

self.Debuffs = CreateFrame("Frame", nil, self)
self.Debuffs.size = 25
self.Debuffs.gap = false
self.Debuffs:SetHeight(self.Debuffs.size)
self.Debuffs:SetWidth(self.Debuffs.size * 8)
self.Debuffs:SetPoint("BOTTOMLEFT", self, "TOPLEFT", -2, -42)
self.Debuffs.initialAnchor = "TOPLEFT"
self.Debuffs["growth-y"] = "DOWN"
self.Debuffs["growth-x"] = "RIGHT"
self.Debuffs.numDebuffs = 5
self.Debuffs.spacing = 3



-- COMBO POINTS

self.CPoints = self:CreateFontString(nil, "OVERLAY")
self.CPoints:SetPoint("RIGHT", self, "RIGHT", 18, 0)
self.CPoints:SetFont(font, 18, "OUTLINE")
self.CPoints:SetTextColor(1,0.9,0.4)
self.CPoints:SetJustifyH"RIGHT"
			
-- TARGET RAID ICONS
		
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(25)
self.RaidIcon:SetWidth(25)
self.RaidIcon:SetPoint("RIGHT", self, "RIGHT", 30, 0)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
end

-- TOT 


if unit=="targetoftarget" then
self:SetWidth(120)
self:SetHeight(15)
self.Power.value:Hide()
self.Power:SetHeight(1.5)
self.Health.value:SetPoint("TOPRIGHT", self.Health, -3, 12)
self.Name:SetPoint("TOPLEFT", self.Health,  2,11)
self.Name:SetWidth(70)
self.Name:Hide()		
self.Health.value:SetHeight(fontsize)
self.Health.value:Hide()
self.Health:SetHeight(12)
self.Level:Hide()
self.Name:SetFont(font, 14, "OUTLINE")
self.Health.value:SetFont(font, 1, "OUTLINE")
self.Name:SetHeight(fontsize)
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = 0},
}
self:SetBackdropColor(0,0,0,1)


-- TOT RAID ICONS

self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(14)
self.RaidIcon:SetWidth(14)
self.RaidIcon:SetPoint("CENTER", self, 0, 19)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
end

-- FOCUS

if unit=="focus" then
self:SetWidth(120)
self:SetHeight(15)
self.Power.value:Hide()
self.Health.value:SetPoint("TOPRIGHT", self.Health, -3, 12)
self.Name:SetPoint("TOPLEFT", self.Health,  2,11)
self.Name:Hide()
self.Name:SetWidth(70)		
self.Health.value:SetHeight(fontsize)
self.Health.value:Hide()
self.Health:SetHeight(12)
self.Level:Hide()
self.Name:SetFont(font, 14, "OUTLINE")
self.Health.value:SetFont(font, 1, "OUTLINE")
self.Name:SetHeight(fontsize)
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
self:SetBackdropColor(0,0,0,1)

-- FOCUS BUFF's
		 	
self.debuffs = CreateFrame("Frame", nil, self)
self.debuffs.size = 0
self.debuffs.gap = false
self.debuffs:SetHeight(self.debuffs.size)
self.debuffs:SetWidth(self.debuffs.size * 7)
self.debuffs:SetPoint("RIGHT", self, "RIGHT", 38, -9.5)
self.debuffs.initialAnchor = "TOPRIGHT"
self.debuffs["growth-y"] = "DOWN"
self.debuffs["growth-x"] = "left"
self.debuffs.numDebuffs = 0
self.debuffs.spacing = 3
			
-- FOCUS RAID ICONS
		
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(20)
self.RaidIcon:SetWidth(20)
self.RaidIcon:SetPoint("CENTER", self, "CENTER", 0, 25)
self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
end

--CASTBAR's SHIZZLE
  
if(unit == 'player' or unit == 'target') then	
self.Castbar = CreateFrame('StatusBar', nil, self)
self.Castbar:SetStatusBarTexture(bartex)

self.Castbar:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
self.Castbar:SetBackdropColor(0,0,0,1)

self.Castbar.bg = self.Castbar:CreateTexture(nil, "BORDER")
self.Castbar.bg:SetAllPoints(self.Castbar)
self.Castbar.bg:SetTexture(bartex)
self.Castbar.bg:SetAlpha(1)
self.Castbar.bg:SetVertexColor(0,0,0)

if(unit == "player") then

local _, class = UnitClass(unit) 
color = self.colors.class[class] 
self.Castbar:SetBackdropColor(0,0,0)
self.Castbar:SetStatusBarColor(statusbarcolor[1],statusbarcolor[2],statusbarcolo
r[3])
self.Castbar.bg:SetVertexColor(color[1],color[2],color[3])
self.Castbar:SetHeight(18)
self.Castbar:SetWidth(200)
self.Castbar:SetPoint('CENTER', UIParent, 'CENTER', playerCastBar_x, playerCastBar_y)


  
else

self.Castbar:SetBackdropColor(0, 0, 0)
self.Castbar:SetStatusBarColor(statusbarcolor[1],statusbarcolor[2],statusbarcolo
r[3])
self.Castbar.bg:SetVertexColor(0.80, 0.01, 0)
self.Castbar:SetHeight(18)
self.Castbar:SetWidth(200)
self.Castbar:SetPoint('CENTER', oUF_Target, 'CENTER', targetCastBar_x, targetCastBar_y)

end

self.Castbar.Text = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Text:SetPoint('TOPLEFT', self.Castbar, 2, -1)
self.Castbar.Text:SetFont(font, 14)
self.Castbar.Text:SetTextColor(1, 1, 1)
self.Castbar.Text:SetJustifyH('LEFT')

self.Castbar.Time = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Time:SetPoint('TOPRIGHT', self.Castbar, 0, -1)
self.Castbar.Time:SetFont(font, 14)
self.Castbar.Time:SetTextColor(1, 1, 1)
self.Castbar.Time:SetJustifyH('RIGHT')
end
		


	

	

-- AURA TEXTURE

self.PostCreateAuraIcon = auraIcon
self.SetAuraPosition = auraOffset

return self   
end
		   
--FRAMES.. iv'e been lazy. i use the move function to place my frames. works for me. :)

oUF:RegisterStyle("Mojo", func)
oUF:SetActiveStyle("Mojo")

local player = oUF:Spawn("player", "oUF_Player")
player:SetPoint("CENTER", -0, -405)

local target = oUF:Spawn("target", "oUF_Target")
target:SetPoint("CENTER", -0, -200) 

local pet = oUF:Spawn("pet", "oUF_Pet")
pet:SetPoint("BOTTOMLEFT", player, 0, -24)

local tot = oUF:Spawn("targetoftarget", "oUF_TargetofTarget")
tot:SetPoint("Topleft", target, 130, 24)

local focus	= oUF:Spawn("focus", "oUF_Focus")
focus:SetPoint("BOTTOMLEFT", player, 130, -24)
 
Zuletzt bearbeitet von einem Moderator:
Und bei sTooltip wird mir der Blizz Border noch angezeigt

Code:
--[[
	
	sTooltip
	Copyright (c) 2008, Shantalya
	All rights reserved.
	
]]

--[[ KONFIGURATION - START ]]--

local barHeight = 7; -- Die Höhe der Lebensleiste
local barHealthText = false; -- Lebensanzeige auf der Lebensleiste || true = Ja, false = Nein

local textSize = 10; -- Schriftgröße der Lebensleiste
local textFont = "Fonts\\FRIZQT__.ttf"; -- Schriftart der Lebensleiste

local statusBarTexture = "Interface\\TargetingFrame\\UI-StatusBar"; -- Textur der Lebensleiste

--[[ KONFIGURATION - ENDE ]]--


old_HealthBar_OnValueChanged = HealthBar_OnValueChanged;
function HealthBar_OnValueChanged(self, value, smooth)
	if ( not value ) then
		return;
	end
	if ( GameTooltipStatusBar and barHealthText ) then
		if ( not GameTooltipStatusBar.HealthText ) then
			GameTooltipStatusBar.HealthText = GameTooltipStatusBar:CreateFontString("GameTooltipStatusBarHealthText", "ARTWORK");
			GameTooltipStatusBar.HealthText:SetFont(textFont, textSize);
			GameTooltipStatusBar.HealthText:SetShadowOffset( 1, -1);
			GameTooltipStatusBar.HealthText:SetPoint("CENTER", GameTooltipStatusBar, "CENTER", 0, 1);
		end
		GameTooltipStatusBar.HealthText:SetText("");
		local unit = select(2, GameTooltip:GetUnit());	
		if ( unit and UnitName(unit) ~= UNKNOWN ) then
			if ( UnitHealth(unit) > 0 ) then
				GameTooltipStatusBar.HealthText:SetText(UnitHealth(unit));
			else
				GameTooltipStatusBar.HealthText:SetText(DEAD);
			end
		end
	end
end

function GameTooltip:GetReputation(fraction)
	if ( fraction >= -42000 and fraction < -6000) then
		return (fraction+42000).. "/36000";
	elseif ( fraction >= -6000 and fraction < -3000) then
		return (fraction+6000).. "/3000";
	elseif ( fraction >= -3000 and fraction < 0) then
		return (fraction+3000).. "/3000";
	elseif ( fraction >= 0 and fraction < 3000) then
		return fraction .. "/3000";
	elseif ( fraction >= 3000 and fraction < 9000 ) then
		return (fraction-3000) .. "/6000";
	elseif(  fraction >= 9000 and fraction < 21000 ) then
		return (fraction-9000) .. "/12000";
	elseif ( fraction >= 21000 and fraction < 42000 ) then
		return (fraction-21000) .. "/21000";
	elseif ( fraction >= 42000 ) then
		return (fraction-42000) .. "/1000";
	else
		return "Unbekannter Ruf";
	end
end

GameTooltip:HookScript("OnTooltipSetUnit", function(self)
	local unit = select(2, self:GetUnit());	
	
	if ( unit and UnitName(unit) ~= UNKNOWN ) then
		local unitIsPlayer = UnitIsPlayer(unit);
		local unitClassColor = RAID_CLASS_COLORS[select(2,UnitClass(unit))] or { r = 1, g = 0, b = 1 };
		local unitLevel = UnitLevel(unit);
		local unitClassification = UnitClassification(unit);
		local unitName = UnitName(unit);
		local unitReactionColor = { r = select(1, UnitSelectionColor(unit)), g = select(2, UnitSelectionColor(unit)), b = select(3, UnitSelectionColor(unit)) };
		local isInInstance = select(2, IsInInstance());
		local difficultyColor = GetQuestDifficultyColor(unitLevel);
		local unitTargetName = UnitName(unit .. "target");
		local unitTargetClassColor = RAID_CLASS_COLORS[select(2,UnitClass(unit .. "target"))] or { r = 1, g = 0, b = 1 };
		local unitTargetReactionColor = { r = select(1, UnitSelectionColor(unit .. "target")), g = select(2, UnitSelectionColor(unit .. "target")), b = select(3, UnitSelectionColor(unit .. "target")) };
		
		if ( UnitLevel(unit) == -1 ) then
			unitLevel = "|cffff0000??|r";
		end
		
		if ( unitIsPlayer ) then
			if ( IsInGuild() and GameTooltipTextLeft2:GetText():find("^" .. GetGuildInfo("player")) ) then
				GameTooltipTextLeft2:SetTextColor(1, 0, 1);
			end
			
			for i=2, GameTooltip:NumLines(), 1 do
				if ( getglobal("GameTooltipTextLeft" .. i):GetText():find("^" .. LEVEL) ) then
					getglobal("GameTooltipTextLeft" .. i):SetText(format("|cff%02x%02x%02x%s|r", difficultyColor.r*255, difficultyColor.g*255, difficultyColor.b*255, unitLevel) .. " " .. UnitRace(unit) .. ", " .. format("|cff%02x%02x%02x%s|r", unitClassColor.r*255, unitClassColor.g*255, unitClassColor.b*255, UnitClass(unit)));
					break;
				end
			end
			
			--self:SetBackdropBorderColor(unitClassColor.r, unitClassColor.g, unitClassColor.b);
			GameTooltipStatusBar:SetStatusBarColor(unitClassColor.r, unitClassColor.g, unitClassColor.b);
			GameTooltipTextLeft1:SetTextColor(unitClassColor.r, unitClassColor.g, unitClassColor.b);
		else
			if ( unitClassification == "worldboss" ) then
				unitClassification = " (" .. BOSS .. ") ";
			elseif ( unitClassification == "rareelite" ) then
				unitClassification = " (Rare Elite) ";
			elseif ( unitClassification == "elite" ) then
				unitClassification = " (" .. ELITE .. ") ";
			elseif ( unitClassification == "rare" ) then
				unitClassification = " (Rare) ";
			else
				unitClassification = " ";
			end
			
			for i=2, GameTooltip:NumLines(), 1 do
				if ( getglobal("GameTooltipTextLeft" .. i):GetText():find("^" .. LEVEL) ) then
					getglobal("GameTooltipTextLeft" .. i):SetText(format("|cff%02x%02x%02x%s|r", difficultyColor.r*255, difficultyColor.g*255, difficultyColor.b*255, unitLevel) .. unitClassification .. UnitCreatureType(unit));
					break;
				end
			end
			
			for i=3, GameTooltip:NumLines(), 1 do
				for factionIndex=1, GetNumFactions(), 1 do
					name, _, _, _, _, earnedValue, _, _, isHeader = GetFactionInfo(factionIndex);
					if ( not isHeader and getglobal("GameTooltipTextLeft" .. i):GetText():find("^" .. name) ) then
						getglobal("GameTooltipTextLeft" .. i):SetText(getglobal("GameTooltipTextLeft" .. i):GetText() .. " (" .. self:GetReputation(earnedValue) .. ")");
						break;
					end
				end
			end
			
			if ( UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) ) then
				self:SetBackdropBorderColor(0.5, 0.5, 0.5);
				GameTooltipStatusBar:SetStatusBarColor(0.5, 0.5, 0.5);
				GameTooltipTextLeft1:SetTextColor(0.5, 0.5, 0.5);
			else
				self:SetBackdropBorderColor(unitReactionColor.r, unitReactionColor.g, unitReactionColor.b);
				GameTooltipStatusBar:SetStatusBarColor(unitReactionColor.r, unitReactionColor.g, unitReactionColor.b);
				GameTooltipTextLeft1:SetTextColor(unitReactionColor.r, unitReactionColor.g, unitReactionColor.b);
			end
		end		
		
		if ( UnitExists(unit .. "target") ) then
			if ( UnitName("player") == unitTargetName ) then
				self:AddLine(TARGET .. ": |cffff00ff" .. string.upper(YOU) .. "|r", 1, 1, 1)
			else
				if UnitIsPlayer(unit .. "target") then
					self:AddLine(TARGET .. ": " .. format("|cff%02x%02x%02x%s|r", unitTargetClassColor.r*255, unitTargetClassColor.g*255, unitTargetClassColor.b*255, unitTargetName), 1, 1, 1)
				else
					self:AddLine(TARGET .. ": " .. format("|cff%02x%02x%02x%s|r", unitTargetReactionColor.r*255, unitTargetReactionColor.g*255, unitTargetReactionColor.b*255, unitTargetName), 1, 1, 1)
				end
			end
		end
		if ( UnitIsPVP(unit) and isInInstance ~= "pvp" and isInInstance ~= "arena" and GetZonePVPInfo() ~= "combat" ) then
			GameTooltipTextLeft1:SetText("|cffFF8800#|r " .. GameTooltipTextLeft1:GetText());
		end
		for i=2, GameTooltip:NumLines(), 1 do
			if ( getglobal("GameTooltipTextLeft" .. i):GetText():find(PVP_ENABLED) ) then
				getglobal("GameTooltipTextLeft" .. i):SetText(nil);
				break
			end
		end
	
		self:AddLine(" ")
		GameTooltipStatusBar:ClearAllPoints();
		GameTooltipStatusBar:SetPoint("BOTTOMLEFT", 7, 8);
		GameTooltipStatusBar:SetPoint("BOTTOMRIGHT", -7, 8);
		GameTooltipStatusBar:SetHeight(barHeight);
		GameTooltipStatusBar:SetStatusBarTexture(statusBarTexture)
	end
end);

GameTooltipStatusBar.background = GameTooltipStatusBar:CreateTexture("GameTooltipStatusBarBackground", "BACKGROUND");
GameTooltipStatusBar.background:SetPoint("TOPLEFT");
GameTooltipStatusBar.background:SetPoint("BOTTOMRIGHT");
GameTooltipStatusBar.background:SetTexture(statusBarTexture);
GameTooltipStatusBar.background:SetVertexColor(1, 1, 1, 0.6);

GameTooltip:SetBackdrop({ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = true, tileSize = 8, edgeSize = 16, insets = { left = -2, right = -2, top = -2, bottom = -2 } });
GameTooltip:SetScript("OnShow", function(self) self:SetBackdropColor(0, 0, 0, 0.8); end);

ItemRefTooltip:SetBackdrop({ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = true, tileSize = 8, edgeSize = 16, insets = { left = 4, right = 4, top = 4, bottom = 4 } });
ItemRefTooltip:SetScript("OnShow", function(self) self:SetBackdropColor(0, 0, 0, 0.6); end);

ShoppingTooltip1:SetBackdrop({ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = true, tileSize = 8, edgeSize = 16, insets = { left = 4, right = 4, top = 4, bottom = 4 } });
ShoppingTooltip1:SetScript("OnShow", function(self) self:SetBackdropColor(0, 0, 0, 0.6); end);

ShoppingTooltip2:SetBackdrop({ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = true, tileSize = 8, edgeSize = 16, insets = { left = 4, right = 4, top = 4, bottom = 4 } });
ShoppingTooltip2:SetScript("OnShow", function(self) self:SetBackdropColor(0, 0, 0, 0.6); end);

ShoppingTooltip3:SetBackdrop({ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = true, tileSize = 8, edgeSize = 16, insets = { left = 4, right = 4, top = 4, bottom = 4 } });
ShoppingTooltip3:SetScript("OnShow", function(self) self:SetBackdropColor(0, 0, 0, 0.6); end);

DropDownList1MenuBackdrop:SetBackdrop({ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = true, tileSize = 8, edgeSize = 16, insets = { left = 4, right = 4, top = 4, bottom = 4 } });
DropDownList1MenuBackdrop:SetScript("OnShow", function(self) self:SetBackdropColor(0, 0, 0, 0.6); end);

DropDownList2MenuBackdrop:SetBackdrop({ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = true, tileSize = 8, edgeSize = 16, insets = { left = 4, right = 4, top = 4, bottom = 4 } });
DropDownList2MenuBackdrop:SetScript("OnShow", function(self) self:SetBackdropColor(0, 0, 0, 0.6); end);


local frame = CreateFrame("Frame", "ItemRefTooltipIconFrame", ItemRefTooltip);
frame:SetWidth(37);
frame:SetHeight(37);
frame:SetBackdrop({ edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = true, tileSize = 16, edgeSize = 16, insets = { left = 4, right = 4, top = 4, bottom = 4 }});
frame:SetPoint("TOPRIGHT", ItemRefTooltip, "TOPLEFT", 2, 0);
frame.icon = frame:CreateTexture(frame:GetName() .. "IconTexture", "BACKGROUND");
frame.icon:SetWidth(33);
frame.icon:SetHeight(33);
frame.icon:SetPoint("CENTER", frame, "CENTER", 0, 0);
--frame.icon:SetTexCoord(0.07, 0.93, 0.07, 0.93); 
frame.count = frame:CreateFontString(frame:GetName() .. "Count", "ARTWORK", "NumberFontNormal");
frame.count:SetJustifyH("RIGHT");
frame.count:SetPoint("BOTTOMRIGHT", frame.icon, -2, 2);

hooksecurefunc("SetItemRef", function(link, text, button)
	if ( ItemRefTooltipIconFrame:IsShown() ) then
		SetItemButtonCount(ItemRefTooltipIconFrame, 0);
		ItemRefTooltipIconFrame:Hide();
	end
	if ( strsub(link, 1, 4) == "item" ) then
		local itemStackCount, _, itemTexture = select(8, GetItemInfo(strmatch(link, "item:(%d+)")));
		itemStackCount = itemStackCount or 0;
		SetItemButtonTexture(ItemRefTooltipIconFrame, itemTexture);
		SetItemButtonCount(ItemRefTooltipIconFrame, itemStackCount);
		ItemRefTooltipIconFrame:Show();
	elseif ( strsub(link, 1, 5) == "spell" ) then
		SetItemButtonTexture(ItemRefTooltipIconFrame, select(3, GetSpellInfo(strmatch(link, "spell:(%d+)"))));
		ItemRefTooltipIconFrame:Show();
	elseif ( strsub(link, 1, 11) == "achievement") then
		SetItemButtonTexture(ItemRefTooltipIconFrame, select(10, GetAchievementInfo(strmatch(link, "achievement:(%d+)"))));
		ItemRefTooltipIconFrame:Show();
	end
end);

--[[
GameTooltipStatusBar:ClearAllPoints()
GameTooltipStatusBar:SetPoint("BOTTOMLEFT", 8, 9)
GameTooltipStatusBar:SetPoint("BOTTOMRIGHT", -8, 9)
GameTooltipStatusBar:SetHeight(10)
]]

GameTooltipStatusBar:ClearAllPoints()
GameTooltipStatusBar:SetPoint("BOTTOMLEFT", 8, 9)
GameTooltipStatusBar:SetPoint("BOTTOMRIGHT", -8, 9)


local frameborder = "Interface\\AddOns\\sTooltip\\frameborder"
local color_rb = 0.3
local color_gb = 0.3
local color_bb = 0.3

	--Tooltip Border
	local TopLeft = GameTooltip:CreateTexture(nil, "OVERLAY")
	TopLeft:SetTexture(frameborder)
	TopLeft:SetTexCoord(0, 1/3, 0, 1/3)
	TopLeft:SetPoint("TOPLEFT", GameTooltip, -3, 3)
	TopLeft:SetWidth(16) TopLeft:SetHeight(16)
	TopLeft:SetVertexColor(color_rb,color_gb,color_bb)
	TopLeft:SetDrawLayer("BORDER")

	local TopRight = GameTooltip:CreateTexture(nil, "OVERLAY")
	TopRight:SetTexture(frameborder)
	TopRight:SetTexCoord(2/3, 1, 0, 1/3)
	TopRight:SetPoint("TOPRIGHT", GameTooltip, 3, 3)
	TopRight:SetWidth(16) TopRight:SetHeight(16)
	TopRight:SetVertexColor(color_rb,color_gb,color_bb)
	TopRight:SetDrawLayer("BORDER")
	
	local BottomLeft = GameTooltip:CreateTexture(nil, "OVERLAY")
	BottomLeft:SetTexture(frameborder)
	BottomLeft:SetTexCoord(0, 1/3, 2/3, 1)
	BottomLeft:SetPoint("BOTTOMLEFT", GameTooltip, -3, -3)
	BottomLeft:SetWidth(16) BottomLeft:SetHeight(16)
	BottomLeft:SetVertexColor(color_rb,color_gb,color_bb)
	BottomLeft:SetDrawLayer("BORDER")
	
	local BottomRight = GameTooltip:CreateTexture(nil, "OVERLAY")
	BottomRight:SetTexture(frameborder)
	BottomRight:SetTexCoord(2/3, 1, 2/3, 1)
	BottomRight:SetPoint("BOTTOMRIGHT", GameTooltip, 3, -3)
	BottomRight:SetWidth(16) BottomRight:SetHeight(16)
	BottomRight:SetVertexColor(color_rb,color_gb,color_bb)
	BottomRight:SetDrawLayer("BORDER")
	
	local TopEdge = GameTooltip:CreateTexture(nil, "OVERLAY")
	TopEdge:SetTexture(frameborder)
	TopEdge:SetTexCoord(1/3, 2/3, 0, 1/3)
	TopEdge:SetPoint("TOPLEFT", TopLeft, "TOPRIGHT")
	TopEdge:SetPoint("TOPRIGHT", TopRight, "TOPLEFT")
	TopEdge:SetHeight(16)
	TopEdge:SetVertexColor(color_rb,color_gb,color_bb)
	TopEdge:SetDrawLayer("BORDER")

	local BottomEdge = GameTooltip:CreateTexture(nil, "OVERLAY")
	BottomEdge:SetTexture(frameborder)
	BottomEdge:SetTexCoord(1/3, 2/3, 2/3, 1)
	BottomEdge:SetPoint("BOTTOMLEFT", BottomLeft, "BOTTOMRIGHT")
	BottomEdge:SetPoint("BOTTOMRIGHT", BottomRight, "BOTTOMLEFT")
	BottomEdge:SetHeight(16)
	BottomEdge:SetVertexColor(color_rb,color_gb,color_bb)
	BottomEdge:SetDrawLayer("BORDER")
	
	local LeftEdge = GameTooltip:CreateTexture(nil, "OVERLAY")
	LeftEdge:SetTexture(frameborder)
	LeftEdge:SetTexCoord(0, 1/3, 1/3, 2/3)
	LeftEdge:SetPoint("TOPLEFT", TopLeft, "BOTTOMLEFT")
	LeftEdge:SetPoint("BOTTOMLEFT", BottomLeft, "TOPLEFT")
	LeftEdge:SetWidth(16)
	LeftEdge:SetVertexColor(color_rb,color_gb,color_bb)
	LeftEdge:SetDrawLayer("BORDER")
	
	local RightEdge = GameTooltip:CreateTexture(nil, "OVERLAY")
	RightEdge:SetTexture(frameborder)
	RightEdge:SetTexCoord(2/3, 1, 1/3, 2/3)
	RightEdge:SetPoint("TOPRIGHT", TopRight, "BOTTOMRIGHT")
	RightEdge:SetPoint("BOTTOMRIGHT", BottomRight, "TOPRIGHT")
	RightEdge:SetWidth(16)
	RightEdge:SetVertexColor(color_rb,color_gb,color_bb)
	RightEdge:SetDrawLayer("BORDER")



ich bedanke mich schonmal
 
das mit dem tot hab ich auch das prob wie wohl jeder der es nutzt^^

desweiteren wird aber auch mein begeleiter nicht mehr angezeigt

und das potrait fehlt is bei mir jetzt so hell dadurch sieht man leider den lebensabzug nicht mehr so gut
 
Zuletzt bearbeitet von einem Moderator:
Schade das du nichtmehr spielst, wow wird dich vermissen.
Bei mir kam am patchday eine fehlermeldung, jedoch musste ich nur targettarget zu targetoftarget machen, sonst hatte ich kein focus?! aber hatte am patchday auch kein tot leider
 
Zurück