Repository navigation
Expand file tree
/
Copy pathCore.lua
More file actions
80 lines (68 loc) · 1.93 KB
/
Copy pathCore.lua
File metadata and controls
80 lines (68 loc) · 1.93 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
local DF = LibStub('AceAddon-3.0'):NewAddon('cDF', 'AceConsole-3.0')
local db
-- DF.InterfaceVersion = select(4, GetBuildInfo())
-- DF.Wrath = DF.InterfaceVersion >= 30400
-- DF.Era = DF.InterfaceVersion <= 20000
local defaults = {
profile = {
modules = {['Unitframe'] = true, ['Castbar'] = true, ['Chat'] = true},
bestnumber = 42
}
}
function DF:OnInitialize()
-- Called when the addon is loaded
self.db = LibStub('AceDB-3.0'):New('DragonflightUIDB', defaults, true)
db = self.db.profile
self:SetupOptions()
self:RegisterSlashCommands()
end
function DF:OnEnable()
-- Called when the addon is enabled
--self:Print('DragonflightUI enabled!')
self:ShowStartMessage()
end
function DF:OnDisable()
-- Called when the addon is disabled
end
function DF:GetModuleEnabled(module)
return db.modules[module]
end
function DF:SetModuleEnabled(module, value)
local old = db.modules[module]
db.modules[module] = value
if old ~= value then
if value then
self:EnableModule(module)
else
self:DisableModule(module)
end
self:Print('/reload')
end
end
local name, realm = UnitName('player')
local showDebug = name == 'Zimtdev'
function DF:Debug(m, value)
if showDebug then
m:Print(value)
end
end
function DF:ShowStartMessage()
local version = ''
--[[
if not GetAddOnMetadata then
version = C_AddOns.GetAddOnMetadata('DragonflightUI', 'Version')
else
version = GetAddOnMetadata('DragonflightUI', 'Version')
end
self:Print(version .. " loaded! Type '/dragonflight'or '/df' to open the options menu.")
]]
print("|cffffd700Chromie |cff1974d2Dragonflight |cffffffffloaded. Welcome " .. UnitName("player") .. "!")
end
function DF:GetClassColor(class, alpha)
local r, g, b, hex = GetClassColor(class)
if alpha then
return r, g, b, alpha
else
return r, g, b, 1
end
end