-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCore.lua
39 lines (30 loc) · 939 Bytes
/
Core.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
local _G = getfenv(0)
local FOLDER_NAME, private = ...
local PostAuction = _G.PostAuction
local function GetWowBuild()
local buildstr = select(2, _G.GetBuildInfo())
assert(type(buildstr) == "string")
return tonumber(buildstr)
end
local function InitialChecks()
assert(GetWowBuild() >= 27481, "this addon isn't for you")
assert(PostAuction and type(PostAuction) == "function")
end
function private.HookedStartAuction(...)
if not private.warning then
private.warning = true
_G.DEFAULT_CHAT_FRAME:AddMessage(string.format( "%s is now active", FOLDER_NAME ))
end
return PostAuction(...)
end
local function HookStartAuction()
assert(_G.Original_StartAuction == nil)
assert(_G.StartAuction ~= nil)
_G.Original_StartAuction = _G.StartAuction
_G.StartAuction = private.HookedStartAuction
end
local function Init()
InitialChecks()
HookStartAuction()
end
return Init()