View Single Post
05-16-09, 08:20 AM   #7
illum1n4ti
A Defias Bandit
 
illum1n4ti's Avatar
Join Date: Jun 2006
Posts: 3
Hello mates,

I was thinking to share this with you .. As you can see i have changed the texture of the border .. see my screen shot.



Code:
-- Function is called after a button was added to an object
-- We color the borders of the button to see if it is an ammo bag or else
-- Please note that the buttons are in most cases recycled and not new created
local PostAddButton = function(self, button, bag)
	if(not button.NormalTexture) then return end
	button.NormalTexture:SetWidth(43)
        button.NormalTexture:SetHeight(43)
	button.NormalTexture:SetTexture([[Interface\FXP\Classic.tga]])

	local bagType = cargBags.Bags[button.bagID].bagType
	if(button.bagID == KEYRING_CONTAINER) then
		button.NormalTexture:SetVertexColor(1, 0.7, 0)		-- Key ring
	elseif(bagType and bagType > 0 and bagType < 8) then
		button.NormalTexture:SetVertexColor(1, 1, 0)		-- Ammo bag
	elseif(bagType and bagType > 4) then
		button.NormalTexture:SetVertexColor(0, 1, 0)		-- Profession bags
	else
		button.NormalTexture:SetVertexColor(0.5, 0.5, 0.5)	-- Normal bags
	end
end
But as u can see my Ammo and Herb bags ain't coloring am i doing something wrong? maybe you guys can help me out.
  Reply With Quote