Hello,
i have created an ouf layout for TBC Classic.
to add castbars i created a function which is called within player and target function. The player castbar works just fine but the target castbar does not work at all. Here are the issues:
- The target castbar does not appear for any target casts of other players or npcs with exception of my casts (if I target myself)
- if I interrupt my spellcast the target castbar will still continue the spellcast.
- if I cast a spell and switch to another target than myself the target castbar (with my currently casted spell) wont disappear or update to the new targets casted spell.
Here is the code for my castbar
The Castbar Code
Lua Code:
createCastBar = function(self, x, y, w, h, unit)
local Castbar = CreateFrame('StatusBar', nil, self, "BackdropTemplate")
Castbar:SetStatusBarTexture(bartex)
Castbar:SetStatusBarColor(1.0, 0.5, 0.3)
Castbar:SetHeight(w)
Castbar:SetWidth(h)
Castbar:SetBackdrop({
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
insets = {top = 0, left = 0, bottom = 0, right = 0}})
Castbar:SetBackdropColor(0.045, 0.045, 0.045, 1)
Castbar.Border = CreateFrame('Frame', nil, Castbar)
Castbar.Border:SetAllPoints(Castbar)
Castbar.Border:SetFrameLevel(Castbar:GetFrameLevel() + 5)
CreateBorder(Castbar.Border, borderradius)
Castbar.SafeZone = Castbar:CreateTexture(nil,"ARTWORK")
Castbar.SafeZone:SetTexture(bartex)
Castbar.SafeZone:SetVertexColor(.75,.10,.10,.2)
Castbar.SafeZone:SetPoint("TOPRIGHT")
Castbar.SafeZone:SetPoint("BOTTOMRIGHT")
Castbar:SetPoint('LEFT', self.Health, x, y)
Castbar.Spark = Castbar:CreateTexture(nil,'OVERLAY')
Castbar.Spark:SetTexture([[Interface\CastingBar\UI-CastingBar-Spark]])
Castbar.Spark:SetBlendMode('Add')
Castbar.Spark:SetHeight(Castbar:GetHeight() + 10)
Castbar.Spark:SetWidth(30)
Castbar.Spark:SetVertexColor(1, 1, 1)
Castbar.Icon = Castbar:CreateTexture(nil, 'OVERLAY')
Castbar.Icon:SetPoint("RIGHT", Castbar, "LEFT", -13, -3)
Castbar.Icon:SetHeight(33)
Castbar.Icon:SetWidth(33)
Castbar.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
Castbar.Text = Castbar:CreateFontString(nil, 'OVERLAY')
Castbar.Text:SetPoint('LEFT', Castbar, -1, -25)
Castbar.Text:SetFont(font, fontsize, "OUTLINE")
Castbar.Text:SetShadowOffset(1, -1)
Castbar.Text:SetTextColor(1, 1, 1)
Castbar.Text:SetJustifyH('LEFT')
Castbar.Time = Castbar:CreateFontString(nil, 'OVERLAY')
Castbar.Time:SetPoint('RIGHT', Castbar, 5, -25)
Castbar.Time:SetFont(font, fontsize, "OUTLINE")
Castbar.Time:SetTextColor(1, 1, 1)
Castbar.Time:SetJustifyH('RIGHT')
Castbar.PostChannelUpdate = PostChannelUpdate
Castbar.PostCastStart = PostCastStart
Castbar.PostChannelStart = PostCastStart
Castbar.PostChannelStop = PostChannelStop
Castbar.PostCastInterrupted = PostCastInterrupted
Castbar.PostCastFailed = PostCastFailed
self.Castbar = Castbar
end
The Target Code
Lua Code:
function martinioUF:Target(unit)
self:SetParent(UIParent)
eventListeners(self)
self:SetWidth(250)
self:SetHeight(19)
...CODE ...
createCastBar(self, 0, -40, 15, 228, unit)
self.LeaderIndicator = self.Leader
self.RaidTargetIndicator = self.RaidIcon
self.ReadyCheckIndicator = self.ReadyCheck
return self
end
Did I miss something or make something wrong?
best,
Martin