Thread Tools Display Modes
07-15-16, 08:00 PM   #1
gwyd
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 10
Alternate UnitPower

How are we getting at alternate unit power as well as unit power (insanity + mana for shadow priest)?

I hadn't been paying a ton of attention and just realized that I needed to handle this.
  Reply With Quote
07-16-16, 03:15 AM   #2
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by gwyd View Post
How are we getting at alternate unit power as well as unit power (insanity + mana for shadow priest)?

I hadn't been paying a ton of attention and just realized that I needed to handle this.
In oUF it's called druidmana, name may be a bit misleading now, but previously only dudus had this feature.

BTW, if anyone needs latest version of oUF for Legion, you may use mine, I merged many p3lim's, Sticklord's and my PRs into it. I keep it up to date, cuz I use it too
__________________

Last edited by lightspark : 07-16-16 at 03:26 AM.
  Reply With Quote
07-16-16, 05:20 AM   #3
gwyd
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 10
Thanks. I've done the same thing merging the PRs.
  Reply With Quote
07-16-16, 03:30 PM   #4
Folji
A Flamescale Wyrmkin
 
Folji's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 136
Originally Posted by lightspark View Post
BTW, if anyone needs latest version of oUF for Legion, you may use mine, I merged many p3lim's, Sticklord's and my PRs into it. I keep it up to date, cuz I use it too
Ohh, cheers luv! I've been fretting a bit myself over what to do with oUF in terms of having my own UI ready for Legion, but this solves those worries rather nicely!
  Reply With Quote
07-16-16, 03:47 PM   #5
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by Folji View Post
Ohh, cheers luv! I've been fretting a bit myself over what to do with oUF in terms of having my own UI ready for Legion, but this solves those worries rather nicely!
Haha, you're welcome
__________________
  Reply With Quote
07-17-16, 05:13 PM   #6
gwyd
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 10
Does it make sense that the following always prints the additional power bar name for the spec being swapped from (not the one being swapped to) or am I doing something wrong?

Lua Code:
  1. self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", function(self)
  2.   print(ADDITIONAL_POWER_BAR_NAME)
  3. end)
  Reply With Quote
07-17-16, 10:31 PM   #7
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by gwyd View Post
Does it make sense that the following always prints the additional power bar name for the spec being swapped from (not the one being swapped to) or am I doing something wrong?

Lua Code:
  1. self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", function(self)
  2.   print(ADDITIONAL_POWER_BAR_NAME)
  3. end)
Wrong. There's only one name in ADDITIONAL_POWER_BAR_NAME and it's "MANA", cuz it's a constant. If you're interested in such things, you should always check related Blizz code first.
__________________

Last edited by lightspark : 07-17-16 at 10:38 PM.
  Reply With Quote
07-18-16, 10:29 PM   #8
badness
A Cliff Giant
 
badness's Avatar
Join Date: May 2010
Posts: 74
So if i use this latest version of oUF for Legion I don't have to change anything in my layout? Because I use oUF_Freeb
  Reply With Quote
07-19-16, 04:56 AM   #9
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by badness View Post
So if i use this latest version of oUF for Legion I don't have to change anything in my layout? Because I use oUF_Freeb
You may have to, we tried to keep everything as backward compatible as possible, but some things had to be changed. TBH, I'm not really sure right now, cuz too many changes were made.
__________________

Last edited by lightspark : 07-19-16 at 04:58 AM.
  Reply With Quote
07-19-16, 05:56 AM   #10
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by lightspark View Post
You may have to, we tried to keep everything as backward compatible as possible, but some things had to be changed. TBH, I'm not really sure right now, cuz too many changes were made.
Only a few callbacks/hooks were changed, there's a lot of additions though, mostly classicons class/spec support.

The most affected callback(s) is/are probably the one(s) for the runes element.

Edit: Oh, and the eclipse element was removed straight up.
  Reply With Quote
07-19-16, 06:06 AM   #11
gwyd
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 10
Originally Posted by lightspark View Post
Wrong. There's only one name in ADDITIONAL_POWER_BAR_NAME and it's "MANA", cuz it's a constant. If you're interested in such things, you should always check related Blizz code first.
You're right. Sorry. Confused myself. I was actually looking at UnitClass("player") which always returns the power type of the previous spec. It's not super hard to work around, just odd. Thanks for pointing me to the bliz code. That's pretty useful to have.
  Reply With Quote
07-21-16, 08:24 PM   #12
badness
A Cliff Giant
 
badness's Avatar
Join Date: May 2010
Posts: 74
Combo points for rogue doesn't update/show, only when I switch target it would show then it wouldn't update unless I switch to another target. Anything I can do to fix this?
  Reply With Quote
08-01-16, 05:54 PM   #13
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Originally Posted by badness View Post
Combo points for rogue doesn't update/show, only when I switch target it would show then it wouldn't update unless I switch to another target. Anything I can do to fix this?
Use the ClassIcons implementation. I bet you are using the old CPoints ?

Regarding DruidPower, have any of you use it recently on your Frames?
I have mine working fine except for the fact that it doesn't show for Druids. Which is a bit ironic.

Another thing, by default the element should disappear if full mana, correct? At least I think it is how it used to work. Not seeing this too.

EDIT - Been looking at druidmana.lua and it seems there is no inbuilt functionality to hide when full mana. And about it not displaying for Druid it only works for pre-Legion. I don't play much druid nowadays or nothing at all, but is is not necessary anymore for Druid players? I guess they don't use much mana then.

Just for reference if someone wants to do the same (hide on full mana). It is very simple, just call the PostUpdate hook.

Lua Code:
  1. -- Post Update
  2. DruidMana.PostUpdate = druidManaPostUpdate

Then call something like:

Lua Code:
  1. -- Druid Mana post update callback
  2. local druidManaPostUpdate = function(self, unit, cur, max)
  3.   -- Hide DruidMana if full
  4.   if(cur == max) then
  5.     self:Hide()
  6.   else
  7.     self:Show()
  8.   end
  9. end
__________________
My oUF Layout: oUF Lumen

Last edited by neverg : 08-02-16 at 10:48 AM.
  Reply With Quote
08-02-16, 10:56 PM   #14
Azgaurd
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 4
It is not really needed for druids anymore since it does not cost mana to shape shift. Even the proc to cast healing touch does not cost mana.
  Reply With Quote
08-03-16, 04:38 AM   #15
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by neverg View Post
Use the ClassIcons implementation. I bet you are using the old CPoints ?

Regarding DruidPower, have any of you use it recently on your Frames?
I have mine working fine except for the fact that it doesn't show for Druids. Which is a bit ironic.

Another thing, by default the element should disappear if full mana, correct? At least I think it is how it used to work. Not seeing this too.

EDIT - Been looking at druidmana.lua and it seems there is no inbuilt functionality to hide when full mana. And about it not displaying for Druid it only works for pre-Legion. I don't play much druid nowadays or nothing at all, but is is not necessary anymore for Druid players? I guess they don't use much mana then.

Just for reference if someone wants to do the same (hide on full mana). It is very simple, just call the PostUpdate hook.

Lua Code:
  1. -- Post Update
  2. DruidMana.PostUpdate = druidManaPostUpdate

Then call something like:

Lua Code:
  1. -- Druid Mana post update callback
  2. local druidManaPostUpdate = function(self, unit, cur, max)
  3.   -- Hide DruidMana if full
  4.   if(cur == max) then
  5.     self:Hide()
  6.   else
  7.     self:Show()
  8.   end
  9. end
https://github.com/haste/oUF/pull/268

The element is shown the same as the blizzard one, it'll show full stop if mana is not your primary resource.

https://github.com/tekkub/wow-ui-sou...ar.lua#L69-L79

Originally Posted by Azgaurd View Post
It is not really needed for druids anymore since it does not cost mana to shape shift. Even the proc to cast healing touch does not cost mana.
Casting HT a few times will drain all your mana though.
  Reply With Quote
08-03-16, 06:09 PM   #16
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Forgot to test on a Moonkin Druid!
Again Druid and DK are probably the classes I know less about now.

Thanks for that.
__________________
My oUF Layout: oUF Lumen
  Reply With Quote
08-03-16, 07:17 PM   #17
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
I added overrides to the element so that layouts can add more if they wanted to, like for cat and bear forms (energy and rage) as well.

Last edited by p3lim : 08-03-16 at 07:23 PM.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Alternate UnitPower

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