View Single Post
01-30-13, 01:18 PM   #6
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Originally Posted by Farmbuyer View Post
I remember that the only thing Blizzard registers to listen for that event is the minimap, to change the little icon cluster. If you haven't already, extract their code and take a look at FrameXML/Minimap.* to see what they're doing.
Doh, I totally forgot about the little icon. PLAYER_DIFFICULTY_CHANGED seems to indeed be the right event according to Minimap.lua (do a search on MiniMapInstanceDifficulty_OnEvent()): https://github.com/tekkub/wow-ui-sou...ML/Minimap.lua

Using GetInstanceInfo() seems to provide the correct info about what difficulty is used.

lua Code:
  1. local isHeroic
  2. function eventFrame:PLAYER_DIFFICULTY_CHANGED ()
  3.     local _, type, difficulty, _, _, dynamicDifficulty, isDynamicInstance = GetInstanceInfo()
  4.     -- type == 'party' part is optional.
  5.     isHeroic = (isDynamicInstance and dynamicDifficulty == 1 or difficulty = 2) --[[ and type == 'party' ]]
  6.  
  7.     print("isHeroic: ", isHeroic and 'yes' or 'no')
  8. end
  9.  
  10. eventFrame.PLAYER_ENTERING_WORLD = eventFrame.PLAYER_DIFFICULTY_CHANGED

Last edited by ravagernl : 01-30-13 at 01:22 PM.
  Reply With Quote