Quantcast Need help to create graphical Addon - WoWInterface
Thread Tools Display Modes
10-10-16, 04:59 AM   #1
DeadAngel1985
Guest
Posts: n/a
Need help to create graphical Addon

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
Attached Thumbnails
Click image for larger version

Name:	RaidFrameIcons-Config.jpg
Views:	104
Size:	71.6 KB
ID:	8848  
  Reply With Quote
10-10-16, 02:22 PM   #2
tonyis3l33t
A Cyclonian
 
tonyis3l33t's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 42
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
  Reply With Quote
10-11-16, 06:43 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,567
Originally Posted by DeadAngel1985 View Post
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 View Post
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.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
10-12-16, 02:15 AM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,610
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.
  Reply With Quote

WoWInterface » Developer Discussions » Graphics Help » Need help to create graphical Addon

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off