Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-24-10, 03:41 AM   #1
Pyrates
A Cliff Giant
 
Pyrates's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 77
Making an alternative power bar

Hey all I'm using a nice oUf layout that has a power bar already (yay ). I want to make an alternative one and switch between those two ingame (on shapeshift, I guess). I know how to make a power bar, so let's just say I have oUF_player.Power (the original working bar) and oUF_player.altpower (my newly constructed bar not in use). On login, I'd execute "oUF_player.oldpower = oUF_player.Power" to save the original bar in an independent variable. Now my idea would be to catch the shapeshift event and then as appropriate use the following code:

Code:
oUF_player.Power = oUF_player.altpower
oUF_player.oldpower:Hide()
On shifting back, I'd use

Code:
oUF_player.Power = oUF_player.oldpower
oUF_player.altpower:Hide()
I have the following questions now:
  • Does it work this way, or did I miss something?
  • What if I call this function in combat? I have no experience what one can do in combat, but of course I can protect the whole thing via InCombatLockdown(), but is it necessary?
  • Any good way to find out which one is the active power bar via code? Can I use something like "oUF_player.Power == oUF_player.oldpower" to check if the original power bar is active? Or what else should I do (thing that comes to my mind would be a global variable for that, or a local one of oUF_player, but that sounds kinda... constructed ^^).

Thanks for any help and pointers
__________________
" ... and the Vogon will do things to you that you wish you'd never been born, or, if you're a clearer minded thinker, that the Vogon had never been born."
  Reply With Quote
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Making an alternative power bar


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