situation handling
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 22:31:49 +01:00
parent 3b9b67e2fa
commit ed2354b0fa
8 changed files with 63 additions and 9 deletions

View File

@@ -1,17 +1,12 @@
local _screens = {}
function Screen.get_screens_array()
local screens_array = {}
for _, screen_data in pairs(_screens) do
table.insert(screens_array, screen_data)
end
return screens_array
end
function Screen.register(screen_data)
if _screens[screen_data.id] then
trace("Warning: Overwriting screen with id: " .. screen_data.id)
end
if not screen_data.situations then
screen_data.situations = {}
end
_screens[screen_data.id] = screen_data
end

View File

@@ -6,5 +6,9 @@ Screen.register({
"play_rhythm",
"play_ddr",
"go_to_walking_to_home",
}
"have_a_coffee",
},
situations = {
"drink_coffee",
},
})