WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Graphics Help (https://www.wowinterface.com/forums/forumdisplay.php?f=14)
-   -   Need help to create graphical Addon (https://www.wowinterface.com/forums/showthread.php?t=54629)

DeadAngel1985 10-10-16 04:59 AM

Need help to create graphical Addon
 
1 Attachment(s)
Hello everyone,

first sorry for my bad english and i hope you will understand my request.

I am looking for a person who can help me to design an own graphical Addon menu.
I have wrote a little addon and now i want to give the user the option to
change options ingame.

What does the Addon?
The Addon is for collecting professions. It swaps gloves when you hover a node or a herb
so that you can use the enchants for faster mining or herbalsim and then switch back to your
normal gloves. When you are infight it will not change the gloves. The Addon works fine for me
so i will share it with other people.


What i need:
- A slash command to open the menu
- The option to choose between english and german
- Check list where i can chose my professions
- 4 blocks where i can drag and drop the types of gloves (Normal gloves, mining, herbalsim and skinning)

I hope somebody can help me. (If you are german it would be easier)

i have painted a little picture what i could be

tonyis3l33t 10-10-16 02:22 PM

take a look at my set swap addon; it has some features which can be used as learning examples for you. I write code in a pretty easy-to-follow way so I can more easily relearn it and maintain. See Options.lua file, mostly. In general, I find a good way to learn WoW's API and nuances is by reviewing other simple addons.

http://www.wowinterface.com/download...ftSetSwap.html

Phanx 10-11-16 06:43 PM

Quote:

Originally Posted by DeadAngel1985 (Post 319809)
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.

Quote:

Originally Posted by DeadAngel1985 (Post 319809)
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:
  1. local enchantsForProfession = {
  2.     Fishing = {
  3.         ["846"] = true, -- +2 Fishing
  4.     },
  5.     Herbalism = {
  6.         ["845"] = true, -- +2 Herbalism
  7.     },
  8.     Mining = {
  9.         ["844"] = true, -- +2 Mining
  10.     },
  11. }
  12.  
  13. local function FindGlovesForProfession(professionName)
  14.     local enchants = enchantValuesForProfession[professionName]
  15.     if not enchants then
  16.         return
  17.     end
  18.  
  19.     for bag = 0, 4 do
  20.         for slot = 1, GetContainerNumSlots(bag) do
  21.             local itemLink = GetContainerItemLink(bag, slot)
  22.             local enchantID = itemLink and itemLink:match("Hitem:%d+:(%d+):")
  23.             if enchantID and enchants[enchantID] then
  24.                 return bag, slot
  25.             end
  26.         end
  27.     end
  28. end
  29.  
  30. local bag, slot = FindGlovesForProfession("Fishing")
  31. if bag and slot then
  32.     -- Do something with the gloves here
  33. 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.

p3lim 10-12-16 02:15 AM

I think the enchants he was after were one of these:

http://www.wowhead.com/spell=190988/legion-herbalism
http://www.wowhead.com/spell=190989/legion-mining
http://www.wowhead.com/spell=190990/legion-skinning
http://www.wowhead.com/spell=190991/legion-surveying

But they can be detected the same way.


All times are GMT -6. The time now is 01:07 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI