Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[-------------------------------------------------------------------------
- Coldkil unitframes layout - now with 138% more awesomeness
- ---------------------------------------------------------------------------]]
- --get the addon namespace
- local addon, ns = ...
- --get the config values
- local cfg = ns.cfg
- local focuscfg = ns.cfg.focus
- local layout = ns.cfg.layout
- -- get the library
- local lib = ns.lib
- -------------------------------------------------------------
- -- Local variables
- -------------------------------------------------------------
- local _TEXTURE = cfg.tex
- local blankTex = cfg.texblank
- local font = cfg.font
- local smalls = cfg.fontsize
- local myClass = lib.getClass('player')
- local pp = lib.scale
- -------------------------------------------------------------
- -- Unit Frames Layout
- -------------------------------------------------------------
- local Shared = function(self, unit, isSingle)
- self.menu = lib.menu
- self:SetScript("OnEnter", UnitFrame_OnEnter)
- self:SetScript("OnLeave", UnitFrame_OnLeave)
- -- XXX: Change to AnyUp when RegisterAttributeDriver doesn't cause clicks
- -- to get incorrectly eaten.
- self:RegisterForClicks"AnyDown"
- -- enable our colors
- self.colors = colors
- if unit == "player" or unit == "target" then
- self:SetSize(200, 30)
- elseif unit == "focus" or unit == "pet" or unit == "targettarget" then
- self:SetSize(60, 5)
- elseif unit == "party" then
- self:SetSize(150, 20)
- else
- self:SetSize(35, 32)
- end
- ------------------------------------------------------------
- -- Shared things we want on different unitframes
- ------------------------------------------------------------
- local panelhp = CreateFrame("Frame",nil,self)
- panelhp:SetFrameLevel(5)
- local panelpow = CreateFrame("Frame",nil,self)
- panelpow:SetFrameLevel(5)
- local over = CreateFrame("Frame",nil,self)
- self.Panelhp = panelhp
- self.Panelpow = panelpow
- self.over = over
- -- test self size
- --self:SetBackdrop(backdrop)
- --self:SetBackdropColor(0,1,0,.5)
- --self:SetFrameLevel(10)
- -- Health Bar
- local Health = CreateFrame("StatusBar", nil, self)
- Health:SetFrameLevel(3)
- Health:SetStatusBarTexture(_TEXTURE)
- local HealthBackground = Health:CreateTexture(nil, "BORDER")
- HealthBackground:SetTexture(_TEXTURE)
- Health.bg = HealthBackground
- local shadowH = CreateFrame("Frame", nil, Health)
- shadowH:SetFrameLevel(3)
- shadowH:SetPoint("TOPLEFT", Health, "TOPLEFT", -1, 1)
- shadowH:SetPoint("BOTTOMRIGHT", Health, "BOTTOMRIGHT", 1, -1)
- shadowH:SetBackdrop(backdrop)
- shadowH:SetBackdropColor(0, 0, 0, 0)
- shadowH:SetBackdropBorderColor(0, 0, 0, 1)
- Health.frequentUpdates = true
- Health.Smooth = true
- Health.PostUpdate = lib.PostUpdateHealth
- self.Health = Health
- -- HP text/tag
- local HealthPoints = lib.SetFontString(panelhp, font, smalls, "OUTLINE, MONOCHROME")
- local HPper = lib.SetFontString(panelhp, font, smalls, "OUTLINE, MONOCHROME")
- local hptag = lib.SetFontString(panelhp, font, smalls, "OUTLINE, MONOCHROME")
- hptag:SetText("HP")
- self:Tag(HealthPoints, '[dead][offline][classic:health]')
- Health.value = HealthPoints
- Health.valueper = HPper
- Health.tag = hptag
- -- Power Bar
- local Power = CreateFrame("StatusBar", nil, self)
- Power:SetFrameLevel(3)
- Power:SetStatusBarTexture(_TEXTURE)
- local PowerBackground = Power:CreateTexture(nil, "BORDER")
- PowerBackground:SetTexture(_TEXTURE)
- local shadowP = CreateFrame("Frame", nil, Power)
- shadowP:SetFrameLevel(3)
- shadowP:SetPoint("TOPLEFT", Power, "TOPLEFT", -1, 1)
- shadowP:SetPoint("BOTTOMRIGHT", Power, "BOTTOMRIGHT", 1, -1)
- shadowP:SetBackdrop(backdrop)
- shadowP:SetBackdropColor(.6, .6, .6, .25)
- shadowP:SetBackdropBorderColor(0, 0, 0, 1)
- Power.bg = PowerBackground
- Power.frequentUpdates = true
- Power.Smooth = true
- self.Power = Power
- -- Power text/tag
- local PowerPoints = lib.SetFontString(panelhp, font, smalls, "OUTLINE, MONOCHROME")
- local powtag = lib.SetFontString(panelhp, font, smalls, "OUTLINE, MONOCHROME")
- Power.value = PowerPoints
- Power.tag = powtag
- Power.PostUpdate = lib.PostUpdatePower
- --Portrait
- local portrait = CreateFrame("PlayerModel", self:GetName().."_Portrait", self)
- portrait:SetFrameLevel(4)
- self.Portrait = portrait
- -- Castbar
- local Castbar = CreateFrame("StatusBar", nil, self)
- Castbar:SetStatusBarTexture(_TEXTURE)
- Castbar:SetFrameLevel(2)
- Castbar.PostCastStart = lib.CheckCast
- Castbar.PostChannelStart = lib.CheckChannel
- local CBshadow = CreateFrame("Frame", nil, Castbar)
- CBshadow:SetFrameLevel(2)
- CBshadow:SetPoint("TOPLEFT", Castbar, "TOPLEFT", -1, 1)
- CBshadow:SetPoint("BOTTOMRIGHT", Castbar, "BOTTOMRIGHT", 1, -1)
- CBshadow:SetBackdrop(backdrop)
- CBshadow:SetBackdropColor(.1,.1,.1,.9)
- CBshadow:SetBackdropBorderColor(0, 0, 0, 1)
- -- Castbar Text
- Castbar.time = lib.SetFontString(Castbar, font, smalls, "OUTLINE, MONOCHROME")
- Castbar.Text = lib.SetFontString(Castbar, font, smalls, "OUTLINE, MONOCHROME")
- self.Castbar = Castbar
- self.Castbar.Time = Castbar.time
- -- Name, Level, Classiication
- Name = lib.SetFontString(panelhp, font, smalls, "OUTLINE, MONOCHROME")
- Level = lib.SetFontString(panelhp, font, smalls, "OUTLINE, MONOCHROME")
- self:Tag(Name, '[name]')
- self:Tag(Level, '[level][shortclassification][difficulty]')
- self.Level = Level
- self.Name = Name
- -- Buffs/Debuffs frames (defined here, so if you want you can create them for other unitframes, atm target only)
- local Buffs = CreateFrame("Frame", nil, self)
- Buffs.PostCreateIcon = lib.PostCreateAura
- Buffs.PostUpdateIcon = lib.PostUpdateAura
- self.Buffs = Buffs
- local Debuffs = CreateFrame("Frame", nil, self)
- Debuffs.PostCreateIcon = lib.PostCreateAura
- Debuffs.PostUpdateIcon = lib.PostUpdateAura
- self.Debuffs = Debuffs
- -------------------------------------------------------------
- -- Player Layout
- -------------------------------------------------------------
- if unit == "player" then
- Health:SetPoint("TOPLEFT", self, "TOPLEFT")
- Health:SetPoint("TOPRIGHT", self, "TOPRIGHT")
- Health:SetHeight(16)
- HealthBackground:SetPoint("LEFT", Health:GetStatusBarTexture(), "RIGHT")
- HealthBackground:SetPoint("TOPRIGHT", Health, "TOPRIGHT")
- HealthBackground:SetPoint("BOTTOMRIGHT", Health, "BOTTOMRIGHT")
- portrait:SetPoint("TOPLEFT", Health, "TOPLEFT")
- portrait:SetPoint("BOTTOMRIGHT", Health, "BOTTOMRIGHT")
- portrait:SetAlpha(.25)
- panelhp:SetPoint("LEFT", Health, "LEFT", -3.5, 5)
- panelhp:SetSize(75,13)
- panelhp:SetBackdrop(backdrop)
- panelhp:SetBackdropColor(.6,.6,.6)
- panelhp:SetBackdropBorderColor(0,0,0)
- HealthPoints:SetPoint("RIGHT", panelhp, "RIGHT", pp(.5), pp(1))
- HealthPoints:SetJustifyH"RIGHT"
- Power:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT")
- Power:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT")
- Power:SetHeight(8)
- PowerBackground:SetPoint("LEFT", Power:GetStatusBarTexture(), "RIGHT")
- PowerBackground:SetPoint("TOPRIGHT", Power, "TOPRIGHT")
- PowerBackground:SetPoint("BOTTOMRIGHT", Power, "BOTTOMRIGHT")
- PowerPoints:SetPoint("LEFT", panelhp, "LEFT", pp(2), pp(1))
- Castbar:SetPoint("LEFT", self, "LEFT", -4, -4)
- Castbar:SetPoint("RIGHT", self, "RIGHT", 4, -4)
- Castbar:SetHeight(13)
- Castbar.time:SetPoint("TOPRIGHT", Power, "BOTTOMRIGHT", 3, -3)
- Castbar.time:SetJustifyH"RIGHT"
- Castbar.Text:SetPoint("TOPLEFT", Power, "BOTTOMLEFT", 0, -3)
- Castbar.Text:SetPoint("TOPRIGHT", Power, "BOTTOMRIGHT", -30, -3)
- Castbar.safezone = Castbar:CreateTexture(nil, "ARTWORK")
- Castbar.safezone:SetTexture(_TEXTURE)
- Castbar.safezone:SetVertexColor(0.89, 0.31, 0.31, 0.6)
- Castbar.SafeZone = Castbar.safezone
- -- holy power / soul shards
- if (myClass == "WARLOCK" or myClass == "PALADIN") then
- local bars = CreateFrame("Frame", nil, self)
- bars:SetPoint("BOTTOMRIGHT", Health, "BOTTOMRIGHT", -2, 1)
- bars:SetSize(60, 12)
- bars:SetFrameLevel(6)
- for i = 1, 3 do
- bars[i]=CreateFrame("StatusBar", self:GetName().."_Shard"..i, self)
- bars[i]=lib.SetFontString(bars, font, smalls, "OUTLINE, MONOCHROME")
- bars[i]:SetSize(20, 12)
- if i == 1 then
- bars[i]:SetPoint("LEFT", bars)
- else
- bars[i]:SetPoint("LEFT", bars[i-1], "RIGHT", 1, 0)
- end
- if myClass == "WARLOCK" then
- bars[i]:SetText("Sh")
- bars[i]:SetJustifyH"RIGHT"
- bars[i]:SetTextColor(1, 0, 1)
- bars.Override = UpdateShards
- self.SoulShards = bars
- else
- bars[i]:SetText("Ho")
- bars[i]:SetJustifyH"RIGHT"
- bars[i]:SetTextColor(228/255,225/255,16/255)
- bars.Override = UpdateHoly
- self.HolyPower = bars
- end
- end
- end
- if myClass == "DRUID" then
- local eclipseBar = CreateFrame('Frame', nil, self)
- eclipseBar:SetPoint("BOTTOM", Health, "TOP", 0, 5)
- eclipseBar:SetSize(self:GetWidth()+2, 11)
- eclipseBar:SetFrameLevel(5)
- eclipseBar:SetFrameStrata"MEDIUM"
- eclipseBar:SetBackdrop(backdrop)
- eclipseBar:SetBackdropColor(.6,.6,.6,0)
- eclipseBar:SetBackdropBorderColor(0,0,0)
- local lunarBar = CreateFrame('StatusBar', nil, eclipseBar)
- lunarBar:SetPoint('LEFT', eclipseBar, 'LEFT', 1, 0)
- lunarBar:SetSize(eclipseBar:GetWidth()-2, eclipseBar:GetHeight()-2)
- lunarBar:SetStatusBarTexture(_TEXTURE)
- lunarBar:SetStatusBarColor(.30, .52, .90, .7)
- eclipseBar.LunarBar = lunarBar
- local solarBar = CreateFrame('StatusBar', nil, eclipseBar)
- solarBar:SetPoint('LEFT', lunarBar:GetStatusBarTexture(), 'RIGHT', 0, 0)
- solarBar:SetSize(eclipseBar:GetWidth()-2, eclipseBar:GetHeight()-2)
- solarBar:SetStatusBarTexture(_TEXTURE)
- solarBar:SetStatusBarColor(.80, .82, .30, .7)
- eclipseBar.SolarBar = solarBar
- self.EclipseBar = eclipseBar
- end
- if layout.pbuffs then
- Buffs:SetPoint("RIGHT", self, "LEFT", -3, 0)
- Buffs:SetWidth(200)
- Buffs:SetHeight(17)
- Buffs.initialAnchor = "RIGHT"
- Buffs["growth-x"] = "LEFT"
- Buffs["growth-y"] = "DOWN"
- Buffs.size = 26
- Buffs.num = 6
- Buffs.spacing = 3
- Buffs.onlyShowPlayer = true
- end
- if layout.pdebuffs then
- if not layout.healer then
- Debuffs:SetPoint("BOTTOMRIGHT", self.Health, "TOPRIGHT", -1, 20)
- Debuffs:SetWidth(250)
- Debuffs:SetHeight(20)
- Debuffs.initialAnchor = "RIGHT"
- Debuffs["growth-x"] = "RIGHT"
- Debuffs["growth-y"] = "UP"
- Debuffs.size = 26
- Debuffs.num = 25
- Debuffs.spacing = 3
- else
- Debuffs:SetPoint("TOPLEFT", self.Power, "BOTTOMLEFT", -1, -10)
- Debuffs:SetWidth(250)
- Debuffs:SetHeight(20)
- Debuffs.initialAnchor = "LEFT"
- Debuffs["growth-x"] = "LEFT"
- Debuffs["growth-y"] = "DOWN"
- Debuffs.size = 26
- Debuffs.num = 25
- Debuffs.spacing = 3
- end
- end
- local ricon = panelhp:CreateTexture(nil, "OVERLAY")
- ricon:SetTexture([[Interface\AddOns\oUF_Coldkil\textures\raidicons.blp]])
- ricon:SetSize(22,22)
- ricon:SetPoint("CENTER", panelhp, "BOTTOM", 0, pp(-3))
- self.RaidIcon = ricon
- -- AltPowerPar, the one that appears for ryolith and other mundane things like DMF
- PlayerPowerBarAlt:SetParent(UIParent)
- PlayerPowerBarAlt:SetFrameStrata("MEDIUM")
- PlayerPowerBarAlt:SetFrameLevel(3)
- PlayerPowerBarAlt:SetClampedToScreen(false)
- PlayerPowerBarAlt:ClearAllPoints()
- PlayerPowerBarAlt.ClearAllPoints = function() end
- PlayerPowerBarAlt:SetPoint("TOP", UIParent, "TOP", 0, -170)
- PlayerPowerBarAlt.SetPoint = function() end
- -- Ghost Button Fix
- GhostFrame:SetParent(UIParent)
- GhostFrame:SetFrameStrata("MEDIUM")
- GhostFrame:SetFrameLevel(3)
- GhostFrame:SetClampedToScreen(false)
- GhostFrame:ClearAllPoints()
- GhostFrame.ClearAllPoints = function() end
- GhostFrame:SetPoint("BOTTOMRIGHT", Minimap, "BOTTOMLEFT", -5, 0)
- GhostFrame.SetPoint = function() end
- -- new timer of the DMF dailies DOESN'T WORK WTF HOW THE HELL I'M SUPPOSED TO MAKE THINGS LOOK PRETTY MY MOM SAYS I'M SPECIAL
- --[[BuffTimer1:SetParent(UIParent)
- BuffTimer1:SetFrameStrata("MEDIUM")
- BuffTimer1:SetFrameLevel(3)
- BuffTimer1:SetClampedToScreen(false)
- BuffTimer1:ClearAllPoints()
- BuffTimer1.ClearAllPoints = function() end
- BuffTimer1:SetPoint("TOP", UIParent, "TOP", 0, -180)
- BuffTimer1.SetPoint = function() end]]
- end
- -------------------------------------------------------------
- -- Target Layout
- -------------------------------------------------------------
- if unit == "target" then
- Health:SetPoint("TOPLEFT", self, "TOPLEFT")
- Health:SetPoint("TOPRIGHT", self, "TOPRIGHT")
- Health:SetHeight(16)
- HealthBackground:SetPoint("LEFT", Health:GetStatusBarTexture(), "RIGHT")
- HealthBackground:SetPoint("TOPRIGHT", Health, "TOPRIGHT")
- HealthBackground:SetPoint("BOTTOMRIGHT", Health, "BOTTOMRIGHT")
- portrait:SetPoint("TOPLEFT", Health, "TOPLEFT")
- portrait:SetPoint("BOTTOMRIGHT", Health, "BOTTOMRIGHT")
- portrait:SetAlpha(.25)
- panelhp:SetPoint("RIGHT", Health, "RIGHT", 4, 5)
- panelhp:SetSize(75,13)
- panelhp:SetBackdrop(backdrop)
- panelhp:SetBackdropColor(.6,.6,.6)
- panelhp:SetBackdropBorderColor(0,0,0)
- HealthPoints:SetPoint("RIGHT", panelhp, "RIGHT", 0, pp(1))
- HPper:SetPoint("LEFT", panelhp, "LEFT", 2.5, pp(1))
- HPper:SetJustifyH"RIGHT"
- Power:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT")
- Power:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT")
- Power:SetHeight(8)
- PowerBackground:SetPoint("LEFT", Power:GetStatusBarTexture(), "RIGHT")
- PowerBackground:SetPoint("TOPRIGHT", Power, "TOPRIGHT")
- PowerBackground:SetPoint("BOTTOMRIGHT", Power, "BOTTOMRIGHT")
- Name:SetPoint("BOTTOMLEFT", Health, "BOTTOMLEFT", 2.5, 2.5)
- Name:SetPoint("BOTTOMRIGHT", Health, "BOTTOMRIGHT", -65, 2.5)
- Castbar:SetPoint("LEFT", self, "LEFT", -4, -4)
- Castbar:SetPoint("RIGHT", self, "RIGHT", 4, -4)
- Castbar:SetHeight(13)
- Castbar.time:SetPoint("TOPLEFT", Power, "BOTTOMLEFT", 0, -3)
- Castbar.Text:SetPoint("TOPRIGHT", Power, "BOTTOMRIGHT", 0, -3)
- Castbar.Text:SetPoint("TOPLEFT", Power, "BOTTOMLEFT", 30, -3)
- Castbar.Text:SetJustifyH"RIGHT"
- if layout.tbuffs then
- if not layout.healer then
- Buffs:SetPoint("TOPLEFT", panelhp, "TOPRIGHT", 3, 0)
- Buffs:SetSize(200, 26)
- Buffs.initialAnchor = "LEFT"
- Buffs.size = 26
- Buffs.num = 6
- Buffs.spacing = 3
- else
- Buffs:SetPoint("BOTTOMLEFT", self.Health, "TOPLEFT", -1, 20)
- Buffs:SetWidth(200)
- Buffs:SetHeight(17)
- Buffs.initialAnchor = "LEFT"
- Buffs["growth-y"] = "UP"
- Buffs.size = 26
- Buffs.num = 9
- Buffs.spacing = 3
- Buffs.onlyShowPlayer = true
- end
- end
- if layout.tdebuffs then
- if not layout.healer then
- Debuffs:SetPoint("BOTTOMLEFT", self.Health, "TOPLEFT", -1, 20)
- Debuffs:SetWidth(250)
- Debuffs:SetHeight(20)
- Debuffs.initialAnchor = "LEFT"
- Debuffs["growth-y"] = "UP"
- Debuffs.size = 26
- Debuffs.num = 10
- Debuffs.spacing = 3
- Debuffs.onlyShowPlayer = true
- else
- Debuffs:SetPoint("RIGHT", self, "LEFT", -3, 0)
- Debuffs:SetWidth(200)
- Debuffs:SetHeight(17)
- Debuffs.initialAnchor = "RIGHT"
- Debuffs["growth-x"] = "LEFT"
- Debuffs["growth-y"] = "DOWN"
- Debuffs.size = 26
- Debuffs.num = 6
- Debuffs.spacing = 3
- end
- end
- -- rogue combo points (now with more druid love!)
- if (myClass == "ROGUE" or myClass == "DRUID") and unit == "target" then
- local CPoints = {}
- CPoints.unit = PlayerFrame.unit
- local combobar = CreateFrame("Frame", nil, self)
- combobar:SetSize(95, 12)
- combobar:SetPoint("BOTTOMRIGHT", ColdPlayer.Health, "BOTTOMRIGHT", 4, 1)
- combobar:Hide()
- combobar:SetFrameLevel(6)
- if myClass == "DRUID" then
- combobar:RegisterEvent("UPDATE_SHAPESHIFT_FORM")
- combobar:SetScript("OnEvent", function()
- local currentform = GetShapeshiftForm()
- if currentform == 3 then
- combobar:Show()
- else
- combobar:Hide()
- end
- end)
- else
- combobar:Show()
- end
- for i = 1, 5 do
- CPoints[i] = lib.SetFontString(combobar, font, smalls, "OUTLINE, MONOCHROME")
- CPoints[i]:SetSize(20, 12)
- CPoints[i]:SetText("c"..i)
- if i == 1 then
- CPoints[i]:SetSize(18, 12)
- CPoints[i]:SetPoint("LEFT", combobar)
- CPoints[i]:SetTextColor(1, 0, 0)
- else
- CPoints[i]:SetPoint("LEFT", CPoints[i-1], "RIGHT", 0, 0)
- end
- end
- CPoints[2]:SetTextColor(1, .5, 0)
- CPoints[3]:SetTextColor(1, 1, 0)
- CPoints[4]:SetTextColor(.5, 1, 0)
- CPoints[5]:SetTextColor(0, 1, 0)
- self.CPoints = CPoints
- end
- local ricon = panelhp:CreateTexture(nil, "OVERLAY")
- ricon:SetTexture([[Interface\AddOns\oUF_Coldkil\textures\raidicons.blp]])
- ricon:SetSize(22,22)
- ricon:SetPoint("CENTER", panelhp, "BOTTOM", 0, pp(-3))
- self.RaidIcon = ricon
- end
- -------------------------------------------------------------
- -- Pet, ToT, Focus layout
- -------------------------------------------------------------
- if unit == "focus" or unit == "pet" or unit == "targettarget" then
- if focuscfg.extended and unit == "focus" then
- self:SetSize(130, 30)
- panelhp:SetSize(55, 13)
- panelhp:SetPoint("RIGHT", Health, "RIGHT", 4, 5)
- panelhp:SetBackdrop(backdrop)
- panelhp:SetBackdropColor(.6,.6,.6)
- panelhp:SetBackdropBorderColor(0,0,0)
- portrait:SetPoint("TOPLEFT", Health, "TOPLEFT", 0, -1)
- portrait:SetPoint("BOTTOMRIGHT", Health, "BOTTOMRIGHT", 0, 1)
- portrait:SetAlpha(.25)
- Health:SetPoint("TOPLEFT", self, "TOPLEFT")
- Health:SetPoint("TOPRIGHT", self, "TOPRIGHT")
- Health:SetHeight(16)
- HealthBackground:SetPoint("LEFT", Health:GetStatusBarTexture(), "RIGHT")
- HealthBackground:SetPoint("RIGHT", Health, "RIGHT")
- HealthBackground:SetHeight(Health:GetHeight())
- HealthPoints:SetPoint("TOPRIGHT", panelhp, "TOPRIGHT", 0, 2)
- HealthPoints:SetJustifyH"RIGHT"
- HPper:SetPoint("LEFT", panelhp, "LEFT", 0, 1)
- Power:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT")
- Power:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT")
- Power:SetHeight(8)
- PowerBackground:SetPoint("LEFT", Power:GetStatusBarTexture(), "RIGHT")
- PowerBackground:SetPoint("RIGHT", Power, "RIGHT")
- PowerBackground:SetHeight(Power:GetHeight())
- Castbar:SetPoint("LEFT", self, "LEFT", -4, -4)
- Castbar:SetPoint("RIGHT", self, "RIGHT", 4, -4)
- Castbar:SetHeight(13)
- Castbar.time:SetPoint("TOPLEFT", Power, "BOTTOMLEFT", 0, -4)
- Castbar.Text:SetPoint("TOPRIGHT", Power, "BOTTOMRIGHT", -2, -4)
- Castbar.Text:SetPoint("TOPLEFT", Power, "BOTTOMLEFT", 30, -4)
- Castbar.Text:SetJustifyH"RIGHT"
- Name:SetPoint("BOTTOMLEFT", Health, "BOTTOMLEFT", 3, 2)
- Name:SetPoint("BOTTOMRIGHT", Health, "BOTTOMRIGHT", -55, 2)
- else
- Health:SetPoint("TOPLEFT", self, "TOPLEFT")
- Health:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT")
- HealthBackground:SetPoint("LEFT", Health:GetStatusBarTexture(), "RIGHT")
- HealthBackground:SetPoint("RIGHT", Health, "RIGHT")
- HealthBackground:SetAlpha(1)
- HealthBackground:SetPoint("TOPRIGHT", self, "TOPRIGHT")
- HealthBackground:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT")
- Name:SetPoint("LEFT", Health, "BOTTOMLEFT")
- Name:SetPoint("RIGHT", Health, "BOTTOMRIGHT")
- Name:SetJustifyH"CENTER"
- end
- end
- -------------------------------------------------------------
- -- Party frames layout
- -------------------------------------------------------------
- if unit == "party" then
- if layout.healer then
- Health:SetSize(150, 20)
- Health:SetPoint("TOP", self, "TOP")
- HealthBackground:SetPoint("LEFT", Health:GetStatusBarTexture(), "RIGHT")
- HealthBackground:SetPoint("RIGHT", Health, "RIGHT")
- HealthBackground:SetAlpha(1)
- HealthBackground:SetHeight(Health:GetHeight())
- Power:SetSize(150, 2)
- Power:SetPoint("TOP", Health, "BOTTOM", 0, -1)
- Name:SetPoint("LEFT", Health, "LEFT", 2, 0)
- HealthPoints:SetPoint("LEFT", Health, "LEFT", 2, 0)
- else
- Health:SetSize(150, 20)
- Health:SetPoint("TOP", self, "TOP")
- HealthBackground:SetPoint("LEFT", Health:GetStatusBarTexture(), "RIGHT")
- HealthBackground:SetPoint("RIGHT", Health, "RIGHT")
- HealthBackground:SetAlpha(1)
- HealthBackground:SetHeight(Health:GetHeight())
- Power:SetSize(150, 3)
- Power:SetPoint("TOP", Health, "BOTTOM", 0, -1)
- Power.colorPower = true
- Name:SetPoint("LEFT", Health, "LEFT", 2, 0)
- Name:SetPoint("RIGHT", Health, "RIGHT", -2, 0)
- end
- if layout.ppdebuffs then
- Debuffs:SetPoint("LEFT", self, "RIGHT", 5, -1)
- Debuffs:SetWidth(180)
- Debuffs:SetHeight(17)
- Debuffs.initialAnchor = "LEFT"
- Debuffs.size = 25
- Debuffs.num = 6
- Debuffs.spacing = 3
- end
- Health.PostUpdate = lib.PostUpdateHealthPartyRaid
- local ricon = Health:CreateTexture(nil, "OVERLAY")
- ricon:SetTexture([[Interface\AddOns\oUF_Coldkil\textures\raidicons.blp]])
- ricon:SetSize(18,18)
- ricon:SetPoint("CENTER", self, "TOP", 0, pp(-4))
- self.RaidIcon = ricon
- local role = Health:CreateTexture(nil, "OVERLAY")
- role:SetSize(18, 18)
- role:SetPoint("RIGHT", self, "RIGHT", -5, -1)
- self.LFDRole = role
- local range = {
- insideAlpha = 1,
- outsideAlpha = .5,
- }
- self.Range = range
- end
- -------------------------------------------------------------
- -- Raid frames layout
- -------------------------------------------------------------
- if unit == "raid" then
- if layout.healer then
- Health:SetSize(pp(37), pp(35))
- Health:SetOrientation"VERTICAL"
- Health:SetPoint("TOP", self, "TOP")
- HealthBackground:SetPoint("BOTTOM", Health:GetStatusBarTexture(), "TOP")
- HealthBackground:SetPoint("TOP", Health, "TOP")
- HealthBackground:SetAlpha(1)
- HealthBackground:SetWidth(Health:GetWidth())
- Power:SetSize(2, 35)
- Power:SetOrientation("VERTICAL")
- Power:SetPoint("RIGHT", Health, "LEFT", -1, 0)
- Power.colorPower = true
- HealthPoints:SetPoint("CENTER", Health, "CENTER")
- Name:SetPoint("CENTER", Health, "CENTER")
- Name:SetJustifyH"CENTER"
- self:Tag(Name, '[nameshort]')
- local ricon = Health:CreateTexture(nil, "OVERLAY")
- ricon:SetTexture([[Interface\AddOns\oUF_Coldkil\textures\raidicons.blp]])
- ricon:SetSize(9,9)
- ricon:SetPoint("CENTER", self, "TOPRIGHT", 0, 0)
- self.RaidIcon = ricon
- else
- self:SetSize(pp(95),pp(14))
- Health:SetSize(pp(95), pp(14))
- Health:SetPoint("TOP", self, "TOP")
- HealthBackground:SetPoint("LEFT", Health:GetStatusBarTexture(), "RIGHT")
- HealthBackground:SetPoint("RIGHT", Health, "RIGHT")
- HealthBackground:SetAlpha(1)
- HealthBackground:SetHeight(Health:GetHeight())
- Name:SetPoint("LEFT", Health, "LEFT", 2, 0)
- Name:SetPoint("RIGHT", Health, "RIGHT", -2, 0)
- self:Tag(Name, '[name]')
- local ricon = Health:CreateTexture(nil, "OVERLAY")
- ricon:SetTexture([[Interface\AddOns\oUF_Coldkil\textures\raidicons.blp]])
- ricon:SetSize(13,13)
- ricon:SetPoint("CENTER", self, "RIGHT", 3, 0)
- self.RaidIcon = ricon
- end
- Health.PostUpdate = lib.PostUpdateHealthPartyRaid
- local range = {
- insideAlpha = 1,
- outsideAlpha = .5,
- }
- self.Range = range
- end
- ----------------------------------------------------------------
- -- Boss/Arena frames layout
- ----------------------------------------------------------------
- if (unit and unit:find("arena%d")) or (unit and unit:find("boss%d")) then
- -- set focus with right-click
- self:SetAttribute("type2", "focus")
- Health:SetSize(180, 20)
- Health:SetPoint("TOP", self, "TOP")
- HealthBackground:SetPoint("LEFT", Health:GetStatusBarTexture(), "RIGHT")
- HealthBackground:SetPoint("RIGHT", Health, "RIGHT")
- HealthBackground:SetAlpha(1)
- HealthBackground:SetHeight(Health:GetHeight())
- HPper:SetFont(font,smalls,"OUTLINE, MONOCHROME")
- HPper:SetPoint("RIGHT", Health, "RIGHT", -1, 2)
- HPper:SetJustifyH"RIGHT"
- Name:SetPoint("LEFT", Health, "LEFT", 2, 1)
- Power:SetSize(180, 3)
- Power:SetPoint("TOP", Health, "BOTTOM", 0, -1)
- PowerBackground:SetPoint("LEFT", Power:GetStatusBarTexture(), "RIGHT")
- PowerBackground:SetPoint("RIGHT", Power, "RIGHT")
- PowerBackground:SetAlpha(.2)
- PowerBackground:SetHeight(Power:GetHeight())
- Power.colorPower = true
- Castbar:SetPoint("TOP", self.Health, "BOTTOM", 0, -5)
- Castbar:SetWidth(180)
- Castbar.time:SetPoint("LEFT", Castbar, "LEFT", 2, 1)
- Castbar.Text:SetPoint("RIGHT", Castbar, "RIGHT", -2, 1)
- Castbar.Text:SetPoint("LEFT", Castbar, "LEFT", 30, 1)
- Castbar.Text:SetJustifyH"RIGHT"
- end
- end
- oUF:RegisterStyle("Coldkil", Shared)
- ----------------------------------------------------------------------------------
- -- spawning various units
- ----------------------------------------------------------------------------------
- local player = oUF:Spawn('player', "ColdPlayer")
- local pet = oUF:Spawn('pet', "ColdPet")
- local target = oUF:Spawn('target', "ColdTarget")
- local tot = oUF:Spawn('targettarget', "ColdToT")
- local focus = oUF:Spawn('focus', "ColdFocus")
- if layout.healer then
- player:SetPoint("BOTTOM", UIParent, "BOTTOM", -175, 240)
- pet:SetPoint('TOPLEFT', player, 'BOTTOMLEFT', 0, -8)
- target:SetPoint("BOTTOM", UIParent, "BOTTOM", -175, 300)
- tot:SetPoint("LEFT", target, "RIGHT", 10, 2)
- focus:SetPoint('TOPLEFT', target, 'BOTTOMLEFT', 0, -18)
- else
- player:SetPoint("BOTTOM", UIParent, "BOTTOM", -175, 240)
- pet:SetPoint('TOPLEFT', player, 'TOPRIGHT', 4, 0)
- target:SetPoint("BOTTOM", UIParent, "BOTTOM", 175, 240)
- tot:SetPoint("TOPRIGHT", target, "TOPLEFT", -4, 0)
- if focuscfg.extended then
- focus:SetPoint('BOTTOM', UIParent, 'BOTTOM', 0, 200)
- else
- focus:SetPoint('BOTTOM', UIParent, 'BOTTOM', 0, 240)
- end
- end
- -- make frames draggable with /cm
- lib.dragalize(player)
- lib.dragalize(pet)
- lib.dragalize(target)
- lib.dragalize(tot)
- lib.dragalize(focus)
- -- you cannot hide standard frames, the game won't let you, so i'm "removing" the button
- player.btn:SetAlpha(0)
- player.btn:SetScale(.0001)
- target.btn:SetAlpha(0)
- target.btn:SetScale(.0001)
- pet.btn:SetAlpha(0)
- pet.btn:SetScale(.0001)
- tot.btn:SetAlpha(0)
- tot.btn:SetScale(.0001)
- focus.btn:SetAlpha(0)
- focus.btn:SetScale(.0001)
- local arena = {}
- for i = 1, 5 do
- arena[i] = oUF:Spawn("arena"..i, "ColdArena"..i)
- if i == 1 then
- arena[i]:SetPoint("LEFT", UIParent, "CENTER", 300, 100)
- else
- arena[i]:SetPoint("TOP", arena[i-1], "BOTTOM", 0, -15)
- end
- end
- for i = 1,MAX_BOSS_FRAMES do
- local c_boss = _G["Boss"..i.."TargetFrame"]
- c_boss:UnregisterAllEvents()
- c_boss.Show = function() return end
- c_boss:Hide()
- _G["Boss"..i.."TargetFrame".."HealthBar"]:UnregisterAllEvents()
- _G["Boss"..i.."TargetFrame".."ManaBar"]:UnregisterAllEvents()
- end
- local boss = {}
- for i = 1, MAX_BOSS_FRAMES do
- boss[i] = oUF:Spawn("boss"..i, "ColdBoss"..i)
- if i == 1 then
- boss[i]:SetPoint("LEFT", UIParent, "CENTER", 400, 150)
- else
- boss[i]:SetPoint('TOP', boss[i-1], 'BOTTOM', 0, -20)
- end
- end
- local party = oUF:SpawnHeader("ColdParty", nil, "custom [@raid6,exists] hide;show",
- 'showParty', true,
- 'yOffset', -12,
- 'columnAnchorPoint', 'LEFT',
- 'columnSpacing', 15,
- 'oUF-initialConfigFunction', [[
- self:SetWidth(260)
- self:SetHeight(48)
- ]]
- )
- if layout.healer then
- party:SetPoint("BOTTOMLEFT", UIParent, "BOTTOM", 65, 240)
- else
- party:SetPoint("TOPLEFT", UIParent, "LEFT", 10, 10)
- end
- lib.dragalize(party)
- party.btn:SetAlpha(0)
- party.btn:SetScale(.0001)
- CompactRaidFrameContainer:Hide()
- CompactRaidFrameManager:SetScale(.0001)
- CompactRaidFrameManager:SetAlpha(0)
- CompactRaidFrameManager:Hide()
- if layout.showraid then
- local raidanchor = CreateFrame("Frame", "ColdRaidAnchor", UIParent)
- if layout.healer then
- local raid = oUF:SpawnHeader("ColdRaid", nil, "custom [@raid6,exists] show;hide",
- 'oUF-initialConfigFunction', [[
- local header = self:GetParent()
- self:SetWidth(35)
- self:SetHeight(32)
- ]],
- "yOffset", -8,
- "showParty", true,
- "showPlayer", true,
- "showRaid", true,
- "groupFilter", "1,2,3,4,5,6,7,8",
- "groupingOrder", "1,2,3,4,5,6,7,8",
- "groupBy", "GROUP",
- "maxColumns", 8,
- "unitsPerColumn", 5,
- "columnSpacing", 10,
- "columnAnchorPoint", "LEFT"
- )
- raid:SetPoint("BOTTOMLEFT", UIParent, "BOTTOM", 50, 230)
- lib.dragalize(raid)
- raid.btn:SetAlpha(0)
- raid.btn:SetScale(.0001)
- else
- local raid = oUF:SpawnHeader("ColdRaid", nil, "custom [@raid6,exists] show;hide",
- 'oUF-initialConfigFunction', [[
- local header = self:GetParent()
- self:SetWidth(95)
- self:SetHeight(14)
- ]],
- "yOffset", pp(-5),
- "showParty", true,
- "showPlayer", true,
- "showRaid", true,
- "groupFilter", "1,2,3,4,5,6,7,8",
- "groupingOrder", "1,2,3,4,5,6,7,8",
- "groupBy", "GROUP"
- )
- raid:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", pp(10), pp(172))
- lib.dragalize(raid)
- raid.btn:SetAlpha(0)
- raid.btn:SetScale(.0001)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement