-
Notifications
You must be signed in to change notification settings - Fork 0
/
LGCDB.lua
executable file
·43 lines (33 loc) · 940 Bytes
/
LGCDB.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
-- LGCDB.lua
-------------------------------------------------------------------------------
-- Title: Let's Get Critical Main
-- Author: iachievedit
-------------------------------------------------------------------------------
local addonName, addon = ...
local LGCritical = addon
-- Create module and set its name.
local module = {}
local moduleName = "Database"
LGCritical[moduleName] = module
local frame = CreateFrame("Frame", "LGCDB")
frame:RegisterEvent("PLAYER_LOGIN")
frame:SetScript("OnEvent", function(this, event, ...)
LGCritical[event](LGCritical, ...)
end)
function LGCritical:PLAYER_LOGIN()
self:SetDefaults()
end
function LGCritical:SetDefaults()
if not LGC_AccountDB then
LGC_AccountDB = {
loginCount = 0
}
end
if not LGC_CharacterDB then
LGC_CharacterDB = {}
end
end
function clearCharacterStats()
LGC_CharacterDB = {}
end
module.clearCharacterStats = clearCharacterStats