Thread Tools Display Modes
10-04-08, 02:41 AM   #21
zhr
A Kobold Labourer
 
zhr's Avatar
Join Date: Oct 2008
Posts: 1
i have a trouble with target names, they run on target hp http://img139.imageshack.us/my.php?image=lolnv5.jpg
how it to correct?
P.S. sorry for my english (:
 
10-04-08, 04:30 AM   #22
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Caellian, you really need to stop using that edit button . Especially when you add ten pages of text (and that 3 hours after it's been posted).

1) "Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:56: attempt to index local 'parent' (a nil value)" tells you that you should take a look at line 56 in your layout code.

2) :GetText() returns a string containing the text of the fontstring, it won't do some magic updating for you. What you could do is to remove .Name, and use the castbar .Text to display name. You can do this with a post hook in the stop functions. Remember that you will have to do all the name updating yourself, and that is has to be aware of casts/channels.

vaddn, use locals and not globals when you create those frames. The initial code should work fine with that.

zhz, it's because your fontstrings have no width limitations. You can set these with :SetWidth and/or :SetPoint.

zynix, read up on :SetPoint, and look for it in the layout. Usually placed at the bottom.
 
10-04-08, 05:43 AM   #23
vadda
A Defias Bandit
Join Date: Oct 2008
Posts: 3
Originally Posted by haste View Post
vaddn, use locals and not globals when you create those frames. The initial code should work fine with that.
Works like a charm...thx...made my day
 
10-05-08, 03:22 AM   #24
Frayol
A Deviate Faerie Dragon
 
Frayol's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 10
Originally Posted by MoonWitch View Post
Thanks I'll do that. I still get freaked out when I see the pvp icon, so I figured it'd be better for my heart to use text. :P
Did you get this to work? I'd be really interested to see the code you used if you did as it is something that I'd like to add as well. I too would prefer to see a text tag rather than the icon... for some reason the icon doesn't always register in my brain whereas text does.

On another note, is it possible to add the AFK and DND flags with oUF? I've tried looking, but haven't managed to find an answer yet. The only reason I ask is that I have a bad habit of setting flags and forgetting about them if there is nothing to remind me on my character frame.
 
10-05-08, 04:42 AM   #25
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Frayol View Post
Did you get this to work? I'd be really interested to see the code you used if you did as it is something that I'd like to add as well. I too would prefer to see a text tag rather than the icon... for some reason the icon doesn't always register in my brain whereas text does.

On another note, is it possible to add the AFK and DND flags with oUF? I've tried looking, but haven't managed to find an answer yet. The only reason I ask is that I have a bad habit of setting flags and forgetting about them if there is nothing to remind me on my character frame.
You can easily do this with custom tags, but it doesnt really have anything to do with unitframes, so thats the reason haste havent implemented it.
 
10-05-08, 06:33 AM   #26
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
On another note, is it possible to add the AFK and DND flags with oUF? I've tried looking, but haven't managed to find an answer yet. The only reason I ask is that I have a bad habit of setting flags and forgetting about them if there is nothing to remind me on my character frame.
You could add some custom tags:

Code:
oUF.Tags["[AFK]"] = function(u) return UnitIsAFK(u) and "AFK" or ""
oUF.Tags["[DND]"] = function(u) return UnitIsDND(u) and "DND" or ""

oUF.TagEvents["[AFK]"] = "UNIT_FLAGS"
oUF.TagEvents["[DND]"] = "UNIT_FLAGS"
(note: I'm not certain if the event is correct as I don't have access to WoW currently.)

and then use those tags as you would normally.
 
10-05-08, 06:44 AM   #27
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Slakah View Post
You could add some custom tags:

Code:
oUF.Tags["[AFK]"] = function(u) return UnitIsAFK(u) and "AFK" or ""
oUF.Tags["[DND]"] = function(u) return UnitIsDND(u) and "DND" or ""

oUF.TagEvents["[AFK]"] = "UNIT_FLAGS"
oUF.TagEvents["[DND]"] = "UNIT_FLAGS"
(note: I'm not certain if the event is correct as I don't have access to WoW currently.)

and then use those tags as you would normally.
PLAYER_FLAGS_CHANGED is the event

(dont be fooled by the name of the event, it works for any unit)
 
10-05-08, 08:18 AM   #28
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
One question, i would like to have my experience bar to show but only when i mouseover it.

I've tried something like the code below but obviously it doesn't work, i know it's wrong but that's all i could come up with using wowwiki and unfortunately i couldn't find any better information on how to do this.


Code:
local OnEnter = function(self)
 self.Experience_OnEnter(self)
 self.Experience:Show()
end

local OnLeave = function(self)
 self.Experience_OnLeave(self)
 self.Experience:Hide()
end
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
10-05-08, 08:35 AM   #29
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Caellian View Post
One question, i would like to have my experience bar to show but only when i mouseover it.
end[/code]
I don't know the code for your .Experience, so I'm just assuming it's a frame. The following will make it appear/disappear when you hover it:
Code:
self.Experience:SetScript('OnEnter', function(self) self:SetAlpha(1) end)
self.Experience:SetScript('OnLeave', function(self) self:SetAlpha(0) end)
You will have to use the OnEnter/OnLeave handler on the frame if you want it to show/hide when you enter the unit frame as a whole however. The above will only work for when you hover the position for the actual frame. You should also use :Hide/:Show in that case, and not :SetAlpha.
 
10-05-08, 08:40 AM   #30
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Thanks a lot i will give it a try, it's a statusbar btw. (here's the main part of it)

