oUF

99.9k Downloads

About the caster

dwWei opened this issue ยท 9 comments

commented

Hello, I always have this bug when I use the caster.
Occasionally rollback animation after I or the target casting skill
CastBar
">>>>>
<<<<<"
It seems that this situation does not occur without using Spark?

My settings are as follows

--CreateCastBar

local Spark = s:CreateTexture(nil, "OVERLAY")
Spark:SetTexture("Interface\CastingBar\UI-CastingBar-Spark")
Spark:SetBlendMode("ADD")
Spark:SetAlpha(.8)
Spark:SetPoint("TOPLEFT", s:GetStatusBarTexture(), "TOPRIGHT", -10, 10)
Spark:SetPoint("BOTTOMRIGHT", s:GetStatusBarTexture(), "BOTTOMRIGHT", 10, -10)
s.Spark = Spark

There is a CastBar rollback situation

normal
V
error Rollback when casting is complete
GIF

commented

I am not seeing anything unexpected when using the spark with my layout, so I think it is an issue with your layout.

Feel free to reopen this issue with a GIF to illustrate your problem precisely if you are still convinced this is caused by oUF and is not a layout problem.

commented

I am not seeing anything unexpected when using the spark with my layout, so I think it is an issue with your layout.

Feel free to reopen this issue with a GIF to illustrate your problem precisely if you are still convinced this is caused by oUF and is not a layout problem.

Hello, please see GIF.

commented

I still suspect a layout issue here. Do you set castbar.channeling = true somewhere in your layout code? Do you have a link to your layout?

commented

Do you have a link to your layout?

commented
commented

I still suspect a layout issue here. Do you set castbar.channeling = true somewhere in your layout code? Do you have a link to your layout?

 local function SetCastBarColorShielded(self)
  self.__owner:SetStatusBarColor(unpack(L.C.colors.castbar.shielded))
  --self.__owner.bg:SetVertexColor(unpack(L.C.colors.castbar.shieldedBG))
end

local function SetCastBarColorDefault(self)
  self.__owner:SetStatusBarColor(unpack(L.C.colors.castbar.default))
  --self.__owner.bg:SetVertexColor(unpack(L.C.colors.castbar.defaultBG))
end

--CreateCastBar
local function CreateCastBar(self)
  if not self.cfg.castbar or not self.cfg.castbar.enabled then return end
  --statusbar
  local s = CreateFrame("StatusBar", nil, self.Health)
  s:SetStatusBarTexture(L.C.textures.statusbar)
  s:SetFrameStrata("MEDIUM")
  s:SetSize(unpack(self.cfg.castbar.size))
  SetPoint(s,self,self.cfg.castbar.point)
  s:SetStatusBarColor(unpack(L.C.colors.castbar.default))

--Spark
  local Spark = s:CreateTexture(nil, "OVERLAY")
  Spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark")
  Spark:SetBlendMode("ADD")
  Spark:SetAlpha(.8)
  Spark:SetPoint("TOPLEFT", s:GetStatusBarTexture(), "TOPRIGHT", -10, 10)
  Spark:SetPoint("BOTTOMRIGHT", s:GetStatusBarTexture(), "BOTTOMRIGHT", 10, -10)
  s.Spark = Spark
  --icon for player and target only
  if self.cfg.castbar.icon and self.cfg.castbar.icon.enabled then
    --icon
    local i = s:CreateTexture(nil,"BACKGROUND",nil,-8)
    i:SetSize(unpack(self.cfg.castbar.icon.size))
    SetPoint(i,s,self.cfg.castbar.icon.point)
    if self.cfg.castbar.icon.texCoord then
      i:SetTexCoord(unpack(self.cfg.castbar.icon.texCoord))
    else
      i:SetTexCoord(0.1, 0.9, 0.1, 0.9)
    end
    s.Icon = i
    --backdrop (for the icon)
    CreateBackdrop(s,i)
  end
  --shield
  local shield = s:CreateTexture(nil,"BACKGROUND",nil,-8)
  shield.__owner = s
  s.Shield = shield
  --use a trick here...we use the show/hide on the shield texture to recolor the castbar
  hooksecurefunc(shield,"Show",SetCastBarColorShielded)
  hooksecurefunc(shield,"Hide",SetCastBarColorDefault)
  --text
  if self.cfg.castbar.name and self.cfg.castbar.name.enabled then
    local cfg = self.cfg.castbar.name
    local name = CreateText(s,cfg.font,cfg.size,cfg.outline,cfg.align,cfg.noshadow)
    if cfg.points then
      SetPoints(name,s,cfg.points)
    else
      SetPoint(name,s,cfg.point)
    end
    s.Text = name
  end
  return s
end
L.F.CreateCastBar = CreateCastBar

I am using the oUF_Simple UI code.
No castbar.channeling = true
oUF_Simple\core\functions.lua

R

I did another experiment just now. It's not related to Spark.
GIF

The cause of the error is that the last Casting is channeling, and this will happen later.

commented

2
....

commented

Am I now supposed to post a GIF where it works as intended? :)

commented

This is very likely a layout bug or a bug in your ouf fork, who knows. But in worst case scenario, you could try pulling my castbar rework PR #480 and updating your layout code accordingly. It's tested and used millions of times at this point since it's used in ElvUI.