Quantcast WoWInterface - View Single Post - 2 Script Questions
View Single Post
01-06-13, 10:43 PM   #2
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,603
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.
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote