Smooth Power Values (Digits)
I wasn't quite sure how to put what I wanted to ask into words, so I made a quick and dirty mock up video. I will recommend that you watch it at a higher resolution than the default 360p embedded resolution:
Video Is it possible to make the power value digits count 'up' and 'down' like in the video? If so, what would it take to accomplish that? Is this going to be a boatload of work? To be completely honest, I'm not entirely sure that I'd like this change, but if at all possible, I would like to see it in action on my screen while playing before I can truly make that call. As always, any help is appreciated. :) Thanks! EDIT: Apologies... the layout is oUF_Fail and here is the link. |
Set a OnValueChanged script handler on the power bar and update the text based on the value it receives.
|
Quote:
|
I really like that. Especially, because I currently use "numbers only" unit frames that work fine but could need some ooomph. Please share the solution. :)
|
I'd imagine something like this:
Code:
self.Power:HookScript("OnValueChanged", function(bar, value) |
Phanx's way is probably better but...
Code:
local text = lib.gen_fontstring(f.Health, cfg.font, 18, "OUTLINE") |
I can't figure out how to color the text to match the bar. Any ideas would be appreciated.
|
Quote:
Code:
local r, g, b = yourstatusbar:GetStatusBarColor() Code:
yourtext:SetTextColor(r, g, b) |
Thanks Dawn, unfortunately all that did was change the color from white to yellow but I think it is a step in the right direction.
|
I don't know where you put it and how you color said statusbar. I suppose it's class coloured?
|
Code:
self.Power:HookScript("OnValueChanged", function(bar, value) |
Thanks Phanx I'll try that when I get home from work.
|
Quote:
|
Awesome it works!!! Thank you all so much. There is no way I could have done it without you. I'm still such a noob when it comes to lua.
|
Would it be possible to incorporate this in a tag?
I'm currently trying to get my head around it, but can't really get to it. Thing is I don't use any bars and therefore no hp or pp functions at all, just tags. Code:
For instance, this is my health percent tag |
Two options.
Try frequent events first. http://wowprogramming.com/docs/event...EALTH_FREQUENT http://wowprogramming.com/docs/event...POWER_FREQUENT If that is not enough use the onUpdate function haste provides. It can be enabled via: Lua Code:
Hope that helps. |
My question is how to "incorporate" the "OnValueChanged" visual effect into a tag.
Since I only have self or a font string in my layout, no self.health or power to :HookScript. :) |
You don't. Your only option with the tag is to unconditionally update it many times per second.
Also, you could easily add a Power bar element to your frame, but give it no dimensions and/or points, thus making it invisible. The only way to run some code when a bar's value changes is to actually have a bar whose value is being changed. |
Thanks, that's what I was thinking. I was just hoping that I missed something. :(
|
Well you can create an invisible statusbar object and use the onValueChanged of that hidden element.
|
All times are GMT -6. The time now is 12:32 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI