vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1  
2 if(CTLStats) then
3 CTLStats:Hide();
4 end
5  
6 CTLStats = CreateFrame("Frame", "UIParent");
7 CTLStats:SetAllPoints(UIParent);
8 CTLStats:SetFrameStrata("TOOLTIP");
9  
10 CTLStatsText = CTLStats:CreateFontString(nil,nil,"GameFontHighlightSmall");
11 CTLStatsText:SetPoint("TOPLEFT", CTLStats, 0, 0);
12  
13  
14 local lastsent = 0;
15 local lastbypass = 0;
16 local lasttime = GetTime();
17  
18 CTLStats:SetScript("OnUpdate", function()
19 local now = GetTime()
20  
21 if(now - lasttime > 1) then
22  
23 ChatThrottleLib:UpdateAvail(); -- NOTE THAT THIS NORMALLY DOES NOT GET CALLED PERIODICALLY. Disable this for final testing!
24  
25 local sent = 0;
26 for _,Prio in ChatThrottleLib.Prio do
27 sent = sent + Prio.nTotalSent;
28 end
29  
30 CTLStatsText:SetText(format("%4.0f cps via lib (%4.0f bytes avail), %4.0f cps bypassed lib",
31 (sent-lastsent) / (now-lasttime),
32 ChatThrottleLib.avail,
33 (ChatThrottleLib.nBypass-lastbypass) / (now-lasttime)
34 ));
35  
36 lasttime=now;
37 lastsent=sent;
38 lastbypass=ChatThrottleLib.nBypass;
39  
40 end
41  
42 if(ChatThrottleLib.bChoking) then
43 CTLStatsText:SetTextColor(1,0.2,0.2);
44 else
45 CTLStatsText:SetTextColor(0.9,0.9,1);
46 end
47  
48 end);