remove ai generated comments
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-18 19:29:06 +01:00
parent 6303781534
commit 1cf09de1fb
15 changed files with 56 additions and 155 deletions

View File

@@ -1,5 +1,3 @@
-- Audio subsystem
function Audio.music_stop() music() end
function Audio.music_play_mainmenu() end
function Audio.music_play_wakingup() end

View File

@@ -1,14 +1,8 @@
-- Gamepad buttons
local INPUT_KEY_UP = 0
local INPUT_KEY_DOWN = 1
local INPUT_KEY_LEFT = 2
local INPUT_KEY_RIGHT = 3
local INPUT_KEY_A = 4 -- Z key
local INPUT_KEY_B = 5 -- X key
local INPUT_KEY_Y = 7 -- S key
-- Keyboard keys
-- TODO: Find correct key codes for SPACE and LCTRL
local INPUT_KEY_A = 4 local INPUT_KEY_B = 5 local INPUT_KEY_Y = 7
local INPUT_KEY_SPACE = 48
local INPUT_KEY_BACKSPACE = 51
local INPUT_KEY_ENTER = 50
@@ -19,6 +13,5 @@ function Input.left() return btnp(INPUT_KEY_LEFT) end
function Input.right() return btnp(INPUT_KEY_RIGHT) end
function Input.select() return btnp(INPUT_KEY_A) or keyp(INPUT_KEY_SPACE) end
function Input.menu_confirm() return btnp(INPUT_KEY_A) or keyp(INPUT_KEY_ENTER) end
function Input.player_interact() return btnp(INPUT_KEY_B) or keyp(INPUT_KEY_ENTER) end -- B button
function Input.menu_back() return btnp(INPUT_KEY_Y) or keyp(INPUT_KEY_BACKSPACE) end
function Input.player_interact() return btnp(INPUT_KEY_B) or keyp(INPUT_KEY_ENTER) end function Input.menu_back() return btnp(INPUT_KEY_Y) or keyp(INPUT_KEY_BACKSPACE) end
function Input.toggle_popup() return keyp(INPUT_KEY_ENTER) end

View File

@@ -88,23 +88,13 @@ function UI.draw_desition_selector(desitions, selected_desition_index)
local bar_height = 16
local bar_y = Config.screen.height - bar_height
rect(0, bar_y, Config.screen.width, bar_height, Config.colors.dark_grey)
if #desitions > 0 then
local selected_desition = desitions[selected_desition_index]
local desition_label = selected_desition.label
local text_width = #desition_label * 4 -- Assuming 4 pixels per char
local text_y = bar_y + 4
-- Center the decision label
local text_x = (Config.screen.width - text_width) / 2
-- Draw left arrow at the far left
Print.text("<", 2, text_y, Config.colors.green)
-- Draw selected desition label
Print.text(desition_label, text_x, text_y, Config.colors.item) -- Highlight color
-- Draw right arrow at the far right
Print.text(">", Config.screen.width - 6, text_y, Config.colors.green) -- 6 = 2 (right margin) + 4 (char width)
end
local text_width = #desition_label * 4 local text_y = bar_y + 4
local text_x = (Config.screen.width - text_width) / 2
Print.text("<", 2, text_y, Config.colors.green)
Print.text(desition_label, text_x, text_y, Config.colors.item) Print.text(">", Config.screen.width - 6, text_y, Config.colors.green) end
end
function UI.update_desition_selector(desitions, selected_desition_index)

View File

@@ -8,8 +8,7 @@ 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
Context.selected_desition_index = 1 else
PopupWindow.show({"Error: Screen '" .. screen_id .. "' not found or not indexed!"})
end
end