local CPanel = require "lib.simple_ui.level.cpanel" local layout = {} function layout:update(dt) local cid = Tree.level.selector:selected() if cid then self.characterPanel = CPanel(cid) self.characterPanel:show() elseif Tree.level.selector:deselected() then self.characterPanel:hide() end if self.characterPanel then self.characterPanel:update(dt) end end function layout:draw() if self.characterPanel then self.characterPanel:draw() end end return layout