tekkub / ouf_tek

WoW Addon - My oUF layout

This URL has Read+Write access

ouf_tek / layout.lua
3f0e9a13 » haste 2008-08-02 Create the basics. 1 --[[-------------------------------------------------------------------------
2 Trond A Ekseth grants anyone the right to use this work for any purpose,
3 without any conditions, unless such conditions are required by law.
4 ---------------------------------------------------------------------------]]
5
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 6 local texture = [[Interface\AddOns\oUF_tek\textures\statusbar]]
7 local smallheight, height, width = 31, 64, 170
c0c996e6 » haste 2008-08-03 Unit reaction border. 8 local UnitReactionColor = UnitReactionColor
2106271f » haste 2008-08-05 UnitReaction can return nil. 9 local gray = {r = .3, g = .3, b = .3}
fa358684 » tekkub 2009-06-12 Add focus highlight to tank... 10 local focus_highlight = {r = 1, g = 0, b = 1}
5507ca6e » tekkub 2008-09-15 Add bits needed to use embe... 11 local oUF = tekoUFembed
12 tekoUFembed = nil
3f0e9a13 » haste 2008-08-02 Create the basics. 13
14 local menu = function(self)
15 local unit = self.unit:sub(1, -2)
16 local cunit = self.unit:gsub("(.)", string.upper, 1)
17
18 if(unit == "party" or unit == "partypet") then
19 ToggleDropDownMenu(1, nil, _G["PartyMemberFrame"..self.id.."DropDown"], "cursor", 0, 0)
20 elseif(_G[cunit.."FrameDropDown"]) then
21 ToggleDropDownMenu(1, nil, _G[cunit.."FrameDropDown"], "cursor", 0, 0)
22 end
23 end
24
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 25 local PostUpdateHealth = function(self, event, unit, bar, min, max)
fa358684 » tekkub 2009-06-12 Add focus highlight to tank... 26 local color = self.istankframe and UnitExists("focus") and UnitIsUnit(unit, "focus") and focus_highlight or
27 not UnitIsDeadOrGhost(unit) and (not UnitIsTapped(unit) or UnitIsTappedByPlayer(unit)) and UnitReactionColor[UnitReaction(unit, 'player')]
28 or gray
cb12cf02 » tekkub 2008-09-14 Redesign for new tag string... 29 self:SetBackdropBorderColor(color.r, color.g, color.b)
57e4befe » haste 2008-08-02 Added power points. 30 end
fa358684 » tekkub 2009-06-12 Add focus highlight to tank... 31 local function Update_Focus_Highlight(self, event, ...) PostUpdateHealth(self, event, self.unit) end
57e4befe » haste 2008-08-02 Added power points. 32
5607d5bd » haste 2008-08-02 Added health bar. 33 local backdrop = {
34 bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
35 edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", edgeSize = 16,
36 insets = {left = 4, right = 4, top = 4, bottom = 4},
37 }
38
e5ba16c7 » tekkub 2008-09-16 Custom aura tags! 39
40 ---------------------------
41 -- Custom tags --
42 ---------------------------
43
7abba020 » tekkub 2009-06-12 Custom PP tag 44 oUF.TagEvents["[tekpp]"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_MAXRUNIC_POWER"
45 oUF.Tags["[tekpp]"] = function(u) local c, m = UnitPower(u), UnitPowerMax(u) return c >= m and m ~= 100 and oUF.Tags["[maxpp]"](u) or oUF.Tags["[perpp]"](u).."%" end
46
cb12cf02 » tekkub 2008-09-14 Redesign for new tag string... 47 oUF.TagEvents["[tekhp]"] = "UNIT_HEALTH UNIT_MAXHEALTH"
3d6737c9 » tekkub 2008-09-18 Don't show HP text for offl... 48 oUF.Tags["[tekhp]"] = function(u) local c, m = UnitHealth(u), UnitHealthMax(u) return (c <= 1 or not UnitIsConnected(u)) and "" or c >= m and oUF.Tags["[maxhp]"](u)
cb12cf02 » tekkub 2008-09-14 Redesign for new tag string... 49 or UnitCanAttack("player", u) and oUF.Tags["[perhp]"](u).."%" or "-"..oUF.Tags["[missinghp]"](u) end
50
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 51 oUF.TagEvents["[tekhp2]"] = "UNIT_HEALTH UNIT_MAXHEALTH"
c18c32ba » tekkub 2009-03-05 Tag party pets correctly wh... 52 oUF.Tags["[tekhp2]"] = function(u) local c, m = UnitHealth(u), UnitHealthMax(u) if c == 0 then return "Dead" elseif c < m then return "-"..oUF.Tags["[missinghp]"](u) end end
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 53
54 oUF.TagEvents["[tekpet]"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_NAME_UPDATE"
55 oUF.Tags["[tekpet]"] = function(u) if UnitHealth(u) >= UnitHealthMax(u) then return oUF.Tags["[name]"](u) end end
56
e5ba16c7 » tekkub 2008-09-16 Custom aura tags! 57
c8660b10 » tekkub 2009-04-19 Add pally healy buffs 58 oUF.Tags["[teksacs]"] = function(u) if UnitAura(u, "Sacred Shield") then return "|cffFFAA00SS|r" end end
59 oUF.Tags["[tekbol]"] = function(u) if UnitAura(u, "Beacon of Light") then return "|cffFFD800BoL|r" end end
50f946cf » tekkub 2009-04-01 Add guardian spirit to buff... 60 oUF.Tags["[tekgs]"] = function(u) if UnitAura(u, "Guardian Spirit") then return "|cffFFD800GS|r" end end
5dcfc01e » tekkub 2009-02-26 Use conditional spaces in tags 61 oUF.Tags["[tekmd]"] = function(u) if UnitAura(u, "Misdirection") then return "|cff8E79FEMD|r" end end
62 oUF.Tags["[tekss]"] = function(u) if UnitAura(u, "Soulstone Resurrection") then return "|cffCA21FFSs|r" end end
63 oUF.Tags["[tekinn]"] = function(u) if UnitAura(u, "Innervate") then return "|cff00FF33Inn|r" end end
64 oUF.Tags["[tekpws]"] = function(u) if UnitAura(u, "Power Word: Shield") then return "|cffFFD800PwS|r" end end
65 oUF.Tags["[tekrenew]"] = function(u) if UnitAura(u, "Renew") then return "|cff00FF10Rn|r" end end
66 oUF.Tags["[tekfood]"] = function(u) if UnitAura(u, "Food") then return "|cffD79A6DFoo|r" end end
67 oUF.Tags["[tekdrink]"] = function(u) if UnitAura(u, "Drink") then return "|cff00A1DEDr|r" end end
68 oUF.Tags["[tekms]"] = function(u) if UnitAura(u, "Mortal Strike") then return "|cffFF1111Ms|r" end end
69 oUF.Tags["[tekfw]"] = function(u) if UnitAura(u, "Fear Ward") then return "|cff9900FFFW|r" end end
70 oUF.Tags["[tekrejuv]"] = function(u) if UnitAura(u, "Rejuvenation") then return "|cff00FEBFRej|r" end end
71 oUF.Tags["[tekregrow]"] = function(u) if UnitAura(u, "Regrowth") then return "|cff00FF10Rg|r" end end
72 oUF.Tags["[tekflour]"] = function(u) if UnitAura(u, "Flourish") then return "|cff33FF33Fl|r" end end
73 oUF.Tags["[tekws]"] = function(u) if UnitDebuff(u, "Weakened Soul") then return "|cffFF5500Ws|r" end end
74 oUF.Tags["[tekpom]"] = function(u) local c = select(4, UnitAura(u, "Prayer of Mending")) if c then return "|cffFFCF7FPoM("..c..")|r" end end
75 oUF.Tags["[teklb]"] = function(u) local c = select(4, UnitAura(u, "Lifebloom")) if c then return "|cffA7FD0ALB("..c..")|r" end end
e5ba16c7 » tekkub 2008-09-16 Custom aura tags! 76
f3343170 » tekkub 2008-09-17 Huzzah! Debuffs! 77 local function HasDebuffType(unit, t)
78 for i=1,40 do
79 local name, _, _, _, debuffType = UnitDebuff(unit, i)
80 if not name then return
81 elseif debuffType == t then return true end
82 end
83 end
84
85 oUF.Tags["[tekdisease]"] = function(u) return HasDebuffType(u, "Disease") and "|cff996600Di|r" or "" end
86 oUF.Tags["[tekmagic]"] = function(u) return HasDebuffType(u, "Magic") and "|cff3399FFMa|r" or "" end
87 oUF.Tags["[tekcurse]"] = function(u) return HasDebuffType(u, "Curse") and "|cff9900FFCu|r" or "" end
88 oUF.Tags["[tekpoison]"] = function(u) return HasDebuffType(u, "Poison") and "|cff009900Po|r" or "" end
e5ba16c7 » tekkub 2008-09-16 Custom aura tags! 89
c8660b10 » tekkub 2009-04-19 Add pally healy buffs 90 oUF.TagEvents["[teksacs]"] = "UNIT_AURA"
91 oUF.TagEvents["[tekbol]"] = "UNIT_AURA"
e5ba16c7 » tekkub 2008-09-16 Custom aura tags! 92 oUF.TagEvents["[tekmd]"] = "UNIT_AURA"
93 oUF.TagEvents["[tekss]"] = "UNIT_AURA"
94 oUF.TagEvents["[tekinn]"] = "UNIT_AURA"
95 oUF.TagEvents["[tekpws]"] = "UNIT_AURA"
96 oUF.TagEvents["[tekrenew]"] = "UNIT_AURA"
97 oUF.TagEvents["[tekfood]"] = "UNIT_AURA"
98 oUF.TagEvents["[tekdrink]"] = "UNIT_AURA"
99 oUF.TagEvents["[tekms]"] = "UNIT_AURA"
100 oUF.TagEvents["[tekws]"] = "UNIT_AURA"
101 oUF.TagEvents["[tekfw]"] = "UNIT_AURA"
102 oUF.TagEvents["[tekpom]"] = "UNIT_AURA"
103 oUF.TagEvents["[teklb]"] = "UNIT_AURA"
104 oUF.TagEvents["[tekrejuv]"] = "UNIT_AURA"
105 oUF.TagEvents["[tekregrow]"] = "UNIT_AURA"
106 oUF.TagEvents["[tekflour]"] = "UNIT_AURA"
107
f3343170 » tekkub 2008-09-17 Huzzah! Debuffs! 108 oUF.TagEvents["[tekdisease]"] = "UNIT_AURA"
109 oUF.TagEvents["[tekmagic]"] = "UNIT_AURA"
110 oUF.TagEvents["[tekcurse]"] = "UNIT_AURA"
111 oUF.TagEvents["[tekpoison]"] = "UNIT_AURA"
e5ba16c7 » tekkub 2008-09-16 Custom aura tags! 112
113
114 ------------------------------
115 -- Layout factory --
116 ------------------------------
cb12cf02 » tekkub 2008-09-14 Redesign for new tag string... 117
3f0e9a13 » haste 2008-08-02 Create the basics. 118 local func = function(settings, self, unit)
fa358684 » tekkub 2009-06-12 Add focus highlight to tank... 119 self.istankframe = self:GetParent():GetName() == "oUF_Tanks"
120 if self.istankframe then
121 self.PLAYER_FOCUS_CHANGED = Update_Focus_Highlight
122 self:RegisterEvent("PLAYER_FOCUS_CHANGED")
123 end
124
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 125 self.unit = unit
3f0e9a13 » haste 2008-08-02 Create the basics. 126 self.menu = menu
127
128 self:SetScript("OnEnter", UnitFrame_OnEnter)
129 self:SetScript("OnLeave", UnitFrame_OnLeave)
130
131 self:RegisterForClicks"anyup"
132 self:SetAttribute("*type2", "menu")
133
5607d5bd » haste 2008-08-02 Added health bar. 134 self:SetBackdrop(backdrop)
135 self:SetBackdropColor(0, 0, 0, 1)
92c179ca » haste 2008-08-02 Added power bar. 136 self:SetBackdropBorderColor(.3, .3, .3, 1)
5607d5bd » haste 2008-08-02 Added health bar. 137
138 -- Health bar
139 local hp = CreateFrame"StatusBar"
140 hp:SetStatusBarTexture(texture)
141
142 hp:SetParent(self)
92c179ca » haste 2008-08-02 Added power bar. 143 hp:SetPoint("TOP", 0, -8)
144 hp:SetPoint("LEFT", 8, 0)
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 145 hp:SetPoint("RIGHT", -8, 0)
5607d5bd » haste 2008-08-02 Added health bar. 146
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 147 hp.colorTapping = true
148 hp.colorHappiness = true
149 hp.colorDisconnected = true
150 hp.colorClass = true
93d26b34 » tekkub 2008-09-13 Color up them NPC HP bars b... 151 hp.colorClassNPC = true
238e448d » tekkub 2008-12-20 Use frequentUpdates 152 hp.frequentUpdates = true
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 153
5607d5bd » haste 2008-08-02 Added health bar. 154 self.Health = hp
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 155 self.PostUpdateHealth = PostUpdateHealth
5607d5bd » haste 2008-08-02 Added health bar. 156
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 157 local hpp = hp:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") --"GameFontNormal")
158 hpp:SetPoint("RIGHT", hp, -2, 0)
e0795866 » haste 2008-08-02 Added health points. 159 hpp:SetTextColor(1, 1, 1)
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 160 self:Tag(hpp, settings.size == 'partypet' and "[tekhp2]" or "[dead][offline][tekhp]")
e0795866 » haste 2008-08-02 Added health points. 161
5607d5bd » haste 2008-08-02 Added health bar. 162 -- Health bar background
163 local hpbg = hp:CreateTexture(nil, "BORDER")
164 hpbg:SetAllPoints(hp)
165 hpbg:SetTexture(texture)
a63eaac9 » tekkub 2008-09-13 Use new multiplier for bar ... 166 hpbg.multiplier = .5
5607d5bd » haste 2008-08-02 Added health bar. 167 hp.bg = hpbg
92c179ca » haste 2008-08-02 Added power bar. 168
2fab2145 » haste 2008-08-02 Added name string. 169 -- Unit name
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 170 local name = hp:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") --"GameFontNormal")
171 name:SetPoint("LEFT", 2, 0)
55b99e66 » tekkub 2008-09-17 Move stringy auras to the r... 172 name:SetPoint("RIGHT", hpp, "LEFT", -2, 0)
2fab2145 » haste 2008-08-02 Added name string. 173 name:SetJustifyH"LEFT"
174 name:SetTextColor(1, 1, 1)
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 175 self:Tag(name, settings.size == 'partypet' and "[tekpet]" or "[name][leader]")
176
177 -- Power bar
178 local pp = CreateFrame"StatusBar"
179 pp:SetStatusBarTexture(texture)
180
181 pp:SetParent(self)
182 pp:SetPoint("LEFT", 8, 0)
183 pp:SetPoint("RIGHT", -8, 0)
184
185 pp.colorTapping = true
186 pp.colorDisconnected = true
187 pp.colorPower = true
188
189 self.Power = pp
190
191 -- Power bar background
192 local ppbg = pp:CreateTexture(nil, "BORDER")
193 ppbg:SetAllPoints(pp)
194 ppbg:SetTexture(texture)
195 ppbg.multiplier = .5
196 pp.bg = ppbg
23571fe2 » haste 2008-08-02 Added info string. 197
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 198
199 if settings.size == 'partypet' then
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 200 name:SetPoint("LEFT", 2, 1)
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 201 name:SetPoint("RIGHT", -2, 0)
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 202 hpp:SetPoint("RIGHT", hp, -2, 1)
0de7c5db » haste 2008-08-02 Add a new layout without th... 203
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 204 hp:SetHeight(14)
0de7c5db » haste 2008-08-02 Add a new layout without th... 205
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 206 pp:Hide()
207 ppbg:Hide()
208 self.Power = nil
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 209
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 210 elseif settings.size == 'small' or settings.size == 'party' then
211 name:SetPoint("LEFT", 2, 1)
212 hpp:SetPoint("RIGHT", hp, -2, 1)
0de7c5db » haste 2008-08-02 Add a new layout without th... 213
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 214 hp:SetHeight(10)
215 pp:SetHeight(4)
216 pp:SetPoint("BOTTOM", 0, 8)
0de7c5db » haste 2008-08-02 Add a new layout without th... 217
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 218 else
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 219 hp:SetHeight(14)
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 220 pp:SetHeight(14)
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 221 pp.colorPower = true
238e448d » tekkub 2008-12-20 Use frequentUpdates 222 pp.frequentUpdates = true
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 223
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 224 local ppp = hp:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") --"GameFontNormal")
225 ppp:SetPoint("RIGHT", pp, -2, 0)
0de7c5db » haste 2008-08-02 Add a new layout without th... 226 ppp:SetTextColor(1, 1, 1)
d475fc94 » tekkub 2009-04-19 Fix frq tag for new method 227 ppp.frequentUpdates = self.unit == "player"
7abba020 » tekkub 2009-06-12 Custom PP tag 228 self:Tag(ppp, "[tekpp]")
0de7c5db » haste 2008-08-02 Add a new layout without th... 229
230 -- Info string
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 231 local info = pp:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") --"GameFontNormal")
232 info:SetPoint("LEFT", 2, 0)
233 info:SetPoint("RIGHT", ppp, "LEFT", -2, 0)
0de7c5db » haste 2008-08-02 Add a new layout without th... 234 info:SetJustifyH"LEFT"
235 info:SetTextColor(1, 1, 1)
5dcfc01e » tekkub 2009-02-26 Use conditional spaces in tags 236 self:Tag(info, "[difficulty][smartlevel][( )rare] [raidcolor][smartclass]")
0de7c5db » haste 2008-08-02 Add a new layout without th... 237
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 238 local cast = CreateFrame"StatusBar"
239 cast:SetWidth(width - 16 -14)
240 cast:SetHeight(14)
241 cast:SetStatusBarTexture(texture)
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 242 cast:SetStatusBarColor(.8, .8, 0)
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 243
244 cast:SetParent(self)
245 cast:SetPoint("BOTTOM", 0, 8)
246 cast:SetPoint("LEFT", 8 + 14, 0)
247
248 local castbg = cast:CreateTexture(nil, "BORDER")
249 castbg:SetAllPoints()
250 castbg:SetTexture(texture)
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 251 castbg:SetVertexColor(.4, .4, 0)
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 252 cast.bg = castbg
253
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 254 local castime = cast:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") --"GameFontNormal")
255 castime:SetPoint("RIGHT", cast, -2, 0)
256 castime:SetTextColor(1, 1, 1)
257 cast.Time = castime
258
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 259 local castext = cast:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") --"GameFontNormal")
260 castext:SetPoint("LEFT", cast, 2, 0)
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 261 castext:SetPoint("RIGHT", castime, "LEFT", -2, 0)
262 castext:SetJustifyH"LEFT"
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 263 castext:SetTextColor(1, 1, 1)
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 264 cast.Text = castext
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 265
266
267 local casticon = cast:CreateTexture(nil, "BORDER")
268 casticon:SetPoint("RIGHT", cast, "LEFT")
269 casticon:SetWidth(14) casticon:SetHeight(14)
8c5d2c8c » tekkub 2008-09-13 Update for new version of oUF 270 cast.Icon = casticon
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 271
272 self.Castbar = cast
23571fe2 » haste 2008-08-02 Added info string. 273 end
d36da0e3 » haste 2008-08-02 Add buffs/debuffs. 274
a2857b07 » tekkub 2009-06-12 make sure pets get same aur... 275 local auratags = "[tekcurse( )][tekpoison( )][tekdisease( )][tekmagic( )][tekms( )][tekmd( )][tekgs( )][tekbol( )][teksacs( )][tekpws( )][tekws( )][tekflour( )][teklb( )][tekregrow( )][tekrejuv( )][tekrenew( )][tekpom( )][tekss( )][tekfw( )][tekinn( )][tekfood( )][tekdrink]"
92c6fe8e » haste 2008-08-03 Don't show buffs/debuffs on... 276 if(unit ~= 'player') then
bb3b3682 » tekkub 2008-09-13 Add party 277 if settings.size == 'party' then
55b99e66 » tekkub 2008-09-17 Move stringy auras to the r... 278 local auras = self:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
bb3b3682 » tekkub 2008-09-13 Add party 279 auras:SetPoint("LEFT", self, "RIGHT")
55b99e66 » tekkub 2008-09-17 Move stringy auras to the r... 280 auras:SetTextColor(1, 1, 1)
a2857b07 » tekkub 2009-06-12 make sure pets get same aur... 281 self:Tag(auras, auratags)
55b99e66 » tekkub 2008-09-17 Move stringy auras to the r... 282
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 283 elseif settings.size == 'partypet' then
284 local auras = self:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
285 auras:SetPoint("RIGHT", self, "LEFT")
286 auras:SetTextColor(1, 1, 1)
a2857b07 » tekkub 2009-06-12 make sure pets get same aur... 287 self:Tag(auras, auratags)
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 288
289 else
bb3b3682 » tekkub 2008-09-13 Add party 290 -- Buffs
291 local buffs = CreateFrame("Frame", nil, self)
292 if settings.size == 'small' then buffs:SetPoint("BOTTOMLEFT", self, "TOPLEFT") else buffs:SetPoint("TOPLEFT", self, "BOTTOMLEFT") end
293 buffs:SetHeight(16)
294 buffs:SetWidth(width/2)
295
296 buffs.size = 16
297 buffs.num = math.floor(width / buffs.size + .5)
298 buffs["growth-y"] = settings.size == 'small' and "UP" or "DOWN"
299
300 self.Buffs = buffs
301
302 -- Debuffs
303 local debuffs = CreateFrame("Frame", nil, self)
304 if settings.size == 'small' then debuffs:SetPoint("BOTTOMRIGHT", self, "TOPRIGHT") else debuffs:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT") end
305 debuffs:SetHeight(16)
306 debuffs:SetWidth(width/2)
307
308 debuffs.initialAnchor = settings.size == 'small' and "BOTTOMRIGHT" or "TOPRIGHT"
309 debuffs["growth-x"] = "LEFT"
310 debuffs["growth-y"] = settings.size == 'small' and "UP" or "DOWN"
311 debuffs.size = 16
312 debuffs.num = math.floor(width / debuffs.size + .5)
313
314 self.Debuffs = debuffs
315 end
185fcf1c » haste 2008-08-05 Add a blue border on the pl... 316 else
92c6fe8e » haste 2008-08-03 Don't show buffs/debuffs on... 317 end
0de7c5db » haste 2008-08-02 Add a new layout without th... 318
07c3369b » haste 2008-08-05 Add the leader icon. 319 local leader = self:CreateTexture(nil, "OVERLAY")
320 leader:SetHeight(16)
321 leader:SetWidth(16)
cb12cf02 » tekkub 2008-09-14 Redesign for new tag string... 322 leader:SetPoint("LEFT", self, "TOPLEFT", 15, 0)
07c3369b » haste 2008-08-05 Add the leader icon. 323 leader:SetTexture[[Interface\GroupFrame\UI-Group-LeaderIcon]]
324 self.Leader = leader
325
afa00912 » tekkub 2008-09-13 Add raid icons 326 -- Raid icon
327 local ricon = self:CreateTexture(nil, "OVERLAY")
328 ricon:SetHeight(16)
329 ricon:SetWidth(16)
330 ricon:SetPoint("CENTER", self, "TOP")
331 ricon:SetTexture[[Interface\TargetingFrame\UI-RaidTargetingIcons]]
332 self.RaidIcon = ricon
333
c7d06f23 » tekkub 2008-09-13 Add threat icons 334 -- Threat icon
335 local threat = self:CreateTexture(nil, "OVERLAY")
336 threat:SetHeight(20)
337 threat:SetWidth(20)
338 threat:SetPoint("CENTER", self, "TOPRIGHT", -4, -4)
339 threat:SetTexture([[Interface\Minimap\ObjectIcons]])
340 threat:SetTexCoord(6/8, 7/8, 1/2, 1)
341 self.Threat = threat
342
cb12cf02 » tekkub 2008-09-14 Redesign for new tag string... 343 -- PvP icon
344 local pvp = self:CreateTexture(nil, "OVERLAY")
345 pvp:SetHeight(32)
346 pvp:SetWidth(32)
347 if settings.size then pvp:SetPoint("CENTER", self, "LEFT", 6, -6) else pvp:SetPoint("CENTER", self, "BOTTOMLEFT", 12, 0) end
348 self.PvP = pvp
349
350 if unit == "player" then
351 -- Resting icon
352 local rest = self:CreateTexture(nil, "OVERLAY")
353 rest:SetHeight(24)
354 rest:SetWidth(24)
355 rest:SetPoint("CENTER", self, "TOPLEFT", 5, -1)
356 rest:SetTexture([[Interface\CharacterFrame\UI-StateIcon]])
357 rest:SetTexCoord(0, 1/2, 0, 0.421875)
358 self.Resting = rest
359
360 local combat = self:CreateTexture(nil, "OVERLAY")
361 combat:SetHeight(24)
362 combat:SetWidth(24)
363 combat:SetPoint("CENTER", self, "BOTTOMRIGHT", -5, 5)
364 combat:SetTexture([[Interface\CharacterFrame\UI-StateIcon]])
365 combat:SetTexCoord(1/2, 1, 0.01, 0.5)
366 self.Combat = combat
367
368 end
369
0de7c5db » haste 2008-08-02 Add a new layout without th... 370 -- Range fading on party
371 if(not unit) then
372 self.Range = true
373 self.inRangeAlpha = 1
948ccb5a » tekkub 2008-09-13 Change party range alpha 374 self.outsideRangeAlpha = .65
0de7c5db » haste 2008-08-02 Add a new layout without th... 375 end
3f0e9a13 » haste 2008-08-02 Create the basics. 376 end
377
378 oUF:RegisterStyle("Classic", setmetatable({
379 ["initial-width"] = width,
380 ["initial-height"] = height,
381 }, {__call = func}))
382
0de7c5db » haste 2008-08-02 Add a new layout without th... 383 oUF:RegisterStyle("Classic - Small", setmetatable({
384 ["initial-width"] = width,
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 385 ["initial-height"] = smallheight,
0de7c5db » haste 2008-08-02 Add a new layout without th... 386 ["size"] = 'small',
387 }, {__call = func}))
388
bb3b3682 » tekkub 2008-09-13 Add party 389 oUF:RegisterStyle("Classic - Party", setmetatable({
390 ["initial-width"] = width,
391 ["initial-height"] = smallheight,
392 ["size"] = 'party',
393 }, {__call = func}))
394
395 oUF:RegisterStyle("Classic - PartyPet", setmetatable({
d50d9be3 » tekkub 2009-02-26 Add partypet UFs 396 ["initial-width"] = width/2,
bb3b3682 » tekkub 2008-09-13 Add party 397 ["initial-height"] = smallheight,
398 ["size"] = 'partypet',
399 }, {__call = func}))
400
cb12cf02 » tekkub 2008-09-14 Redesign for new tag string... 401
402 -----------------------
403 -- Cluster --
404 -----------------------
405
3f0e9a13 » haste 2008-08-02 Create the basics. 406 oUF:SetActiveStyle"Classic"
407
408 local player = oUF:Spawn"player"
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 409 player:SetPoint("BOTTOMRIGHT", WorldFrame, "BOTTOM", 0, 80)
7c0e254d » haste 2008-08-03 Spawn the pet also. 410
350ba452 » haste 2008-08-03 Fix a typo. 411 local target = oUF:Spawn"target"
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 412 target:SetPoint("LEFT", player, "RIGHT")
c7f1c39c » haste 2008-08-02 Added party. 413
414 oUF:SetActiveStyle"Classic - Small"
415
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 416 local pet = oUF:Spawn"pet"
417 pet:SetPoint('BOTTOMRIGHT', player, 'TOPRIGHT')
418
419 local focus = oUF:Spawn"focus"
420 focus:SetPoint("BOTTOMLEFT", target, "TOPLEFT")
421
422
bb3b3682 » tekkub 2008-09-13 Add party 423 ----------------------------
424 -- Party frames --
425 ----------------------------
426
427 oUF:SetActiveStyle("Classic - Party")
428
429 local party = oUF:Spawn("header", "oUF_Party")
430 party:SetPoint("TOPLEFT", UIParent, "LEFT", 300, 0)
431 party:SetManyAttributes(
432 "showParty", true,
433 "yOffset", 0, -- -smallheight,
434 "xOffset", -40
435 )
436 party:Show()
437
438
5a257bcd » tekkub 2009-03-01 Add maintank and mainassist... 439 local tanks = oUF:Spawn("header", "oUF_Tanks")
440 tanks:SetPoint("BOTTOM", party, "TOP", 0, 20)
441 tanks:SetManyAttributes(
442 "showRaid", true,
443 "yOffset", 0, -- -smallheight,
444 "xOffset", -40,
c8659e2f » tekkub 2009-06-12 merge assists into tanks group 445 "groupFilter", "MAINTANK,MAINASSIST"
5a257bcd » tekkub 2009-03-01 Add maintank and mainassist... 446 )
447 tanks:Show()
448
449
9de1c8d6 » tekkub 2009-06-12 Add personal tank frames 450 local ptanks = oUF:Spawn("header", "oUF_Tanks")
451 ptanks:SetPoint("BOTTOM", tanks, "TOP", 0, 0)
452 ptanks:SetManyAttributes(
453 "showRaid", true,
454 "yOffset", 0, -- -smallheight,
455 "xOffset", -40,
456 "nameList", ""
457 )
458 ptanks:Show()
459
460
461 local mytanks = {}
462 SLASH_OUF_TEK_TANK1 = "/ptank"
463 SlashCmdList.OUF_TEK_TANK = function(msg)
464 if InCombatLockdown() then return print("Cannot set personal tanks in combat!") end
465
466 local name = msg ~= "" and msg or UnitName("target")
467 local found
468 for i,n in pairs(mytanks) do
469 if n == name then
470 found = true
471 table.remove(mytanks, i)
472 end
473 end
474 if not found then table.insert(mytanks, name) end
475
476 ptanks:SetAttribute("nameList", table.concat(mytanks, ","))
477 end
bb3b3682 » tekkub 2008-09-13 Add party 478
479
def19a9c » tekkub 2009-06-12 Fix how pets are spawned so... 480 oUF:SetActiveStyle("Classic - PartyPet")
bb3b3682 » tekkub 2008-09-13 Add party 481
def19a9c » tekkub 2009-06-12 Fix how pets are spawned so... 482 local lastpet
483 for i=1,4 do
484 local pet = oUF:Spawn("partypet"..i)
485 pet:SetPoint("TOPRIGHT", lastpet or party, lastpet and "BOTTOMRIGHT" or "TOPLEFT")
486 lastpet = pet
487 end
5a257bcd » tekkub 2009-03-01 Add maintank and mainassist... 488
489
cb12cf02 » tekkub 2008-09-14 Redesign for new tag string... 490 ---------------------------
491 -- Rune frames --
492 ---------------------------
bb3b3682 » tekkub 2008-09-13 Add party 493
5486b157 » tekkub 2008-09-12 My tweaks to classic layout 494 RuneButtonIndividual4:ClearAllPoints()
495 RuneButtonIndividual4:SetPoint("RIGHT", player, "LEFT", -2, 0)
496
497 RuneButtonIndividual2:ClearAllPoints()
498 RuneButtonIndividual2:SetPoint("BOTTOM", RuneButtonIndividual4, "TOP", 0, 4)
499
500 RuneButtonIndividual6:ClearAllPoints()
501 RuneButtonIndividual6:SetPoint("TOP", RuneButtonIndividual4, "BOTTOM", 0, -4)
502
503 RuneButtonIndividual5:ClearAllPoints()
504 RuneButtonIndividual5:SetPoint("RIGHT", RuneButtonIndividual6, "LEFT", -4, 0)
505
506 RuneButtonIndividual3:ClearAllPoints()
507 RuneButtonIndividual3:SetPoint("RIGHT", RuneButtonIndividual4, "LEFT", -4, 0)
508
509 RuneButtonIndividual1:ClearAllPoints()
510 RuneButtonIndividual1:SetPoint("RIGHT", RuneButtonIndividual2, "LEFT", -4, 0)
511