Thread Tools Display Modes
03-16-11, 05:54 AM   #1
Pyrates
A Cliff Giant
 
Pyrates's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 77
PostUpdateAltPower?

I'd need some advice about the AltPowerBar I'm sorta thinking of for my bossframes. I want to make it the way RealUI does it for health: Just a line with an arrow below it, and the arrow moves along the line indicating the right number (I'll want to have the exakt number attached to the arrow, too).

So, I'm thinking to do it along those lines: Make a very small AltPowerBar, just single color background, and then single color "foreground" (is that a word?). Then I'd make a function PostUpdateAltPower so I can move the arrow. I'd try to use a tag for the text of the bar, but parent it to the arrow so it moves along with it.

Is that the right idea? I tried browsing github to find out about PostUpdateAltPower, but couldn't really find it, does it exist? I'd be grateful for any pointers to see if I'm on the right track

Side question: How could one test this bar? I realize I could use something like 'self.unit="player"' to test the frames themselves, but that wouldn't make the AltPowerBar of the unitframe show up, would it?

(e) Another side question: Is there a possibility to spawn the boss frames, but still have the blizzard ones? So I could test mine without loosing vital info during a raid.
__________________
" ... 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."

Last edited by Pyrates : 03-16-11 at 07:11 AM. Reason: Spelling
  Reply With Quote
03-16-11, 12:55 PM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Sounds correct. The post-update is define like most of them in oUF[1]

An easy way to test is with the plants vs ghouls quest in hillsbrad and in the maw of madness.

To have the default frames stay: modify oUFisableBlizzard() in blizzard.lua to not remove the boss frames (by commenting it out or whatever).

[1] https://github.com/haste/oUF/blob/ma...werbar.lua#L24
__________________
「貴方は1人じゃないよ」
  Reply With Quote
03-16-11, 04:02 PM   #3
Pyrates
A Cliff Giant
 
Pyrates's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 77
Thanks a lot

Now, do you have any suggestion how to test boss frames? I tried using

Code:
/script x = MyBossFrame1 x.hide = function() Show() end; x:Show() x.unit = "player"
But that kinda didn't work out, the AltPower didn't show up and change and things, although I'm pretty sure I made things correct (due to the fact that I c&p'ed things out of a working layoug, and the frame looks good, no errors...). Of course I could still have made an error, but how does everybody else test those things?
__________________
" ... 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
03-16-11, 04:09 PM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Just spawn a player frame with the boss frame style. Should be pretty easy to do, unless you are using the old if-mangled-single-style solution :P

There aren't really any easy to test boss units you can abuse. At least not that I know of.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
03-17-11, 04:05 AM   #5
Pyrates
A Cliff Giant
 
Pyrates's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 77
Hmm, that sounds a lot like I'd need to know what I'm talking about I'm learning by doing, copying together various codes and getting rid of errors... that's why I need test cases so badly

I don't know what's the old vs new solution. I have a function shared, I register a style with it, and then I call

Code:
boss[i] = oUF:Spawn("boss"..i, "MyBoss"..i)
The shared function doesn't test for the unit (it's only there to make boss frames), so I tried

Code:
oUF:Spawn("player", "SanUItest")
but that did nothing. What would I need to do here? I do have an ouf player frame already, do I need to disable that?

Again, thanks for any help If there are any resources I should be aware of, other than the wiki on github, I'd be glad if someone could point them out
__________________
" ... 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
03-17-11, 09:34 AM   #6
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You can spawn 30 player frames if you feel like it. oUF doesn't prevent it. It does sound like you have a single-style, and if it doesn't do any unit checking, then spawning a player frame should work just fine. As long as you anchor it with :SetPoint().

You'll have to paste your code if you want any further help. I can't really give you any more hints :P.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
03-17-11, 01:28 PM   #7
Pyrates
A Cliff Giant
 
Pyrates's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 77
Ok, thanks for your help. You can find the code here, hope you don't mind the https. It's probably pretty messy because I've been trying out stuff, the spawning things start at line 456. The boss frames seem to spawn ok (I posted above how I tested that), but not the additional player frame on line 467 (there's no error, the frame just doesn't appear).
__________________
" ... 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
03-17-11, 04:36 PM   #8
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Just got home, and heading to bed shortly, so I'll keep it short for now:

Your layout checks what unit it was called with (unit and unit:find("boss%d")), which prevents it from doing most of its stuff with the player frame. These checks are what prevent you from testing it with the player unit.

