WoWInterface SVN pStats

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 28 to Rev 27
    Reverse comparison

Rev 28 → Rev 27

trunk/pStats/pStats.lua
1,17 → 1,22
--[[
 
Copyright (c) 2009, Adrian L Lange
All rights reserved.
 
You're allowed to use this addon, free of monetary charge,
but you are not allowed to modify, alter, or redistribute
this addon without express, written permission of the author.
 
--]]
 
local function classColors()
local function GetClassColors()
local _, enClass = UnitClass('player')
local colorTable = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[enClass] or RAID_CLASS_COLORS[enClass]
 
return colorTable.r, colorTable.g, colorTable.b
end
 
local function formatValue(value)
local function ReformatValue(value)
if(value > 999) then
return string.format('%.1f MiB', value / 1024)
else
19,14 → 24,14
end
end
 
local function onEnter(self)
local r, g, b = classColors()
local function OnEnter(self)
local r, g, b = GetClassColors()
local _, _, latency = GetNetStats()
local addons, total = {}, 0
 
GameTooltip:SetOwner(self, 'ANCHOR_BOTTOMLEFT', 0, self:GetHeight())
GameTooltip:ClearLines()
GameTooltip:AddDoubleLine(string.format('%01d fps', GetFramerate()), string.format('%d ms', latency), r, g, b, r, g, b)
GameTooltip:AddDoubleLine(string.format('%.1f fps', GetFramerate()), string.format('%d ms', latency), r, g, b, r, g, b)
GameTooltip:AddLine('\n')
 
UpdateAddOnMemoryUsage()
42,15 → 47,23
table.sort(addons, function(a,b) return a[2] > b[2] end)
 
for key, value in next, addons do
GameTooltip:AddDoubleLine(value[1], formatValue(value[2]), 1, 1, 1)
GameTooltip:AddDoubleLine(value[1], ReformatValue(value[2]), 1, 1, 1)
end
 
GameTooltip:AddLine('\n')
GameTooltip:AddDoubleLine('User AddOn memory usage:', formatValue(total), r, g, b, r, g, b)
GameTooltip:AddDoubleLine('Default UI memory usage:', formatValue(gcinfo() - total), r, g, b, r, g, b)
GameTooltip:AddDoubleLine('Total memory usage:', formatValue(gcinfo()), r, g, b, r, g, b)
GameTooltip:AddDoubleLine('User AddOn memory usage:', ReformatValue(total), r, g, b, r, g, b)
GameTooltip:AddDoubleLine('Default UI memory usage:', ReformatValue(gcinfo() - total), r, g, b, r, g, b)
GameTooltip:AddDoubleLine('Total memory usage:', ReformatValue(gcinfo()), r, g, b, r, g, b)
GameTooltip:Show()
end
 
MiniMapTrackingButton:HookScript('OnClick', GameTooltip_Hide)
MiniMapTrackingButton:SetScript('OnEnter', onEnter)
\ No newline at end of file +local function OnClick(self) + if(GameTooltip:GetOwner() == self) then + GameTooltip:Hide() + end + + ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, 'MiniMapTracking') +end + +MiniMapTrackingButton:SetScript('OnClick', OnClick) +MiniMapTrackingButton:SetScript('OnEnter', OnEnter) \ No newline at end of file