feat: added new functionality with focus, added base background to screens, created Focus.close(), Focus.start(), Focus.driven() methods for different use-cases, added focus to screens
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:
Zoltan Timar
2026-02-26 14:53:22 +01:00
parent 226d75d905
commit 954a39aef1
12 changed files with 232 additions and 9 deletions

View File

@@ -6,17 +6,23 @@ local _selected_decision_index = 1
--- @within GameWindow
function GameWindow.draw()
local screen = Screen.get_by_id(Context.game.current_screen)
if screen.background then Map.draw(screen.background) end
if screen.background then
Map.draw(screen.background)
elseif screen.background_color then
rect(0, 0, Config.screen.width, Config.screen.height, screen.background_color)
end
UI.draw_top_bar(screen.name)
if #_available_decisions > 0 then
UI.draw_decision_selector(_available_decisions, _selected_decision_index)
end
Sprite.draw()
Focus.draw()
end
--- Updates the game window logic.
--- @within GameWindow
function GameWindow.update()
Focus.update()
if Input.menu_back() then
Window.set_current("menu")
MenuWindow.refresh_menu_items()
@@ -60,6 +66,8 @@ function GameWindow.update()
selected_decision.handle()
end
end
end
--- Sets the active window.