mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-30 07:30:52 +00:00
Refresh the FPS & Lag panel tooltip while it is shown
The tooltip was built once on enter, so its memory, network and addon figures stayed at the values from that moment. The widget's one-second ticker now rebuilds it while the panel still owns GameTooltip. The tooltip takes its owner as self, not this, so the ticker can call it.
This commit is contained in:
+8
-3
@@ -105,11 +105,12 @@ pfUI:RegisterModule("panel", function()
|
||||
|
||||
do -- FPS & Lag
|
||||
local widget = CreateFrame("Frame", "pfPanelWidgetLag", UIParent)
|
||||
local lag, fps, laghex, fpshex, _
|
||||
widget.Tooltip = function()
|
||||
local lag, fps, laghex, fpshex, owner, _
|
||||
widget.Tooltip = function(self)
|
||||
owner = self
|
||||
local active = 0
|
||||
GameTooltip:ClearLines()
|
||||
GameTooltip_SetDefaultAnchor(GameTooltip, this)
|
||||
GameTooltip_SetDefaultAnchor(GameTooltip, self)
|
||||
GameTooltip:AddLine("|cff555555" .. T["Systeminfo"])
|
||||
for i=1, GetNumAddOns() do
|
||||
if IsAddOnLoaded(i) then
|
||||
@@ -202,6 +203,10 @@ pfUI:RegisterModule("panel", function()
|
||||
end
|
||||
|
||||
pfUI.panel:OutputPanel("fps", fps .. " " .. T["fps"] .. " & " .. lag .. " " .. T["ms"], widget.Tooltip, widget.Click)
|
||||
|
||||
if owner and GameTooltip:IsOwned(owner) then
|
||||
widget.Tooltip(owner)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user