View Single Post
07/05/15, 02:58 AM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Here you go, here is a complete example. This example does "anticipate" the next tick (as I mentioned above) so it does not fall behind during the 2 second regen delay.

I just altered my Stamina Bar tutorial code to smooth out the status bar updates. It was a tutorial for beginners so the bar is pretty ugly but it updates very smoothly. You can find it on my dropbox here:
Circonians Stamina Bar Tutorial Addon (with Smooth Updates)

I added some comments about what I did & why, you really only need to worry about the file CirconianStaminaBar.lua, lines 15-68 are the part that update the status bar. This is from a tutorial I wrote so theres probably other comments in there too. If you try to replicate it & have problems or have trouble understanding some other part of the code look at the tutorial: Circonians Stamina Bar Tutorial

Also note I intentionally did not smooth out the drops/loss of stats. I agree to making it look nice, but I figured when you get hit for xxx dmg, that health is gone immediately so the bar should reflect that. Although you could easily alter the code to smooth out the stat losses as well.

Last edited by circonian : 07/05/15 at 03:47 AM.
  Reply With Quote