Thread Tools Display Modes
06-16-11, 10:42 PM   #1
ncbadgirl
A Deviate Faerie Dragon
 
ncbadgirl's Avatar
AddOn Compiler - Click to view compilations
Join Date: Oct 2008
Posts: 10
Angry Threat Bar

Yet back again for some help. Trying to move this threat bar..as it stays put after moving the unitframes. I've played with the coding in lib to either break it..or just srsly mess it up. /facepalm.

What I am looking to do is just place it right under the target frame between buffs/debuffs as it's suppost to.

However this is what I have atm


Code:
lib.ThreatBar = function(self)
if cfg.ThreatBar then
	local ThreatBar = CreateFrame("StatusBar", self:GetName()..'_ThreatBar', UIParent)
	ThreatBar:SetFrameLevel(5)
	ThreatBar:SetPoint("LEFT", UIParent, "BOTTOM", cfg.targetx, cfg.targety-45)
	ThreatBar:SetWidth(245)
	ThreatBar:SetHeight(5)	  
	ThreatBar:SetStatusBarTexture(cfg.statusbar_texture)
	ThreatBar:GetStatusBarTexture():SetHorizTile(false)	   
	ThreatBar.Title = SetFontString(ThreatBar, cfg.font)
	ThreatBar.Title:SetText("Threat:")
	ThreatBar.Title:SetPoint("RIGHT", ThreatBar, "CENTER", -2, 0)
	ThreatBar.Text = SetFontString(ThreatBar, cfg.font)
	ThreatBar.Text:SetPoint("LEFT", ThreatBar, "CENTER", 2, 0)			  
	ThreatBar.bg = ThreatBar:CreateTexture(nil, 'BORDER')
	ThreatBar.bg:SetAllPoints(ThreatBar)
	ThreatBar.bg:SetTexture(0,0,0)	   
	ThreatBar.useRawThreat = false
	
	local h = CreateFrame("Frame", nil, ThreatBar)
	h:SetFrameLevel(4)
	h:SetPoint("TOPLEFT",-5,5)
	h:SetPoint("BOTTOMRIGHT",5,-5)
	frame1px1(h)
	CreateShadow(h)
	
	self.ThreatBar = ThreatBar
end
"ThreatBar:SetPoint("LEFT", UIParent, "BOTTOM", cfg.targetx, cfg.targety-45)" and h:SetFrameLevel(4)
h:SetPoint("TOPLEFT",-5,5)
h:SetPoint("BOTTOMRIGHT",5,-5)
Have been my targets for trying to move it. I just guess I am doing it wrong.
Thank again for the help.
  Reply With Quote
06-17-11, 12:28 AM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
1. You anchor your bar to UIParent, and not the oUF frame.
2. The parent for both of your frames are nil, which equals to WordlFrame. Change these to self or another frame parented to self.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
06-17-11, 05:33 AM   #3
ncbadgirl
A Deviate Faerie Dragon
 
ncbadgirl's Avatar
AddOn Compiler - Click to view compilations
Join Date: Oct 2008
Posts: 10
Originally Posted by haste View Post
1. You anchor your bar to UIParent, and not the oUF frame.
2. The parent for both of your frames are nil, which equals to WordlFrame. Change these to self or another frame parented to self.
Did I add I am new to this? Lol sorry still unsure what to go about as far as moving it? Sorry =/
  Reply With Quote
06-17-11, 08:34 AM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Point 1. is the reason for why it doesn't move with your frame. ie.:
[code[ThreatBar:SetPoint("LEFT", UIParent, "BOTTOM", cfg.targetx, cfg.targety-45)[/code]

You might want to read up on :SetPoint.

You need to change the anchoring to be correct for `self', not `UIParent'. (point bottom, relative point top should work fine on self, with proper x/y values).

Point 2. is for the next issue you _might_ get, and that's the threat bar not hiding with your frame. You can add the parent argument to CreateFrame or use :SetParent to do so.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
06-17-11, 10:31 AM   #5
ncbadgirl
A Deviate Faerie Dragon
 
ncbadgirl's Avatar
AddOn Compiler - Click to view compilations
Join Date: Oct 2008
Posts: 10
thanks for the info. Get what your saying now..and have it moving! YAY made my day thank you again!!
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Threat Bar


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