View Single Post
09-29-20, 07:01 AM   #15
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
I think this is the best way to go:

Code:
testButton:SetScript("OnClick", function()
    
    if InCombatLockdown() then
    
      -- If you are using an addon that has removed WorldMapFrame from UIPanelWindows,
      -- we are able to hide WorldMapFrame for you here.
      -- If not, hiding the map will result in ToggleGameMenu() not working any more,
      -- because WorldMapFrame will still be listed in UIParent's FramePositionDelegate.
      if not UIPanelWindows["WorldMapFrame"] then
        WorldMapFrame:Hide()
      end
      
    else
      HideUIPanel(WorldMapFrame)
    end
  end)
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote