--CASTBAR's SHIZZLE
if(unit == 'player' or unit == 'target' or unit == 'pet' or unit=='focus' or unit=='targettarget') then
self.Castbar = CreateFrame('StatusBar', nil, self)
self.Castbar:SetStatusBarTexture(bartex)
self.Castbar:SetFrameLevel(0)
self.Castbar:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
self.Castbar:SetBackdropColor(0,0,0,1)
self.Castbar2 = CreateFrame('StatusBar', nil, self.Castbar)
self.Castbar2:SetFrameLevel(4)
self.Castbar2:SetStatusBarTexture(bartex)
self.Castbar.bg = self.Castbar:CreateTexture(nil, "BORDER")
self.Castbar.bg:SetAllPoints(self.Castbar)
self.Castbar.bg:SetTexture(bartex)
self.Castbar.bg:SetAlpha(1)
self.Castbar.bg:SetVertexColor(0,0,0)
self.castbarpanel = CreateFrame('StatusBar', nil, self.Castbar)
self.castbarpanel:SetStatusBarTexture(bartex2)
self.castbarpanel:SetWidth(184)
self.castbarpanel:SetHeight(1)
self.castbarpanel:SetPoint("CENTER",self,0, 0)
self.castbarpanel:SetStatusBarColor(statusbarcolor[1],statusbarcolor[2],statusbarcolor[3])
self.castbarpanel:SetBackdrop{
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", tile = true, tileSize = 16,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
self.castbarpanel:SetBackdropColor(0,0,0,1)
self.Castbar.Icon = self.Castbar:CreateTexture(nil, 'BACKGROUND')
self.Castbar.Icon:SetHeight(30)
self.Castbar.Icon:SetWidth(30)
self.Castbar.Icon:SetTexCoord(.07, .93, .07, .93)
self.Castbar.Icon:SetPoint("CENTER", self, 0, 0)
self.Castbar.Icon:Hide()
self.Castbar.Icon.bg = self.Castbar:CreateTexture(nil, "OVERLAY")
self.Castbar.Icon.bg:SetAllPoints(self.Castbar.Icon)
self.Castbar.Icon.bg:SetPoint("TOPLEFT", self.Castbar.Icon, "TOPLEFT", -1, 1)
self.Castbar.Icon.bg:SetPoint("BOTTOMRIGHT", self.Castbar.Icon, "BOTTOMRIGHT", 1, -1)
self.Castbar.Icon.bg:SetTexture(iconborder)
self.Castbar.Icon.bg:Hide()
self.Castbar.Time = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Time:SetPoint('TOPRIGHT', self.Castbar, 0, -1)
self.Castbar.Time:SetFont(font, 8,"OUTLINE")
self.Castbar.Time:SetTextColor(1, 1, 1)
self.Castbar.Time:SetJustifyH('RIGHT')
end
if(unit == "player") then
local _, class = UnitClass(unit)
color = self.colors.class[class]
self.Castbar:SetBackdropColor(0,0,0)
self.Castbar:SetStatusBarColor(color[1],color[2],color[3])
self.Castbar.bg:SetVertexColor(statusbarcolor[1],statusbarcolor[2],statusbarcolor[3])
self.Castbar:SetHeight(9)
self.Castbar:SetWidth(184)
self.Castbar:SetPoint('CENTER', oUF_Player, 'CENTER', 0,5)
self.Castbar.Text = self.Castbar2:CreateFontString(nil, 'OVERLAY')
self.Castbar.Text:SetPoint('CENTER', self.Castbar, 0, -5)
self.Castbar.Text:SetFont(font, 8,"OUTLINEMONOCHROME")
self.Castbar.Text:SetTextColor(1, 1, 1)
self.Castbar.Text:SetJustifyH('LEFT')
self.Castbar.Icon:Hide()
self.Castbar.Icon.bg:Hide()
self.Castbar.Icon:SetPoint("CENTER",self.Castbar, 0, 0)
self.castbarpanel:SetWidth(126)
elseif(unit == "focus") then
self.Castbar:SetBackdropColor(0,0,0)
self.Castbar:SetStatusBarColor(focuscolor[1],focuscolor[2], focuscolor[3])
self.Castbar.bg:SetVertexColor(statusbarcolor[1],statusbarcolor[2],statusbarcolor[3])
self.Castbar:SetHeight(9)
self.Castbar:SetWidth(184)
self.Castbar:SetPoint('CENTER', oUF_Focus, 'CENTER', 0,5)
self.Castbar.Text = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Text:SetPoint('CENTER', self.Castbar, 0, 35)
self.Castbar.Text:SetFont(font, 16,"OUTLINEMONOCHROME")
self.Castbar.Text:SetTextColor(1, 1, 1)
self.Castbar.Text:SetJustifyH('LEFT')
self.castbarpanel:SetPoint("CENTER",self.Castbar, 0, 25)
self.castbarpanel:SetStatusBarColor(focuscolor[1],focuscolor[2], focuscolor[3])
self.Castbar.Icon:Show()
self.Castbar.Icon.bg:Show()
self.Castbar.Icon:SetPoint("CENTER", self.Castbar, 0, 65)
self.Castbar.Time = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Time:SetPoint('CENTER', self.Castbar, 0, 65)
self.Castbar.Time:SetFont(font, 8,"OUTLINEMONOCHROME")
self.Castbar.Time:SetTextColor(1, 1, 1)
self.Castbar.Time:SetJustifyH('CENTER')
elseif(unit == "targettarget") then
self.Castbar:SetBackdropColor(0,0,0)
self.Castbar:SetStatusBarColor(totcolor[1],totcolor[2], totcolor[3])
self.Castbar.bg:SetVertexColor(statusbarcolor[1],statusbarcolor[2],statusbarcolor[3])
self.Castbar:SetHeight(9)
self.Castbar:SetWidth(184)
self.Castbar:SetPoint('CENTER', oUF_TargetTarget, 'CENTER', 0,5)
self.castbarpanel:Hide()
self.Castbar.Icon:Hide()
self.Castbar.Icon.bg:Hide()
self.Castbar.Icon:SetPoint("CENTER", self.Castbar, 0, 0)
else
self.Castbar:SetBackdropColor(0, 0, 0)
self.Castbar:SetStatusBarColor(1, 0.23, 0.36)
self.Castbar.bg:SetVertexColor(statusbarcolor[1],statusbarcolor[2],statusbarcolor[3])
self.Castbar:SetHeight(18)
self.Castbar:SetWidth(190)
self.Castbar:SetPoint('CENTER', oUF_Target,'CENTER',0,5)
self.Castbar:SetHeight(9)
self.Castbar:SetWidth(184)
self.Castbar.Text = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Text:SetPoint('CENTER', self.Castbar, 300, 35)
self.Castbar.Text:SetFont(font, 16,"OUTLINEMONOCHROME")
self.Castbar.Text:SetTextColor(1, 1, 1)
self.Castbar.Text:SetJustifyH('LEFT')
self.castbarpanel:SetPoint("CENTER",self.Castbar, 300, 25)
self.castbarpanel:SetStatusBarColor(1, 0.23, 0.36)
self.Castbar.Icon:Show()
self.Castbar.Icon.bg:Show()
self.Castbar.Icon:SetPoint("CENTER", self.Castbar,300, 65)
self.Castbar.Time = self.Castbar:CreateFontString(nil, 'OVERLAY')
self.Castbar.Time:SetPoint('CENTER', self.Castbar, 300, 65)
self.Castbar.Time:SetFont(font, 8,"OUTLINEMONOCHROME")
self.Castbar.Time:SetTextColor(1, 1, 1)
self.Castbar.Time:SetJustifyH('CENTER')
end