This event get triggered when the CET Overlay gets hidden.
Use this to keep track of the overlays state, and e.g. to only draw your own UI when CETs overlay is visible. Use it in conjunction with onOverlayOpen to get a proper on/off switch case.
Usage Example
Display a warning message when the CET Overlay is closed:
init.lua
-- onOverlayOpenregisterForEvent('onOverlayOpen', function()-- get playerlocal player = Game.GetPlayer()-- bail early if player doesn't existsifnot player thenreturnend-- display warning message player:SetWarningMessage('Overlay is closed')end)
Advanced Example
Render an ImGui window when the CET Overlay is opened:
This example use the onDraw event, which is triggered continuously. Make sure to check the documentation before any modification.
init.lua
-- set initial varlocal isOverlayVisible =false-- onOverlayOpenregisterForEvent('onOverlayOpen', function() isOverlayVisible =trueend)-- onOverlayCloseregisterForEvent('onOverlayClose', function() isOverlayVisible =falseend)-- onDraw-- this event is triggered continuouslyregisterForEvent('onDraw', function()-- bail early if overlay is not openifnot isOverlayVisible thenreturnend-- draw ImGui windowif ImGui.Begin('Window Title', ImGuiWindowFlags.AlwaysAutoResize) then ImGui.Text('Hello World!')end ImGui.End()end)