Add pagination to game launcher - 4 games per page

- GameLauncher now displays only 4 games per page to keep menu in bounds
- Added page navigation with page indicator (Page X/Y)
- KEY0 navigates between pages and within page
- KEY1 selects the highlighted game
- Touch selection works on current page only
- Helper methods: get_total_pages(), get_page_start_index(), get_page_end_index()
- Updated both lib/ and emulator/ versions for consistency
This commit is contained in:
Adolfo Reyna
2026-02-12 20:39:38 -05:00
parent 50793ac535
commit 38ffdac749
155 changed files with 14785 additions and 39340 deletions

View File

@@ -41,3 +41,22 @@ target_compile_definitions(basic1_emulator PRIVATE LUA_32BITS=1)
target_include_directories(basic1_emulator PRIVATE . .. ../display ../fonts ../games ../lib ../lib/lua)
target_link_libraries(basic1_emulator SFML::Graphics SFML::Window SFML::System)
# Copy Lua example files to build directory
file(GLOB LUA_EXAMPLE_FILES "../games/lua_examples/*.lua")
foreach(LUA_FILE ${LUA_EXAMPLE_FILES})
get_filename_component(FILENAME ${LUA_FILE} NAME)
add_custom_command(TARGET basic1_emulator POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${LUA_FILE}
${CMAKE_CURRENT_BINARY_DIR}/games/lua_examples/${FILENAME}
COMMENT "Copying Lua example: ${FILENAME}"
)
endforeach()
# Also ensure directory exists
add_custom_command(TARGET basic1_emulator POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_CURRENT_BINARY_DIR}/games/lua_examples
COMMENT "Creating games/lua_examples directory"
)