Thread Tools Display Modes
10-01-16, 02:33 PM   #1
judicator-wow
A Defias Bandit
Join Date: Jan 2015
Posts: 2
Open PvP Pane event/hook - AV Blacklist Bug

Anyone know if there is an event/hook triggered when you open the PvP pane?

I've been trying to write my first simple addon that will add Alterac Valley back onto the blacklist (using SetBlacklistMap()) since it gets reset every time you log. I have it working so it's added when you log back in no problem. As confirmed using a print statement with ... GetBlacklistMapName(1), etc.

However, I notice that it's actually when you press 'h' (or whatever) and first open the PvP pane that it actually gets reset and AV is removed again. And it only gets reset the very first time you open the pane.

So I wanted something like when PvP frame opens, then I trigger adding AV back into exclusions automatically, since I forget to do it manually 90% of the time and end up in AV which I loathe in it's current form.

... maybe this is why I haven't found an addon to fix it .

Thanks!!
  Reply With Quote
10-02-16, 10:14 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Generally speaking, the UI responds to events; it doesn't trigger them. For example, the bank UI opens in response to the "bank opened" event -- opening the bank UI isn't what triggers the event.

For the PVP queue frame, no events are involved either way, so you'd just need to hook the OnShow script handler for the frame:

Lua Code:
  1. frame:HookScript("OnShow", function(self)
  2.     -- do stuff here
  3. end)

However, depending on how the default UI code is operating in this area, OnShow may be too early; you should look through the default UI code and find the Blizzard function that's actually resetting those filters, and hook that instead:

Lua Code:
  1. hooksecurefunc("NameOfTheFunction", function(list, of, args, the, function, receives)
  2.     -- do stuff here
  3. end)

The quickest way to find the right part of the UI code is probably to search for the name of the PVP queueing frame (use /fstack in-game to find it) and follow the links to the Lua file (the frame itself will be created in an XML file) where all its functions are defined.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
10-04-16, 08:38 PM   #3
judicator-wow
A Defias Bandit
Join Date: Jan 2015
Posts: 2
Awesome, that will help me look into this further. Thanks for pointing me in the right direction, greatly appreciate the in-depth reply!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Open PvP Pane event/hook - AV Blacklist Bug


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