Scene Manager: On scene change

From ESOUI Wiki

Jump to: navigation, search

Careful: SCENE_MANAGER is initialised some time after EVENT_ADDON_LOADED, so you might run into nil exceptions there.

local function sceneChange(sceneName, oldState, newState)
    
    if (newState == SCENE_SHOWN) then
        -- do stuff
    elseif (newState == SCENE_HIDDEN) then
        -- do stuff
    end
    
end

local scene = SCENE_MANAGER:GetScene("inventory")
scene:RegisterCallback("StateChange", sceneChange)
Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox