Files
pfUI/skins/blizzard/keybindings.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

43 lines
1.5 KiB
Lua

pfUI:RegisterSkin("KeyBindings", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
HookAddon("Blizzard_BindingUI", function()
StripTextures(KeyBindingFrame)
CreateBackdrop(KeyBindingFrame, nil, nil, .75)
CreateBackdropShadow(KeyBindingFrame)
KeyBindingFrame.backdrop:SetPoint("TOPLEFT", 2, 10)
KeyBindingFrame.backdrop:SetPoint("BOTTOMRIGHT", -42, 10)
KeyBindingFrame:SetHitRectInsets(2,42,10,10)
EnableMovable(KeyBindingFrame)
SkinScrollbar(KeyBindingFrameScrollFrameScrollBar)
SkinCheckbox(KeyBindingFrameCharacterButton)
SkinButton(KeyBindingFrameDefaultButton)
SkinButton(KeyBindingFrameCancelButton)
SkinButton(KeyBindingFrameOkayButton)
SkinButton(KeyBindingFrameOkayButton)
KeyBindingFrameOkayButton:ClearAllPoints()
KeyBindingFrameOkayButton:SetPoint("RIGHT", KeyBindingFrameCancelButton, "LEFT", -2*bpad, 0)
SkinButton(KeyBindingFrameUnbindButton)
SkinButton(KeyBindingFrameUnbindButton)
KeyBindingFrameUnbindButton:ClearAllPoints()
KeyBindingFrameUnbindButton:SetPoint("RIGHT", KeyBindingFrameOkayButton, "LEFT", -2*bpad, 0)
for key = 1, KEY_BINDINGS_DISPLAYED do
for btn = 1, 2 do
local button = _G["KeyBindingFrameBinding"..key.."Key"..btn.."Button"]
StripTextures(button)
SkinButton(button)
button:SetScript("OnMouseDown", nop)
button:SetScript("OnMouseUp", nop)
end
end
end)
end)