View Single Post
04-12-21, 01:47 PM   #12
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
In one of my map addons, I did a work around like this:

Lua Code:
  1. -- If you add quest tracker entries, these are tainted until the next /reload.
  2. -- QuestMapFrame_OpenToQuestDetails is called when clicking on a quest tracker entry
  3. -- or when clicking on the ShowMapButton of QuestLogPopupDetailFrame.
  4. -- During combat, QuestMapFrame_OpenToQuestDetails does not manage
  5. -- to bring up WorldMapFrame and hide EncounterJournal and QuestLogPopupDetailFrame.
  6. local OriginalQuestMapFrame_OpenToQuestDetails = QuestMapFrame_OpenToQuestDetails
  7. QuestMapFrame_OpenToQuestDetails = function(...)
  8.  
  9.   if InCombatLockdown() then
  10.     if not WorldMapFrame:IsShown() then
  11.       WorldMapFrame:Show()
  12.     else
  13.       WorldMapFrame:Raise()
  14.     end
  15.   end
  16.  
  17.   OriginalQuestMapFrame_OpenToQuestDetails(...)
  18. end
  19.  
  20.  
  21.  
  22.  
  23. -- QuestLogPopupDetailFrame_Show is called when you right click
  24. -- on a quest tracker entry and select "Open Quest Details".
  25. -- During combat, QuestLogPopupDetailFrame_Show does not manage to
  26. -- bring up QuestLogPopupDetailFrame, so we have to show it manually.
  27. local OriginalQuestLogPopupDetailFrame_Show = QuestLogPopupDetailFrame_Show
  28. QuestLogPopupDetailFrame_Show = function(...)
  29.  
  30.   if InCombatLockdown() then
  31.  
  32.     if not QuestLogPopupDetailFrame:IsShown() then
  33.       QuestLogPopupDetailFrame:Show()
  34.  
  35.     else
  36.       -- If QuestLogPopupDetailFrame is already shown for the clicked quest,
  37.       -- it should be closed, which QuestLogPopupDetailFrame_Show with
  38.       -- its HideUIPanel() also cannot do during combat.
  39.       local questLogIndex = ...
  40.       local questID = C_QuestLog.GetQuestIDForLogIndex(questLogIndex)
  41.       if QuestLogPopupDetailFrame.questID == questID then
  42.         QuestLogPopupDetailFrame:Hide()
  43.         return
  44.       else
  45.         QuestLogPopupDetailFrame:Raise()
  46.       end
  47.     end
  48.   end
  49.  
  50.   OriginalQuestLogPopupDetailFrame_Show(...)
  51. end
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote