Originally Posted by DeadAngel1985
The option to choose between english and german
|
Why is this an option? You should just detect which language the game client is set to, and use that.
Originally Posted by DeadAngel1985
4 blocks where i can drag and drop the types of gloves (Normal gloves, mining, herbalsim and skinning)
|
Maybe I'm misunderstanding the purpose of your addon, but why does the user need to tell the addon which gloves have the profession enchants? Just scan their bags to find them on demand:
Lua Code:
local enchantsForProfession = {
Fishing = {
["846"] = true, -- +2 Fishing
},
Herbalism = {
["845"] = true, -- +2 Herbalism
},
Mining = {
["844"] = true, -- +2 Mining
},
}
local function FindGlovesForProfession(professionName)
local enchants = enchantValuesForProfession[professionName]
if not enchants then
return
end
for bag = 0, 4 do
for slot = 1, GetContainerNumSlots(bag) do
local itemLink = GetContainerItemLink(bag, slot)
local enchantID = itemLink and itemLink:match("Hitem:%d+:(%d+):")
if enchantID and enchants[enchantID] then
return bag, slot
end
end
end
end
local bag, slot = FindGlovesForProfession("Fishing")
if bag and slot then
-- Do something with the gloves here
end
Note the included enchant IDs were taken from
http://wow.gamepedia.com/EnchantId and may not be correct. If there's only one enchant for each profession these days, you don't even need the sub-tables.