MapManager
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-02-18 19:11:13 +01:00
parent 60a6c73a32
commit e2bd1711c0
10 changed files with 358 additions and 54 deletions

View File

@@ -1,12 +1,13 @@
function GameWindow.draw()
local currentScreenData = Context.screens[Context.current_screen]
UI.draw_top_bar(currentScreenData.name)
if currentScreenData and currentScreenData.decisions and #currentScreenData.decisions > 0 then
local screen = Context.screens[Context.current_screen]
MapManager.draw(screen.background_map_id)
UI.draw_top_bar(screen.name)
if screen and screen.decisions and #screen.decisions > 0 then
local available_desitions = {}
for _, desition_id in ipairs(currentScreenData.decisions) do
local desition_obj = DesitionManager.get(desition_id)
if desition_obj and desition_obj.condition() then -- Check condition directly
table.insert(available_desitions, desition_obj)
for _, desition_id in ipairs(screen.decisions) do
local desition = DesitionManager.get(desition_id)
if desition and desition.condition() then
table.insert(available_desitions, desition)
end
end
-- If no available desitions, display nothing or a message
@@ -38,13 +39,13 @@ function GameWindow.update()
Context.selected_desition_index = 1 -- Reset selected decision on screen change
end
local currentScreenData = Context.screens[Context.current_screen]
if currentScreenData and currentScreenData.decisions and #currentScreenData.decisions > 0 then
local screen = Context.screens[Context.current_screen]
if screen and screen.decisions and #screen.decisions > 0 then
local available_desitions = {}
for _, desition_id in ipairs(currentScreenData.decisions) do
local desition_obj = DesitionManager.get(desition_id)
if desition_obj and desition_obj.condition() then -- Check condition directly
table.insert(available_desitions, desition_obj)
for _, desition_id in ipairs(screen.decisions) do
local desition = DesitionManager.get(desition_id)
if desition and desition.condition() then -- Check condition directly
table.insert(available_desitions, desition)
end
end