docs
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful

This commit is contained in:
2026-02-21 23:53:36 +01:00
parent 3b137fd48e
commit 76964f872d
28 changed files with 301 additions and 28 deletions

View File

@@ -1,5 +1,7 @@
local _screens = {}
--- Registers a screen definition.
-- @param screen_data table The screen data table.
function Screen.register(screen_data)
if _screens[screen_data.id] then
trace("Warning: Overwriting screen with id: " .. screen_data.id)
@@ -7,9 +9,18 @@ function Screen.register(screen_data)
if not screen_data.situations then
screen_data.situations = {}
end
if not screen_data.init then
screen_data.init = function() end
end
if not screen_data.update then
screen_data.update = function() end
end
_screens[screen_data.id] = screen_data
end
--- Gets a screen by ID.
-- @param screen_id string The ID of the screen.
-- @return table The screen table or nil.
function Screen.get_by_id(screen_id)
return _screens[screen_id]
end