WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (http://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   OUF_p3lim - Adding altpower (http://www.wowinterface.com/forums/showthread.php?t=46495)

skarie 05-21-13 02:35 AM

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)


Rainrider 05-21-13 04:43 AM

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.

skarie 05-21-13 06:19 PM

Quote:

Originally Posted by Rainrider (Post 278345)
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.

Rainrider 05-21-13 08:31 PM

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?

skarie 05-21-13 10:33 PM

Quote:

Originally Posted by Rainrider (Post 278406)
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.

nin 05-21-13 11:36 PM

Not contributing much to the question but for testing maw of madness in twilight highlands is pretty good. :)

Rainrider 05-22-13 11:02 AM

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.

skarie 05-22-13 01:13 PM

Quote:

Originally Posted by Rainrider (Post 278445)
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.

Rainrider 05-22-13 03:12 PM

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.


All times are GMT -6. The time now is 02:16 AM.

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC