PDA

View Full Version : Average Time to Load Tooltip


dinrogue
07-06-2007, 03:29 AM
So, as you probably all know by know, I'm working on my mod still. One last thing that is bugging me, is that it seems to take about a minute to two minutes for it to calculate the durability.

I'm using an OnUpdate method to wait until the Durability information is available in the tooltip to calculate it for the first time, before handing it off to the OnEvent method.

function RogueReadyTest_OnUpdate(elapsed)
this.TimeSinceLastUpdate = this.TimeSinceLastUpdate + elapsed;

if (this.TimeSinceLastUpdate > RR_UpdateInterval) then
out("t = "..this.TimeSinceLastUpdate);

for i=1,18 do
local hasItem, hasCooldown, repairCost = GameTooltip:SetInventoryItem("player", i);
out(""..GameTooltip:NumLines().."")
if (GameTooltip:NumLines() > 0) then
RogueReadyTest_GeneralScripts:Hide()
if (RR_Debug=="On") then
out("Disabling RR update function. Dura/broken count should now be updated.");
end
RR_DuraPercent, RR_Broken=RogueReadyTest_getDurability()
RogueReadyTest_setDuraPercent()
RogueReadyTest_setNumBroken()
break;
end
end
this.TimeSinceLastUpdate = 0;
end
end


Everytime I log into the game (even when this addon is only one loaded) it prints out the time 3-10 times before eventually calculating the durability and ending the method, which I'm pretty sure is to long. While I'm waiting for it to calculate, I can open my character screen and view the durability in the tooltip. In this time, I've seen both FuBar and Titan durability mods get the value. So, what I'm wondering is, is the delay caused by the game itself, or is my OnUpdate method wrong? It's had me stumped for a while.

Thanks.