ldoc return fixes

This commit is contained in:
2026-02-26 17:41:06 +01:00
parent e56662f6ad
commit 337f1fc132
21 changed files with 279 additions and 262 deletions

View File

@@ -9,11 +9,12 @@ AudioTestWindow = {
--- Generates menu items for audio test.
--- @within AudioTestWindow
--- @param list_func table List of audio functions.
--- @param index_func number Current index of selected function.
--- @return result table Generated menu items, an array of menu item tables.
--- @return result.label string Display text for the menu item.
--- @return result.decision function Called when the menu item is selected.
--- @param list_func table List of audio functions.<br/>
--- @param index_func number Current index of selected function.<br/>
--- @return result table Generated menu items, an array of menu item tables or nil. </br>
--- Fields: </br>
--- * label (string) Display text for the menu item.<br/>
--- * decision (function) Called when the menu item is selected.<br/>
function AudioTestWindow.generate_menuitems(list_func, index_func)
return {
{
@@ -44,7 +45,7 @@ end
--- Generates list of audio functions.
--- @within AudioTestWindow
--- @return table A sorted list of audio function names.
--- @return result table A sorted list of audio function names.
function AudioTestWindow.generate_listfunc()
local result = {}

View File

@@ -72,7 +72,7 @@ end
--- Sets the active window.
--- @within GameWindow
--- @param new_state string The ID of the new active window.
--- @param new_state string The ID of the new active window.</br>
function GameWindow.set_state(new_state)
Window.set_current(new_state)
end

View File

@@ -3,8 +3,8 @@ local _windows = {}
--- Registers a window table.
--- @within Window
--- @param id string The ID of the window (e.g., "splash", "menu").
--- @param window_table table The actual window module table (e.g., SplashWindow).
--- @param id string The ID of the window (e.g., "splash", "menu").</br>
--- @param window_table table The actual window module table (e.g., SplashWindow).</br>
function Window.register(id, window_table)
_windows[id] = window_table
end
@@ -12,21 +12,23 @@ end
--- Retrieves a registered window table by its ID.
--- @within Window
--- @param id string The ID of the window.
--- @return result table The window module table.
--- @return result.update function Called each frame to update window logic.
--- @return result.draw function Called each frame to draw the window.
--- @return result table The window module table or nil. </br>
--- Fields: </br>
--- * update (function) Called each frame to update window logic.<br/>
--- * draw (function) Called each frame to draw the window.<br/>
function Window.get(id)
return _windows[id]
end
--- Sets the currently active window.
--- @within Window
--- @param id string The ID of the window to activate.
--- @param id string The ID of the window to activate.</br>
function Window.set_current(id)
Context.current_window = id
end
--- Gets the ID of the currently active window.
--- This function is used by the main game loop to update and draw the active window.
--- @within Window
--- @return string The ID of the active window.
function Window.get_current_id()

View File

@@ -2,16 +2,16 @@
--- Initializes DDR minigame state.
--- @within MinigameDDRWindow
--- @param params table Optional parameters for configuration.
--- @param params table Optional parameters for configuration.<br/>
function MinigameDDRWindow.init(params)
Context.minigame_ddr = Minigame.configure_ddr(params)
end
--- Starts the DDR minigame.
--- @within MinigameDDRWindow
--- @param return_window string The window ID to return to after the minigame.
--- @param[opt] song_key string The key of the song to play.
--- @param[opt] params table Optional parameters for minigame configuration.
--- @param return_window string The window ID to return to after the minigame.</br>
--- @param[opt] song_key string The key of the song to play.</br>
--- @param[opt] params table Optional parameters for minigame configuration.</br>
function MinigameDDRWindow.start(return_window, song_key, params)
MinigameDDRWindow.init(params)
Context.minigame_ddr.return_window = return_window or "game"
@@ -265,4 +265,4 @@ function MinigameDDRWindow.draw()
else
Print.text_center("RANDOM MODE", Config.screen.width / 2, debug_y, Config.colors.blue)
end
end
end

View File

@@ -1,16 +1,14 @@
--- @section MinigameButtonMashWindow
--- Initializes button mash minigame state.
--- @within MinigameButtonMashWindow
--- @param params table Optional parameters for configuration.
--- @param params table Optional parameters for configuration.<br/>
function MinigameButtonMashWindow.init(params)
Context.minigame_button_mash = Minigame.configure_button_mash(params)
end
--- Starts the button mash minigame.
--- @within MinigameButtonMashWindow
--- @param return_window string The window ID to return to after the minigame.
--- @param[opt] params table Optional parameters for minigame configuration.
--- @param return_window string The window ID to return to after the minigame.<br/>
--- @param[opt] params table Optional parameters for minigame configuration.<br/>
function MinigameButtonMashWindow.start(return_window, params)
MinigameButtonMashWindow.init(params)
local mg = Context.minigame_button_mash

View File

@@ -2,15 +2,15 @@
--- Initializes rhythm minigame state.
--- @within MinigameRhythmWindow
--- @param params table Optional parameters for configuration.
--- @param params table Optional parameters for configuration.<br/>
function MinigameRhythmWindow.init(params)
Context.minigame_rhythm = Minigame.configure_rhythm(params)
end
--- Starts the rhythm minigame.
--- @within MinigameRhythmWindow
--- @param return_window string The window ID to return to after the minigame.
--- @param[opt] params table Optional parameters for minigame configuration.
--- @param return_window string The window ID to return to after the minigame.<br/>
--- @param[opt] params table Optional parameters for minigame configuration.<br/>
function MinigameRhythmWindow.start(return_window, params)
MinigameRhythmWindow.init(params)
local mg = Context.minigame_rhythm

View File

@@ -9,7 +9,7 @@ local LINE_HEIGHT = 8
--- Displays a popup window.
--- @within PopupWindow
--- @param content_strings table A table of strings to display in the popup.
--- @param content_strings table A table of strings to display in the popup.</br>
function PopupWindow.show(content_strings)
Context.popup.show = true
Context.popup.content = content_strings or {}
@@ -49,4 +49,4 @@ function PopupWindow.draw()
Print.text("[A] Close", TEXT_MARGIN_X, POPUP_Y + POPUP_HEIGHT - LINE_HEIGHT - 2, Config.colors.light_blue)
end
end
end

View File

@@ -1,5 +1,3 @@
--- @section SplashWindow
--- Draws the splash window.
--- @within SplashWindow
function SplashWindow.draw()