Code:
		if(IsAddOnLoaded('oUF_Experience')) then
			self.Experience = CreateFrame('StatusBar', nil, self)
			self.Experience:SetPoint('TOPLEFT', self.Power, 'BOTTOMLEFT', 0, -2.5)
			self.Experience:SetPoint('BOTTOMRIGHT', self.Power, 'BOTTOMRIGHT', 0, -7.5)
			self.Experience:SetStatusBarTexture(texturebar)
			self.Experience:SetBackdrop({bgFile = 'Interface\\Tooltips\\UI-Tooltip-Background', insets = {top = -1, left = -1, bottom = -1, right = -1}})
			self.Experience:SetBackdropColor(.15,.15,.15)
			self.Experience.Tooltip = true
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 10-05-08 at 08:43 AM.
 
10-05-08, 08:40 AM   #31
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Caellian View Post
Thanks a lot i will give it a try, it's a statusbar btw.
Thats a frame
 
10-05-08, 09:39 AM   #32
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by p3lim View Post
Thats a frame
Yes sry, but that didn't do anything, i've added this to the experience block, tried with both alpha-show/hide.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
10-05-08, 10:14 AM   #33
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
You'll need to set the alpha to 0 when it's loaded as well, or else it will be shown until moused over.

soo:

Code:
self.Experience:SetScript('OnEnter', function(self) self:SetAlpha(1) end)
self.Experience:SetScript('OnLeave', function(self) self:SetAlpha(0) end)
self.Experience:SetAlpha(0)
 
10-05-08, 10:22 AM   #34
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
...I am not editing, i am not editing, i am not editing...

Nvm the above, actually i didn't even need to use that, i just edited my current OnEnter/OnLeave, thanks for the hints.

Code:
	self:SetScript("OnEnter", function(self)
		if(unit == 'player') then self.Experience:Show() end
		UnitFrame_OnEnter(self)
	end)

	self:SetScript("OnLeave", function(self)
		if(unit == 'player') then self.Experience:Hide() end
		UnitFrame_OnLeave(self)
	end)
Originally Posted by Slakah View Post
You'll need to set the alpha to 0 when it's loaded as well, or else it will be shown until moused over.
I've added self.Experience:Hide() to the exp block but it still is shown on login though.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 10-05-08 at 10:29 AM.
 
10-05-08, 10:46 AM   #35
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
I've added self.Experience:Hide() to the exp block but it still is shown on login though.
Line 72 of oUF_Experience bar:Show().

So you'll need to force it to hide when shown i.e.

Code:
local function Hide(f)
   f:Hide()
   f:SetScript("OnShow", f.Hide)
end
local function Show(f)
	f:Show()
	f:SetScript("OnShow", nil)
end

Hide(self.Experience)

self:SetScript("OnEnter", function(self)
	if(unit == 'player') then Show(self.Experience) end
	UnitFrame_OnEnter(self)
end)
self:SetScript("OnLeave", function(self)
	if(unit == 'player') then Hide(self.Experience) end
	UnitFrame_OnLeave(self)
end)

Last edited by Slakah : 10-05-08 at 02:35 PM.
 
10-05-08, 02:30 PM   #36
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Hmm this doesn't work at all

Code:
local function Hide(f)
   f:Hide()
   f:SetScript("OnShow", f.Hide)
end
local Show(f)
	f:Show() -- LINE 280
	f:SetScript("OnShow", nil)
end

Hide(self.Experience)
Code:
Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:280: syntax error near 'f'
Count: 1
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
10-05-08, 02:34 PM   #37
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Caellian View Post
Hmm this doesn't work at all

Code:
local function Hide(f)
   f:Hide()
   f:SetScript("OnShow", f.Hide)
end
local Show(f)
	f:Show() -- LINE 280
	f:SetScript("OnShow", nil)
end

Hide(self.Experience)
Code:
Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:280: syntax error near 'f'
Count: 1
Code:
local function Hide(f)
   f:Hide()
   f:SetScript("OnShow", function() f.Hide end)
end
local Show(f)
	f:Show() -- LINE 280
	f:SetScript("OnShow", nil)
end

Hide(self.Experience)
 
10-05-08, 02:36 PM   #38
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by Caellian View Post
Hmm this doesn't work at all

I forgot the "function" bit, amoung other things :P.

Post edited so it'll work now.

Last edited by Slakah : 10-05-08 at 02:41 PM.
 
10-05-08, 03:33 PM   #39
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Yes yes now it works, it's hidden on login, but it won't show up anymore
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
 
10-05-08, 04:02 PM   #40
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
This is what i've got, hidden on login, but doesn't show up on mouseover.

Beginning of the style (where the OnEnter/OnLeave were)

Code:
	local function Hide(f)
		f:Hide()
		f:SetScript("OnShow", f.Hide)
	end

	local function Show(f)
		f:Show()
		f:SetScript("OnShow", nil)
	end

	self:SetScript("OnEnter", function(self)
		if(unit == 'player') then Show(self.Experience) end
		UnitFrame_OnEnter(self)
	end)

	self:SetScript("OnLeave", function(self)
		if(unit == 'player') then Hide(self.Experience) end
		UnitFrame_OnLeave(self)
	end)
And at the end of the self.Experience block

Code:
Hide(self.Experience)
P3lim, if i use yours with
Code:
f:SetScript("OnShow", function() f.Hide end)
i get a
Code:
Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:282: '=' expected near 'end'
. Line 282 is yours just above.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }

Last edited by Caellian : 10-05-08 at 05:16 PM.
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF - Layout discussion

Thread Tools
Display Modes

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