-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.lua
More file actions
50 lines (39 loc) · 920 Bytes
/
database.lua
File metadata and controls
50 lines (39 loc) · 920 Bytes
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
--[[
cKick
Copyright(c) 2016, Tobias 'Chimaine' Rummelt, kontakt(at)rummelt-software.de
All rights reserved
]]
local ADDON_NAME, addon = ...
local DB_NAME = "cKick_Settings"
-- ----------------------------------------------------
local _version = 2
local function GetDefaultSettings()
return {
Version = _version,
Scale = 1,
Points = {},
BarWidth = 150,
BarHeight = 15,
BarSpacing = 1,
BarTexture = "darkborder",
BarColor = { .31, .41, .53 },
ClassColor = false,
FontSize = 10,
FontFace = "Friz Quadrata TT",
}
end
function addon:ReadSettings()
local db = _G[DB_NAME]
if ( not db ) then
addon:Log( "Creating new DB" )
db = GetDefaultSettings()
_G[DB_NAME] = db
end
if ( ( not db.Version ) or ( _version > db.Version ) ) then
-- TODO
addon:Log( "Upgrading DB from version", db.Version, "to", _version )
db = GetDefaultSettings()
_G[DB_NAME] = db
end
return db
end