mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
some changes to use of display_text.
* add parameter, wait_key to display_text(). - set this true to wait button press after all words is displayed. * use ARRAYLEN macro instead of #define WORDS * add macro to indicate end of style array. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24846 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
04067fd7a0
commit
56d29e8977
13 changed files with 91 additions and 166 deletions
|
@ -1300,8 +1300,6 @@ static void jewels_nextlevel(struct game_context* bj) {
|
|||
|
||||
static bool jewels_help(void)
|
||||
{
|
||||
rb->lcd_setfont(FONT_UI);
|
||||
#define WORDS (sizeof help_text / sizeof (char*))
|
||||
static char *help_text[] = {
|
||||
"Jewels", "", "Aim", "",
|
||||
"Swap", "pairs", "of", "jewels", "to", "form", "connected",
|
||||
|
@ -1323,22 +1321,12 @@ static bool jewels_help(void)
|
|||
{ 0, TEXT_CENTER|TEXT_UNDERLINE },
|
||||
{ 2, C_RED },
|
||||
{ 42, C_RED },
|
||||
{ -1, 0 }
|
||||
LAST_STYLE_ITEM
|
||||
};
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
rb->lcd_set_background(LCD_BLACK);
|
||||
rb->lcd_set_foreground(LCD_WHITE);
|
||||
#endif
|
||||
int button;
|
||||
if (display_text(WORDS, help_text, formation, NULL))
|
||||
|
||||
rb->lcd_setfont(FONT_UI);
|
||||
if (display_text(ARRAYLEN(help_text), help_text, formation, NULL, true))
|
||||
return true;
|
||||
do {
|
||||
button = rb->button_get(true);
|
||||
if (rb->default_event_handler (button) == SYS_USB_CONNECTED) {
|
||||
return true;
|
||||
}
|
||||
} while( ( button == BUTTON_NONE )
|
||||
|| ( button & (BUTTON_REL|BUTTON_REPEAT) ) );
|
||||
rb->lcd_setfont(FONT_SYSFIXED);
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue