WIP basic menu

This commit is contained in:
Dylan Smith
2026-01-14 11:30:04 -05:00
parent 6cdbe8cb11
commit 197a361ce8
8 changed files with 651 additions and 10 deletions

View File

@@ -10,11 +10,11 @@ void draw_menu(const graphical_menu_t *const menu)
const uint16_t entry_height = 40;
const uint16_t padding_x = 10;
const uint16_t padding_y = 0;
const pixel_t enabled_text_color = MAKE_PIXEL(31, 63, 31); // White text
const pixel_t disabled_text_color = MAKE_PIXEL(15, 31, 15); // Gray text for disabled
const pixel_t entry_bg_color = MAKE_PIXEL(15, 15, 15); // Slightly darker for entry background
const pixel_t highlighted_bg_color = MAKE_PIXEL(0, 31, 63); // Blue background for highlighted entry
const pixel_t highlighted_text_color = MAKE_PIXEL(31, 63, 31); // White text for highlighted entry
const pixel_t enabled_text_color = MAKE_PIXEL(0, 0, 0);
const pixel_t disabled_text_color = MAKE_PIXEL(128, 128, 128);
const pixel_t entry_bg_color = MAKE_PIXEL(255, 255, 255);
const pixel_t highlighted_bg_color = MAKE_PIXEL(0, 0, 0);
const pixel_t highlighted_text_color = MAKE_PIXEL(255, 255, 0);
// Ensure selected_entry_idx is within bounds
if (selected_entry_idx >= menu->num_entries)
@@ -45,7 +45,7 @@ void draw_menu(const graphical_menu_t *const menu)
// Calculate baseline from top position: baseline = top + (line_height - base_line)
const uint16_t text_baseline_y = y_pos + padding_y + (roboto_bold_font.line_height - roboto_bold_font.base_line);
draw_string((pixel_t *)framebuffer, &roboto_bold_font,
draw_string((pixel_t *)framebuffer, &runescape_font,
padding_x, text_baseline_y,
entry->title, text_color);
}