Files
impostor/inc/system/system.util.lua
Zsolt Tasnadi 9eef8fd6e0
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline failed
ci/woodpecker/pull_request_closed/woodpecker Pipeline failed
Util.go_to_screen_by_id
2026-02-17 21:58:22 +01:00

15 lines
458 B
Lua

Util = {}
function Util.safeindex(array, index)
return ((index - 1 + #array) % #array) + 1
end
function Util.go_to_screen_by_id(screen_id)
local screen_index = Context.screen_indices_by_id[screen_id]
if screen_index then
Context.current_screen = screen_index
Context.selected_desition_index = 1 -- Reset selected decision on new screen
else
PopupWindow.show({"Error: Screen '" .. screen_id .. "' not found or not indexed!"})
end
end