Quantcast
WoWInterface - View Single Post - Anchoring cast bar to personal resource display
View Single Post
09-17-17, 03:56 AM   #7
nKweo
A Deviate Faerie Dragon
 
nKweo's Avatar
Join Date: Oct 2012
Posts: 16
So you ended up with something like this?
Code:
local function attach()
	CastingBarFrame:ClearAllPoints()
	CastingBarFrame:SetPoint("TOP",C_NamePlate.GetNamePlateForUnit("player"),"BOTTOM",0,-28)
	--CastingBarFrame.SetPoint = function() end
end

local function detach()
	CastingBarFrame:ClearAllPoints()
	CastingBarFrame:SetPoint("TOP",UIParent,"BOTTOM",0,160)
	--CastingBarFrame.SetPoint = function() end
end

local f = CreateFrame("frame")
f:RegisterEvent("NAME_PLATE_UNIT_ADDED","player")
f:SetScript("OnEvent",attach)

local f = CreateFrame("frame")
f:RegisterEvent("NAME_PLATE_UNIT_REMOVED","player")
f:SetScript("OnEvent",detach)
Haven't played around too much with it, since it won't solve the cast bar stretching problem. Would be nice if someone else would chime in, but otherwise your other suggestions work ok for now.
  Reply With Quote