You could take a look at how Lily does it: https://github.com/haste/oUF_Lily/blob/master/lily.lua

The main difference is that each layout group has its own style, and it uses spawnHelper to change to the correct one. The gain you get with this is that you can test the unit specific styles with a different unit, by just manually changing the active style and spawning the frame.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
03-17-11, 04:53 PM   #9
Pyrates
A Cliff Giant
 
Pyrates's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 77
Originally Posted by haste View Post
Your layout checks what unit it was called with (unit and unit:find("boss%d")), which prevents it from doing most of its stuff with the player frame. These checks are what prevent you from testing it with the player unit.
Naa that's commented out

You could take a look at how Lily does it: https://github.com/haste/oUF_Lily/blob/master/lily.lua

The main difference is that each layout group has its own style, and it uses spawnHelper to change to the correct one. The gain you get with this is that you can test the unit specific styles with a different unit, by just manually changing the active style and spawning the frame.
Good call, I'll check that out. Sleep well
__________________
" ... 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
03-18-11, 02:23 PM   #10
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You still have some unit checks which aren't commented out.

The player frame isn't visible because you don't give it a size by the way. You just anchor it and that's it.

You might also be interested to know that there is a third argument sent to the style function, which is true when you can safely run combat locked functions like :SetSize().
__________________
「貴方は1人じゃないよ」
  Reply With Quote
03-18-11, 06:09 PM   #11
Pyrates
A Cliff Giant
 
Pyrates's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 77
Originally Posted by haste View Post
You still have some unit checks which aren't commented out.
D'oh, that's the problem with c&p

The player frame isn't visible because you don't give it a size by the way. You just anchor it and that's it.
Double d'oh

I've changed my codebase (working off ouf_bossbars now), but I could solve that spawning and testing thing, thanks a lot. Just out of curiosity, if I spawn the boss frames for the player, the altpowerbar doesn't show up at plants & zombies (to be precise, only for a very short time when leaving the 'vehicle'). Is that normal? Code would be here, I don't see anything that would make the apb not work for the player spawn.

You might also be interested to know that there is a third argument sent to the style function, which is true when you can safely run combat locked functions like :SetSize().
Hmm, I do have a related problem, but I don't see how I could solve it with this. I want to reposition the boss frames according to how many boss frames are shown. I thought about hooking the OnShow function and then see which others are shown to determine the position. Yet I don't think it will work, because I'm in combat at that point, and can't move frames, can I? Is that possible in any way?
__________________
" ... 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
03-18-11, 06:35 PM   #12
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Originally Posted by Pyrates View Post
I've changed my codebase (working off ouf_bossbars now), but I could solve that spawning and testing thing, thanks a lot. Just out of curiosity, if I spawn the boss frames for the player, the altpowerbar doesn't show up at plants & zombies (to be precise, only for a very short time when leaving the 'vehicle'). Is that normal? Code would be here, I don't see anything that would make the apb not work for the player spawn.
Problem here being.. Plants vs Zombies happens in a vehicle setting, which means the player frame is swapped with pet.

There's a discussion of this here: http://www.wowinterface.com/forums/s...ad.php?t=38714

Originally Posted by Pyrates View Post
Hmm, I do have a related problem, but I don't see how I could solve it with this. I want to reposition the boss frames according to how many boss frames are shown. I thought about hooking the OnShow function and then see which others are shown to determine the position. Yet I don't think it will work, because I'm in combat at that point, and can't move frames, can I? Is that possible in any way?
I believe you can do it through the secure system, but I'm not entirely sure.
You'd basically have to use a state drive and make it update based on the boss unitids.

Another issue which would arise is the fact that some fights use boss2 and boss3, but not boss1 (or some similar odd combination).

I won't really spend any time looking into this for you .
__________________
「貴方は1人じゃないよ」
  Reply With Quote
03-19-11, 05:21 AM   #13
Pyrates
A Cliff Giant
 
Pyrates's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 77
Originally Posted by haste View Post
Another issue which would arise is the fact that some fights use boss2 and boss3, but not boss1 (or some similar odd combination).
Oh my, that's pretty uncool. I'll probably just play with the placement I have right now and see if I like it... they're just bossframes after all

I won't really spend any time looking into this for you .
I certainly understand, I'll drop that for now as well. Thanks anyways for the great help
__________________
" ... 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) » PostUpdateAltPower?


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