Files
pfUI/skins/blizzard/trainer.lua
T
Brues 3fe072c594 Route hooksecurefunc callers through pfUI.hooksecurefunc; global belongs to ClassicAPI
pfUI's Lua hooksecurefunc lived in pfUI.env and shadowed ClassicAPI's C
global for all pfUI code. Replace it with a thin pfUI.hooksecurefunc shim
that keeps the missing-target no-op our call sites rely on (ClassicAPI
errors on a nil target) and delegates the actual hook to _G.hooksecurefunc.

Migrated all 70 internal call sites (modules/libs/skins) to
pfUI.hooksecurefunc; bare hooksecurefunc now resolves to ClassicAPI's C
version everywhere. Dropped the unused prepend path and the orphaned
pfUI.hooks table.
2026-07-05 14:58:26 -05:00

52 lines
1.9 KiB
Lua

pfUI:RegisterSkin("Trainer", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
HookAddonOrVariable("Blizzard_TrainerUI", function()
StripTextures(ClassTrainerFrame)
CreateBackdrop(ClassTrainerFrame, nil, nil, .75)
CreateBackdropShadow(ClassTrainerFrame)
ClassTrainerFrame.backdrop:SetPoint("TOPLEFT", 10, -10)
ClassTrainerFrame.backdrop:SetPoint("BOTTOMRIGHT", -32, 72)
ClassTrainerFrame:SetHitRectInsets(10,32,10,72)
EnableMovable(ClassTrainerFrame)
SkinCloseButton(ClassTrainerFrameCloseButton, ClassTrainerFrame.backdrop, -6, -6)
ClassTrainerFrame:DisableDrawLayer("BACKGROUND")
ClassTrainerNameText:ClearAllPoints()
ClassTrainerNameText:SetPoint("TOP", ClassTrainerFrame.backdrop, "TOP", 0, -10)
ClassTrainerGreetingText:ClearAllPoints()
ClassTrainerGreetingText:SetPoint("TOP", ClassTrainerNameText, "BOTTOM", 0, -4)
SkinButton(ClassTrainerCancelButton)
SkinButton(ClassTrainerTrainButton)
ClassTrainerTrainButton:ClearAllPoints()
ClassTrainerTrainButton:SetPoint("RIGHT", ClassTrainerCancelButton, "LEFT", -2*bpad, 0)
SkinDropDown(ClassTrainerFrameFilterDropDown)
StripTextures(ClassTrainerListScrollFrame)
SkinScrollbar(ClassTrainerListScrollFrameScrollBar)
StripTextures(ClassTrainerDetailScrollFrame)
SkinScrollbar(ClassTrainerDetailScrollFrameScrollBar)
StripTextures(ClassTrainerSkillIcon)
SkinButton(ClassTrainerSkillIcon, nil, nil, nil, nil, true)
pfUI.hooksecurefunc("ClassTrainer_SetSelection", function()
HandleIcon(ClassTrainerSkillIcon, ClassTrainerSkillIcon:GetNormalTexture())
end)
StripTextures(ClassTrainerExpandButtonFrame)
StripTextures(ClassTrainerCollapseAllButton)
SkinCollapseButton(ClassTrainerCollapseAllButton, true)
for i = 1, CLASS_TRAINER_SKILLS_DISPLAYED do
SkinCollapseButton(_G["ClassTrainerSkill"..i])
end
end)
end)