View Single Post
07-16-15, 09:56 AM   #9
sezz
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 158
Originally Posted by alikim View Post
I mean how do you do this?
this is what I'm using for my profession cds, not sure if it's the right way but it works and doesn't taint

Code:
		button:WrapScript(button, "PreClick", [[
			if (button == "RightButton") then
				-- Hide
				self:SetID(0);
				self:SetAttribute("userhidden", true);
				self:SetAttribute("macrotext", nil);
				self:Hide();

				-- Update Anchors
				self:GetParent():RunAttribute("UpdateChildAnchors");
			elseif (button == "MiddleButton") then
				-- Toggle Profession
				self:SetAttribute("macrotext", self:GetAttribute("macrotext-profession"));
			else
				-- Create Profession Cooldown Item
				self:SetAttribute("macrotext", self:GetAttribute("macrotext-tradeskill"));
			end
		]]);

btw, why don't you just reskin the original button instead?
  Reply With Quote