I have an idea for an addon. This will be the first one I make myself, from scratch. I'm currently maintaining Swindler Preventer but that was taken over by Adspace made by Gazmik Fizzwidget. So it was (relatively) easy to simply update/maintain his code, but starting one from scratch is something else.
I'm looking for some help with the 'base' 'core' code. The part that handles configuration and settings. Using Ace would probably be easier, but as this is my first time I'm not really sure what I'm doing.
I was hoping that someone could 'get me started' by coding the beginning of the config file for me, then I could copy their code for the rest of the configuration I want to do.
Basically, I need a super-small addon that will do the config and save it to a LUA file. If profile support could be included that'd be awesome too.
Basically, the idea I have is for the addon to automatically do emotes, but only voice emotes. (The ones with in-game voice to go with them.) I don't see these voice emotes used often enough, and I'd like to use them more often myself, but typically I'm too busy fighting/tanking/healing to do them manually.
So I'm going to try to come up with various 'triggers' that apply to each emote. Ultimately I look to support at least one 'trigger' for every voice emote in the game. But not everyone who uses the addon is going to agree on the exact same 'triggers' so the config file is important! This is where I need your help, since I'm new to lua and haven't made an addon with a config from scratch before.
Here's the way I want the config menu to look:
(One dash - equals a 'folder' underneath the name of the addon in the interface menu.)
(Two dashes -- equals a checkbox. If no default is specified, it defaults to on.)
(Three dashes --- equals a suboption and should be slightly indented to indicate it's based on a higher option.)
(Extra dashes equals more suboptions.)
Make Some Noise Configuration Menu:
(In the folder that is when you click on the name of the addon itself, and not any of the subfolders on the interface menu, I want to describe the goal of the addon and have a little paragraph there.)
- General Settings
-- Enable Addon (all other settings in the entire addon will be disabled/grayed out if this is disabled).
-- Time between emotes: (Slider, from 30 to 600, intervals of 5 allowed on slider, and a textbox to manually enter in a value, which doesn't have to be a multiple of 5. Error if below 30 and set to 30 instead; 30 is a minimum. Values over 600 are allowed.) (If you mouseover this option it will have a 'help tooltip' I'll fill in later.) (Default: 30)
--- Suboption (disabled if above option disabled): Global emote cooldown or Individual Emote Cooldown. (The way I see this working is two checkboxes as a suboption of this suboption, and checking one deselects the other.) (Help tooltip included on option and both suboptions.) (Default: Global)
- Heal me!
-- Enable /healme (helpful tooltip)
--- /healme when below X% maximum health (slider, 1-100% in intervals of 1%, textbox to manually enter a value, default = 35%)
---- Only in combat (help tooltip)
That should be good enough to get me started and then I can set up triggers for all the other emotes I want to configure for and set up the rest of the config file from there based on your example. Please note that you don't have to actually code the healme emote if you don't want to, I'm just looking for the config to get started with. I can also make my own descriptions and help tooltips as long as I know the code to surround them with.
So if someone could be kind to get me started with the base code and then I can take it from there. Thanks in advance!
So please help me out. I need the code to get started. Your 'addon' should:
1 - include all the xml, toc, lua files and the Ace library if needed to get the config set up. The name of the addon is 'Make Some Noise' but can be abbreviated to MSN in config/variables/coding/etc.
2 - Hopefully using the profile setting, be able to save variables and remember settings between sessions. Once I see how to get the base config going I can rename variables to what I want them to be so don't worry about naming them 'correctly'.
3 - Be extremely simple and only contain code necessary to accomplish these goals. I'm still a lua newbie. =(
Another thing that I want to config is a 'test button'. For instance on the Healme page of the config, right next to the 'enable /healme', I'd like a 'test button' that can be clicked on and when you do, it plays your race/gender's 'healme' emote (but without actually doing the emote, it's sound only, client-side). If this is possible, please code that in as well. =D If not, or if it's too complicated, I'll worry about that later.
So... it's the first addon you'll make yourself from scratch, but you don't actually want to write it yourself, or from scratch, and you want someone else to write the bulk of the code for you, for free? Good luck with that.
As a healer, let me tell you that this kind of thing is extremely annoying, and in most situations, if I were grouped with someone using such an addon, I would either leave the group or just deliberately let them die over and over. My entire job is to keep people alive. I know when your health is low. Spamming audio emotes is unnecessary and obnoxious.
This is nowhere near the bulk of the code. I have plans for this addon far above and beyond what's described here. This is just to get started.
Another option, instead of coding it, is to point me to an addon that has good code that I can just take a look at. I simply don't know the LUA. Or point me to a tutorial.
I can code myself just fine if I know the actual functions and such. So far I can make an 'always on' addon that performs a certain function. What I don't know how to do yet is set up a config GUI in the interface options menu, or how to designate how to save variables so the config can be remembered. I'm also unfamiliar with Ace's 'profile' system. So that's what I was looking for help with.
I assume someone who actually knows the code could scrap up an 'outline' in like 5 minutes, tops. They don't have to actually DO the coding, just give me enough to get an idea of the functions and such, and I'll take over and do the rest.
And lastly, I already use 'auto shout out' which does the /healme and /helpme emotes automatically. Nobody ever complains. Healers are 99% of the time too busy healing to pay attention to the chat/emote channel anyway. And about the only one that actually hears the character speak is me.
As a healer myself, I've never been annoyed by other people doing it. I just ignore it. What annoys me more is when the tank stops tanking in order to top themself off when I'm at 100% mana and they're at 95% health. I'm the healer, let me do my freakin' job. The time and mana you're wasting healing yourself could be spent on dps instead. But oh well.
And healme is just one of the many voice emotes in the game. I plan to support them all. And practically none of the rest of them even relate to 'annoying the healer' at all.
I can code myself just fine if I know the actual functions and such.
Then you should ask specific questions! I think I speak for most people here when I say that we appreciate if you know exactly what you want to know. We can't really help you become a programmer from scratch, but we can help you along the way.
That being said, you do ask more specifically in the same paragraph, and I will try to answer that.
Adding a interface options category for your own addon is just a matter of doing this:
local frame = CreateFrame("Frame")
frame.name = "My addon"
frame.name is simply the label used in the category list, and can be anything. After that you can add widgets to frame just like with any other frame.
To save variables between sessions you need to specify it in your ToC file using either the SavedVariables or SavedVariablesPerCharacter tags. This variable needs to be global, and gets loaded when ADDON_LOADED fires with your addon's name as the first argument.