View Single Post
01-06-13, 10:43 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
1. In the Lua file you linked, searching for "GetXPExhaustion" -- the API function that tells you how much rested XP you have -- quickly reveals the Lua function the default UI calls to update the bar, "ExhaustionTick_OnEvent". Looking at the contents of this function, it appears that the rest bar is named named "ExhaustionLevelFillBar". Looking in the corresponding XML file reveals that "ExhaustionLevelFillBar", is actually a texture, not a statusbar, so it will have SetWidth and SetHeight methods, but not SetValue or other frame/statusbar methods.

2. I'm not sure what you mean by "make it not generate as much memory usage". The tooltip just shows you how much memory your addons are using. It doesn't "generate" any memory. If you're seeing your tooltip addon occupy increasing amounts of memory, it's probably because you're generating a new table on every update, which is very expensive and wasteful. You should only create the "topAddOns" table once, outside of the "UpdateTooltip" method. Since the number of table entries (NUM_ADDONS_TO_DISPLAY) never changes you don't even need to clear the table between uses; you can just overwrite the values like you're already doing.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote