N64FlashcartMenu/src/menu/components.h

70 lines
2.1 KiB
C
Raw Normal View History

/**
* @file components.h
* @brief Menu Components
* @ingroup menu
*/
#ifndef COMPONENTS_H__
#define COMPONENTS_H__
#include <libdragon.h>
#include "menu_state.h"
/**
* @addtogroup
* @{ menu_components
*/
void component_box_draw (int x0, int y0, int x1, int y1, color_t color);
void component_border_draw (int x0, int y0, int x1, int y1);
void component_layout_draw (void);
void component_progressbar_draw (int x0, int y0, int x1, int y1, float progress);
void component_seekbar_draw (float progress);
void component_loader_draw (float position);
void component_scrollbar_draw (int x, int y, int width, int height, int position, int items, int visible_items);
void component_file_list_scrollbar_draw (int position, int items, int visible_items);
void component_dialog_draw (int width, int height);
void component_messagebox_draw (char *fmt, ...);
void component_main_text_draw (rdpq_align_t align, rdpq_valign_t valign, char *fmt, ...);
void component_actions_bar_text_draw (rdpq_align_t align, rdpq_valign_t valign, char *fmt, ...);
void component_background_init (char *cache_location);
void component_background_free (void);
void component_background_replace_image (surface_t *image);
void component_background_draw (void);
void component_file_list_draw (entry_t *list, int entries, int selected);
typedef struct {
int count;
int selected;
2023-08-20 18:07:58 +02:00
bool hide_pending;
struct {
const char *text;
void (*action) (menu_t *menu);
} list[];
} component_context_menu_t;
#define COMPONENT_CONTEXT_MENU_LIST_END { .text = NULL }
void component_context_menu_init (component_context_menu_t *cm);
void component_context_menu_show (component_context_menu_t *cm);
bool component_context_menu_process (menu_t *menu, component_context_menu_t *cm);
void component_context_menu_draw (component_context_menu_t *cm);
typedef struct {
bool loading;
surface_t *image;
} component_boxart_t;
Add ability for 3 letter ID for boxart (#47) <!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> Allows boxart to be 3 letters by checking the "media type" if required. It continues to be compatible with 2 letters. Also update sodium64 rom address (changed in https://github.com/Hydr8gon/sodium64/commit/d006af487073cb16be1cd8e230ff30bf722500b6). ## Motivation and Context <!--- What does this sample do? What problem does it solve? --> <!--- If it fixes/closes/resolves an open issue, please link to the issue here --> Fixes an issue for at least `DZ` which shares the same ID between Dezaemon 3D for the 64DD and Duke Nukem: Zero Hour Cartridge. ## How Has This Been Tested? <!-- (if applicable) --> <!--- Please describe in detail how you tested your sample/changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## Screenshots <!-- (if appropriate): --> ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [x] Improvement (non-breaking change that adds a new feature) - [ ] Bug fix (fixes an issue) - [ ] Breaking change (breaking change) - [ ] Config and build (change in the configuration and build system, has no impact on code or features) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] My code follows the code style of this project. - [x] My change requires a change to the documentation. - [x] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. <!--- It would be nice if you could sign off your contribution by replacing the name with your GitHub user name and GitHub email contact. --> Signed-off-by: GITHUB_USER <GITHUB_USER_EMAIL>
2023-09-17 10:38:42 +02:00
component_boxart_t *component_boxart_init (uint8_t media_type, uint16_t id);
void component_boxart_free (component_boxart_t *b);
void component_boxart_draw (component_boxart_t *b);
/** @} */ /* menu_components */
#endif