WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Message already sent? (https://www.wowinterface.com/forums/showthread.php?t=58838)

Chr0nicxHack3r 07-12-21 02:44 PM

Message already sent?
 
I am working on an addon that does call outs for the group. I am wondering if someone can tell me if it is possible for the addon to recognize that someone already had the callout that way 2+ people are not making the same call out at once?

Dridzt 07-13-21 09:43 AM

Quote:

Originally Posted by Chr0nicxHack3r (Post 339561)
I am working on an addon that does call outs for the group. I am wondering if someone can tell me if it is possible for the addon to recognize that someone already had the callout that way 2+ people are not making the same call out at once?

The easiest way to do that would probably be to bounce some addon messages around on group changes to maintain a list of members with the addon installed / enabled; then have the addon decide to send or self-mute based on a rule applied to that list (if you are not in the first alphabetical spot or the lowest group index of available members for example)

Edit: To clarify by bounce addon messages around I mean the addon comms that are hidden from players with SendAddonMessage to maintain a list of players in the group that have your addon installed / enabled when GROUP_ROSTER_UPDATE happens.

Then apply a rule to that list of group members with your addon that ensures only one of them will try to broadcast.
For example sort it alphabetically or by group index and only the instance of the addon with the first / lowest index broadcasts and other instances do not.

The other way would be to add an arbitrary delay to the broadcasts and do chat parsing to self-mute when a message from another instance of the addon has already gone out.
This is real messy and I wouldn't recommend it though.


All times are GMT -6. The time now is 10:36 PM.

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