mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-07 11:08:56 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
787903271b |
+20
@@ -582,6 +582,26 @@ function pfUI.api.HookAddon(addon, func)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- [ HookAddonOrVariable ]
|
||||||
|
-- Compatibility shim for pfUI plugins (e.g. pfUI-addonskinner) that still
|
||||||
|
-- call the pre-rewrite API. Routes addon names through HookAddon, and keeps
|
||||||
|
-- the legacy "or variable" fallback for callers that pass a global name.
|
||||||
|
function pfUI.api.HookAddonOrVariable(addon, func)
|
||||||
|
if C_AddOns.DoesAddOnExist(addon) then
|
||||||
|
return pfUI.api.HookAddon(addon, func)
|
||||||
|
end
|
||||||
|
local lurker = CreateFrame("Frame")
|
||||||
|
lurker:RegisterEvent("ADDON_LOADED")
|
||||||
|
lurker:RegisterEvent("PLAYER_LOGIN")
|
||||||
|
lurker:SetScript("OnEvent", function()
|
||||||
|
if _G[addon] then
|
||||||
|
func()
|
||||||
|
lurker:UnregisterAllEvents()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
_G.HookAddonOrVariable = pfUI.api.HookAddonOrVariable
|
||||||
|
|
||||||
-- [ Create Gold String ]
|
-- [ Create Gold String ]
|
||||||
-- Transforms a amount of copper into a fully fledged gold string
|
-- Transforms a amount of copper into a fully fledged gold string
|
||||||
-- 'money' [int] the amount of coppy (GetMoney())
|
-- 'money' [int] the amount of coppy (GetMoney())
|
||||||
|
|||||||
Reference in New Issue
Block a user