To disable AvA messages outside of the AvA world put this code to the end of any lua file in your addons folder:
Lua Code:
EVENT_MANAGER:RegisterForEvent("AvA_World_Messages", EVENT_ADD_ON_LOADED, function(_, addon) if (addon):find("^ZO_") then return end --run this code after default UI is loaded local handlers = ZO_CenterScreenAnnounce_GetHandlers() local avaEvents = { EVENT_ARTIFACT_CONTROL_STATE, EVENT_KEEP_GATE_STATE_CHANGED, EVENT_CORONATE_EMPEROR_NOTIFICATION, EVENT_DEPOSE_EMPEROR_NOTIFICATION, } for _, eventId in ipairs(avaEvents) do ZO_PreHook(handlers, eventId, function() return not IsPlayerInAvAWorld() end) end EVENT_MANAGER:UnregisterForEvent("AvA_World_Messages", EVENT_ADD_ON_LOADED) end)
Or if you want to have messages in chat instead of center screen announcements:
Lua Code:
EVENT_MANAGER:RegisterForEvent("AvA_World_Messages", EVENT_ADD_ON_LOADED, function(_, addon) if (addon):find("^ZO_") then return end --run this code after default UI is loaded local handlers = ZO_CenterScreenAnnounce_GetHandlers() local avaEvents = { EVENT_ARTIFACT_CONTROL_STATE, EVENT_KEEP_GATE_STATE_CHANGED, EVENT_CORONATE_EMPEROR_NOTIFICATION, EVENT_DEPOSE_EMPEROR_NOTIFICATION, } local function HookAvAEventHandler(event) local original = handlers[event] handlers[event] = function(...) local inAvAWorld = IsPlayerInAvAWorld() if inAvAWorld == false then local _,_,msg = original(...) d(msg) else return original(...) end end end for _, eventId in ipairs(avaEvents) do HookAvAEventHandler(eventId) end EVENT_MANAGER:UnregisterForEvent("AvA_World_Messages", EVENT_ADD_ON_LOADED) end)
|