I've recently a simple little addon (hopefully), and have come across some problems (or more accurately, I have absolutely no idea how to do the things I want to). Was hoping that someone might give me some pointers ;)
Function of the mod:
Create a list of raid/partymembers in a tablet, not very different from how Elkano's FriendsFu / GuildFu does it, with the ability to whisper people by clicking their name (In a basic form this actually works right now :) )
A frame consisting of a list of raidmembers, where you can target them by clicking, also with indications if target has buffs, are dead, are in zone xxx etc (I will not even attempt this for a while, but eventually... hopefully :P )
I fetch the content of the tablet from RosterLib, and currently I've succeeded in creating the list with name, groupnumber and class (and class colour too, woho!), and the click to whisper thingy is working great, but... I've failed to order the content. I'm guessing there should be something in OnDataUpdate() but I've failed to figure out what, how and why, regardless of my feeble attempts to read the code of other mods I guess are doing something similar. The goal is to be able to sort the content by name class etc, depending on an option. Any help would be greatly appreciated (as basic as possible, I'm here to learn, not just to get this particular addon working ;) )
Now name, class and subgroup is all fine and dandy, but reading http://www.wowace.com/wiki/Roster-2.1 I get the impression that inserting other information about your group into the table should be vey possible, and I definatly would like to be able to be able to know if a player is dead, which zone it is in, and including checking for buffs wouldn't be bad either ;)
So my question is, how do I put this information into my roster table (or more exactly into my tablet, but since I'd want to use it later for that secure targetable frame too I guess it would be better to put it in the existing roster and pulling it out from there together with the rest of the information)?
I guess I have to find some way to figure that stuff out, so that first, and then I got to figure out how to put it in the table, which I, once again, feel like a monkey scratching it's head when I try to figure out.
Hope someone can help me ;)
Thanks in advanced (and a big thanks to everyone around here, for providing such nice addons and libraries, and for taking your time to educate those of us who lack the skills, but are willing to listen. )
PS. supplying a zip with the files in their current form, incase someone wants to see them. Allthough I warn you, probably not a pretty sight :)
RosterLib unit objects from :IterateRoster can be accessed like a normal table, so you can apply any properties you want to the unit objects and they will survive for the rest of the session or until a UI reload.
Gah... I feel so stupid :( I guess I understand what you say can be done, but I have absolutely no idea how to do it, tried fiddling with some stuff, but even I knew they weren't going to work before I even "tried them out" :(
If you got the time help me with an example and maybe I'll understand, please *puppy-eyes*
Lets say I use a
for unit in Roster:IterateRoster(false) do
---insert stuff to put the info on the tablet, which i think is working---
and I want to use "zone" in the above thingy to be able to see someones zone (duh :P )
and then what?
something with "table.insert"? and where do I put it? in on enable so it runs once? or do i need to watch for an event and update it "manually" every time it changes?
Feel like an idiot for having to ask this, but one have to begin somewhere, right?
Hope you can take your time to help :)
Saw that Roster 2.2 was released today/is going to be released soon, will I have to relearn all this if I'd change over, or would it more be a matter of switching a few words around (keep in mind.... I'm not particularly good at this stuff (yet, hopefully :P ) )
Gah, seems I'm not bright enough to understand this. I'll have to leave the addonwriting until I can find someone willing to walk me trough the basics in person I guess, reading code without insane amounts of comments is apparently beyond me.
Thanks for trying to help though.