-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.lua
167 lines (124 loc) · 4.21 KB
/
core.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
-----------------------------
-- INIT
-----------------------------
local addon, ns = ...
local cfg = ns.cfg
local lib = ns.lib
-----------------------
-- Style Functions
-----------------------
local UnitSpecific = {
player = function(self, ...)
self.mystyle = "player"
-- Size and Scale
self:SetScale(1)
self:SetWidth(cfg.unitframeWidth)
self:SetHeight(cfg.unitframeHeight)
-- Generate Bars
lib.addHealthBar(self)
lib.addStrings(self)
lib.addPowerBar(self)
lib.gen_InfoIcons(self)
lib.addSecondaryPowerBar(self)
lib.createBuffs(self)
lib.createDebuffs(self)
lib.createStaggerBar(self)
lib.createExpTags(self)
-- healthbar/powerbar
self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
self.Health:SetSize(cfg.unitframeWidth, cfg.unitframeHeight)
self.Health.frequentUpdates = true
self.Power:SetPoint('BOTTOMLEFT', self, 'BOTTOMLEFT', cfg.unitframeWidth - cfg.powerWidth, -(cfg.unitframeHeight - cfg.powerHeight + 15))
self.Power:SetSize(cfg.powerWidth, cfg.powerHeight)
self.Power.frequentUpdates = true
self.SecondaryPower:SetPoint('BOTTOMRIGHT', UIParent, 'BOTTOM', cfg.secondarypowerX, cfg.secondarypowerY)
self.SecondaryPower:SetSize(cfg.secondarypowerWidth, cfg.secondarypowerHeight)
-- oUF_Smooth
self.Health.Smooth = true
self.Power.Smooth = true
-- Event Handlers
self:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED", cfg.updateSpec)
end,
target = function(self, ...)
self.mystyle = "target"
-- Size and Scale
self:SetScale(1)
self:SetWidth(cfg.unitframeWidth)
self:SetHeight(cfg.unitframeHeight)
-- Generate Bars
lib.addHealthBar(self)
lib.addStrings(self)
lib.createBuffs(self)
lib.createDebuffs(self)
-- healthbar/powerbar
self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
self.Health:SetSize(cfg.unitframeWidth, cfg.unitframeHeight)
self.Health.frequentUpdates = true
-- oUF_Smooth
self.Health.Smooth = true
-- Event Handlers
self:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED", cfg.updateSpec)
end,
targettarget = function(self, ...)
self.mystyle = "tot"
-- Size and Scale
self:SetScale(1)
self:SetWidth(120)
self:SetHeight(21)
-- Generate Bars
lib.addHealthBar(self)
lib.addStrings(self)
self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
self.Health:SetSize(120, 21)
self.Health.frequentUpdates = true
-- oUF_Smooth
self.Health.Smooth = true
end,
}
-----------------------
-- Register Styles
-----------------------
-- Global Style
local GlobalStyle = function(self, unit, isSingle)
self.menu = lib.spawnMenu
self:RegisterForClicks('AnyUp')
-- Call Unit Specific Styles
if (UnitSpecific[unit]) then
return UnitSpecific[unit](self)
end
end
-- Boss Style
local BossStyle = function(self, unit)
self.mystyle="boss"
-- Size and Scale
self:SetScale(1)
self:SetSize(120, 21)
-- Generate Bars
lib.addHealthBar(self)
lib.addStrings(self)
self.Health:SetPoint('TOPLEFT', self, 'TOPLEFT', 0, 0)
self.Health:SetSize(120, 21)
self.Health.frequentUpdates = true
-- oUF_Smooth
self.Health.Smooth = true
end
-----------------------
-- Spawn Frames
-----------------------
oUF:RegisterStyle('AmbrosiaGlobal', GlobalStyle)
oUF:RegisterStyle('AmbrosiaBoss', BossStyle)
oUF:Factory(function(self)
-- Single Frames
self:SetActiveStyle('AmbrosiaGlobal')
self:Spawn('player'):SetPoint("BOTTOMRIGHT",UIParent,"BOTTOM", cfg.playerX, cfg.playerY)
self:Spawn('target'):SetPoint("BOTTOMLEFT",UIParent,"BOTTOM", cfg.targetX, cfg.targetY)
self:Spawn('targettarget'):SetPoint("BOTTOMLEFT",UIParent,"BOTTOM", cfg.totX, cfg.totY)
self:SetActiveStyle('AmbrosiaBoss')
self:Spawn("boss1", "oUF_Boss1"):SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -75, 425)
self:Spawn("boss2", "oUF_Boss2"):SetPoint("BOTTOMRIGHT", oUF_Boss1, "TOPRIGHT", 0, 8)
self:Spawn("boss3", "oUF_Boss3"):SetPoint("BOTTOMRIGHT", oUF_Boss2, "TOPRIGHT", 0, 8)
self:Spawn("boss4", "oUF_Boss4"):SetPoint("BOTTOMRIGHT", oUF_Boss3, "TOPRIGHT", 0, 8)
self:Spawn("boss5", "oUF_Boss5"):SetPoint("BOTTOMRIGHT", oUF_Boss4, "TOPRIGHT", 0, 8)
self:Spawn("boss6", "oUF_Boss6"):SetPoint("BOTTOMRIGHT", oUF_Boss5, "TOPRIGHT", 0, 8)
end)
oUF:DisableBlizzard('party')