-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.lua
81 lines (72 loc) · 1.63 KB
/
config.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
local _, NS = ...
local CreateFrame = CreateFrame
---@class PositionArray
---@field[1] string
---@field[2] string
---@field[3] number
---@field[4] number
---@class ColorArray
---@field r number
---@field g number
---@field b number
---@field a number
---@class GlobalTable : table
---@field lock boolean
---@field labeltext string
---@field showlabel boolean
---@field showzero boolean
---@field font string
---@field round boolean
---@field color ColorArray
---@field position PositionArray
---@field debug boolean
---@class DBTable : table
---@field global GlobalTable
---@class DMS
---@field ADDON_LOADED function
---@field PLAYER_LOGIN function
---@field PLAYER_ENTERING_WORLD function
---@field PLAYER_MOUNT_DISPLAY_CHANGED function
---@field UNIT_POWER_BAR_SHOW function
---@field UNIT_POWER_BAR_HIDE function
---@field UNIT_SPELLCAST_SUCCEEDED function
---@field WatchForPlayerMoving function
---@field GetDynamicSpeed function
---@field SlashCommands function
---@field frame Frame
---@field db GlobalTable
---@type DMS
---@diagnostic disable-next-line: missing-fields
local DMS = {}
NS.DMS = DMS
local DMSFrame = CreateFrame("Frame", "DMSFrame")
DMSFrame:SetScript("OnEvent", function(_, event, ...)
if DMS[event] then
DMS[event](DMS, ...)
end
end)
NS.DMS.frame = DMSFrame
NS.DefaultDatabase = {
global = {
lock = false,
labeltext = "Speed:",
showlabel = true,
showzero = false,
fontsize = 15,
font = "Friz Quadrata TT",
round = true,
color = {
r = 1,
g = 1,
b = 1,
a = 1,
},
position = {
"CENTER",
"CENTER",
0,
0,
},
debug = false,
},
}