Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BuffFrame:UnregisterAllEvents()
- BuffFrame:Hide()
- TemporaryEnchantFrame:Hide()
- CompactRaidFrameManager:UnregisterAllEvents()
- CompactRaidFrameManager:Hide()
- CompactRaidFrameContainer:UnregisterAllEvents()
- CompactRaidFrameContainer:Hide()
- ConsolidatedBuffs:Hide()
- ConsolidatedBuffs:UnregisterAllEvents()
- SpellActivationOverlayFrame:Hide()
- SpellActivationOverlayFrame:UnregisterAllEvents()
- RuneFrame:Hide()
- RuneFrame.Show = RuneFrame.Hide
- local backdrop = { bgFile = 'Interface\\ChatFrame\\ChatFrameBackground', insets = {top = -1, left = -1, bottom = -1, right = -1}, }
- local btex = 'Interface\\AddOns\\oUF_y\\Flat.tga'
- --local fonttw = 'Interface\\AddOns\\oUF_y\\twcenmt.ttf'
- local font2 = 'Interface\\AddOns\\oUF_y\\visitor2.ttf'
- local fonttw = font2
- local cpoint = 'Interface\\AddOns\\oUF_y\\square.tga'
- local _, playerClass = UnitClass("player")
- classcolor = function(unit)
- if unit then
- local class = select(2, UnitClass(unit))
- if RAID_CLASS_COLORS[class] then
- return RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b
- end
- end
- end
- oUF.colors.runes = {
- {1, .1, .4};
- {.3, .5, .3};
- {.3, 1, 1};
- {.9, .3, 1};
- }
- local dropdown = CreateFrame("Frame", "MyAddOnUnitDropDownMenu", UIParent, "UIDropDownMenuTemplate") -- thanks to Phanx for this
- UIDropDownMenu_Initialize(dropdown, function(self)
- local unit = self:GetParent().unit
- if not unit then return end
- local menu, name, id
- if UnitIsUnit(unit, "player") then
- menu = "SELF"
- elseif UnitIsUnit(unit, "vehicle") then
- menu = "VEHICLE"
- elseif UnitIsUnit(unit, "pet") then
- menu = "PET"
- elseif UnitIsPlayer(unit) then
- id = UnitInRaid(unit)
- if id then
- menu = "RAID_PLAYER"
- name = GetRaidRosterInfo(id)
- elseif UnitInParty(unit) then
- menu = "PARTY"
- else
- menu = "PLAYER"
- end
- else
- menu = "TARGET"
- name = RAID_TARGET_ICON
- end
- if menu then
- UnitPopup_ShowMenu(self, menu, unit, name, id)
- end
- end, "MENU")
- local menu = function(self)
- dropdown:SetParent(self)
- ToggleDropDownMenu(1, nil, dropdown, "cursor", 0, 0)
- end
- local FormatTime = function(s) -- stole this from ouf_cael I think
- local day, hour, minute = 86400, 3600, 60
- if s >= day then
- return format("%dd", floor(s/day + 0.5)), s % day
- elseif s >= hour then
- return format("%dh", floor(s/hour + 0.5)), s % hour
- elseif s >= minute then
- return format("%dm", floor(s/minute + 0.5)), s % minute
- elseif s >= minute / 12 then
- return floor(s + 0.5), (s * 100 - floor(s * 100))/100
- end
- return format("%.1d", s), (s * 100 - floor(s * 100))/100
- end
- local CreateAuraTimer = function(self,elapsed)
- if self.timeLeft then
- self.elapsed = (self.elapsed or 0) + elapsed
- if self.elapsed >= 0.1 then
- if not self.first then
- self.timeLeft = self.timeLeft - self.elapsed
- else
- self.timeLeft = self.timeLeft - GetTime()
- self.first = false
- end
- if self.timeLeft > 0 then
- local time = FormatTime(self.timeLeft)
- self.remaining:SetText(time)
- self.remaining:SetTextColor(0.84, 0.75, 0.65)
- else
- self.remaining:Hide()
- self:SetScript("OnUpdate", nil)
- end
- self.elapsed = 0
- end
- end
- end
- local UpdateAura = function(icons, unit, icon, index, offset, filter, isDebuff)--(self, icons, unit, icon, index)
- local _, _, _, _, _, duration, expirationTime, unitCaster, _ = UnitAura(unit, index, icon.filter)
- if unitCaster ~= 'player' then
- if icon.debuff or unit == 'player' then
- icon.icon:SetDesaturated(true)
- end
- end
- if duration and duration > 0 then
- icon.remaining:Show()
- else
- icon.remaining:Hide()
- end
- icon.duration = duration
- icon.timeLeft = expirationTime
- icon.first = true
- icon:SetScript("OnUpdate", CreateAuraTimer)
- end
- local CreateAura = function(aura, button)
- button.count:SetPoint("TOPLEFT", -8, 18)
- button.count:SetFont(font2, 12, "MONOCHROMETHINOUTLINE")
- button.count:SetTextColor(1, 1, 1)
- button.overlay:SetTexture(nil)
- button.overlay:SetPoint("TOPLEFT", button, "TOPLEFT")
- button.overlay:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT")
- button.overlay:SetTexCoord(0, 1, 0, 1)
- button.overlay.Hide = function(self) end
- button.icon:SetTexCoord(0.07, 0.93, 0.07, 0.93)
- local f = CreateFrame("Frame", nil, button)
- f:SetBackdrop(backdrop)
- f:SetBackdropColor(0,0,0)
- f:SetPoint("TOPLEFT", button, "TOPLEFT", 0, 0)
- f:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT")
- f:SetFrameStrata("LOW")
- button.remaining = button:CreateFontString(nil, "OVERLAY")
- button.remaining:SetPoint("BOTTOMRIGHT", 2, -1)
- button.remaining:SetFont(font2, 12, "MONOCHROMETHINOUTLINE")
- button.remaining:SetTextColor(1, 1, 1)
- end
- oUF.Tags["text:hp"] = function(u)
- local hp = tostring(UnitHealth(u)) -- string.len doesn't work with numbers :(
- if string.len(hp) > 6 then
- hp = select(3, hp:find("^(...)")):gsub("%d", "%1%.", 1).." m" -- more graceful solution wanted
- elseif string.len(hp) > 5 then
- hp = select(3, hp:find("^(...)")).." k"
- end
- if(not UnitIsConnected(u)) then
- return "D/C"
- elseif UnitIsDead(u) then
- return "DEAD"
- elseif UnitIsGhost(u) then
- return "GHOST"
- else
- return hp
- end
- end
- oUF.TagEvents["text:hp"] = oUF.TagEvents.missinghp
- oUF.Tags["text:pp"] = function(u)
- local pp, pmax = tostring(UnitPower(u)), UnitPowerMax(u)
- if string.len(pp) > 6 then
- pp = select(3, pp:find("^(...)")):gsub("%d", "%1.", 1).." m"
- elseif string.len(pp) > 5 then
- pp = select(3, pp:find("^(...)")).." k"
- end
- if(not UnitIsConnected(u)) then
- return "D/C"
- elseif UnitIsDead(u) then
- return "DEAD"
- elseif UnitIsGhost(u) then
- return "GHOST"
- elseif(cur == 0 or pmax == 0) then
- return "NONE"
- else
- return pp
- end
- end
- oUF.TagEvents["text:pp"] = oUF.TagEvents.missingpp
- oUF.Tags["text:pres"] = function(u)
- if u then
- return UnitIsAFK(u) and "|cFFFFFFFF<AFK>|r" or UnitIsDND(u) and "|cFFFFFFFF<DND>|r" -- stolen from ouf_nivea
- end
- end
- oUF.TagEvents["text:pres"] = "PLAYER_FLAGS_CHANGED"
- oUF.Tags["text:combo"] = function(u)
- local cp
- if(UnitHasVehicleUI'player') then -- fuck yeah p3lim
- cp = GetComboPoints('vehicle', 'target')
- else
- cp = GetComboPoints('player', 'target')
- end
- local cpstring = string.rep("*", cp)
- return (cp == 5) and "|cFFFF0000"..cpstring or "|cFFFFF569"..cpstring
- end
- oUF.TagEvents["text:combo"] = "UNIT_COMBO_POINTS PLAYER_TARGET_CHANGED"
- local function healthstringupdate(s,u,...)
- if u then
- local barlength = math.floor(s:GetParent():GetWidth()/5.8)
- local curhp,maxhp = UnitHealth(u),UnitHealthMax(u)
- local dashes = string.rep("-", barlength)
- local replacenumhp = math.floor((curhp/maxhp)*#dashes)
- local classred, classgreen, classblue = classcolor(u)
- local hexcolor = string.format("|cFF%02x%02x%02x", classred * 255, classgreen * 255, classblue * 255)
- dashes = dashes:gsub("%-", hexcolor.."\124||cFF595972", replacenumhp)
- dashes = dashes:gsub(hexcolor.."\124||cFF595972", "%-", replacenumhp-1) -- WTB better solution, pst
- s.string:SetText("|cFF595972["..dashes.."]|r")
- end
- end
- local function powerstringupdate(s,u,...)
- if u then
- if (UnitPowerMax(u) == 0) then
- s.string:SetText(nil)
- return
- end
- local barlength = math.floor((s:GetParent():GetWidth()/5.8) - 6) -- 5 chars for health or power number plus 1 space
- local curpp,maxpp = UnitPower(u),UnitPowerMax(u)
- local dashes = string.rep("-", barlength)
- local replacenumpp = math.floor((curpp/maxpp)*#dashes)
- local classred, classgreen, classblue = classcolor(u)
- local hexcolor = string.format("|cFF%02x%02x%02x", classred * 255, classgreen * 255, classblue * 255)
- dashes = dashes:gsub("%-", "|cFF595972\124|"..hexcolor, replacenumpp)
- dashes = dashes:gsub("|cFF595972\124|"..hexcolor, "%-", replacenumpp-1)
- local endcap = replacenumpp == barlength and "|r|cFF595972]|r" or "|r|cFF595972]|r" -- loads of escape problems because I'm using a pipe :D
- s.string:SetText("|cFF595972["..hexcolor..dashes..endcap)
- end
- end
- local function caststringonupdate(s,e,...)
- if s.casting then
- local totalTime = s.endTime - s.startTime
- local curTime = GetTime() - s.startTime
- local dashes = string.rep("-", 26)
- local replacecastpos = math.floor((curTime/totalTime)*#dashes)
- dashes = dashes:gsub("%-", "|cFFFFFFFF\124||cFF595972", replacecastpos)
- dashes = dashes:gsub("|cFFFFFFFF\124||cFF595972", "%-", replacecastpos-1)
- s.string:SetText("|cFF595972["..dashes.."]|r")
- end
- end
- local function caststringstart(s, u, ...)
- local startTime
- if u then
- if UnitCastingInfo(u) then
- _,_,_,_, startTime, endTime = UnitCastingInfo(u)
- s.startTime = startTime / 1e3 -- stole this from ouf's castbar.lua
- s.endTime = endTime / 1e3
- elseif UnitChannelInfo(u) then
- _,_,_,_, startTime, endTime = UnitChannelInfo(u)
- s.startTime = startTime / 1e3
- s.endTime = endTime / 1e3
- end
- s:SetScript("OnUpdate", caststringonupdate)
- end
- end
- local function caststringstop(s,u,...)
- s.startTime = nil
- s.endTime = nil
- s:SetScript("OnUpdate", nil)
- end
- local function runeonupdate(s,e)
- local minrune,maxrune = s:GetMinMaxValues()
- if(maxrune == 1) then
- s:SetScript("OnUpdate", nil)
- end
- local current = s:GetValue()
- local r,g,b = s:GetStatusBarColor()
- local color = string.format("|cFF%02x%02x%02x", r * 255, g * 255, b * 255)
- local multi = 0.3
- local bgcolor = string.format("|cFF%02x%02x%02x", (r * 255)/multi, (g * 255)/multi, (b * 255)/multi)
- local rcurrent = math.floor(((current/maxrune)*4)+0.5)
- local reverse = 4 - rcurrent
- local runestring = color.."["..string.rep("-", rcurrent).."|r"..string.rep("-",reverse)..color.."]"
- s.string:SetText(runestring)
- --print("min: "..minrune.." max: "..maxrune.." current: "..s:GetValue())
- end
- local function runetextupdate(s,rune,...)
- for i=1,6 do
- local currentrune = s.Runes[i]
- local r,g,b = currentrune:GetStatusBarColor()
- local runecolor = string.format("|cFF%02x%02x%02x", r * 255, g * 255, b * 255)
- local minrune,maxrune = currentrune:GetMinMaxValues()
- --print("min: "..minrune.." Max: "..maxrune)
- if(maxrune == 1) then
- currentrune.string:SetText(runecolor.."[----]")
- else
- currentrune:HookScript("OnUpdate", runeonupdate)
- end
- end
- end
- local function layout(self, unit)
- self.menu = menu
- self:RegisterForClicks("anyup")
- self:SetAttribute("*type2", "menu")
- self:SetBackdrop(backdrop)
- self:SetBackdropColor(0,0,0,0)
- self:SetHeight(28)
- self:SetWidth(207)
- local healthcontainer = CreateFrame("Statusbar", nil, self) -- ouf expects self.Health (and most other elements) to be a statusbar no matter what
- local healthstring = healthcontainer:CreateFontString(nil, 'OVERLAY')
- healthstring:SetFont(font2, 12, 'MONOCHROMETHINOUTLINE')
- healthstring:SetShadowColor(0,0,0,0)
- healthstring:SetJustifyH("CENTER")
- healthstring:SetPoint("CENTER", self, 0, 0)
- self.Health = healthcontainer
- self.Health.string = healthstring
- self.Health.PostUpdate = healthstringupdate
- local powercontainer = CreateFrame("Statusbar", nil, self)
- local powerstring = powercontainer:CreateFontString(nil, 'OVERLAY')
- powerstring:SetFont(font2, 12, 'MONOCHROMEOUTLINE')
- powerstring:SetShadowColor(0,0,0,0)
- powerstring:SetJustifyH("LEFT")
- --powerstring:SetPoint("TOP", healthstring, "BOTTOM", 0, 4) -- centered
- powerstring:SetPoint("TOPLEFT", healthstring, "BOTTOMLEFT", -.5, 4) -- to the left
- self.Power = powercontainer
- self.Power.string = powerstring
- self.Power.PostUpdate = powerstringupdate
- local healthval = self:CreateFontString(nil, 'OVERLAY')
- healthval:SetFont(font2, 12, 'MONOCHROMEOUTLINE')
- healthval:SetShadowColor(0,0,0,0)
- healthval:SetJustifyH("RIGHT")
- healthval:SetPoint("TOPRIGHT", healthstring, "BOTTOMRIGHT", -.5, 4)
- self:Tag(healthval,'[raidcolor][text:hp]')
- self.Health.value = healthval
- local powerval = self:CreateFontString(nil, 'OVERLAY')
- powerval:SetFont(font2, 12, 'MONOCHROMEOUTLINE')
- powerval:SetShadowColor(0,0,0,0)
- powerval:SetJustifyH("RIGHT")
- powerval:SetPoint("TOPRIGHT", healthstring, "BOTTOMRIGHT", -.5, 4)
- powerval:SetAlpha(0)
- self:Tag(powerval,'[raidcolor][text:pp]')
- self.Power.value = powerval
- self:SetScript("OnEnter", function(self) -- Toggle visibility of health/power when mousing over the frame
- powerval:SetAlpha(1)
- healthval:SetAlpha(0)
- UnitFrame_OnEnter(self)
- end)
- self:SetScript("OnLeave", function(self)
- powerval:SetAlpha(0)
- healthval:SetAlpha(1)
- UnitFrame_OnLeave(self)
- end)
- local unitnames = self:CreateFontString(nil, 'ARTWORK')
- unitnames:SetFont(fonttw, 12, 'MONOCHROMETHINOUTLINE')
- unitnames:SetShadowColor(0,0,0,0)
- unitnames:SetPoint('BOTTOM', healthstring, "TOP", 0, 0)
- unitnames:SetJustifyH("CENTER")
- self:Tag(unitnames,'[text:pres][raidcolor][name]')
- self.Name = unitnames
- local castcontainer = CreateFrame("Statusbar", nil, self)
- local caststring = castcontainer:CreateFontString(nil, 'OVERLAY')
- caststring:SetFont(font2, 12, 'MONOCHROMETHINOUTLINE')
- caststring:SetShadowColor(0,0,0,0)
- caststring:SetJustifyH("CENTER")
- caststring:SetPoint("BOTTOM", self, 0, -80)
- self.Castbar = castcontainer
- self.Castbar.string = caststring
- self.Castbar.PostCastStart = caststringstart
- self.Castbar.PostChannelStart = caststringstart
- self.Castbar.PostCastStop = caststringstop
- self.Castbar.PostChannelStop = caststringstop
- local casttext = castcontainer:CreateFontString(nil, 'OVERLAY')
- casttext:SetFont(font2, 12, 'MONOCHROMETHINOUTLINE')
- casttext:SetShadowColor(0,0,0,0)
- casttext:SetJustifyH("CENTER")
- casttext:SetPoint("BOTTOM", caststring, "TOP", 0, 0)
- self.Castbar.Text = casttext
- self.RaidIcon = self:CreateTexture(nil, "OVERLAY")
- self.RaidIcon:SetHeight(10)
- self.RaidIcon:SetWidth(10)
- self.RaidIcon:SetPoint("RIGHT", self.Name, 'LEFT', -6, -1)
- self.RaidIcon:SetTexture"Interface\\TargetingFrame\\UI-RaidTargetingIcons"
- --[[local threat = self.Health:CreateTexture(nil, "OVERLAY")
- threat:SetSize(3,3)
- threat:SetPoint("TOPRIGHT", self.Health, "TOPRIGHT")
- threat:SetTexture(cpoint)
- threat:SetVertexColor(1,0,0)
- self.Threat = threat
- local threatbg = self.Health:CreateTexture(nil, "ARTWORK") -- 1 px border around the tiny red square
- threatbg:SetPoint("TOPRIGHT", self.Health, "TOPRIGHT")
- threatbg:SetSize(self.Threat:GetHeight()+1,self.Threat:GetWidth()+1)
- threatbg:SetTexture(cpoint)
- threatbg:SetVertexColor(0,0,0)
- threatbg:Hide()
- self.Threatbg = threatbg
- self.Threat.PostUpdate = function(self, unit, status)
- if(status and status > 0) then
- threatbg:Show()
- else
- threatbg:Hide()
- end
- end]]
- local leader = self:CreateTexture(nil, "OVERLAY")
- leader:SetSize(15,15)
- leader:SetTexture("Interface\\GroupFrame\\UI-Group-LeaderIcon")
- leader:SetAlpha(.7)
- leader:SetPoint("BOTTOM", self.Name, "LEFT", -1, -4)
- leader:SetTexCoord(0.2,-0.4,-0.4,0.8,1.4,0.2,0.8,1.4) -- Rotate so it looks slated on top of the unit name
- self.Leader = leader
- local buffs = CreateFrame("Frame", nil, self)
- buffs:SetHeight(40)
- buffs:SetWidth(self:GetWidth())
- buffs.spacing = 3
- buffs.size = 16
- buffs.disableCooldown = true
- self.Buffs = buffs
- self.Buffs.PostCreateIcon = CreateAura
- self.Buffs.PostUpdateIcon = UpdateAura
- local debuffs = CreateFrame("Frame", nil, self)
- debuffs:SetHeight(40)
- debuffs:SetWidth(self:GetWidth())
- debuffs.spacing = 3
- debuffs.size = 16
- debuffs.disableCooldown = true
- self.Debuffs = debuffs
- self.Debuffs.PostCreateIcon = CreateAura
- self.Debuffs.PostUpdateIcon = UpdateAura
- end
- --[[ /////////////////////////////////////////////////////////////////////////////////// ]]--
- --[[ /////////////////////////////////////////////////////////////////////////////////// ]]--
- --[[ I keep scrolling past this while looking for it, so heres a big comment as a marker ]]--
- --[[ /////////////////////////////////////////////////////////////////////////////////// ]]--
- --[[ /////////////////////////////////////////////////////////////////////////////////// ]]--
- local UnitSpecific = {
- target = function(self)
- layout(self)
- self.Buffs.initialAnchor = "TOPRIGHT"
- self.Buffs["growth-x"] = "LEFT"
- self.Buffs["growth-y"] = "DOWN"
- self.Buffs:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT", -5, -5)
- self.Debuffs["growth-x"] = "RIGHT"
- self.Debuffs["growth-y"] = "UP"
- self.Debuffs:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 2, 3)
- local combopoints = self:CreateFontString(nil, 'OVERLAY')
- combopoints:SetFont(font2, 12, 'MONOCHROMETHINOUTLINE')
- combopoints:SetShadowColor(0,0,0,0)
- combopoints:SetPoint("BOTTOMLEFT", self.Health.string, "LEFT")
- combopoints:SetJustifyH("LEFT")
- self:Tag(combopoints,'[text:combo]')
- end,
- targettarget = function(self)
- layout(self)
- self:SetSize(80,10)
- self.Health:Hide()
- self.Power:Hide()
- self.Castbar:Hide()
- self.Castbar.Text:Hide()
- self.Health.value:Hide()
- self.Power.value:Hide()
- self.Name:SetWidth(self:GetWidth())
- self.Name:SetHeight(10)
- self.Name:SetJustifyH("LEFT")
- self.Name:ClearAllPoints()
- self.Name:SetPoint("CENTER", self)
- end,
- focus = function(self)
- layout(self)
- self.Buffs:ClearAllPoints()
- self.Debuffs:ClearAllPoints()
- self.Buffs.initialAnchor = "BOTTOMLEFT"
- self.Buffs["growth-x"] = "RIGHT"
- self.Buffs["growth-y"] = "UP"
- self.Buffs:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, 3)
- self.Debuffs["growth-x"] = "RIGHT"
- self.Debuffs["growth-y"] = "DOWN"
- self.Debuffs:SetPoint("TOPLEFT", self, "TOPLEFT", 0, -9)
- local combopoints = self:CreateFontString(nil, 'OVERLAY')
- combopoints:SetFont(font2, 12, 'MONOCHROMETHINOUTLINE')
- combopoints:SetShadowColor(0,0,0,0)
- combopoints:SetPoint("BOTTOMLEFT", self.Health.string, "LEFT")
- combopoints:SetJustifyH("LEFT")
- self:Tag(combopoints,'[text:combo]')
- end,
- pet = function(self)
- layout(self)
- self:SetSize(80,10)
- self.Health:Hide()
- self.Power:Hide()
- self.Castbar:Hide()
- self.Health.value:Hide()
- self.Power.value:Hide()
- self.Name:SetWidth(self:GetWidth())
- self.Name:SetHeight(10)
- self.Name:SetJustifyH("RIGHT")
- self.Name:ClearAllPoints()
- self.Name:SetPoint("CENTER", self)
- end,
- party = function(self)
- layout(self)
- self:SetSize(100,20) --207,28
- self.Castbar:Hide()
- self.Castbar.Text:Hide()
- self.Castbar.PostCastStart = nil
- self.Castbar.PostChannelStart = nil
- self.LFDRole = self.Health:CreateTexture(nil, "OVERLAY")
- self.LFDRole:SetHeight(14)
- self.LFDRole:SetWidth(14)
- self.LFDRole:SetPoint("TOPRIGHT", self, 0, 8)
- self.LFDRole:SetTexture("Interface\LFGFrame\UI-LFG-ICON-PORTRAITROLES")
- self.LFDRole:SetTexCoord(0, 0.5, 0, 0.4)
- self.Range = { insideAlpha = 1, outsideAlpha = 0.3 }
- self.Name.frequentUpdates = 0.5
- end,
- --[[raid = function(self)
- layout(self)
- self:SetSize(40,20)
- self.Health:SetWidth(self:GetWidth())
- self.Health:SetHeight(self:GetHeight()-3)
- self.Power:SetHeight(2)
- self.Power:SetWidth(self:GetWidth())
- self.Name:ClearAllPoints()
- self.Name:SetPoint("TOP", self)
- self.Name:SetWidth(self:GetWidth())
- self.Name:SetHeight(10)
- self.Castbar:Hide()
- self.Castbar = CreateFrame("StatusBar", self:GetName().."_Castbar", self.Power)
- self.Castbar:SetStatusBarTexture(btex)
- self.Castbar:SetStatusBarColor(.35, .35, .45, 1)
- self.Castbar:SetAllPoints(self.Power)
- self.Leader:SetPoint("LEFT", self, "TOPLEFT", 0, 0)
- self.Range = { insideAlpha = 1, outsideAlpha = 0.3 }
- self.Name.frequentUpdates = 0.5
- end,]]
- player = function(self)
- layout(self)
- --self.Name:Hide()
- self.Buffs["growth-y"] = "DOWN"
- self.Buffs["growth-x"] = "RIGHT"
- self.Buffs.initialAnchor = "TOPLEFT"
- self.Buffs:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 1, -5)
- self.Debuffs["growth-y"] = "UP"
- self.Debuffs["growth-x"] = "LEFT"
- self.Debuffs:SetPoint("BOTTOMLEFT", self, "TOPRIGHT", -20, 3)
- if playerClass == "DEATHKNIGHT" then
- self.Runes = CreateFrame("Frame", nil, self)
- self.Runes:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 1, -.5)
- self.Runes:SetHeight(7)
- self.Runes:SetWidth(self:GetWidth())
- self.Runes:SetBackdrop(backdrop)
- self.Runes:SetBackdropColor(0,0,0,0)
- for i = 1, 6 do
- self.Runes[i] = CreateFrame("StatusBar", self:GetName().."_Runes"..i, self.Runes)
- self.Runes[i]:SetStatusBarTexture(btex) -- Need to keep this so I can grab the color from it later
- local runestring = self.Runes[i]:CreateFontString(nil, 'ARTWORK')
- runestring:SetFont(font2, 12, 'MONOCHROMETHINOUTLINE')
- runestring:SetShadowColor(0,0,0,0)
- runestring:SetTextColor(.35,.35,.45)
- runestring:SetJustifyH("CENTER")
- runestring:SetText("[----]")
- self.Runes[i].string = runestring
- if (i == 1) then
- self.Runes[i].string:SetPoint("LEFT", self.Runes, "LEFT")
- else
- self.Runes[i].string:SetPoint("LEFT", self.Runes[i-1].string, "RIGHT", 3.1, 0)
- end
- end
- self.Runes.PostUpdate = runetextupdate
- self.Runes.UpdateType = runetextupdate
- self.Buffs:SetPoint("TOPLEFT", self.Runes, "BOTTOMLEFT", 0, -4)
- end
- end
- }
- oUF:RegisterStyle("ouf_text", layout) -- Stolen, without shame, from ouf_lily
- for unit,layout in next, UnitSpecific do
- -- Capitalize the unit name, so it looks better.
- oUF:RegisterStyle('ouf_text - ' .. unit:gsub("^%l", string.upper), layout)
- end
- local spawnHelper = function(self, unit, ...)
- if(UnitSpecific[unit]) then
- self:SetActiveStyle('ouf_text - ' .. unit:gsub("^%l", string.upper))
- local object = self:Spawn(unit)
- object:SetPoint(...)
- return object
- else
- self:SetActiveStyle'ouf_text'
- local object = self:Spawn(unit)
- object:SetPoint(...)
- return object
- end
- end
- local namelist = UnitName("player")
- for i = 1,39 do
- namelist = namelist..","..UnitName("player")
- end
- oUF:Factory(function(self)
- spawnHelper(self, 'focus', "CENTER", 502, 0)
- spawnHelper(self, 'player', 'RIGHT', UIParent, 'CENTER', -1, -250)
- spawnHelper(self, 'pet', 'TOPRIGHT', oUF_ouf_textPlayer, 'TOPLEFT', -3, 0)
- spawnHelper(self, 'target', 'TOPLEFT', oUF_ouf_textPlayer, 'TOPRIGHT', 3, 0)
- spawnHelper(self, 'targettarget', 'TOPLEFT', oUF_ouf_textTarget, 'TOPRIGHT', 3, 0)
- self:SetActiveStyle'ouf_text - Party'
- local party = self:SpawnHeader(nil, nil, 'raid,party', 'showParty', true, 'showRaid', false, 'showPlayer', false, 'yOffset', -15)
- party:SetPoint("TOPLEFT", 6, -8)
- --[[self:SetActiveStyle'ouf_text - Raid'
- local raid = {}
- for i = 1, 8 do -- thanks ouf_mono
- local raidgroup = self:SpawnHeader(nil, nil, 'raid',
- 'showParty', true,
- 'showPlayer', true,
- 'showRaid', true,
- 'yOffset', -5,
- 'xOffset', -5,
- 'maxColumns', 8,
- 'unitsPerColumn', 5,
- 'groupFilter', tostring(i),
- 'groupingOrder', '1,2,3,4,5,6,7,8',
- 'groupBy', 'GROUP',
- 'columnSpacing', 5,
- 'columnAnchorPoint', 'BOTTOM',
- 'point', "RIGHT")
- if i == 1 then
- raidgroup:SetPoint("BOTTOMRIGHT", -5.1, 5)
- else
- raidgroup:SetPoint("BOTTOMRIGHT", raid[i-1], "TOPRIGHT", 0, 5)
- end
- raid[i] = raidgroup
- end]]
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement