Hide UI when menus open

Sasky [09-09-14 - 08:09]
Hide UI when menus open
Filename
CyrHUD.lua
CyrHUD.txt
diff --git a/CyrHUD.lua b/CyrHUD.lua
index 5a4abbf..9ed5979 100644
--- a/CyrHUD.lua
+++ b/CyrHUD.lua
@@ -82,6 +82,9 @@ function CyrHUD.saveWindowPosition( window )
     CyrHUD.cfg.yoff = y
 end

+function CyrHUD.actionLayerChange(_, _, activeLayerIndex)
+    CyrHUD_UI:SetHidden(activeLayerIndex > 2)
+end

 ----------------------------------------------
 -- Notification UI pool
@@ -258,6 +261,9 @@ function CyrHUD.init()
     end)
     EVENT_MANAGER:RegisterForEvent("CyrHUDAttackChange", EVENT_KEEP_UNDER_ATTACK_CHANGED, CyrHUD.eventAttackChange)
     CyrHUD.visible = true
+
+    EVENT_MANAGER:RegisterForEvent('CyrHUD', EVENT_ACTION_LAYER_POPPED, CyrHUD.actionLayerChange)
+    EVENT_MANAGER:RegisterForEvent('CyrHUD', EVENT_ACTION_LAYER_PUSHED, CyrHUD.actionLayerChange)
 end

 function CyrHUD.deinit()
@@ -265,6 +271,8 @@ function CyrHUD.deinit()
     EVENT_MANAGER:UnregisterForUpdate("CyrHUDKeepCheck")
     EVENT_MANAGER:UnregisterForUpdate("CyrHUDUIUpdate")
     EVENT_MANAGER:UnregisterForUpdate("CyrHUDUpdateAPCount")
+    EVENT_MANAGER:UnregisterForEvent("CyrHUD", EVENT_ACTION_LAYER_POPPED)
+    EVENT_MANAGER:UnregisterForEvent("CyrHUD", EVENT_ACTION_LAYER_PUSHED)
     CyrHUD_UI:SetHidden(true)
     CyrHUD.visible = false
 end
diff --git a/CyrHUD.txt b/CyrHUD.txt
index d872e2c..ffcd805 100644
--- a/CyrHUD.txt
+++ b/CyrHUD.txt
@@ -1,6 +1,6 @@
 ## APIVersion: 100008
 ## Title: CyrHUD
-## Version: 1.0.2
+## Version: 1.0.3
 ## Author: Sasky
 ## SavedVariables: CyrHUD_SavedVars