|
||||||
| Lua Code Discussion You scared? Terrified. Mortified. Petrified. Stupefied... by [coding]. | ||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Junior Member
Join Date: Oct 2008
Location: Massachusetts
Posts: 87
|
I've got a feature to auto accept group invites in my MultiTool addon if certain conditions are met...
Code:
self:RegisterEvent("PARTY_INVITE_REQUEST", "confirmPartyInvite")
function MultiTool:confirmPartyInvite(info, sender)
if (self.db.profile.groupRejectFlag and not self:isInWhiteList(sender)) then
DeclineGroup()
StaticPopup_Hide("PARTY_INVITE")
return
elseif (self.db.profile.groupFlag and self:isInWhiteList(sender)) then
AcceptGroup()
StaticPopup_Hide("PARTY_INVITE")
return
end
end
I can put in some kind of delay, or otherwise change the way the code works and probably get it working, but I wanted to post here in case either someone else already figured it out, or else to let folks know that it appears there was some undocumented (as far as I can see) change in the way the StaticPopup_Hide("PARTY_INVITE") is being handled. |
|
|
|
|
|
#2 |
|
Hero Member
Join Date: Nov 2005
Posts: 817
|
I put an OnUpdate in my code and check at 0.2 intervals for GetNumPartyMembers()>0 before hiding the static popup.
I only SetScript the OnUpdate in the PARTY_INVITE_REQUEST event and nil it after hiding the popup. |
|
|
|
|
|
#3 |
|
Full Member
Join Date: Nov 2006
Location: Germany
Posts: 141
|
Putting the following code before the call to StaticPopup_Hide should prevent the Popup from declining the invite:
Code:
for i=1, STATICPOPUP_NUMDIALOGS do
local dlg = _G["StaticPopup"..i]
if dlg.which == "PARTY_INVITE" then
dlg.inviteAccepted = 1
break
end
end
__________________
http://xkcd.com/378/ |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Oct 2008
Location: Massachusetts
Posts: 87
|
Thank you both for the suggestions.
I was thinking along slightly different lines, but I think either of these will work out better for me. Still curious if 3.1 just plain changed something, or if I've had broken code all along, but was getting away with it until high server lag during patch day caused the "brokenness" to show through. |
|
|
|
|
|
#5 |
|
Hero Member
Join Date: Nov 2005
Posts: 817
|
Borlox workaround is more elegant.
|
|
|
|
|
|
#6 |
|
Wiki Master
Join Date: Feb 2005
Posts: 5,085
|
I'm going to dig into the default UI later tonight and see EXACTLY what it does now, so that we can duplicate that.
|
|
|
|
|
|
#7 |
|
Legendary Member
Join Date: May 2006
Location: Arizona
Posts: 3,787
|
while it might be a bit hacky, why not just use the static popu's own scripts?
You loop though it to find the dialoug, why not just call the accept buttons :Click() script?
__________________
Author of GuildCraft, SickOfClickingDailies, CursorCooldown, Broken_LFD WoWAce Addon List WoWInterface Addon List "I was there in the beginning... and things were very different back then" --An Echo from a time before. |
|
|
|
|
|
#8 | |
|
Amazing Member
Join Date: Feb 2005
Posts: 1,076
|
Quote:
edit: it does. left a comment on the automaton wowace page. Last edited by Farmbuyer; 04-16-2009 at 01:44 AM. |
|
|
|
|
|
|
#9 |
|
Newbie
Join Date: Oct 2008
Posts: 3
|
I registered the PARTY_MEMBERS_CHANGED event and close the static popup in Automaton that way. Works dandy.
|
|
|
|
|
|
#10 |
|
Amazing Member
Join Date: Jul 2006
Posts: 1,461
|
Why not simply:
Code:
UIParent:UnregisterEvent"PARTY_INVITE_REQUEST" |
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
All times are GMT. The time now is 02:05 AM.
WowAce Forums





