Quantcast Does anybody know the event for the completion of a Mythic+ dungeon? - WoWInterface
Thread Tools Display Modes
11-28-16, 10:27 PM   #1
nukme
A Murloc Raider
Join Date: Jul 2016
Posts: 5
Does anybody know the event for the completion of a Mythic+ dungeon?

I want to monitor the completion frame with success/fail info and teammates head-icons for my own code. But I don't know the event fired for this frame and I can't find any related topics around.

Where should I begin to look?
  Reply With Quote
11-29-16, 02:24 AM   #2
Tim
A Frostmaul Preserver
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 278
You could do the same thing I just did to help point you in the right direction. Go into Blizzard's source code and look at the Scenario Objective Tracker file.

https://github.com/tomrus88/Blizzard...iveTracker.lua

Code:
local scenarioName, currentStage, numStages, flags, _, _, completed, xp, money = C_Scenario.GetInfo()
local stageName, stageDescription, numCriteria, _, _, _, numSpells, spellInfo, weightedProgress = C_Scenario.GetStepInfo()

SCENARIO_COMPLETED
SCENARIO_CRITERIA_UPDATE
SCENARIO_UPDATE
I wasn't able to find documentation on those events to be able to give you any parameters.


As for "teammates head-icons", I have no clue what you're talking about so I can't help there.
  Reply With Quote
11-29-16, 08:51 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If you know when the event occurs, just type "/etrace" soon before it happens to bring up the Blizzard event monitor tool. I'd suggest removing some of the super-spammy events like COMBAT_LOG_EVENT_UNFILTERED, UNIT_AURA, etc (mouse over it and click the "X") but otherwise it's a decent tool for identifying event names and exploring their arguments. Once you have the exact event name you can easily look through Blizzard's code to see how they handle it.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
11-29-16, 07:42 PM   #4
nukme
A Murloc Raider
Join Date: Jul 2016
Posts: 5
Originally Posted by Tim View Post
You could do the same thing I just did to help point you in the right direction. Go into Blizzard's source code and look at the Scenario Objective Tracker file.

https://github.com/tomrus88/Blizzard...iveTracker.lua

Code:
local scenarioName, currentStage, numStages, flags, _, _, completed, xp, money = C_Scenario.GetInfo()
local stageName, stageDescription, numCriteria, _, _, _, numSpells, spellInfo, weightedProgress = C_Scenario.GetStepInfo()

SCENARIO_COMPLETED
SCENARIO_CRITERIA_UPDATE
SCENARIO_UPDATE
I wasn't able to find documentation on those events to be able to give you any parameters.


As for "teammates head-icons", I have no clue what you're talking about so I can't help there.
Originally Posted by Phanx View Post
If you know when the event occurs, just type "/etrace" soon before it happens to bring up the Blizzard event monitor tool. I'd suggest removing some of the super-spammy events like COMBAT_LOG_EVENT_UNFILTERED, UNIT_AURA, etc (mouse over it and click the "X") but otherwise it's a decent tool for identifying event names and exploring their arguments. Once you have the exact event name you can easily look through Blizzard's code to see how they handle it.
Thanks for helping out!

I know the event fired when a mythic+ ends, which is CHALLENGE_MODE_COMPLETED. This event fires as the last boss dies, yet not synchronized as the top completion frame shows. For a long time I have no clue about the completion frame, hence the ask.

However I did find something interesting from random keyword googling yesterday.
The old global function GetChallengeModeCompletionInfo has been removed, but there's a replica for it, C_ChallengeMode.GetCompletionInfo. And this function is used in Blizzard code Interface/Addons/Blizzard_ChallengesUI, in which the behaviour of completion frame is defined as ChallengeModeCompleteBannerMixin. And it feeds data into Interface/FrameXML/TopBannerManager to queue up for show. If I get the ideas right.

Now what I want to do is to take a screenshot at the completion banner of a mythic+. The problem is that the completion frame shows a little later than the boss-kill banner, due to the queue, meaning it's just later than the event CHALLENGE_MODE_COMPLETED. I have tried to hook functions as
Code:
hooksecurefunc(ChallengeModeCompleteBannerMixin,"PlayBanner",Screenshot)
but seems to be null. I get no error, and no screenshot. How can I proceed?

Last edited by nukme : 11-29-16 at 07:47 PM.
  Reply With Quote
11-30-16, 01:02 PM   #5
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 453
ChallengeModeCompleteBannerMixin is only available after Blizzard_ChallengesUI has been loaded. So either load the addon yourself prior to hooking, or listen to ADDON_LOADED and do the hook there.
  Reply With Quote
12-07-16, 11:33 AM   #6
nukme
A Murloc Raider
Join Date: Jul 2016
Posts: 5
Originally Posted by Rainrider View Post
ChallengeModeCompleteBannerMixin is only available after Blizzard_ChallengesUI has been loaded. So either load the addon yourself prior to hooking, or listen to ADDON_LOADED and do the hook there.
I have finished my code. Turns out the frame name should be ChallengeModeCompleteBanner, as defined in the .xml file.

So the right hook is as below, when Blizzard_ChallengesUI is loaded.
Code:
hooksecurefunc(ChallengeModeCompleteBanner,"PlayBanner",Screenshot)
And one can change the hook a bit to allow for some delay to wait for the whole complete banner.

However I don't fully understand the structure of blizz code, as the relationship between ChallengeModeCompleteBanner and ChallengeModeCompleteBannerMixin confuses me, and I have to do some trial and error to comfirm the right hook combination.
  Reply With Quote
12-16-16, 08:44 AM   #7
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 792
In this case the ChallengeModeCompleteBannerMixin is the template while the ChallengeModeCompleteBanner is the actual frame they use in-game.

The Mixin is the class, while the other object is the actual instance. Their mixin code basically just loops through all the keys on the Mixin object and assigns them to the new table/frame and references the methods from the original.

This is a micro example of a mixin:
Code:
local GoldMixin = { copper = 0, change = function(self, n) self.copper = self.copper + n end } -- some generic gold mixin for whatever purpose

local playerGold = {} -- our actual instance that represents the player gold
for k,v in pairs(GoldMixin)do playerGold[k]=v end -- this is what the CreateMixin() API does that Blizz often uses, they also have a XML handler for the same thing when doing this from XML files
playerGold:change(1000) -- working with the method
__________________
Profile: Curse | Wowhead
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Does anybody know the event for the completion of a Mythic+ dungeon?

Thread Tools
Display Modes

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