Originally Posted by Farmbuyer
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:
local isHeroic
function eventFrame:PLAYER_DIFFICULTY_CHANGED ()
local _, type, difficulty, _, _, dynamicDifficulty, isDynamicInstance = GetInstanceInfo()
-- type == 'party' part is optional.
isHeroic = (isDynamicInstance and dynamicDifficulty == 1 or difficulty = 2) --[[ and type == 'party' ]]
print("isHeroic: ", isHeroic and 'yes' or 'no')
end
eventFrame.PLAYER_ENTERING_WORLD = eventFrame.PLAYER_DIFFICULTY_CHANGED