View Single Post
10-05-20, 02:38 PM   #6
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Hi,

I have tried the SDPhantom code to fix an issue I got since long time very similar to the one is having cokedrivers.

I had this code in my addon:

Lua Code:
  1. TargetFrameSpellBar:ClearAllPoints()
  2. TargetFrameSpellBar:SetPoint("CENTER", UIParent, "CENTER",0,-30)
  3. TargetFrameSpellBar.SetPoint = function() end
  4. TargetFrameSpellBar:SetScale(2.0)
  5. TargetFrameSpellBar.Icon:SetAlpha(0)
  6. TargetFrameSpellBar.BorderShield:SetAlpha(0)

The position of the target casting bar is correct but I got one error often when I start a (multi)boss .

If I remove this code and I use this:

Lua Code:
  1. hooksecurefunc("Target_Spellbar_AdjustPosition", function(self)
  2.             if self == TargetFrameSpellBar then
  3.                 self:ClearAllPoints()
  4.                 self:SetPoint("CENTER", UIParent, "CENTER", 0, -30)
  5.                 -- self.SetPoint = function() end
  6.                 self:SetScale(2.0)
  7.                 self.Icon:SetAlpha(0)
  8.                 self.BorderShield:SetAlpha(0)              
  9.             end
  10.         end)

When castbar appear for the first time it is in the wrong place but in the middle of the cast it goes in center position as I wanted.
The next castbars are put in the right position always.

If I use this:

Lua Code:
  1. self.SetPoint = function() end

No castbar appears (probably because wow doesn't show any un-anchored frame).

Here is a demo:

https://streamable.com/2vi6su

Any idea ?

Thanks for any help.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote