View Single Post
03-19-14, 07:05 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Based on that code and the API documentation for PickupEquipmentSet, it looks like you need to use the set index, not the set name, and I'd expect this to work:

Code:
frame:SetAttribute("type", "equipmentset")
frame:SetAttribute("equipmentset", 4)
If you want to let the user enter a name instead of an index, you can find the index like this:

Code:
local function GetEquipmentSetIDByName(name)
    for i = 1, GetNumEquipmentSets() do
        if GetEquipmentSetInfo(i) == name then
            return i
        end
    end
end
I'm not that knowledgable about the equipment set API in general, though... if the indices are not fixed (eg. they can change if the user renames the set or adds a new set) then you probably want to store the set by name, and check its ID every time something changes.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 03-19-14 at 07:10 PM.
  Reply With Quote