Reply
 
Thread Tools Display Modes
Old 05-21-13, 02:35 AM   #1
skarie
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 37
OUF_p3lim - Adding altpower

I am trying to add altpowerbar to target frame. So I went ahead and added below codes into target section. But it's not showing up. Any idea?

Code:
	
                local AltPower = CreateFrame('StatusBar', nil, self)
		AltPower:SetPoint('BOTTOM', 0, -10)
		AltPower:SetSize(230, 6)
		AltPower:SetStatusBarTexture(TEXTURE)
		AltPower:SetStatusBarColor(0.15, 0.7, 0.1)
		AltPower:SetBackdrop(BACKDROP)
		AltPower:SetBackdropColor(0, 0, 0)
		AltPower:EnableMouse(true)
		AltPower.colorTexture = true
		self.AltPowerBar = AltPower

		local AltPowerBG = AltPower:CreateTexture(nil, 'BORDER')
		AltPowerBG:SetAllPoints()
		AltPowerBG:SetTexture(1/3, 1/3, 1/3)
skarie is offline   Reply With Quote
Old 05-21-13, 04:43 AM   #2
Rainrider
A Rage Talon Dragon Guard
Join Date: Nov 2008
Posts: 314
If you want it to show your player altpowerbar, you should parent it to the player frame. You could still position it wherever you want.
Rainrider is offline   Reply With Quote
Old 05-21-13, 06:19 PM   #3
skarie
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 37
Originally Posted by Rainrider View Post
If you want it to show your player altpowerbar, you should parent it to the player frame. You could still position it wherever you want.
I want to add altpowerbar to target frame (not player frame) because player frame already has a altpowerbar.

And since I added the codes inside the target frame section, self is indeed the target frame. I must have overlooked something obvious.
skarie is offline   Reply With Quote
Old 05-21-13, 08:31 PM   #4
Rainrider
A Rage Talon Dragon Guard
Join Date: Nov 2008
Posts: 314
By what you posted I can tell what you've added (and it seems right), but not where you've added it. Also, how do you test this? Does UnitAlternatePowerInfo("target") return anything? What is its hideFromOthers return?
Rainrider is offline   Reply With Quote
Old 05-21-13, 10:33 PM   #5
skarie
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 37
Originally Posted by Rainrider View Post
By what you posted I can tell what you've added (and it seems right), but not where you've added it. Also, how do you test this? Does UnitAlternatePowerInfo("target") return anything? What is its hideFromOthers return?
I test it on LFR stone guards and check on boss energy bar .

I added the codes in local = UnitSpecific = { ... and inside target = function(self)..end .. }

I am gonna try to test out UnitAlternatePowerInfo("target") and hideFromOthers tonite.
skarie is offline   Reply With Quote
Old 05-21-13, 11:36 PM   #6
nin
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 210
Not contributing much to the question but for testing maw of madness in twilight highlands is pretty good.
nin is offline   Reply With Quote
Old 05-22-13, 11:02 AM   #7
Rainrider
A Rage Talon Dragon Guard
Join Date: Nov 2008
Posts: 314
What nin suggested would work for testing if you edit the Toggler function in oUF/elements/altpowerbar.lua (line 128) to include unit == "target" in the condition. Remove this after done testing. This is needed because hideFromOthers is true in Maw of Madness and neither tagetframe.unit nor targetframe.realUnit are "player" when you target yourself.
Rainrider is offline   Reply With Quote
Old 05-22-13, 01:13 PM   #8
skarie
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 37
Originally Posted by Rainrider View Post
What nin suggested would work for testing if you edit the Toggler function in oUF/elements/altpowerbar.lua (line 128) to include unit == "target" in the condition. Remove this after done testing. This is needed because hideFromOthers is true in Maw of Madness and neither tagetframe.unit nor targetframe.realUnit are "player" when you target yourself.
Sweet, this works. Thanks Rainrider and Nin. However i dont think altpowerbar only supports player frame. What if I wanna add altpowerbar to boss frame, will I have to add unit == 'boss' to line 128 again?

This doesnt make sense to me.

Last edited by skarie : 05-22-13 at 02:33 PM.
skarie is offline   Reply With Quote
Old 05-22-13, 03:12 PM   #9
Rainrider
A Rage Talon Dragon Guard
Join Date: Nov 2008
Posts: 314
oUF's altpower element would show the bar for every unit where the 6th return of UnitAlternatePowerInfo(unit) - hideFromOthers - is nil. Only exception is the player, where it would be always shown if present. You could also display the altpowerbar instead of the power bar by setting self.Power.displayAltPower = true. In that case the 7th return of UnitAlternatePowerInfo(unit) - showOnRaid - should be true. That's the case for encounters like Atramedes. You are not bound to obey that though, but in that case you would have to write your own implementation of the altpowerbar element or use self.Power.Override.
Rainrider is offline   Reply With Quote
Reply

Go BackWoWInterface » Featured Projects » oUF (Otravi Unit Frames) » OUF_p3lim - Adding altpower

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