View Single Post
09-17-09, 09:23 AM   #10
Daltanious
A Murloc Raider
 
Daltanious's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 5
Originally Posted by ave0000 View Post
Hi, first of all I want to thank you for making a simple and extremely useful addon, it has significantly improved my ability to heal.
This is exactly the reason why I wrote BOLT, I'm very happy of that

Originally Posted by ave0000 View Post
Swapped the initialization of targetClass in StartTimer:
Code:
function BOLTButton:StartTimer(targetName)
	self.targetName = targetName
	_, self.targetClass = UnitClass(targetName)
	...
Yes, your use of the EnglishClass instead of LocalizedClass is a lot better.


Originally Posted by ave0000 View Post
Getting to the point, I was poking through the code and noticed that BOLTButton:SetNamePlate() could be improved. I thought, hey there must be a better way to figure out class -> color. So I poked around and made two changes.

Then I trimmed SetNamePlate to:
Code:
function BOLTButton:SetNamePlate()
	local red,green,blue
	local displayName

	local c = RAID_CLASS_COLORS[self.targetClass] or {r = 0.75, g = 1, b = 0.75}
	red, green, blue = c.r, c.g, c.b
	
	-- in any case... trunc at 12 chars lenght
	displayName = string.sub(self.targetName,1,5)	
	self.frameBtn.namePlate:SetText(displayName)
	self.frameBtn.namePlate:SetTextColor(red, green, blue, 1)	-- visible by default
end
I didn't know the RAID_CLASS_COLORS table use, your suggestion is excellent and I will use from the next release.
  Reply With Quote