-
Notifications
You must be signed in to change notification settings - Fork 0
/
raid.lua
executable file
·197 lines (170 loc) · 7.22 KB
/
raid.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
---------------------------------------------------------------------
-- Namespacing teh shit out of this
---------------------------------------------------------------------
local ns, oUFYna = ...
local oUF = ns.oUF or oUF
---------------------------------------------------------------------
-- Configuration
---------------------------------------------------------------------
local media = "Interface\\AddOns\\oUF_Ynarah\\media\\"
local statusbar = "Interface\\TargetingFrame\\UI-StatusBar"
local font = STANDARD_TEXT_FONT
local numbers = "Fonts\\skurri.TTF"
local fontSize = 11
--local border = media..'border.tga'
local border = media..'gloss.tga'
local ptyWidth = 135
local ptyHeight = 15
local ptyMPH = 3
local bossWidth = 175
local bossHeight = 20
---------------------------------------------------------------------
-- Aura Skinning
---------------------------------------------------------------------
local PostCreateAura = function(element, button)
button.showType = true
button.count:ClearAllPoints()
button.count:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -1, 2)
button.overlay:SetTexture(border)
button.overlay:SetTexCoord(0, 1, 0, 1)
button.overlay.Hide = function(self) self:SetVertexColor(0.25, 0.25, 0.25) end
button.icon:SetTexCoord(.07, .93, .07, .93)
end
local PostUpdateDebuff = function(element, unit, button, index)
if(UnitIsFriend("player", unit) or button.isPlayer) then
local _, _, _, _, type = UnitAura(unit, index, button.filter)
local color = DebuffTypeColor[type] or DebuffTypeColor.none
button:SetBackdropColor(color.r * 3/5, color.g * 3/5, color.b * 3/5)
--button.icon:SetDesaturated(false)
button.overlay:SetTexture(border)
button.overlay:SetTexCoord(0, 1, 0, 1)
button.overlay.Hide = function(self) self:SetVertexColor(0.25, 0.25, 0.25) end
button.icon:SetTexCoord(.07, .93, .07, .93)
else
button:SetBackdropColor(0, 0, 0)
--button.icon:SetDesaturated(true)
button.overlay:SetTexture(border)
button.overlay:SetTexCoord(0, 1, 0, 1)
button.overlay.Hide = function(self) self:SetVertexColor(0.25, 0.25, 0.25) end
button.icon:SetTexCoord(.07, .93, .07, .93)
end
end
---------------------------------------------------------------------
-- HP BG Updater
---------------------------------------------------------------------
local updateHealthBG = function(self, event, unit, bar, min, max)
if (UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) or not UnitIsConnected(unit)) then
local color = self.colors.tapped
bar.bg:SetVertexColor(color[1] * 0.4, color[2] * 0.4, color[3]* 0.4)
else
local _, class = UnitClass(unit)
local color = UnitIsPlayer(unit) and self.colors.class[class] or {1,1,1}
bar.bg:SetVertexColor(color[1] * 0.4, color[2] * 0.4, color[3]* 0.4)
end
end
---------------------------------------------------------------------
-- Func of doom
---------------------------------------------------------------------
local func_of_raid = function(self, unit, settings)
self.colors = colors
self.menu = menu
self:SetScript("OnEnter", UnitFrame_OnEnter)
self:SetScript("OnLeave", UnitFrame_OnLeave)
self:RegisterForClicks"anyup"
self:SetAttribute("*type2", "menu")
self:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
insets = {left = -2, right = -2, top = -2, bottom = -5},
}
self:SetBackdropColor(0, 0, 0, .4)
self.Health = CreateFrame("StatusBar", nil, self)
self.Health:SetPoint("TOPRIGHT", self)
self.Health:SetPoint("TOPLEFT", self)
self.Health:SetStatusBarTexture(statusbar)
self.Health:SetHeight(ptyHeight)
self.Health:SetStatusBarColor(100/255, 111/255, 101/255)
self.Health.frequentUpdates = true
self.Health.Smooth = true
self.Health.bg = self.Health:CreateTexture(nil, "BORDER", self)
self.Health.bg:SetAllPoints(self.Health)
self.Health.bg:SetAlpha(.4)
self.Power = CreateFrame("StatusBar", nil, self)
self.Power:SetPoint("TOPRIGHT", self.Health, "BOTTOMRIGHT", 0, -3)
self.Power:SetPoint("TOPLEFT", self.Health, "BOTTOMLEFT", 0, -3)
self.Power:SetStatusBarTexture(statusbar)
self.Power:SetHeight(ptyMPH)
self.Power.frequentUpdates = true
self.Power.Smooth = true
self.Power.colorClass = true
self.Power.bg = self.Power:CreateTexture(nil, "BORDER", self)
self.Power.bg:SetAllPoints(self.Power)
self.Power.bg:SetAlpha(.4)
self.Name = SetFontString(self.Health, font, fontSize+1, "LEFT", self.Health, "RIGHT", 2, 0)
self:Tag(self.Name, "[raidcolor][yna:shortname] [offline<)] [yna:AFKDND<]")
self.Health.value = SetFontString(self.Health, font, fontSize+1, "RIGHT", self.Health, "RIGHT", -2, 0)
self:Tag(self.Health.value, "[curhp] ([perhp]%)")
self.Power.value = SetFontString(self.Health, font, fontSize+1, "LEFT", self.Health, "LEFT", 2, 0)
self.Tag(self.Power.value, "[colorpp]")
self.Castbar = CreateFrame("StatusBar")
self.Castbar:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -2, right = -2, top = -2, bottom = -2},
}
self.Castbar:SetBackdropColor(0, 0, 0, .3)
self.Castbar:SetWidth(ptyWidth)
self.Castbar:SetHeight(ptyMPH)
self.Castbar:SetParent(self.Health)
self.Castbar:SetPoint("TOP", self.Power, "BOTTOM", 0, -4)
self.Castbar:SetStatusBarTexture(statusbar)
self.Castbar:SetStatusBarColor(45/255, 21/255, 53/255)
self.Castbar:SetMinMaxValues(1, 100)
self.Castbar:SetValue(1)
self.Castbar:Hide()
self.Castbar.bg = self.Castbar:CreateTexture(nil, "BORDER")
self.Castbar.bg:SetAllPoints(self.Castbar)
self.Castbar.bg:SetAlpha(0.4)
self.Castbar.Text = self.Castbar:CreateFontString(nil, "OVERLAY")
self.Castbar.Text:SetPoint("LEFT", self.Castbar, 2, 0)
self.Castbar.Text:SetWidth(ptyWidth)
self.Castbar.Text:SetFont(font, fontSize)
self.Castbar.Text:SetTextColor(1, 1, 1)
self.Castbar.Text:SetJustifyH"LEFT"
self.Castbar.Text:SetShadowOffset(1, -1)
self.Castbar.Icon = self.Castbar:CreateTexture(nil, "BACKGROUND")
self.Castbar.Icon:SetHeight(ptyHeight)
self.Castbar.Icon:SetWidth(ptyHeight)
self.Castbar.Icon:SetTexCoord(.07, .93, .07, .93)
self.Castbar.Icon:SetPoint("RIGHT", self.Health, "LEFT", -5, -2)
self.Castbar.Icon.overlay = self.Castbar:CreateTexture(nil, "OVERLAY")
self.Castbar.Icon.overlay:SetAllPoints(self.Castbar.Icon)
self.Castbar.Icon.overlay:SetTexture(border)
self.PVP = SetFontString(self.Health, font, 13, "RIGHT", self.Health, "LEFT", 0, 0)
self.PVP:SetTextColor(1, 0, 0)
self:Tag(self.PVP, "[pvp]")
self.RaidIcon = self.Health:CreateTexture(nil, "OVERLAY")
self.RaidIcon:SetHeight(14)
self.RaidIcon:SetWidth(14)
self.RaidIcon:SetPoint("RIGHT", self, "LEFT")
if(IsAddOnLoaded("oUF_CombatFeedback")) then
self.CombatFeedbackText = SetFontString(self.Health, font, fontSize+1, "CENTER", self.Health, "CENTER", 0, 0)
self.CombatFeedbackText:SetShadowOffset(1, -1)
self.CombatFeedbackText:SetShadowColor(0, 0, 0)
end
self.DebuffHighlightBackdrop = true
self.DebuffHighlightFilter = true
self.DebuffHighlightAlpha = .5
self.PostUpdateHealth = updateHealthBG
if(not unit) then
self.SpellRange = true
self.Range = true
self.inRangeAlpha = 1.0
self.outsideRangeAlpha = 0.4
self.Power.Smooth = true
self.Health.Smooth = true
self.MoveableFrames = true
end
-- Attributing width and height to shit
self:SetAttribute("initial-height", ptyHeight+ptyMPH)
self:SetAttribute("initial-width", ptyWidth)
self.Power:SetHeight(ptyMPH)
end