As Errc said you can watch EVENT_ACTION_LAYERS_POPPED and _PUSHED for just watching if something is opened.
If you need to access further informations for example when the Inventory is opened:
Lua Code:
MyAddon = {}
MyAddon.InventoryOpened = false
function MyAddon.ZOPlayerInventoryOnShow(self, hidden)
if ( not hidden ) then
MyAddon.InventoryOpened = true
end
end
function MyAddon.ZOPlayerInventoryOnHide(self, hidden)
if ( hidden ) then
MyAddon.InventoryOpened = false
end
end
function MyAddon.OnAddOnLoaded(eventcode, addOnName)
if (addOnName ~= "MyAddon") then return end
-- ZO_PlayerInventory < ToplevelControl which is shown when pressing "i"
ZO_PlayerInventory:SetHandler("OnShow", MyAddon.ZOPlayerInventoryOnShow)
ZO_PlayerInventory:SetHandler("OnShow", MyAddon.ZOPlayerInventoryOnHide)
end
EVENT_MANAGER:RegisterForEvent("MyAddon_EVENT_ADD_ON_LOADED", EVENT_ADD_ON_LOADED, MyAddon.OnAddOnLoaded)