Thread Tools Display Modes
07-14-11, 08:57 AM   #1
TwistedJester
A Kobold Labourer
Join Date: Jul 2011
Posts: 1
Battleground & Instance Queue

Hello,
I'm looking for a battleground and instance 'on ready' event code.
I want to catch the event when the 'Accept or Dismiss' dialog opens, but so far I had no luck in finding the right one.

Thanks in advance.
  Reply With Quote
07-14-11, 09:13 AM   #2
AcidWeb
A Theradrim Guardian
 
AcidWeb's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 69
There is no event triggered on receiving battleground popup.

If you want to check if that popup is "Battleground ready" you need to hook the OnShow of static popup window.
Code:
function BattlegroundStartCheck()
	if StaticPopup1["which"] == "CONFIRM_BATTLEFIELD_ENTRY" then
		--That is "Battleground ready" popup!
	end
end

StaticPopup1:HookScript("OnShow", BattlegroundStartCheck);

Last edited by AcidWeb : 07-14-11 at 09:18 AM.
  Reply With Quote
07-14-11, 09:17 AM   #3
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
and for the dungeon finder event it's LFG_PROPOSAL_SHOW

Last edited by Ketho : 07-14-11 at 10:06 AM.
  Reply With Quote
07-14-11, 10:30 AM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,335
Originally Posted by AcidWeb View Post
There is no event triggered on receiving battleground popup.
It should be BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE that is currently being handled by PVPFrame.lua. I can't confirm it easily, I know it's one of the BATTLEFIELD_MGR events from looking at Blizzard's code. They have the entire event group running a single update function that eventually shows the popup when the time comes.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 07-14-11 at 10:33 AM.
  Reply With Quote
07-14-11, 11:03 AM   #5
AcidWeb
A Theradrim Guardian
 
AcidWeb's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 69
Originally Posted by SDPhantom View Post
It should be BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE that is currently being handled by PVPFrame.lua. I can't confirm it easily, I know it's one of the BATTLEFIELD_MGR events from looking at Blizzard's code. They have the entire event group running a single update function that eventually shows the popup when the time comes.
BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE trigger only on popup to join PVP zone (Tol Barad etc.) not battleground.
  Reply With Quote
07-14-11, 11:42 AM   #6
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
About the battleground stuff, I know there is BATTLEFIELDS_SHOW, but I haven't seen it actually fire at all ..
  Reply With Quote
07-14-11, 11:48 AM   #7
AcidWeb
A Theradrim Guardian
 
AcidWeb's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 69
Originally Posted by Ketho View Post
About the battleground stuff, I know there is BATTLEFIELDS_SHOW, but I haven't seen it actually fire at all ..
That never trigger :-P
BATTLEFIELDS_CLOSE trigger on closing PVP window.

One method more:
After each UPDATE_BATTLEFIELD_STATUS you need run check GetBattlefieldStatus(1) and GetBattlefieldStatus(2). If any return "confirm" player was been invited to enter this battleground but has not done so yet. So he got popup now or he minimized it.

Last edited by AcidWeb : 07-14-11 at 11:54 AM.
  Reply With Quote
07-15-11, 05:51 AM   #8
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,335
Originally Posted by AcidWeb View Post
BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE trigger only on popup to join PVP zone (Tol Barad etc.) not battleground.
From your code, it's checking for a StaticPopup using the CONFIRM_BATTLEFIELD_ENTRY dataset. Tracing it back through Blizzard code to find what creates the popup points to PVP_UpdateStatus() defined in PVPFrame.lia line 1803. The line that specifically shows the StaticPopup is line 1892.

From PVPFrame_OnEvent() defined at line 178, these events trugger a call to PVP_UpdateStatus():
  • PLAYER_ENTERING_WORLD
  • UPDATE_BATTLEFIELD_STATUS
  • ZONE_CHANGED_NEW_AREA
  • ZONE_CHANGED
  • BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE
  • BATTLEFIELD_MGR_EJECT_PENDING
  • BATTLEFIELD_MGR_EJECTED
  • BATTLEFIELD_MGR_QUEUE_INVITE
  • BATTLEFIELD_MGR_ENTRY_INVITE
  • BATTLEFIELD_MGR_ENTERED

It has to be triggered from one of these events and I know it isn't PLAYER_ENTERING_WORLD or any of the ZONE_CHANGED events.



Note: PVP_UpdateStatus() is called in Minimap.lua line 111 in an OnUpdate handler, but is passing a value of 1 to the tooltipOnly parameter, which skips handling the StaticPopup.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Battleground & Instance Queue


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