View Single Post
12-18-15, 05:57 AM   #1
Basso
A Fallenroot Satyr
 
Basso's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 22
Need help with Nameplate Castbar

I'm working on a little nameplate addon but i got two problems left i can't solve at the moment.

Code:
spellIcon:ClearAllPoints(); 
	spellIcon:SetWidth(CASTBAR_HEIGHT * (BAR_BORDER + 1)); 
	spellIcon:SetHeight(CASTBAR_HEIGHT * (BAR_BORDER + 1)); 
	spellIcon:SetPoint("BOTTOMRIGHT", castBar, "BOTTOMLEFT", -4, 0);
	
	
	local SpellIconOverlay = castBar:CreateTexture(nil, "MEDIUM", nil, -2); 
	SpellIconOverlay:SetTexture("Interface\\AddOns\\Test\\SpellIcon"); 
	SpellIconOverlay:SetVertexColor(0, 0, 0); 
	SpellIconOverlay:SetWidth((CASTBAR_HEIGHT * (BAR_BORDER + 1)) + 1); 
	SpellIconOverlay:SetHeight((CASTBAR_HEIGHT * (BAR_BORDER + 1)) + 1); 
	SpellIconOverlay:SetPoint("CENTER", castBar.spellIcon, "CENTER", 0, 0);
This is the positioning of the Castbar Spell Icon and this works so far, my Problem is the overlay always
stays behind the actual spell icon, and if i try to us :SetFrameLevel("LOW") on the Spellicon i get bombed
with this error:
Code:
Message: ...e\AddOns\Test\Test.lua:173: attempt to call method 'SetFrameLevel' (a nil value)
My idea was that maybe the spell icon stuff is further splitted in a table but i can't find a list of it.


the second Problem is the spell name, i want to shorten it if its gets longer then a specific amount
of letters, i have a function for that which i use on the name of the unit that works fine, but i can't use
it on the CastbarText, at the moment it seems to me that it is the same problem as above.

same attempt like on the name:
Code:
castBar.spellName = utf8sub(castBar.spellName:GetText(), 27, false);
the error:
Code:
Message: ...e\AddOns\Test\Test.lua:18: attempt to index local 'string' (a nil value)
Anyone knows a solution?
Or simply has a list of the content of these Tables i seem to dumb to find ?

Thanks,
Basso
  Reply With Quote