Download
(2Kb)
Download
Updated: 05-08-08 05:53 AM
Pictures
File Info
Updated:05-08-08 05:53 AM
Created:unknown
Downloads:2,346
Favorites:4
MD5:

oUF Spark

Version: r57
by: ganders [More]

I suggest you use Snago's oUF_PowerSpark. It's better well written and the author actually knows what he's doing =P

Adds a spark to Rogues' and Druids' energy bar on oUF unit frames showing time remaining until next energy tick.

How to use:
Put this anywhere in the main function in your layout.

Code:
local spark = pp:CreateTexture(nil, "OVERLAY")
spark:SetTexture"Interface\\CastingBar\\UI-CastingBar-Spark"
spark:SetBlendMode"ADD"
spark:SetVertexColor(1, 1, 0)
spark:SetHeight(pp:GetHeight())
spark:SetWidth(pp:GetHeight() * 4)
self.Spark = spark
You can use any texture you want, however that is the normal "spark" texture.

Obviously, the height and width is changable, as is the blend mode if you'd like.

If you want to make the spark go across the health bar you'd use hp:CreateTexture instead of pp:CreateTexture, and if you wanted it to go across the entire unit frame you'd use self:CreateTexture.

The spark will sync with your energy tick timer the first time you get an energy tick. This shouldn't be a problem when you're first logging in or zoning, but if you Reload your UI it could be a little off at first.


Other layouts and files:

oUF_P3lim
oUF_Ligherfluid
oUF_Kosken
oUF_Lily
oUF_DispelColor
oUF_TsoHG
oUF_CombatText
oUF_PowerSpark
oUF_Banzai + LibBanzai-2.0
oUF

Optional Files (0)


Post A Reply Comment Options
Unread 05-05-08, 07:16 AM  
ganders
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 131
File comments: 59
Uploads: 10
Ok I updated the version on my SVN to re-show the spark as P3lim told me, and it also will check to make sure that the object is your player frame before it sets the Update script, so you can put it anywhere in the main chunk and it should still only work on your playaer frame.
Last edited by ganders : 05-05-08 at 07:16 AM.
Report comment to moderator  
Reply With Quote
Unread 05-05-08, 07:13 AM  
ganders
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 131
File comments: 59
Uploads: 10
Originally posted by hipjipp
i've noticed another thing. if you have the code from the info page here the spark has a quite big chance to move from the playerframe to another frame. i had my spark on my party frame once... i moved the code into my player chunk and now it stays there. Just a tip.
I should probably put that on the main page =P

I put it on the wiki, but not on here. DOH!


Thanks for the tip P3lim
Last edited by ganders : 05-05-08 at 07:13 AM.
Report comment to moderator  
Reply With Quote
Unread 05-05-08, 06:32 AM  
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1710
File comments: 1222
Uploads: 43
Originally posted by hipjipp
i've noticed another thing. if you have the code from the info page here the spark has a quite big chance to move from the playerframe to another frame. i had my spark on my party frame once... i moved the code into my player chunk and now it stays there. Just a tip.
Yup
Code:
if unit == "player" then 
insertcodetoshowsparkhere
end
Report comment to moderator  
Reply With Quote
Unread 05-05-08, 06:31 AM  
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1710
File comments: 1222
Uploads: 43
change this:
Code:
	if UnitPowerType"player" ~= 3 then
		spark:Hide()
	end
to this:
Code:
	if UnitPowerType"player" ~= 3 then
		spark:Hide()
	else
		spark:Show()
	end
Report comment to moderator  
Reply With Quote
Unread 05-05-08, 06:31 AM  
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view AddOns

Forum posts: 79
File comments: 236
Uploads: 10
i've noticed another thing. if you have the code from the info page here the spark has a quite big chance to move from the playerframe to another frame. i had my spark on my party frame once... i moved the code into my player chunk and now it stays there. Just a tip.
Report comment to moderator  
Reply With Quote
Unread 05-04-08, 07:11 PM  
ganders
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 131
File comments: 59
Uploads: 10
Originally posted by hipjipp
i've noticed a tiny bug, easily fixed though. when i switch out of catform on my druid it hides all frames, replace the
Code:
self:Hide()
with
Code:
spark:Hide()
and it will no longer hide all frames.

Awesome plugin btw ^^
Ya I noticed that too, and fixed it on my SVN, just too lazy to upload a change that tiny to WoWI
Report comment to moderator  
Reply With Quote
Unread 05-04-08, 05:01 AM  
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view AddOns

Forum posts: 79
File comments: 236
Uploads: 10
i've noticed a tiny bug, easily fixed though. when i switch out of catform on my druid it hides all frames, replace the
Code:
self:Hide()
with
Code:
spark:Hide()
and it will no longer hide all frames.

Awesome plugin btw ^^
Report comment to moderator  
Reply With Quote
Unread 05-03-08, 09:03 PM  
ganders
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 131
File comments: 59
Uploads: 10
Originally posted by Coldfury
there is already a uniform. its oUF.units.<unit>.

like oUF.units.player or oUF.units.targettarget, etc..
That's what I used and people were saying they were getting errors. o.O

Anyway, it's changed now so it should work with any layout. You just have to add it in yourself.
Report comment to moderator  
Reply With Quote
Unread 05-03-08, 08:33 PM  
Coldfury
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 18
File comments: 78
Uploads: 3
Originally posted by ganders
Apparently every oUF layout uses a different table for storing the unit frames, which I didn't know when writing this. I was using P3lim's layout, and his layout uses oUF.player and his player unit frame.

So, short answer, no. There's really no way for me to fix this unless every oUF layout used a uniform structure. You'll have to change it yourself to work with your layout (which shouldn't be too hard).

Hopefully Ammo or someone else will write a better working version of this.
there is already a uniform. its oUF.units.<unit>.

like oUF.units.player or oUF.units.targettarget, etc..
Report comment to moderator  
Reply With Quote
Unread 04-30-08, 04:40 PM  
ganders
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 131
File comments: 59
Uploads: 10
Originally posted by hipjipp
You beat me to it, writing this addon :P

I'm also getting the error on line 10.
Code:
"Interface\\AddOns\\oUF_Spark\\core.lua:10: attempt to index field 'player' (a nil value)"
Got a fix for this?
Apparently every oUF layout uses a different table for storing the unit frames, which I didn't know when writing this. I was using P3lim's layout, and his layout uses oUF.player and his player unit frame.

So, short answer, no. There's really no way for me to fix this unless every oUF layout used a uniform structure. You'll have to change it yourself to work with your layout (which shouldn't be too hard).

Hopefully Ammo or someone else will write a better working version of this.
Report comment to moderator  
Reply With Quote
Unread 04-30-08, 08:36 AM  
hipjipp
A Cliff Giant
 
hipjipp's Avatar
AddOn Author - Click to view AddOns

Forum posts: 79
File comments: 236
Uploads: 10
You beat me to it, writing this addon :P

I'm also getting the error on line 10.
Code:
"Interface\\AddOns\\oUF_Spark\\core.lua:10: attempt to index field 'player' (a nil value)"
Got a fix for this?
Report comment to moderator  
Reply With Quote
Unread 04-24-08, 03:49 AM  
Gaenjin
A Deviate Faerie Dragon

Forum posts: 10
File comments: 56
Uploads: 0
Originally posted by p3lim Thing is, that addon has a parent that is stuck, a frame.

In this addon you parent the texture to a statusbar, which changes the size dynamically, and that doesnt work out well (buggy looks)

Tip: Take the width size from the background of the powerbar instead of the powerbar itself, that way it shouldnt look buggy.[/code] [/b]
Hm, that might explain why I was getting
Code:
"Interface\\AddOns\\oUF_Spark\\core.lua:10: attempt to index field 'player' (a nil value)",
when looking at starlon's layout. I'm not sure what he did with his powerbars, but of all the oUF layouts that I've been looking at, it was the only one I was getting that error in. (I took starlon's custom oUF master out of the mix, so it wasn't that) But I noticed in Spark, that it appeared it was parented to the powerbar, so figured something wasn't playing well there. But maybe I read it wrong.
Last edited by Gaenjin : 04-24-08 at 03:53 AM.
Report comment to moderator  
Reply With Quote
Unread 04-22-08, 07:21 AM  
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1710
File comments: 1222
Uploads: 43
Originally posted by ganders
Thanks for the tip.

And actually, after failing at doing it myself, I did copy a bit of the code from EnergyWatch.

And I've noticed it's a bit buggy as well. The tick is off until the first energy tick, and then it usually gets back on track.
I noticed it was off until the 2nd tick hit in

But try taking the width from the bg instead, i think that will work
Report comment to moderator  
Reply With Quote
Unread 04-21-08, 07:07 PM  
ganders
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 131
File comments: 59
Uploads: 10
Originally posted by p3lim
This plugin doesnt work as smooth as its supposed to.

I can easily see by reading the code that you found alot of it from the addon RogueFocus.

Thing is, that addon has a parent that is stuck, a frame.

In this addon you parent the texture to a statusbar, which changes the size dynamically, and that doesnt work out well (buggy looks)

Tip: Take the width size from the background of the powerbar instead of the powerbar itself, that way it shouldnt look buggy.

also, add this to the updater:
Code:
if select(2, UnitClass("player")) == "DRUID" then
	if UnitPowerType("player") ~= 3 then
		spark:Hide()
	else
		spark:Show()
	end
end
that way the ticker only shows when theres a energy bar

also make the ticker hide when full energy:
Code:
if energy == 100 then
	spark:Hide()
else
	spark:Show()
end
Thanks for the tip.

And actually, after failing at doing it myself, I did copy a bit of the code from EnergyWatch.

And I've noticed it's a bit buggy as well. The tick is off until the first energy tick, and then it usually gets back on track.
Report comment to moderator  
Reply With Quote
Unread 04-21-08, 05:16 PM  
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1710
File comments: 1222
Uploads: 43
This plugin doesnt work as smooth as its supposed to.

I can easily see by reading the code that you found alot of it from the addon RogueFocus.

Thing is, that addon has a parent that is stuck, a frame.

In this addon you parent the texture to a statusbar, which changes the size dynamically, and that doesnt work out well (buggy looks)

Tip: Take the width size from the background of the powerbar instead of the powerbar itself, that way it shouldnt look buggy.

also, add this to the updater:
Code:
if select(2, UnitClass("player")) == "DRUID" then
	if UnitPowerType("player") ~= 3 then
		spark:Hide()
	else
		spark:Show()
	end
end
that way the ticker only shows when theres a energy bar

also make the ticker hide when full energy:
Code:
if energy == 100 then
	spark:Hide()
else
	spark:Show()
end
Last edited by p3lim : 04-21-08 at 05:48 PM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: