Files
pfUI/skins/blizzard/readycheck.lua
T
Brues b64ae7dd53 Replace HookAddonOrVariable with an EventUtil-based HookAddon
The polling lurker frame is gone. HookAddon gates on
C_AddOns.DoesAddOnExist, waits for PLAYER_LOGIN with
EventUtil.ContinueOnPlayerLogin, then runs on
EventUtil.ContinueOnAddOnLoaded. Addons loaded at startup still hook
only after every pfUI module and skin exists and after the addon's
own VARIABLES_LOADED setup. Load-on-demand addons still hook on their
ADDON_LOADED.

The "or variable" form is gone. Callers that passed a global now pass
the addon that defines it: TheoryCraft, SuperMacro, DPSMate and
Turtle_GroupUI. DPSMate names its windows from its settings, so its
hook now checks for DPSMate_DPSMate itself, as the variable lookup
used to. eqcompare's Guda check uses HookAddon too.
2026-10-31 00:28:30 -05:00

47 lines
1.7 KiB
Lua

pfUI:RegisterSkin("Readycheck", function ()
HookAddon("Blizzard_RaidUI", function()
StripTextures(ReadyCheckFrame, true)
CreateBackdrop(ReadyCheckFrame, nil, nil, .75)
CreateBackdropShadow(ReadyCheckFrame)
SkinButton(ReadyCheckFrameYesButton)
ReadyCheckFrameYesButton:ClearAllPoints()
ReadyCheckFrameYesButton:SetPoint("RIGHT", ReadyCheckFrame, "BOTTOM", -8, 24)
SkinButton(ReadyCheckFrameNoButton)
ReadyCheckFrameNoButton:ClearAllPoints()
ReadyCheckFrameNoButton:SetPoint("LEFT", ReadyCheckFrame, "BOTTOM", 8, 24)
ReadyCheckFrameText:ClearAllPoints()
ReadyCheckFrameText:SetPoint("TOP", ReadyCheckFrame, "TOP", 0, -12)
local frame = CreateFrame("Button", nil, ReadyCheckFrame)
frame:SetPoint("TOP", ReadyCheckFrameText, "BOTTOM", 0, -6)
frame:SetSize(220, 10)
frame.bar = CreateFrame("StatusBar", "ReadyCheckFrameStatusBar", ReadyCheckFrame)
frame.bar:SetStatusBarTexture(pfUI.media["img:bar"])
frame.bar:SetAllPoints(frame)
frame.bar.text = frame.bar:CreateFontString("Status", "DIALOG", "GameFontNormal")
frame.bar.text:SetFontObject(GameFontWhite)
frame.bar.text:SetFont(pfUI.font_default, 12, "OUTLINE")
frame.bar.text:SetPoint("CENTER")
local max
hooksecurefunc("ShowReadyCheck", function()
max = ReadyCheckFrame.timer
frame.bar:SetMinMaxValues(0, max)
end)
hooksecurefunc("ReadyCheck_OnUpdate", function()
if not ReadyCheckFrame.timer then return end
local perc = ReadyCheckFrame.timer/max
frame.bar:SetStatusBarColor(GetColorGradient(perc))
frame.bar:SetValue(ReadyCheckFrame.timer)
frame.bar.text:SetText(round(ReadyCheckFrame.timer, 2))
end)
end)
end)