diff Core.lua @ 179:eec8032ba9df v84

addon should close automatically when entering combat now
author yellowfive
date Thu, 13 Feb 2020 13:21:44 -0800
parents 3be9cc6f7d20
children a7f2ba17c39a
line wrap: on
line diff
--- a/Core.lua	Sun Jan 26 12:37:26 2020 -0800
+++ b/Core.lua	Thu Feb 13 13:21:44 2020 -0800
@@ -240,6 +240,12 @@
 	-- disabling is not supported
 end
 
+local function onEnterCombat()
+	Amr:Hide()
+	Amr:HideShopWindow()
+	Amr:HideJunkWindow()
+end
+
 
 ----------------------------------------------------------------------------------------
 -- Slash Commands
@@ -682,6 +688,7 @@
 
 Amr:AddEventHandler("PLAYER_ENTERING_WORLD", onPlayerEnteringWorld)
 
+Amr:AddEventHandler("PLAYER_REGEN_DISABLED", onEnterCombat)
 
 ----------------------------------------------------------------------------------------
 -- Debugging