WoWInterface SVN sStats

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 9 to Rev 10
    Reverse comparison

Rev 9 → Rev 10

trunk/sStats/modules/latency.lua
1,4 → 1,5
local lattimer = 0
local hlatency,wlatency,_
 
 
local sStats_lat, sStats_latText = sStats:CreateModule("lat")
9,10 → 10,55
sStats_lat:SetScript("OnUpdate", function(self, elapsed)
lattimer = lattimer + elapsed
if lattimer >= 1 then
local _,_,latency = GetNetStats()
sStats:SetModuleText(sStats_latText, latency, " ms")
_,_,hlatency,wlatency = GetNetStats()
sStats:SetModuleText(sStats_latText, wlatency, " ms")
lattimer = 0
end
end)
 
 
--tooltips
local tt = GameTooltip
local tips
sStats_lat:SetScript("OnEnter", function(self)
if sStatsPCDB.charSpec then
tips = sStatsPCDB.sStats_lat.tooltip
else
tips = sStatsDB.sStats_lat.tooltip
end
if tips then
tt:SetOwner(self, "ANCHOR_TOPRIGHT")
tt:AddLine("Latency Stats")
tt:AddDoubleLine("UI latency:", hlatency.." ms", 1,1,1,1,1,1)
tt:AddDoubleLine("World latency:", wlatency.." ms", 1,1,1,1,1,1)
GameTooltip:Show()
end
end)
sStats_lat:SetScript("OnLeave", function() if tips then tt:Hide() end end)
 
--adding custom options and saved variables
sStatsDB.sStats_lat.tooltip = sStatsDB.sStats_lat.tooltip or true
if sStatsPCDB.charSpec then
sStatsPCDB.sStats_lat.tooltip = sStatsPCDB.sStats_lat.tooltip or true
end
 
sStatsOptionsTable.args.sStats_lat.args.tooltip = {
name = "Show tooltip",
desc = "Display the tooltip for this module.",
type = "toggle",
get = function()
if sStatsPCDB.charSpec then
return sStatsPCDB.sStats_lat.tooltip
else
return sStatsDB.sStats_lat.tooltip
end
end,
set = function()
if sStatsPCDB.charSpec then
sStatsPCDB.sStats_lat.tooltip = not sStatsPCDB.sStats_lat.tooltip
else
sStatsDB.sStats_lat.tooltip = not sStatsDB.sStats_lat.tooltip
end
end,
}
 
end)
\ No newline at end of file
trunk/sStats/sStats.toc
1,7 → 1,7
## Interface: 40000
## Title: sStats
## Author: Seerah
## Version: 1.1.2
## Version: 1.2
## Notes: Modular framework for stat displays. Includes memory, latency, and fps
## SavedVariables: sStatsDB
## SavedVariablesPerCharacter: sStatsPCDB