/
end |
end |
local dataobj, elapsed = LibStub:GetLibrary('LibDataBroker-1.1'):NewDataObject('Stats', {text = '2.0 MiB', icon = [=[Interface\AddOns\pStats\icon]=]}), 0.5 |
CreateFrame('Frame'):SetScript('OnUpdate', function(self, al) |
elapsed = elapsed + al |
if(elapsed > 0.5) then |
dataobj.text = formats(gcinfo()) |
elapsed = 0 |
end |
end) |
function dataobj.OnLeave() |
GameTooltip:SetClampedToScreen(true) |
GameTooltip:Hide() |
end |
function dataobj.OnEnter(self) |
local function OnEnter(self) |
local db = pStatsDB |
local r, g, b = unpack(db.colors) |
local down, up, latency = GetNetStats() |
GameTooltip:Show() |
end |
local function collect(self) |
end |
function dataobj.OnClick(self, button) |
local function OnClick(self, button) |
if(button == "RightButton") then |
local collected = collectgarbage('count') |
collectgarbage('collect') |
dataobj.OnEnter(self) |
OnEnter(self) |
GameTooltip:AddLine('\n') |
GameTooltip:AddDoubleLine('Garbage Collected:', formats(collected - collectgarbage('count'))) |
GameTooltip:Show() |
else |
if(self:GetName() == 'MiniMapTracking' or self:GetName() == 'MiniMapTrackingButton') then |
ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, 'MiniMapTracking', 0, self:GetHeight()) |
else |
InterfaceOptionsFrame_OpenToFrame('pStats') |
end |
ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, 'MiniMapTracking', 0, self:GetHeight()) |
GameTooltip:Hide() |
end |
end |
end |
if(select(4, GetBuildInfo()) >= 3e4) then |
MiniMapTrackingButton:EnableMouseWheel() |
MiniMapTrackingButton:EnableMouseWheel(true) |
MiniMapTrackingButton:RegisterForClicks('AnyUp') |
MiniMapTrackingButton:SetScript('OnMouseWheel', OnMouseWheel) |
MiniMapTrackingButton:SetScript('OnClick', dataobj.OnClick) |
MiniMapTrackingButton:SetScript('OnEnter', dataobj.OnEnter) |
MiniMapTrackingButton:SetScript('OnLeave', dataobj.OnLeave) |
MiniMapTrackingButton:SetScript('OnClick', OnClick) |
MiniMapTrackingButton:SetScript('OnEnter', OnEnter) |
MiniMapTrackingButton:SetScript('OnLeave', function() |
GameTooltip:SetClampedToScreen(true) |
GameTooltip:Hide() |
end) |
else |
MiniMapTracking:EnableMouseWheel() |
MiniMapTracking:EnableMouseWheel(true) |
MiniMapTracking:SetScript('OnMouseWheel', OnMouseWheel) |
MiniMapTracking:SetScript('OnMouseUp', dataobj.OnClick) |
MiniMapTracking:SetScript('OnEnter', dataobj.OnEnter) |
MiniMapTracking:SetScript('OnLeave', dataobj.OnLeave) |
MiniMapTracking:SetScript('OnMouseUp', OnClick) |
MiniMapTracking:SetScript('OnEnter', OnEnter) |
MiniMapTracking:SetScript('OnLeave', function() |
GameTooltip:SetClampedToScreen(true) |
GameTooltip:Hide() |
end) |
end |
## Author: p3lim |
## Version: 20400.wowi:revision |
## Title: |cffff6000p|rStats |
## Notes: Replaces the tooltip on MinimapTracking with a more informative one. Also supports LDB |
## OptionalDeps: LibStub, CallbackHandler-1.0, LibSimpleOptions-1.0, LibDataBroker-1.1 |
## Notes: Replaces the tooltip on MinimapTracking with a more informative one |
## OptionalDeps: LibStub, LibSimpleOptions-1.0 |
## SavedVariablesPerCharacter: pStatsDB |
Libs\LibStub.lua |
Libs\CallbackHandler-1.0.lua |
Libs\LibSimpleOptions-1.0.lua |
Libs\LibDataBroker-1.1.lua |
LibSimpleOptions-1.0\LibStub\LibStub.lua |
LibSimpleOptions-1.0\LibSimpleOptions-1.0.lua |
pStats.lua |
pStatsConfig.lua |