This repository has been archived by the owner on Nov 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerLootLogger.lua
59 lines (39 loc) · 2.23 KB
/
ContainerLootLogger.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
----------------------------------------------------------------------------------------------------------------------
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
----------------------------------------------------------------------------------------------------------------------
local addonName, CLL = ...
if not CLL then return end
-- Upvalues
local L = CLL.L
local ChatMsg = CLL.Output.Print
--- Called on ADDON_LOADED
function ContainerLootLogger:OnInitialize()
-- Initialise DB if necessary
CLL.Settings.Init()
CLL.DB.Init()
-- Register slash commands
self:RegisterChatCommand("cll", CLL.SlashCmds.InputHandler)
self:RegisterChatCommand("containerlootlogger", CLL.SlashCmds.InputHandler)
end
--- Called on PLAYER_LOGIN or ADDON_LOADED (if addon is loaded-on-demand)
function ContainerLootLogger:OnEnable()
local clientVersion, clientBuild = GetBuildInfo()
-- if settings.showLoginMessage then TotalAP.ChatMsg(format(L["%s %s for WOW %s loaded!"], addonName, TotalAP.versionString, clientVersion)); end
ChatMsg(format(L["%s %s for WOW %s loaded! Type /cll or /containerlootlogger if you need help :)"], "CLL", CLL.version, clientVersion))
-- TotalAP.EventHandlers.RegisterAllEvents()
ContainerLootLogger:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED", CLL.Detection.OnUnitSpellcastSucceeded)
ContainerLootLogger:RegisterEvent("GARRISON_MISSION_NPC_OPENED", CLL.Detection.OnGarrisonMissionNPCOpened)
ContainerLootLogger:RegisterEvent("GARRISON_MISSION_NPC_CLOSED", CLL.Detection.OnGarrisonMissionNPCClosed)
end
--- Called when addon is unloaded or disabled manually
function ContainerLootLogger:OnDisable()
end