Thread Tools Display Modes
10-14-10, 03:47 PM   #1
Karudon
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 15
oUF 1.5.2 issue

Ive got a problem with my layou, Raid works perfectly but player target etc... ;(


Code:
local font = [=[Interface\Addons\Itrulia\media\fonts\arial.ttf]=]
local fontsize = 12
local tags = nil
local normtex = "Interface\\AddOns\\Itrulia\\media\\Textures\\normTex.tga"

local function menu(self)
	ToggleDropDownMenu(1, nil, _G[string.gsub(self.unit, '^.', string.upper)..'FrameDropDown'], 'cursor')
end


oUF_colors = setmetatable({
	tapped = {0.55, 0.57, 0.61},
	disconnected = {0.84, 0.75, 0.65},
	power = setmetatable({
		["MANA"] = {0.31, 0.45, 0.63},
		["RAGE"] = {0.69, 0.31, 0.31},
		["FOCUS"] = {0.71, 0.43, 0.27},
		["ENERGY"] = {0.65, 0.63, 0.35},
		["RUNES"] = {0.55, 0.57, 0.61},
		["RUNIC_POWER"] = {0, 0.82, 1},
		["AMMOSLOT"] = {0.8, 0.6, 0},
		["FUEL"] = {0, 0.55, 0.5},
		["POWER_TYPE_STEAM"] = {0.55, 0.57, 0.61},
		["POWER_TYPE_PYRITE"] = {0.60, 0.09, 0.17},
	}, {__index = oUF.colors.power}),
	happiness = setmetatable({
		[1] = {.69,.31,.31},
		[2] = {.65,.63,.35},
		[3] = {.33,.59,.33},
	}, {__index = oUF.colors.happiness}),
	runes = setmetatable({
			[1] = {.69,.31,.31},
			[2] = {.33,.59,.33},
			[3] = {.31,.45,.63},
			[4] = {.84,.75,.65},
	}, {__index = oUF.colors.runes}),
	reaction = setmetatable({
		[1] = { 222/255, 95/255,  95/255 }, -- Hated
		[2] = { 222/255, 95/255,  95/255 }, -- Hostile
		[3] = { 222/255, 95/255,  95/255 }, -- Unfriendly
		[4] = { 218/255, 197/255, 92/255 }, -- Neutral
		[5] = { 75/255,  175/255, 76/255 }, -- Friendly
		[6] = { 75/255,  175/255, 76/255 }, -- Honored
		[7] = { 75/255,  175/255, 76/255 }, -- Revered
		[8] = { 75/255,  175/255, 76/255 }, -- Exalted	
	}, {__index = oUF.colors.reaction}),
	class = setmetatable({
		["DEATHKNIGHT"] = { 196/255,  30/255,  60/255 },
		["DRUID"]       = { 255/255, 125/255,  10/255 },
		["HUNTER"]      = { 171/255, 214/255, 116/255 },
		["MAGE"]        = { 104/255, 205/255, 255/255 },
		["PALADIN"]     = { 245/255, 140/255, 186/255 },
		["PRIEST"]      = { 212/255, 212/255, 212/255 },
		["ROGUE"]       = { 255/255, 243/255,  82/255 },
		["SHAMAN"]      = {  41/255,  79/255, 155/255 },
		["WARLOCK"]     = { 148/255, 130/255, 201/255 },
		["WARRIOR"]     = { 199/255, 156/255, 110/255 },
	}, {__index = oUF.colors.class}),
}, {__index = oUF.colors})

local function Shared(self, unit)

	self:RegisterForClicks("LeftButtonDown", "RightButtonDown")
	self:SetScript('OnEnter', UnitFrame_OnEnter)
	self:SetScript('OnLeave', UnitFrame_OnLeave)
	self.menu = menu
	self:SetAttribute('type2', 'menu')
    
    self.colors = oUF_colors

    ------------------------------------------------------------------------
	--	Player and Target units layout (mostly mirror'd)
	------------------------------------------------------------------------
	
	if (unit == "player" or unit == "target" or unit == "focus") then
    
		local panel = CreateFrame("Frame",self:GetName().."_Panel", self)
		panel:SetAllPoints(self)
		panel:SetFrameLevel(10)
		panel:SetFrameStrata("MEDIUM")
		self.panel = panel
	
		-- health bar
		local health = CreateFrame('StatusBar', self:GetName().."_Health", self)
		health:SetHeight(Scale(20))
		health:SetPoint("TOPLEFT")
		health:SetPoint("TOPRIGHT")
		health:SetStatusBarTexture(normtex)
		health:SetFrameLevel(5)
		
		local healthBorder = CreateFrame("frame", self:GetName().."_HealthBorder", health)
		healthBorder:SetBackdrop(backdrop)
		healthBorder:SetBackdropColor(0, 0, 0)
		healthBorder:SetAllPoints(health)
		healthBorder:SetFrameLevel(4)
        
        local healthborder2 = CreateFrame("frame","healthborder2",healthBorder)
        CreatePanel(healthborder2,1,1,"CENTER")
        healthborder2:SetPoint("TOPLEFT",-2,2)
        healthborder2:SetPoint("BOTTOMRIGHT",2,-2)
        healthborder2:SetBackdropColor(0,0,0,1)
        healthborder2:SetFrameStrata(health:GetFrameStrata())
        healthborder2:SetFrameLevel(health:GetFrameLevel())		

        
        -- portraits
			local portrait = CreateFrame("PlayerModel", nil, self)
			portrait:SetFrameLevel(8)
            
            if unit == "player" or unit == "target" then
            portrait:SetPoint("TOPLEFT",health)
            portrait:SetPoint("BOTTOMRIGHT",health)
            end
            portrait.PostUpdate = function(self) self:SetAlpha(0) self:SetAlpha(0.1); end;
			table.insert(self.__elements, HidePortrait)
            
			self.Portrait = portrait
        
		-- health bar background
		local healthBG = health:CreateTexture(nil, 'BORDER')
		healthBG:SetAllPoints()
		healthBG:SetTexture(.4, .4, .4,1)
	
		health.value = SetFontString(panel, font, fontsize, tags)
		health.value:SetPoint("RIGHT", panel, "RIGHT", Scale(-4), Scale(1))
		health.PostUpdate = PostUpdateHealth
				
		self.Health = health
		self.Health.bg = healthBG
		health.frequentUpdates = true
        health.Smooth = true
		
        health.colorTapping = false
        health.colorDisconnected = false
        health.colorClass = false
        health:SetStatusBarColor(.1,.1,.1,1)
        healthBG:SetVertexColor(.4, .4, .4,1)		


		-- power
		local power = CreateFrame('StatusBar', nil, self)
		power:SetHeight(Scale(20))
		power:SetWidth(Scale(205))
        
		if unit == "player" then
			power:SetPoint("BOTTOMLEFT", health, "BOTTOMLEFT", -4, -4)
		else
			power:SetPoint("BOTTOMRIGHT", health, "BOTTOMRIGHT", 4, -4)
		end
        
		power:SetStatusBarTexture(normtex)
		power:SetFrameLevel(2)
		
		local powerBG = power:CreateTexture(nil, 'BORDER')
		powerBG:SetAllPoints(power)
		powerBG:SetTexture(normtex)
		powerBG.multiplier = .5
		
		local powerBorder = CreateFrame("frame", self:GetName().."_PowerBorder", power)
		powerBorder:SetBackdrop(backdrop)
		powerBorder:SetBackdropColor(0, 0, 0)
		powerBorder:SetAllPoints(power)
		powerBorder:SetFrameLevel(1)
		
		power.value = SetFontString(panel, font, fontsize, tags)
		power.value:SetPoint("LEFT", panel, "LEFT", Scale(4), Scale(1))
		power.PreUpdate = PreUpdatePower
		power.PostUpdate = PostUpdatePower
        
        local powerborder2 = CreateFrame("frame","powerborder2",powerBorder)
        CreatePanel(powerborder2,1,1,"CENTER")
        powerborder2:SetPoint("TOPLEFT",-2,2)
        powerborder2:SetPoint("BOTTOMRIGHT",2,-2)
        powerborder2:SetBackdropColor(0,0,0,1)
        
		self.Power = power
		self.Power.bg = powerBG
		power.frequentUpdates = .1
		power.colorDisconnected = true
        power.Smooth = true
        power.colorPower = true

		if (unit == "player") then

        -- leader icon
        local Leader = health:CreateTexture(nil, "OVERLAY")
        Leader:SetHeight(Scale(14))
        Leader:SetWidth(Scale(14))
        Leader:SetPoint("TOPLEFT", Scale(2), Scale(8))
        self.Leader = Leader
			
        -- master looter
        local MasterLooter = health:CreateTexture(nil, "OVERLAY")
        MasterLooter:SetHeight(Scale(14))
        MasterLooter:SetWidth(Scale(14))
        MasterLooter:SetPoint("TOP",self,0,5)
        self.MasterLooter = MasterLooter
			

        if (myclass == "WARLOCK" or myclass == "PALADIN") and unit == "player" then
	
            local bars = CreateFrame("Frame", nil, self)
            bars:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, Scale(5))
            bars:SetWidth(Scale(205))
            bars:SetHeight(Scale(8))
            
            for i = 1, 3 do					
                bars[i] = CreateFrame("StatusBar", self:GetName().."_Shard"..i, self)
                bars[i]:SetHeight(Scale(5))					
                bars[i]:SetStatusBarTexture(normtex)
                bars[i]:GetStatusBarTexture():SetHorizTile(false)
                
                l = CreateFrame("frame",nil,bars[i])
                CreatePanel(l,1,1,"CENTER")
                l:SetPoint("TOPLEFT",-2,2)
                l:SetPoint("BOTTOMRIGHT",2,-2)
                l:SetBackdropColor(0,0,0)
                
                if myclass == "WARLOCK" then
                    bars[i]:SetStatusBarColor(255/255,101/255,101/255)
                elseif myclass == "PALADIN" then
                    bars[i]:SetStatusBarColor(228/255,225/255,16/255)
                end
                
                if i == 1 then
                    bars[i]:SetPoint("LEFT", bars)
                    bars[i]:SetWidth(Scale(205/3 - 4.8)) 
                else
                    bars[i]:SetPoint("LEFT", bars[i-1], "RIGHT", Scale(7), 0)
                    bars[i]:SetWidth(Scale(205/3 - 4.8)) 
                end
                
            end
            
            if myclass == "WARLOCK" then
                bars.Override = UpdateShards				
                self.SoulShards = bars
            elseif myclass == "PALADIN" then
                bars.Override = UpdateHoly
                self.HolyPower = bars
            end
        end	

        -- deathknight runes
        if myclass == "DEATHKNIGHT" and db.runebar == true then
            local rWidth, rHeight = 3, db.ptHeight-8
			
            local Runes = CreateFrame("Frame", nil, self)
            Runes:SetPoint("CENTER", self, "CENTER", 0, 0)
            Runes:SetHeight(Scale(rHeight))
            Runes:SetWidth(Scale(rWidth*6)+5*3)

            for i = 1, 6 do
                Runes[i] = CreateFrame("StatusBar", self:GetName().."_Runes"..i, self)
                Runes[i]:SetHeight(Scale(rHeight))
                Runes[i]:SetWidth(Scale(rWidth))
                if (i == 1) then
                    Runes[i]:SetPoint("LEFT", Runes, "LEFT", 0, 0)
                else
                    Runes[i]:SetPoint("LEFT", Runes[i-1], "RIGHT", Scale(3), 0)
                end
                Runes[i]:SetStatusBarTexture(normtex)
                Runes[i]:GetStatusBarTexture():SetHorizTile(false)
                Runes[i]:SetOrientation('VERTICAL')
                Runes[i]:SetBackdrop(backdrop)
                Runes[i]:SetBackdropColor(0,0,0)
                Runes[i]:SetFrameLevel(20)
                
                Runes[i].bg = Runes[i]:CreateTexture(nil, "BORDER")
                Runes[i].bg:SetAllPoints(Runes[i])
                Runes[i].bg:SetTexture(normtex)
                Runes[i].bg.multiplier = 0.3
            end

				self.Runes = Runes
			end
			
			-- shaman totem bar
			if myclass == "SHAMAN" then
				local tWidth, tHeight = 3, db.ptHeight-8
				
				TotemAnchor = CreateFrame("frame", "TotemContainer", self)
				TotemAnchor:SetWidth(tWidth*5+4)
				TotemAnchor:SetHeight(tHeight)
				TotemAnchor:SetPoint("CENTER", panel, "CENTER", 0, 0)
				
				local TotemBar = {}
				TotemBar.Destroy = true
				for i = 1, 4 do
					TotemBar[i] = CreateFrame("StatusBar", self:GetName().."_TotemBar"..i, self)
					if (i == 1) then
					   TotemBar[i]:SetPoint("LEFT", TotemAnchor, "LEFT", 0, 0)
					else
					   TotemBar[i]:SetPoint("TOPLEFT", TotemBar[i-1], "TOPRIGHT", Scale(3), 0)
					end
					TotemBar[i]:SetStatusBarTexture(normtex)
					TotemBar[i]:SetHeight(Scale(tHeight))
					TotemBar[i]:SetWidth(Scale(tWidth))
					TotemBar[i]:SetBackdrop(backdrop)
					TotemBar[i]:SetBackdropColor(0, 0, 0)
					TotemBar[i]:SetMinMaxValues(0, 1)
					TotemBar[i]:SetOrientation('VERTICAL')
					TotemBar[i]:SetFrameLevel(20)

					TotemBar[i].bg = TotemBar[i]:CreateTexture(nil, "BORDER")
					TotemBar[i].bg:SetAllPoints(TotemBar[i])
					TotemBar[i].bg:SetTexture(normtex)
					TotemBar[i].bg.multiplier = 0.3
				end
				self.TotemBar = TotemBar
			end
		end
		
		if (unit == "target") or unit == "focus" then			
			-- Unit name on target
			local Name = health:CreateFontString(nil, "OVERLAY")
			Name:SetPoint("CENTER", panel, "CENTER", Scale(4), Scale(1))
			Name:SetJustifyH("LEFT")
			Name:SetFont(font, fontsize, tags)

			self:Tag(Name, '[getnamecolor][namelong] [diffcolor][level] [shortclassification]')
			self.Name = Name
            
            end
			
            if unit == "target" then
			
			-- combo points on target
			local cpWidth, cpHeight = 5, 5
			CPointsAnchor = CreateFrame("frame", "ComboPointsContainer", self)
			CPointsAnchor:SetWidth(MAX_COMBO_POINTS*cpWidth+4)
			CPointsAnchor:SetHeight(cpHeight)
			CPointsAnchor:SetPoint("CENTER", self, "CENTER", 0, 0)
			
			local CPoints = {}
			CPoints.unit = PlayerFrame.unit
			for i = 1, 5 do
				CPoints[i] = CreateFrame('StatusBar', "ComboPoint"..i, self)
				CPoints[i]:SetHeight(Scale(cpHeight))
				CPoints[i]:SetWidth(Scale(cpWidth))
				CPoints[i]:SetStatusBarTexture(normtex)
				CPoints[i]:GetStatusBarTexture():SetHorizTile(false)
				CPoints[i]:SetFrameLevel(20)
				if i == 1 then
					CPoints[i]:SetPoint("TOPLEFT", CPointsAnchor, "TOPLEFT", 0, 0)
				else
					CPoints[i]:SetPoint("LEFT", CPoints[i-1], "RIGHT", Scale(3), 0)
				end
					
				local border = CreateFrame("Frame", "ComboPoint"..i.."Border", CPoints[i])
				CreatePanel(border, CPoints[i]:GetWidth()+2, CPoints[i]:GetHeight()+2, "CENTER", CPoints[i] , "CENTER" ,0,0)
				border:SetPoint("TOPLEFT", 0, 0)
				border:SetPoint("BOTTOMRIGHT", 0, 0)
				border:SetBackdropColor(0,0,0)
				border:SetFrameStrata("MEDIUM")
				border:SetFrameLevel(19)
			end
			
			CPoints[1]:SetStatusBarColor(0.69, 0.31, 0.31)  
			CPoints[2]:SetStatusBarColor(0.69, 0.31, 0.31)
			CPoints[3]:SetStatusBarColor(0.65, 0.63, 0.35)
			CPoints[4]:SetStatusBarColor(0.65, 0.63, 0.35)
			CPoints[5]:SetStatusBarColor(0.33, 0.59, 0.33)
			
			self.CPoints = CPoints
			self:RegisterEvent("UNIT_COMBO_POINTS", UpdateCPoints)
            
            -- Auras
			local buffs = CreateFrame("Frame", nil, self)
			local debuffs = CreateFrame("Frame", nil, self)
			
            buffs:SetPoint("TOPLEFT", self, "TOPLEFT", 0, 31)

            buffs:SetHeight(26)
            buffs:SetWidth(210)
            buffs.size = 26
            buffs.num = 7
				
            debuffs:SetHeight(26)
            debuffs:SetWidth(210)
            debuffs:SetPoint("BOTTOMLEFT", buffs, "TOPLEFT", -4, 4)
            debuffs.size = 26
            debuffs.num = 21
						
			buffs.spacing = 4
			buffs.initialAnchor = 'TOPLEFT'
			buffs.PostCreateIcon = PostCreateAura
			buffs.PostUpdateIcon = PostUpdateAura
			self.Buffs = buffs	
						
			debuffs.spacing = 4
			debuffs.initialAnchor = 'TOPRIGHT'
			debuffs["growth-y"] = "UP"
			debuffs["growth-x"] = "LEFT"
			debuffs.onlyShowPlayer = false -- true or false
			debuffs.PostCreateIcon = PostCreateAura
			debuffs.PostUpdateIcon = PostUpdateAura
			self.Debuffs = debuffs
            
		end


		
			-- castbar of player and target
            
			local castbar = CreateFrame("StatusBar", self:GetName().."_Castbar", self)
			castbar:SetStatusBarTexture(normtex)

			castbar:SetFrameLevel(1)
			castbar:SetHeight(Scale(15))
			castbar:SetWidth(386)
            
            omg = CreateFrame("frame",nil,castbar)
            CreatePanel(omg,1,1,"CENTER")
            omg:SetPoint("TOPLEFT",-2,2)
            omg:SetPoint("BOTTOMRIGHT",2,-2)
            omg:SetBackdropColor(0,0,0)
            omg:SetFrameLevel(1)
            omg:SetFrameStrata("BACKGROUND") 

            omg2 = CreateFrame("frame",nil,castbar)
            CreatePanel(omg2,1,1,"CENTER")
            omg2:SetPoint("TOPLEFT",1,-1)
            omg2:SetPoint("BOTTOMRIGHT",-1,1)
            omg2:SetBackdropColor(.15,.15,.15,1)
            omg2:SetBackdropBorderColor(0,0,0,0)
            omg2:SetFrameLevel(2)
            omg2:SetFrameStrata("BACKGROUND")
            
            
			if unit == "player" then
				castbar:SetPoint("BOTTOM", BottomLine, "TOP", 2, Scale(100))
			else
				castbar:SetPoint("BOTTOM", BottomLine, "TOP", 0, Scale(350))
			end
			
			castbar.CustomTimeText = CustomCastTimeText
			castbar.CustomDelayText = CustomCastDelayText
			castbar.PostCastStart = PostCastStart
			castbar.PostChannelStart = PostCastStart
			castbar:RegisterEvent('UNIT_SPELLCAST_INTERRUPTABLE', SpellCastInterruptable)
			castbar:RegisterEvent('UNIT_SPELLCAST_NOT_INTERRUPTABLE', SpellCastInterruptable)

			castbar.time = SetFontString(castbar, font, fontsize, tags)
			castbar.time:SetPoint("RIGHT", castbar, "RIGHT", -3, 0)
			castbar.time:SetTextColor(0.84, 0.75, 0.65)
			castbar.time:SetShadowOffset(0, 0)
			castbar.time:SetJustifyH("RIGHT")

			castbar.Text = SetFontString(castbar, font, fontsize, tags)
			castbar.Text:SetPoint("LEFT", castbar, "LEFT", Scale(2), 0)

			castbar.Text:SetShadowOffset(0, 0)
			castbar.Text:SetTextColor(0.84, 0.75, 0.65)
			
            if unit == "player" then
            castbar.safezone = castbar:CreateTexture(nil, "ARTWORK")
            castbar.safezone:SetTexture(normtex)
            castbar.safezone:SetVertexColor(0.69, 0.31, 0.31, 0.75)
            castbar.SafeZone = castbar.safezone
            end
					
			self.Castbar = castbar
			self.Castbar.Time = castbar.time
			self.Castbar.Icon = castbar.icon
		
		-- add combat feedback support
        
        if unit == "player" then
			local CombatFeedbackText 
            CombatFeedbackText = SetFontString(health, font,fontsize, tags)
			CombatFeedbackText:SetPoint("CENTER", 0, 1)
			CombatFeedbackText.colors = {
				DAMAGE = {0.69, 0.31, 0.31},
				CRUSHING = {0.69, 0.31, 0.31},
				CRITICAL = {0.69, 0.31, 0.31},
				GLANCING = {0.69, 0.31, 0.31},
				STANDARD = {0.84, 0.75, 0.65},
				IMMUNE = {0.84, 0.75, 0.65},
				ABSORB = {0.84, 0.75, 0.65},
				BLOCK = {0.84, 0.75, 0.65},
				RESIST = {0.84, 0.75, 0.65},
				MISS = {0.84, 0.75, 0.65},
				HEAL = {0.33, 0.59, 0.33},
				CRITHEAL = {0.33, 0.59, 0.33},
				ENERGIZE = {0.31, 0.45, 0.63},
				CRITENERGIZE = {0.31, 0.45, 0.63},
			}
			self.CombatFeedbackText = CombatFeedbackText
        end
							
		-- set width and height of player and target
		self:SetAttribute('initial-width', Scale(206))
		self:SetAttribute('initial-height', Scale(20))
        
        end
	------------------------------------------------------------------------
	--	Target of Target unit layout
	------------------------------------------------------------------------
	
    
	if (unit == "targettarget") or unit == "pet" then
        
		local panel = CreateFrame("Frame", nil, self)
	
		-- health bar
		local health = CreateFrame('StatusBar', nil, self)
		health:SetHeight(Scale(13))
		health:SetPoint("TOPLEFT")
		health:SetPoint("TOPRIGHT")
		health:SetStatusBarTexture(normtex)
        
        local healthborder = CreateFrame("frame","healthborder",health)
        CreatePanel(healthborder,1,1,"CENTER")
        healthborder:SetPoint("TOPLEFT",-2,2)
        healthborder:SetPoint("BOTTOMRIGHT",2,-2)
        healthborder:SetBackdropColor(0,0,0,1)

		local healthBG = health:CreateTexture(nil, 'BORDER')
		healthBG:SetAllPoints()
		healthBG:SetTexture(.4,.4,.4,1)
		
		self.Health = health
		self.Health.bg = healthBG
		
		health.frequentUpdates = true
        health.Smooth = true
		
        health.colorDisconnected = false
        health.colorClass = false
        health:SetStatusBarColor(.1,.1,.1,1)
        healthBG:SetVertexColor(.4,.4,.4,1)		

		
		-- Unit name
		local Name = health:CreateFontString(nil, "OVERLAY")
		Name:SetPoint("CENTER", health, "CENTER", 0, Scale(0))
		Name:SetFont(font, fontsize, tags)
		Name:SetJustifyH("CENTER")

		self:Tag(Name, '[getnamecolor][namemedium] [diffcolor][level]')
		self.Name = Name
		
        local debuffs = CreateFrame("Frame", nil, health)
        debuffs:SetHeight(20)
        debuffs:SetWidth(127)
        debuffs.size = 20
        debuffs.spacing = 6.5
        debuffs.num = 4

        debuffs:SetPoint("TOPLEFT", health, "TOPLEFT", -0.5, 25)
        debuffs.initialAnchor = "TOPLEFT"
        debuffs["growth-y"] = "UP"
        debuffs.PostCreateIcon = PostCreateAura
        debuffs.PostUpdateIcon = PostUpdateAura
        self.Debuffs = debuffs
		
		-- width and height of target of target
		self:SetAttribute('initial-width', Scale(100))
		self:SetAttribute('initial-height', Scale(13))
        
    ------------------------------------------------------------------------
	--	Arena or boss units layout (both mirror'd)
	------------------------------------------------------------------------

       if (unit and unit:find("arena%d")) or (unit and unit:find("boss%d")) then
		-- Right-click focus on arena or boss units
		self:SetAttribute("type2", "focus")
		
		-- health 
		local health = CreateFrame('StatusBar', nil, self)
		health:SetHeight(Scale(22))
		health:SetPoint("TOPLEFT")
		health:SetPoint("TOPRIGHT")
		health:SetStatusBarTexture(normTex)
        
        local healthborder = CreateFrame("frame","healthborder",self)
        CreatePanel(healthborder,1,1,"CENTER")
        healthborder:SetPoint("TOPLEFT",-2,2)
        healthborder:SetPoint("BOTTOMRIGHT",2,-2)
        healthborder:SetBackdropColor(0,0,0,1)

		health.frequentUpdates = true
		health.colorDisconnected = true
        health.Smooth = true
		
		local healthBG = health:CreateTexture(nil, 'BORDER')
		healthBG:SetAllPoints()
		healthBG:SetTexture(unpack(db.healthBG))

		health.value = SetFontString(health, font, fontsize, tags)
		health.value:SetPoint("LEFT", Scale(2), Scale(1))
		health.PostUpdate = PostUpdateHealth
				
		self.Health = health
		self.Health.bg = healthBG
		
		health.frequentUpdates = true
        health.Smooth = true
		
        health.colorDisconnected = false
        health.colorClass = false
        health:SetStatusBarColor(.1,.1,.1)
        healthBG:SetVertexColor(.4,.4,.4)		

	
		-- power
		local power = CreateFrame('StatusBar', nil, self)
		power:SetHeight(Scale(6))
		power:SetPoint("TOPLEFT", health, "BOTTOMLEFT", 0, -mult)
		power:SetPoint("TOPRIGHT", health, "BOTTOMRIGHT", 0, -mult)
		power:SetStatusBarTexture(normTex)
		
		power.frequentUpdates = true
		power.colorPower = true
		power.Smooth = true

		local powerBG = power:CreateTexture(nil, 'BORDER')
		powerBG:SetAllPoints(power)
		powerBG:SetTexture(normTex)
		powerBG.multiplier = 0.3
		
		power.value = SetFontString(health, font, fontsize, tags)
		power.value:SetPoint("RIGHT", Scale(-2), Scale(1))
		power.PreUpdate = PreUpdatePower
		power.PostUpdate = PostUpdatePower
				
		self.Power = power
		self.Power.bg = powerBG
		
		-- names
		local Name = health:CreateFontString(nil, "OVERLAY")
		Name:SetPoint("CENTER", health, "CENTER", 0, Scale(1))
		Name:SetJustifyH("CENTER")
		Name:SetFont(font, fontsize, tags)
		
		self:Tag(Name, '[getnamecolor][namelong]')
		self.Name = Name
		
		-- create buff at left of unit if they are boss units
		if (unit and unit:find("boss%d")) then
			local buffs = CreateFrame("Frame", nil, self)
			buffs:SetHeight(26)
			buffs:SetWidth(252)
			buffs:SetPoint("RIGHT", self, "LEFT", Scale(-5), 0)
			buffs.size = 26
			buffs.num = 3
			buffs.spacing = 2
			buffs.initialAnchor = 'RIGHT'
			buffs["growth-x"] = "LEFT"
			buffs.PostCreateIcon = PostCreateAura
			buffs.PostUpdateIcon = PostUpdateAura
			self.Buffs = buffs
		end

		-- create debuff for both arena and boss units
		local debuffs = CreateFrame("Frame", nil, self)
		debuffs:SetHeight(26)
		debuffs:SetWidth(200)
		debuffs:SetPoint('LEFT', self, 'RIGHT', Scale(5), 0)
		debuffs.size = 26
		debuffs.num = 5
		debuffs.spacing = 2
		debuffs.initialAnchor = 'LEFT'
		debuffs["growth-x"] = "LEFT"
		debuffs.PostCreateIcon = PostCreateAura
		debuffs.PostUpdateIcon = PostUpdateAura
		debuffs.onlyShowPlayer = db.playerdebuffsonly
		self.Debuffs = debuffs	
		
		
		if (unit and unit:find("arena%d")) or (unit and unit:find("boss%d")) then
			if (unit and unit:find("boss%d")) then
				self.Buffs:SetPoint("RIGHT", self, "LEFT", -4, 0)
				self.Buffs.num = 3
				self.Buffs.numBuffs = 3
				self.Buffs.initialAnchor = "RIGHT"
				self.Buffs["growth-x"] = "LEFT"
			end
			self.Debuffs.num = 5
			self.Debuffs.size = 26
			self.Debuffs:SetPoint('LEFT', self, 'RIGHT', 4, 0)
			self.Debuffs.initialAnchor = "LEFT"
			self.Debuffs["growth-x"] = "RIGHT"
			self.Debuffs["growth-y"] = "DOWN"
			self.Debuffs:SetHeight(26)
			self.Debuffs:SetWidth(200)
			self.Debuffs.onlyShowPlayer = db.playerdebuffsonly
		end	
		
		-- trinket feature via trinket plugin
		if not IsAddOnLoaded("Gladius") then
			if (unit and unit:find('arena%d')) then
				local Trinketbg = CreateFrame("Frame", nil, self)
				Trinketbg:SetHeight(26)
				Trinketbg:SetWidth(26)
				Trinketbg:SetPoint("RIGHT", self, "LEFT", -6, 0)				
				SetTemplate(Trinketbg)
				Trinketbg:SetFrameLevel(0)
                Trinketbg:SetBackdropColor(0,0,0)
				self.Trinketbg = Trinketbg
                
				
				local Trinket = CreateFrame("Frame", nil, Trinketbg)
				Trinket:SetAllPoints(Trinketbg)
				Trinket:SetPoint("TOPLEFT", Trinketbg, Scale(2), Scale(-2))
				Trinket:SetPoint("BOTTOMRIGHT", Trinketbg, Scale(-2), Scale(2))
				Trinket:SetFrameLevel(1)
				Trinket.trinketUseAnnounce = true
				self.Trinket = Trinket
			end
		end
        
        
        
			local castbar = CreateFrame("StatusBar", self:GetName().."_Castbar", self)
			castbar:SetStatusBarTexture(normTex)
			castbar:SetFrameLevel(9)
            castbar:SetFrameStrata("HIGH")
			castbar:SetPoint("TOPLEFT",power,0,0)		
			castbar:SetPoint("BOTTOMRIGHT",power,0,0)		
			
			castbar.time = SetFontString(castbar, font, fontsize, tags)
			castbar.time:SetPoint("RIGHT", castbar, "RIGHT", Scale(-4), Scale(1))
			castbar.time:SetTextColor(0.84, 0.75, 0.65)
			castbar.time:SetJustifyH("RIGHT")
			castbar.CustomTimeText = CustomCastTimeText

			castbar.Text = SetFontString(castbar, font, fontsize, tags)
			castbar.Text:SetPoint("LEFT", castbar, "LEFT", 4, 1)
			castbar.Text:SetTextColor(0.84, 0.75, 0.65)
			
			castbar.CustomDelayText = CustomCastDelayText
			castbar.PostCastStart = PostCastStart
			castbar.PostChannelStart = PostChannelStart
			
			self.Castbar = castbar
			self.Castbar.Time = castbar.time
			self.Castbar.Icon = castbar.icon
		
		
		self:SetAttribute("initial-height", Scale(29))
		self:SetAttribute("initial-width", Scale(200))
	end
    
    end
    
    return self
end

oUF:RegisterStyle('Itrulia', Shared)

local player = oUF:Spawn('player', "oUF_player")
player:SetPoint("RIGHT", BottomLine, "TOP", -60,190)

local focus = oUF:Spawn('focus', "oUF_focus")
focus:SetPoint("CENTER", UIparent, "CENTER")

local target = oUF:Spawn('target', "oUF_target")
target:SetPoint("LEFT", BottomLine, "TOP", 60,190)

local tot = oUF:Spawn('targettarget', "oUF_targettarget")
tot:SetPoint("CENTER", BottomLine, "TOP", 0,190)

local pet = oUF:Spawn('pet', "oUF_pet")
pet:SetPoint("RIGHT", oUF_player, "LEFT", -11, -4)

if not IsAddOnLoaded("Gladius") then
	local arena = {}
	for i = 1, 5 do
		arena[i] = oUF:Spawn("arena"..i, "oUF_Arena"..i)
		if i == 1 then
			arena[i]:SetPoint("BOTTOM", UIParent, "BOTTOM", 252, 411)
		else
			arena[i]:SetPoint("BOTTOM", arena[i-1], "TOP", 0, 10)
		end
	end
end

if not IsAddOnLoaded("DXE") then
	for i = 1,MAX_BOSS_FRAMES do
		local t_boss = _G["Boss"..i.."TargetFrame"]
		t_boss:UnregisterAllEvents()
		t_boss.Show = dummy
		t_boss:Hide()
		_G["Boss"..i.."TargetFrame".."HealthBar"]:UnregisterAllEvents()
		_G["Boss"..i.."TargetFrame".."ManaBar"]:UnregisterAllEvents()
	end

	local boss = {}
	for i = 1, MAX_BOSS_FRAMES do
		boss[i] = oUF:Spawn("boss"..i, "oUF_Boss"..i)
		if i == 1 then
			boss[i]:SetPoint("BOTTOM", UIParent, "BOTTOM", 252, 260)
		else
			boss[i]:SetPoint('BOTTOM', boss[i-1], 'TOP', 0, 10)             
		end
	end
end

http://pastebin.com/ikqc0pus

knows anyone what i did false?

Last edited by Karudon : 10-14-10 at 04:11 PM.
  Reply With Quote
10-14-10, 04:13 PM   #2
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
The "initial-*" attributes are no longer supported. Instead just use direct calls to self:SetWidth() and self:SetHeight() for units that are not spawned by header.
  Reply With Quote
10-14-10, 04:23 PM   #3
Karudon
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 15
Originally Posted by yj589794 View Post
The "initial-*" attributes are no longer supported. Instead just use direct calls to self:SetWidth() and self:SetHeight() for units that are not spawned by header.
i saw and fixed it. (got it totally ignored... ^^)
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF 1.5.2 issue


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off