I'm trying to create some custom bag slot buttons, but trying to avoid all the hassle of using ItemButton and stripping out everything Blizzard have done and replace it with what I actually want.
So I have something like:
Code:
local button = CreateFrame("Button", "GiTestButton", UIParent, "SecureActionButtonTemplate")
button:SetAttribute("type2", "item")
button:SetAttribute("item", "4_2")
-- Make it look pretty and put it somewhere, etc
Now if I have the merchant frame open and an item in slot 2 of bag 4 that cannot be worn by any class (e.g. junk item) then right clicking the button sells the item.
If, however, I have the merchant frame open and a piece of armour or a weapon in that slot then right clicking the button equips it! Which I dont want (it should behave like the standard Blizzard UI)
Note: This will sell potions and other items with an "On Use" that can't be equipped rather than trying to use them.
Has anyone else experienced this before? and is there any way around it to get the behaviour I want?
Or am I going to have to fall back to ItemButton and fighting off all the default stuff I don't want?