diff --git a/api/api.lua b/api/api.lua index 539b1f80..fbbf9336 100644 --- a/api/api.lua +++ b/api/api.lua @@ -551,6 +551,12 @@ function HookScript(f, script, func) f:HookScript(script, func) end +function hooksecurefunc(tbl, name, func) + if type(tbl) == "string" then tbl, name, func = _G, tbl, name end + if not tbl or type(tbl[name]) ~= "function" then return end + return _G.hooksecurefunc(tbl, name, func) +end + -- [ HookAddonOrVariable ] -- Sets a function to be called automatically once an addon gets loaded -- 'addon' [string] addon or variable name diff --git a/compat/vanilla.lua b/compat/vanilla.lua index 001812ec..0e2dc39f 100644 --- a/compat/vanilla.lua +++ b/compat/vanilla.lua @@ -28,17 +28,6 @@ ACTIONBAR_SECURE_TEMPLATE_BUTTON = nil UNITFRAME_SECURE_TEMPLATE = nil --[[ Vanilla API Extensions ]]-- --- Safe post-hook helper. The global `hooksecurefunc` belongs to ClassicAPI --- (its C implementation); this wrapper only adds pfUI's missing-target guard: --- ClassicAPI errors when target[name] isn't a function, whereas a lot of our --- call sites hook optional/late-loaded frames and rely on a silent no-op. --- Normalizes the string form, skips when the target is absent, then delegates --- to the C version (uncapped args, callback-pcall, taint parity). -function pfUI.hooksecurefunc(tbl, name, func) - if type(tbl) == "string" then tbl, name, func = _G, tbl, name end - if not tbl or type(tbl[name]) ~= "function" then return end - return _G.hooksecurefunc(tbl, name, func) -end do -- GetItemInfo local name, link, rarity, minlevel, itype, isubtype, stack diff --git a/libs/libpredict.lua b/libs/libpredict.lua index 5edcf897..98af4d37 100644 --- a/libs/libpredict.lua +++ b/libs/libpredict.lua @@ -897,7 +897,7 @@ local INSTANT_HOT_COOLDOWN = 1.0 -- 1 Sekunde Cooldown (GCD ist 1.5s) local pendingHots = {} -- Gather Data by User Actions -pfUI.hooksecurefunc("CastSpell", function(id, bookType) +hooksecurefunc("CastSpell", function(id, bookType) if not libpredict.sender.enabled then return end local effect, rank = libspell.GetSpellInfo(id, bookType) if not effect then return end @@ -950,7 +950,7 @@ pfUI.hooksecurefunc("CastSpell", function(id, bookType) end end) -pfUI.hooksecurefunc("CastSpellByName", function(effect, target) +hooksecurefunc("CastSpellByName", function(effect, target) if not libpredict.sender.enabled then return end local effect, rank = libspell.GetSpellInfo(effect) if not effect then return end @@ -1014,7 +1014,7 @@ pfUI.hooksecurefunc("CastSpellByName", function(effect, target) end end) -pfUI.hooksecurefunc("UseAction", function(slot, target, selfcast) +hooksecurefunc("UseAction", function(slot, target, selfcast) if not libpredict.sender.enabled then return end if not IsCurrentAction(slot) then return end local kind, id = GetActionInfo(slot) diff --git a/libs/libtooltip.lua b/libs/libtooltip.lua index 9ca41fbe..86dec833 100644 --- a/libs/libtooltip.lua +++ b/libs/libtooltip.lua @@ -54,6 +54,6 @@ end pfUI.api.libtooltip = libtooltip -pfUI.hooksecurefunc(GameTooltip, "SetBagItem", function(self, container, slot) +hooksecurefunc(GameTooltip, "SetBagItem", function(self, container, slot) _, libtooltip.itemCount = GetContainerItemInfo(container, slot) end) diff --git a/libs/libtotem.lua b/libs/libtotem.lua index edad79e5..4652e40e 100644 --- a/libs/libtotem.lua +++ b/libs/libtotem.lua @@ -241,14 +241,14 @@ pfUI.libdebuff_spell_go_hooks["libtotem"] = function(spellId) end -- Hook CastSpellByName to store pending name/icon per slot -pfUI.hooksecurefunc("CastSpellByName", function(effect, target) +hooksecurefunc("CastSpellByName", function(effect, target) local name, rank, icon, _, _, _, spellId = libspell.GetSpellInfo(effect) if not name then return end libtotem:CheckAddQueue(name, rank, icon, spellId) end) -- Hook CastSpell to store pending name/icon per slot -pfUI.hooksecurefunc("CastSpell", function(id, bookType) +hooksecurefunc("CastSpell", function(id, bookType) if not id or not bookType then return end if bookType ~= BOOKTYPE_SPELL and bookType ~= BOOKTYPE_PET then return end local name, rank, icon, _, _, _, spellId = libspell.GetSpellInfo(id, bookType) @@ -259,7 +259,7 @@ end) -- Hook UseAction. GetActionInfo + GetMacroSpell give us the spellID -- directly for both spell-action and macro-action slots, so the -- tooltip-scan fallback (and the "no spellId available" caveat) goes away. -pfUI.hooksecurefunc("UseAction", function(slot, target, selfcast) +hooksecurefunc("UseAction", function(slot, target, selfcast) if not IsCurrentAction(slot) then return end local kind, id = GetActionInfo(slot) local name, rank, spellID diff --git a/modules/castbar.lua b/modules/castbar.lua index f93274d7..283c8515 100644 --- a/modules/castbar.lua +++ b/modules/castbar.lua @@ -490,7 +490,7 @@ pfUI:RegisterModule("castbar", function () -- (the config knob is read at event time so toggling takes effect on the -- next craft without a /reload). DoTradeSkill is synchronous; the server -- roundtrip to SPELLCAST_START gives us plenty of time after this hook. - pfUI.hooksecurefunc("DoTradeSkill", function(index, num) + hooksecurefunc("DoTradeSkill", function(index, num) if pfUI.castbar.player then pfUI.castbar.player.pendingTradeskillCount = tonumber(num) or 1 end diff --git a/modules/chat.lua b/modules/chat.lua index a493ac0b..3987ef8f 100644 --- a/modules/chat.lua +++ b/modules/chat.lua @@ -24,7 +24,7 @@ pfUI:RegisterModule("chat", function () end end - pfUI.hooksecurefunc("UnitPopup_OnClick", function(self) + hooksecurefunc("UnitPopup_OnClick", function(self) if this.value == "IGNORE_PLAYER" then AddIgnore(_G[UIDROPDOWNMENU_INIT_MENU].name) end @@ -449,7 +449,7 @@ pfUI:RegisterModule("chat", function () end end - pfUI.hooksecurefunc("FCF_SaveDock", pfUI.chat.RefreshChat) + hooksecurefunc("FCF_SaveDock", pfUI.chat.RefreshChat) if C.chat.global.tabmouse == "1" then pfUI.chat.mouseovertab = CreateFrame("Frame") diff --git a/modules/cooldown.lua b/modules/cooldown.lua index 8796d4c6..063beba3 100644 --- a/modules/cooldown.lua +++ b/modules/cooldown.lua @@ -136,5 +136,5 @@ pfUI:RegisterModule("cooldown", function () -- vanilla does not have a cooldown frame type, so we hook the -- regular SetTimer function that each one is calling. - pfUI.hooksecurefunc("CooldownFrame_SetTimer", SetCooldown) + hooksecurefunc("CooldownFrame_SetTimer", SetCooldown) end) \ No newline at end of file diff --git a/modules/eqcompare.lua b/modules/eqcompare.lua index 27e9e980..f10c595a 100644 --- a/modules/eqcompare.lua +++ b/modules/eqcompare.lua @@ -140,7 +140,7 @@ pfUI:RegisterModule("eqcompare", function () local function HookTooltip(tooltip) for setter, getter in pairs(TooltipHooks) do - pfUI.hooksecurefunc(tooltip, setter, makeHook(getter)) + hooksecurefunc(tooltip, setter, makeHook(getter)) end end diff --git a/modules/friends.lua b/modules/friends.lua index 55d0cd53..3a131904 100644 --- a/modules/friends.lua +++ b/modules/friends.lua @@ -150,7 +150,7 @@ pfUI:RegisterSkin("Friends", function () end -- set positions - pfUI.hooksecurefunc("WhoList_Update", function() + hooksecurefunc("WhoList_Update", function() for i = 1, WHOS_TO_DISPLAY do local level = _G["WhoFrameButton"..i.."Level"] level:ClearAllPoints() @@ -231,7 +231,7 @@ pfUI:RegisterSkin("Friends", function () end -- set positions - pfUI.hooksecurefunc("GuildStatus_Update", function() + hooksecurefunc("GuildStatus_Update", function() for i = 1, GUILDMEMBERS_TO_DISPLAY do local level = _G["GuildFrameButton"..i.."Level"] level:ClearAllPoints() diff --git a/modules/gm.lua b/modules/gm.lua index 1a3db036..71b23e35 100644 --- a/modules/gm.lua +++ b/modules/gm.lua @@ -86,7 +86,7 @@ pfUI:RegisterModule("gm", function () -- pet dropdown -- table.insert(UnitPopupMenus["PET"], "GM_HEADER") - pfUI.hooksecurefunc("UnitPopup_OnClick", function() + hooksecurefunc("UnitPopup_OnClick", function() local dropdownFrame = _G[UIDROPDOWNMENU_INIT_MENU] local button = this.value local unit = dropdownFrame.unit diff --git a/modules/itemcount.lua b/modules/itemcount.lua index b8b55776..35534978 100644 --- a/modules/itemcount.lua +++ b/modules/itemcount.lua @@ -41,7 +41,7 @@ pfUI:RegisterModule("itemcount", function () end end) - pfUI.hooksecurefunc("SetItemRef", function() + hooksecurefunc("SetItemRef", function() if ItemRefTooltip:HasItem() then local _, _, id = ItemRefTooltip:GetItem() if id then AddCounts(ItemRefTooltip, id) end diff --git a/modules/loot.lua b/modules/loot.lua index 60337c11..93a88dc6 100644 --- a/modules/loot.lua +++ b/modules/loot.lua @@ -392,7 +392,7 @@ pfUI:RegisterModule("loot", function () end pfUI.loot:RemoveMasterlootMenus() -- remove then add to ensure no duplicate menus pfUI.loot:AddMasterLootMenus() - pfUI.hooksecurefunc("UnitPopup_OnClick",function() + hooksecurefunc("UnitPopup_OnClick",function() local dropdownFrame = _G[UIDROPDOWNMENU_INIT_MENU] if not dropdownFrame then return end local button = this.value @@ -405,7 +405,7 @@ pfUI:RegisterModule("loot", function () end end end) - pfUI.hooksecurefunc("UnitPopup_HideButtons",function() + hooksecurefunc("UnitPopup_HideButtons",function() local dropdownFrame = _G[UIDROPDOWNMENU_INIT_MENU] local unit = dropdownFrame.unit local name = dropdownFrame.name diff --git a/modules/mapcolors.lua b/modules/mapcolors.lua index 0163c8a0..f85eab87 100644 --- a/modules/mapcolors.lua +++ b/modules/mapcolors.lua @@ -125,13 +125,13 @@ pfUI:RegisterModule("mapcolors", function () -- WorldMap Initialize('WorldMap') - pfUI.hooksecurefunc('WorldMapButton_OnUpdate', function() + hooksecurefunc('WorldMapButton_OnUpdate', function() if ( this.tick or .5) > GetTime() then return else this.tick = GetTime() + .5 end UpdateUnitFrames('WorldMap') end) if C.appearance.worldmap.colornames == "1" then - pfUI.hooksecurefunc('WorldMapUnit_OnEnter', function() + hooksecurefunc('WorldMapUnit_OnEnter', function() if ( this.tick or .5) > GetTime() then return else this.tick = GetTime() + .5 end UpdateUnitColors('WorldMap', WorldMapTooltip) end) @@ -141,13 +141,13 @@ pfUI:RegisterModule("mapcolors", function () HookAddonOrVariable("Blizzard_BattlefieldMinimap", function() Initialize('BattlefieldMinimap') - pfUI.hooksecurefunc('BattlefieldMinimap_OnUpdate', function() + hooksecurefunc('BattlefieldMinimap_OnUpdate', function() if ( this.tick or .5) > GetTime() then return else this.tick = GetTime() + .5 end UpdateUnitFrames('BattlefieldMinimap') end) if C.appearance.worldmap.colornames == "1" then - pfUI.hooksecurefunc('BattlefieldMinimapUnit_OnEnter', function() + hooksecurefunc('BattlefieldMinimapUnit_OnEnter', function() if ( this.tick or .5) > GetTime() then return else this.tick = GetTime() + .5 end UpdateUnitColors('BattlefieldMinimap', GameTooltip) end) diff --git a/modules/minimap.lua b/modules/minimap.lua index ce9acd6d..ead0c510 100644 --- a/modules/minimap.lua +++ b/modules/minimap.lua @@ -58,7 +58,7 @@ pfUI:RegisterModule("minimap", function () pfUI.minimap:UpdateConfig() - pfUI.hooksecurefunc("ToggleMinimap", function() + hooksecurefunc("ToggleMinimap", function() if pfUI.farmmap and pfUI.farmmap:IsShown() then Minimap:Hide() return diff --git a/modules/player.lua b/modules/player.lua index 6aa25980..d52f5c9c 100644 --- a/modules/player.lua +++ b/modules/player.lua @@ -141,7 +141,7 @@ pfUI:RegisterModule("player", function () end end - pfUI.hooksecurefunc("UnitPopup_OnClick", function() + hooksecurefunc("UnitPopup_OnClick", function() local button = this.value if button == "RESET_INSTANCES_FIX" then StaticPopup_Show("CONFIRM_RESET_INSTANCES") diff --git a/modules/questitem.lua b/modules/questitem.lua index 63a398ef..874ce0a4 100644 --- a/modules/questitem.lua +++ b/modules/questitem.lua @@ -95,7 +95,7 @@ pfUI:RegisterModule("questitem", function () -- itemref tooltip (chat link clicks): hooksecurefunc runs after SetItemRef -- populates ItemRefTooltip, so we just read the item back out of the tooltip -- instead of re-parsing the "item:NNN" out of the link string. - pfUI.hooksecurefunc("SetItemRef", function() + hooksecurefunc("SetItemRef", function() if IsModifierKeyDown() then return end if ItemRefTooltip:HasItem() then local _, _, id = ItemRefTooltip:GetItem() diff --git a/modules/raid.lua b/modules/raid.lua index 1057578c..0f52381f 100644 --- a/modules/raid.lua +++ b/modules/raid.lua @@ -164,7 +164,7 @@ pfUI:RegisterModule("raid", function () end end - pfUI.hooksecurefunc("UnitPopup_OnClick", function() + hooksecurefunc("UnitPopup_OnClick", function() local dropdownFrame = UIDROPDOWNMENU_INIT_MENU and _G[UIDROPDOWNMENU_INIT_MENU] if not dropdownFrame then return end local button = this.value diff --git a/modules/sellvalue.lua b/modules/sellvalue.lua index e87ea803..7ed56724 100644 --- a/modules/sellvalue.lua +++ b/modules/sellvalue.lua @@ -27,7 +27,7 @@ pfUI:RegisterModule("sellvalue", function () frame:Show() end - pfUI.hooksecurefunc("SetItemRef", function() + hooksecurefunc("SetItemRef", function() if IsModifierKeyDown() then return end if ItemRefTooltip:HasItem() then local _, _, id = ItemRefTooltip:GetItem() @@ -163,7 +163,7 @@ pfUI:RegisterModule("sellvalue", function () local function HookTooltip(tooltip) for setter, entry in pairs(TooltipHooks) do - pfUI.hooksecurefunc(tooltip, setter, makeHook(entry)) + hooksecurefunc(tooltip, setter, makeHook(entry)) end end diff --git a/modules/skin.lua b/modules/skin.lua index 67ad4d50..867d4c0d 100644 --- a/modules/skin.lua +++ b/modules/skin.lua @@ -51,12 +51,12 @@ pfUI:RegisterModule("skin", function () DurabilityFrame.SetPoint = function() return end if C.appearance.cd.blizzard == "1" then - pfUI.hooksecurefunc("PaperDollItemSlotButton_Update", function() + hooksecurefunc("PaperDollItemSlotButton_Update", function() local cooldown = _G[this:GetName().."Cooldown"] if cooldown then cooldown.pfCooldownType = "BLIZZARD" end end) - pfUI.hooksecurefunc("SpellButton_UpdateButton", function() + hooksecurefunc("SpellButton_UpdateButton", function() local cooldown = _G[this:GetName().."Cooldown"] if cooldown then cooldown.pfCooldownType = "BLIZZARD" end end) diff --git a/modules/socialmod.lua b/modules/socialmod.lua index ac601099..4cf14cf3 100644 --- a/modules/socialmod.lua +++ b/modules/socialmod.lua @@ -10,7 +10,7 @@ pfUI:RegisterModule("socialmod", function () end end) do -- add colors to guild list - pfUI.hooksecurefunc("GuildStatus_Update", function() + hooksecurefunc("GuildStatus_Update", function() local playerzone = GetRealZoneText() local off = FauxScrollFrame_GetOffset(GuildListScrollFrame) for i=1, GUILDMEMBERS_TO_DISPLAY, 1 do @@ -70,7 +70,7 @@ pfUI:RegisterModule("socialmod", function () end do -- add colors to friend list - pfUI.hooksecurefunc("FriendsList_Update", function() + hooksecurefunc("FriendsList_Update", function() if GetNumFriends() == 0 then return end local playerzone = GetRealZoneText() @@ -123,7 +123,7 @@ pfUI:RegisterModule("socialmod", function () end do -- add colors to who list - pfUI.hooksecurefunc("WhoList_Update", function() + hooksecurefunc("WhoList_Update", function() local num, max = GetNumWhoResults() local off = FauxScrollFrame_GetOffset(WhoListScrollFrame) diff --git a/modules/thirdparty-vanilla.lua b/modules/thirdparty-vanilla.lua index a01bd3d9..177c5cbf 100644 --- a/modules/thirdparty-vanilla.lua +++ b/modules/thirdparty-vanilla.lua @@ -530,7 +530,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function() end -- replace wim class colors with pfUI ones - pfUI.hooksecurefunc("WIM_InitClassProps", function() + hooksecurefunc("WIM_InitClassProps", function() for class in pairs(PFUI_CLASS_COLORS) do local wimclass = _G[format("WIM_LOCALIZED_%s",class)] local colorstr = "|c" .. PFUI_CLASS_COLORS[class].colorStr @@ -547,7 +547,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function() btnClose:SetWidth(13) btnClose:SetHeight(13) end - pfUI.hooksecurefunc("WIM_Icon_DropDown_Update", function() + hooksecurefunc("WIM_Icon_DropDown_Update", function() for i=1,_G.WIM_MaxMenuCount do local btn = _G["WIM_ConversationMenuTellButton"..i] if i==1 and btn:IsEnabled() == 0 then return end @@ -729,7 +729,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function() SkinScrollbar(WIM_HelpScrollFrameScrollBar) end - pfUI.hooksecurefunc("WIM_WindowOnShow", function() + hooksecurefunc("WIM_WindowOnShow", function() if this.backdrop then return end -- already skinned local windowname = this:GetName() @@ -904,7 +904,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function() end -- trigger the event whenever SuperMacro got an update - pfUI.hooksecurefunc("SM_UpdateActionSpell", function() + hooksecurefunc("SM_UpdateActionSpell", function() for slot=1,120 do pfUI.bars.update[slot] = true end end) end) @@ -922,7 +922,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function() pfUI.bars.skip_macro = true -- send clevermacro events to pfUI actionbars - pfUI.hooksecurefunc("ActionButton_OnEvent", function(event) + hooksecurefunc("ActionButton_OnEvent", function(event) events(this, event) end) end) diff --git a/modules/turtle-wow.lua b/modules/turtle-wow.lua index 99e15538..3096ec3f 100644 --- a/modules/turtle-wow.lua +++ b/modules/turtle-wow.lua @@ -65,14 +65,14 @@ pfUI:RegisterModule("turtle-wow", function () HookAddonOrVariable("GroupFrame", function() -- After Turtle's own init, hide frames if pfUI handles them - pfUI.hooksecurefunc("GroupFrame_Toggle", function() + hooksecurefunc("GroupFrame_Toggle", function() if pfUIHandlesGroupOrRaid() then DisableTurtleGroupFrames() end end) -- After every group/raid update, re-hide if pfUI handles them - pfUI.hooksecurefunc("GroupFrame_Update", function() + hooksecurefunc("GroupFrame_Update", function() if pfUIHandlesGroupOrRaid() then DisableTurtleGroupFrames() end @@ -295,7 +295,7 @@ pfUI:RegisterModule("turtle-wow", function () local initialized = false HookAddonOrVariable("Blizzard_InspectUI", function() - pfUI.hooksecurefunc("InspectFrame_Show", function() + hooksecurefunc("InspectFrame_Show", function() -- break if theres nothing left to do if initialized then return end diff --git a/modules/unusable.lua b/modules/unusable.lua index 6fe7e13f..5d39631e 100644 --- a/modules/unusable.lua +++ b/modules/unusable.lua @@ -41,12 +41,12 @@ pfUI:RegisterModule("unusable", function () end -- update on regular pfUI button updates - pfUI.hooksecurefunc(pfUI.bag, "UpdateSlot", function(self, bag, slot) + hooksecurefunc(pfUI.bag, "UpdateSlot", function(self, bag, slot) pfUI.unusable:UpdateSlot(bag, slot) end) -- update on bank frame itemlock updates - pfUI.hooksecurefunc("BankFrameItemButton_UpdateLock", function() + hooksecurefunc("BankFrameItemButton_UpdateLock", function() pfUI.unusable:UpdateSlot(-1, this:GetID()) end) end) diff --git a/skins/blizzard/auction.lua b/skins/blizzard/auction.lua index 7b052dfe..d1bb2711 100644 --- a/skins/blizzard/auction.lua +++ b/skins/blizzard/auction.lua @@ -12,7 +12,7 @@ pfUI:RegisterSkin("Auctionhouse", function () SkinArrowButton(AuctionsNextPageButton, "right", 18) end - pfUI.hooksecurefunc("AuctionFrame_OnShow", function() + hooksecurefunc("AuctionFrame_OnShow", function() AuctionFrame:ClearAllPoints() AuctionFrame:SetPoint("TOPLEFT", 10, -104) end) @@ -76,7 +76,7 @@ pfUI:RegisterSkin("Auctionhouse", function () item:SetPoint("LEFT", 2, 0) end end - pfUI.hooksecurefunc("AuctionFrameBrowse_Update", function() + hooksecurefunc("AuctionFrameBrowse_Update", function() for i = 1, NUM_BROWSE_TO_DISPLAY do HandleIcon(_G["BrowseButton"..i.."Item"], _G["BrowseButton"..i.."ItemIconTexture"]) end @@ -145,7 +145,7 @@ pfUI:RegisterSkin("Auctionhouse", function () item:ClearAllPoints() item:SetPoint("LEFT", 2, 0) end - pfUI.hooksecurefunc("AuctionFrameBid_Update", function() + hooksecurefunc("AuctionFrameBid_Update", function() for i = 1, NUM_BIDS_TO_DISPLAY do HandleIcon(_G["BidButton"..i.."Item"], _G["BidButton"..i.."ItemIconTexture"]) end @@ -191,14 +191,14 @@ pfUI:RegisterSkin("Auctionhouse", function () item:ClearAllPoints() item:SetPoint("LEFT", 2, 0) end - pfUI.hooksecurefunc("AuctionFrameAuctions_Update", function() + hooksecurefunc("AuctionFrameAuctions_Update", function() for i = 1, NUM_AUCTIONS_TO_DISPLAY do HandleIcon(_G["AuctionsButton"..i.."Item"], _G["AuctionsButton"..i.."ItemIconTexture"]) end end) SkinButton(AuctionsItemButton) - pfUI.hooksecurefunc("AuctionSellItemButton_OnEvent", function() + hooksecurefunc("AuctionSellItemButton_OnEvent", function() if event ~= "NEW_AUCTION_UPDATE" then return end HandleIcon(AuctionsItemButton, AuctionsItemButton:GetNormalTexture()) end) diff --git a/skins/blizzard/battlefield_minimap.lua b/skins/blizzard/battlefield_minimap.lua index 6c15cc57..5b541092 100644 --- a/skins/blizzard/battlefield_minimap.lua +++ b/skins/blizzard/battlefield_minimap.lua @@ -19,7 +19,7 @@ pfUI:RegisterSkin("Battlefield Minimap", function () BattlefieldMinimapTab:Hide() end) - pfUI.hooksecurefunc("BattlefieldMinimap_ShowOpacity", function() + hooksecurefunc("BattlefieldMinimap_ShowOpacity", function() OpacityFrame:ClearAllPoints() OpacityFrame:SetPoint("TOPRIGHT", "BattlefieldMinimap", "TOPLEFT", -2*border, 0) end) diff --git a/skins/blizzard/character.lua b/skins/blizzard/character.lua index d10f7b81..cb509e13 100644 --- a/skins/blizzard/character.lua +++ b/skins/blizzard/character.lua @@ -136,18 +136,18 @@ pfUI:RegisterSkin("Character", function () end end - pfUI.hooksecurefunc("CharacterFrame_OnShow", function() + hooksecurefunc("CharacterFrame_OnShow", function() RefreshCharacterSlots() RefreshPetPosition() end) - pfUI.hooksecurefunc("PaperDollItemSlotButton_Update", function() + hooksecurefunc("PaperDollItemSlotButton_Update", function() if this:GetParent() == PaperDollFrame then RefreshCharacterSlot(this) end end) - pfUI.hooksecurefunc("PetTab_Update", RefreshPetPosition) + hooksecurefunc("PetTab_Update", RefreshPetPosition) StripTextures(PaperDollFrame) StripTextures(CharacterAttributesFrame) @@ -270,7 +270,7 @@ pfUI:RegisterSkin("Character", function () -- the FactionStanding text from `bar.standingText` on mouseout, so we -- stash our augmented text there too — otherwise hovering a bar strips -- the "(N)" suffix off. - pfUI.hooksecurefunc("ReputationFrame_Update", function() + hooksecurefunc("ReputationFrame_Update", function() if C.character.reputation.repRequired ~= "1" then return end local offset = FauxScrollFrame_GetOffset(ReputationListScrollFrame) for i = 1, NUM_FACTIONS_DISPLAYED do diff --git a/skins/blizzard/friends.lua b/skins/blizzard/friends.lua index 2f649f42..53973c6a 100644 --- a/skins/blizzard/friends.lua +++ b/skins/blizzard/friends.lua @@ -150,7 +150,7 @@ pfUI:RegisterSkin("Friends", function () end -- set positions - pfUI.hooksecurefunc("WhoList_Update", function() + hooksecurefunc("WhoList_Update", function() for i = 1, WHOS_TO_DISPLAY do local level = _G["WhoFrameButton"..i.."Level"] level:ClearAllPoints() @@ -231,7 +231,7 @@ pfUI:RegisterSkin("Friends", function () end -- set positions - pfUI.hooksecurefunc("GuildStatus_Update", function() + hooksecurefunc("GuildStatus_Update", function() for i = 1, GUILDMEMBERS_TO_DISPLAY do local level = _G["GuildFrameButton"..i.."Level"] level:ClearAllPoints() diff --git a/skins/blizzard/gossipquest.lua b/skins/blizzard/gossipquest.lua index 369cd989..98be46c9 100644 --- a/skins/blizzard/gossipquest.lua +++ b/skins/blizzard/gossipquest.lua @@ -24,11 +24,11 @@ pfUI:RegisterSkin("Gossip and Quest", function () QuestRewardItemHighlightBG:SetTexture(1,1,1,.2) QuestRewardItemHighlightBG:SetAllPoints() - pfUI.hooksecurefunc("QuestFrameItems_Update", function() + hooksecurefunc("QuestFrameItems_Update", function() QuestRewardItemHighlight:Hide() end) - pfUI.hooksecurefunc("QuestRewardItem_OnClick", function() + hooksecurefunc("QuestRewardItem_OnClick", function() if this.type == "choice" then QuestRewardItemHighlight:SetAllPoints(this.backdrop) QuestRewardItemHighlight:Show() diff --git a/skins/blizzard/mail.lua b/skins/blizzard/mail.lua index 0442fd49..d4d00856 100644 --- a/skins/blizzard/mail.lua +++ b/skins/blizzard/mail.lua @@ -12,7 +12,7 @@ pfUI:RegisterSkin("Mailbox", function () StripTextures(SendMailPackageButton) SkinButton(SendMailPackageButton, nil, nil, nil, nil, true) - pfUI.hooksecurefunc("SendMailFrame_Update", function() + hooksecurefunc("SendMailFrame_Update", function() HandleIcon(SendMailPackageButton, SendMailPackageButton:GetNormalTexture()) local _, itemID = GetSendMailItemLink() @@ -62,7 +62,7 @@ pfUI:RegisterSkin("Mailbox", function () do -- OpenMailFrame SkinButton(OpenMailPackageButton, nil, nil, nil, OpenMailPackageButtonIconTexture) - pfUI.hooksecurefunc("InboxFrame_OnClick", function(index) + hooksecurefunc("InboxFrame_OnClick", function(index) local _, itemID = GetInboxItemLink(index) if itemID then local quality = C_Item.GetItemQualityByID(itemID) diff --git a/skins/blizzard/merchant.lua b/skins/blizzard/merchant.lua index e220da3b..eed86a3f 100644 --- a/skins/blizzard/merchant.lua +++ b/skins/blizzard/merchant.lua @@ -6,7 +6,7 @@ pfUI:RegisterSkin("Merchant", function () if MerchantGuildBankRepairButton then -- tbc SkinButton(MerchantGuildBankRepairButton, nil, nil, nil, MerchantGuildBankRepairButtonIcon) MerchantGuildBankRepairButtonIcon:SetTexCoord(.59, .82, .06, .54) - pfUI.hooksecurefunc("MerchantFrame_UpdateRepairButtons", function() + hooksecurefunc("MerchantFrame_UpdateRepairButtons", function() MerchantGuildBankRepairButton:ClearAllPoints() MerchantGuildBankRepairButton:SetPoint("RIGHT", MerchantBuyBackItemItemButton, "LEFT", -14, 0) MerchantRepairAllButton:ClearAllPoints() @@ -56,7 +56,7 @@ pfUI:RegisterSkin("Merchant", function () moneyFrame:SetPoint("BOTTOMLEFT", itemButton, "BOTTOMRIGHT", 5, 1) end - pfUI.hooksecurefunc("MerchantFrame_UpdateMerchantInfo", function() + hooksecurefunc("MerchantFrame_UpdateMerchantInfo", function() if MerchantFrame.selectedTab == 1 then for i = 3, 11, 2 do _G["MerchantItem"..i]:ClearAllPoints() diff --git a/skins/blizzard/options-new.lua b/skins/blizzard/options-new.lua index 588a28df..d99777a6 100644 --- a/skins/blizzard/options-new.lua +++ b/skins/blizzard/options-new.lua @@ -184,7 +184,7 @@ pfUI:RegisterSkin("Options - New", function () end -- hook after category selection: UpdateOptions is local so we hook its caller - pfUI.hooksecurefunc("OptionsListButton_OnClick", SkinControls) + hooksecurefunc("OptionsListButton_OnClick", SkinControls) -- also cover initial load OptionsFrame:HookScript("OnShow", SkinControls) end) \ No newline at end of file diff --git a/skins/blizzard/options-video.lua b/skins/blizzard/options-video.lua index 1563b3cd..f0c1be5b 100644 --- a/skins/blizzard/options-video.lua +++ b/skins/blizzard/options-video.lua @@ -19,7 +19,7 @@ pfUI:RegisterSkin("Options - Video", function () slider:SetPoint(point, anchor, anchorPoint, x, y - shift) end - pfUI.hooksecurefunc("OptionsFrame_Load", function() + hooksecurefunc("OptionsFrame_Load", function() OptionsFramePixelShaders:SetWidth(230) OptionsFrameMiscellaneous:ClearAllPoints() OptionsFrameMiscellaneous:SetPoint("LEFT", OptionsFramePixelShaders, "RIGHT", 6, 0) diff --git a/skins/blizzard/professions.lua b/skins/blizzard/professions.lua index 6ca9f4ae..5608ac14 100644 --- a/skins/blizzard/professions.lua +++ b/skins/blizzard/professions.lua @@ -192,7 +192,7 @@ pfUI:RegisterSkin("Profession", function () reagentlabel:SetTextColor(1,1,1,1) local scanner = libtipscan:GetScanner(name) - pfUI.hooksecurefunc(SetSelection, function(id) + hooksecurefunc(SetSelection, function(id) if id and id ~= 0 then detailscroll:Show() HandleIcon(icon, icon:GetNormalTexture()) diff --git a/skins/blizzard/questlog.lua b/skins/blizzard/questlog.lua index 21f627fc..35152106 100644 --- a/skins/blizzard/questlog.lua +++ b/skins/blizzard/questlog.lua @@ -13,7 +13,7 @@ pfUI:RegisterSkin("Quest Log", function () StripTextures(QUEST_COUNT) QUEST_COUNT:ClearAllPoints() - pfUI.hooksecurefunc("QuestLogUpdateQuestCount", function(numQuests) + hooksecurefunc("QuestLogUpdateQuestCount", function(numQuests) QUEST_COUNT:ClearAllPoints() QUEST_COUNT:SetPoint("BOTTOMRIGHT", QuestLogFrame, "TOPRIGHT", 0, -50) end) @@ -24,7 +24,7 @@ pfUI:RegisterSkin("Quest Log", function () QUEST_COUNT:SetPoint("TOPRIGHT", -10, -30) end - pfUI.hooksecurefunc("QuestLog_OnShow", function() + hooksecurefunc("QuestLog_OnShow", function() QuestLogFrame:ClearAllPoints() QuestLogFrame:SetPoint("TOPLEFT", 10, -104) end) @@ -163,7 +163,7 @@ pfUI:RegisterSkin("Quest Log", function () QuestLogListScrollFrame:SetPoint("TOPLEFT", 10, -54) QuestLogListScrollFrame:SetHeight(350) - pfUI.hooksecurefunc("QuestLog_Update", function() + hooksecurefunc("QuestLog_Update", function() local numEntries = GetNumQuestLogEntries() local questIndex, text, level, questTag, isHeader diff --git a/skins/blizzard/readycheck.lua b/skins/blizzard/readycheck.lua index 2340774d..30212ce3 100644 --- a/skins/blizzard/readycheck.lua +++ b/skins/blizzard/readycheck.lua @@ -38,12 +38,12 @@ pfUI:RegisterSkin("Readycheck", function () frame.bar.text:SetPoint("CENTER", 0, 0) local max - pfUI.hooksecurefunc("ShowReadyCheck", function() + hooksecurefunc("ShowReadyCheck", function() max = ReadyCheckFrame.timer frame.bar:SetMinMaxValues(0, max) end) - pfUI.hooksecurefunc(update_func, function() + hooksecurefunc(update_func, function() if not ReadyCheckFrame.timer then return end local perc = ReadyCheckFrame.timer/max diff --git a/skins/blizzard/survey.lua b/skins/blizzard/survey.lua index c0a39400..cc36aca3 100644 --- a/skins/blizzard/survey.lua +++ b/skins/blizzard/survey.lua @@ -32,7 +32,7 @@ pfUI:RegisterSkin("GM Survey", function () CreateBackdrop(GMSurveyCommentFrame, nil, true, .75) SkinScrollbar(GMSurveyCommentScrollFrameScrollBar) GMSurveyFrameComment:SetMaxLetters(2000) - pfUI.hooksecurefunc("GMSurveyFrame_Update", function() + hooksecurefunc("GMSurveyFrame_Update", function() GMSurveyFrameComment:SetWidth(505) end) end) diff --git a/skins/blizzard/trade.lua b/skins/blizzard/trade.lua index 03f92889..7fdbc8d7 100644 --- a/skins/blizzard/trade.lua +++ b/skins/blizzard/trade.lua @@ -41,7 +41,7 @@ pfUI:RegisterSkin("Trade", function () RecipientButtonBG:SetAllPoints() end - pfUI.hooksecurefunc("TradeFrame_UpdateTargetItem", function(id) + hooksecurefunc("TradeFrame_UpdateTargetItem", function(id) HandleIcon(_G["TradeRecipientItem"..id.."ItemButton"], _G["TradeRecipientItem"..id..'IconTexture']) end) diff --git a/skins/blizzard/trainer.lua b/skins/blizzard/trainer.lua index 467da1b9..aebc9028 100644 --- a/skins/blizzard/trainer.lua +++ b/skins/blizzard/trainer.lua @@ -36,7 +36,7 @@ pfUI:RegisterSkin("Trainer", function () StripTextures(ClassTrainerSkillIcon) SkinButton(ClassTrainerSkillIcon, nil, nil, nil, nil, true) - pfUI.hooksecurefunc("ClassTrainer_SetSelection", function() + hooksecurefunc("ClassTrainer_SetSelection", function() HandleIcon(ClassTrainerSkillIcon, ClassTrainerSkillIcon:GetNormalTexture()) end)