Originally Posted by rodrick
I think you are misunderstanding. That OnUpdate is just a normal frame's OnUpdate and it's being used as a timer. Don't want to update the LDB display every OnUpdate as that's QUITE often and will certainly slowdown the client for such a simple amount of code. Basically that code runs every "frame" where frame is probably not quite as often as a screen redraw but quite quick nontheless.
That part is where it adds up the amount of time between calls and if it's not time yet returns . . . if it IS time on the other hand . . . zero out the elapsed and run the code.
It will probably help if I know what kind of LDB plugin you are attempting to make?
|
Starting with your final question, I'm trying to make a data feed to display the number of XP gains (calculated from the last gain gotten) to level. So, I know
when I need to update the LDB feed, so could I just add in ....
Just read your newer post. So, I'd just add in a new line to my OnEvent code that updates the dataobj.text var whenever it needs to be updated.
So my final code (for updating the feed) would end up being something like.
Code:
-- Called at OnEvent
function SelXP_OnEvent()
if ( event == "PLAYER_XP_UPDATE" ) then
-- getting & setting variables, doing math.
dataobj.text = string.format("%.1f Reps, Sel_Reps)
end
end
Correct?
I'll try it out in a little while, and tell you if it works.