Thread Tools Display Modes
11-19-10, 01:45 PM   #1
Sniffles
A Black Drake
 
Sniffles's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 86
Raid glow?

Hey,
i tried to glow the border of my raidframes, if i have someone in my target. but it doesnt work

my code:
Code:
-- mouseover highlight
	local mov = health:CreateTexture(nil, "OVERLAY")
	mov:SetAllPoints(health)
	mov:SetTexture(BlessedUI.mouseover)
	mov:SetVertexColor(1,1,1,.36)
	mov:SetBlendMode("ADD")
	mov:Hide()
	self.Mouseover = mov
	
	if (UnitIsUnit("target", unit) ) then
		mov:Show()
	else
		mov:Hide()
	end
  Reply With Quote
11-19-10, 05:10 PM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Show/Hide the frame based on your frames OnEnter/OnLeave. Alternatively set the texture layer to HIGHLIGHT and WoW will do the magic for you.
__________________
「貴方は1人じゃないよ」

Last edited by haste : 11-19-10 at 05:15 PM. Reason: ^ The above text is me failing. I blame your confusing frame variables :P.
  Reply With Quote
11-19-10, 05:11 PM   #3
drakull
A Cyclonian
 
drakull's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 49
You have to put that "if" clause inside a function and hook it to the "PLAYER_TARGET_CHANGED" event.

Here's what I use:

lua Code:
  1. -- Create Target Border
  2. function CreateTargetBorder(self)
  3.     local glowBorder = {edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = 1}
  4.     self.TargetBorder = CreateFrame("Frame", nil, self)
  5.     self.TargetBorder:SetPoint("TOPLEFT", self, "TOPLEFT", -1, 1)
  6.     self.TargetBorder:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 1, -1)
  7.     self.TargetBorder:SetBackdrop(glowBorder)
  8.     self.TargetBorder:SetFrameLevel(2)
  9.     self.TargetBorder:SetBackdropBorderColor(.7,.7,.7,1)
  10.     self.TargetBorder:Hide()
  11. end
  12.  
  13. -- Raid Frames Target Highlight Border
  14. function ChangedTarget(self, event, unit)
  15.     if UnitIsUnit('target', self.unit) then
  16.         self.TargetBorder:Show()
  17.     else
  18.         self.TargetBorder:Hide()
  19.     end
  20. end

And then, inside raid style function:
lua Code:
  1. CreateTargetBorder(self)
  2. self:RegisterEvent('PLAYER_TARGET_CHANGED', ChangedTarget)
  Reply With Quote
11-19-10, 05:31 PM   #4
Sniffles
A Black Drake
 
Sniffles's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2010
Posts: 86
@ drakull
*kiss*

Thank you!

  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Raid glow?


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