Thread Tools Display Modes
08-10-05, 07:04 AM   #1
Zanthor
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Aug 2005
Posts: 64
Raid SubGroups - Move and Swap

I'm posting this here in hopes of getting some more experienced UI Modders opinions on the issues I'm running up against here...

I've been trying to write a UI Mod that lets me snapshot a raid group (IE: Best groups for clearing trash in MC) and then move people about by hand (IE: For Boss Fights in MC) and then issue a command to move them all back.

What I've gotten so far is that as long as no group is full I can instantly move people without any problems... I had a 10 man raid testing this last night and could move all 10 to different subgroups instantly with no errors on either end of things... however when I tried to swap the players between groups 1 and 2, thats when my troubles began.

The command:
SetRaidSubgroup(index, subgroup) - works beautifully for this if the groups not full.
SwapRaidSubgroup(index1, index2) - This appears to work quite well as long as you do it by hand, the problem I seem to run into is that when you issue more than 1 at a time, it seems to ignore the previous commands...

My Solution:
Impliment a task list and process it out of the OnUpdate event and use the RAID_ROSTER_UPDATE event to verify that the work is done before allowing the task list to move onto the next step...

So loosely:
Queue Data:
Queue[Index] = {Player#, PlayerName, TargetGroup, CurrentGroup}

OnUpdate -
Check to see if its already working on something
Check to see if there is anything to do
Set flag saying queue being processed.
Find the swap target from the list of players in the queue and issue
swap command.
Issue swap command to game for player A and B
Update player A and B's CurrentGroup in the Queue table
Set flag indicating waiting for UI to update.

-- Need to impliment some form of timer to indicate a timeout status
on the failure to update the raid roster otherwise this will stall and
never pick backup

RaidRosterUpdate
Check to see if the TargetGroup == CurrentGroup for player A
If true
- Remove PlayerA from queue
- Set flag that UI is updated
if False
- Update Queue with current group for all players
- Set flag that UI is updated
Set flag that Queue isn't processing so it can pick up the next cycle

Anyhow, I'm thinking this will work, but haven't had time to get it put in since I came up with it on the way to work this morning...

Anyone want to share an opinion with me?
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Raid SubGroups - Move and Swap


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