This repository was archived by the owner on Jun 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathcore.lua
More file actions
104 lines (89 loc) · 2 KB
/
Copy pathcore.lua
File metadata and controls
104 lines (89 loc) · 2 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
ShaguDPS = {}
-- initialize default question dialog
StaticPopupDialogs["SHAGUMETER_QUESTION"] = {
button1 = YES,
button2 = NO,
timeout = 0,
whileDead = 1,
hideOnEscape = 1,
}
-- list of available statusbar textures
local textures = {
"Interface\\BUTTONS\\WHITE8X8",
"Interface\\TargetingFrame\\UI-StatusBar",
"Interface\\Tooltips\\UI-Tooltip-Background",
"Interface\\PaperDollInfoFrame\\UI-Character-Skills-Bar"
}
-- a basic rounding function
local function round(input, places)
if not places then places = 0 end
if type(input) == "number" and type(places) == "number" then
local pow = 1
for i = 1, places do pow = pow * 10 end
return floor(input * pow + 0.5) / pow
end
end
local function expansion()
local _, _, _, client = GetBuildInfo()
client = client or 11200
-- detect client expansion
if client >= 20000 and client <= 20400 then
return "tbc"
elseif client >= 30000 and client <= 30300 then
return "wotlk"
else
return "vanilla"
end
end
-- shared variables
local data = {
damage = {
[0] = {}, -- overall
[1] = {}, -- current
},
heal = {
[0] = {}, -- overall
[1] = {}, -- current
},
classes = {},
}
local dmg_table = {}
local view_dmg_all = { }
local view_dps_all = { }
local playerClasses = {}
-- default config
local config = {
-- size
height = 15,
spacing = 0,
-- tracking
track_all_units = 0,
merge_pets = 1,
-- appearance
visible = 1,
backdrop = 1,
texture = 2,
pastel = 0,
lock = 0,
}
local internals = {
["_sum"] = true,
["_ctime"] = true,
["_tick"] = true,
["_esum"] = true,
["_effective"] = true,
}
-- create core component frames
local settings = CreateFrame("Frame", nil, UIParent)
local parser = CreateFrame("Frame")
local window = {}
-- make everything public
ShaguDPS.data = data
ShaguDPS.config = config
ShaguDPS.textures = textures
ShaguDPS.window = window
ShaguDPS.settings = settings
ShaguDPS.internals = internals
ShaguDPS.parser = parser
ShaguDPS.round = round
ShaguDPS.expansion = expansion