summaryrefslogtreecommitdiffstats
path: root/apps/plugins/star.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-08-05 14:29:29 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-08-05 14:29:29 +0000
commite2e7ecf350a4d085f6f58052f55ba29e8fe77718 (patch)
treed5abd6a205b9d32cb11e1c2d0ea08602812248d4 /apps/plugins/star.c
parenteac0a5b840571a11b181fdfd463be61aca466976 (diff)
downloadrockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.gz
rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.bz2
rockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.zip
add playback control to more menu of plugins.
although it doesn't make much sense for some plugins like dice as the menu is only shown when you start that plugin. change star plugin to go back to menu when exit game instead of closing plugin so that above change makes useful. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22171 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/star.c')
-rw-r--r--apps/plugins/star.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/apps/plugins/star.c b/apps/plugins/star.c
index 1a27f51f54..118a18227c 100644
--- a/apps/plugins/star.c
+++ b/apps/plugins/star.c
@@ -21,6 +21,7 @@
#include "plugin.h"
#ifdef HAVE_LCD_BITMAP
#include "lib/display_text.h"
+#include "lib/playback_control.h"
PLUGIN_HEADER
@@ -424,8 +425,6 @@ static char board[STAR_HEIGHT][STAR_WIDTH];
#define STAR 3
#define BALL 4
-#define MENU_START 0
-
/* char font size */
static int char_width = -1;
static int char_height = -1;
@@ -1051,18 +1050,21 @@ static int star_menu(void)
{
int selection, level=1;
bool menu_quit = false;
- /* get the size of char */
- rb->lcd_getstringsize("a", &char_width, &char_height);
- MENUITEM_STRINGLIST(menu,"Star Menu",NULL,"Start Game","Choose Level",
- "Help", "Quit");
+ MENUITEM_STRINGLIST(menu, "Star Menu", NULL,
+ "Start Game","Choose Level",
+ "Help", "Playback Control", "Quit");
while(!menu_quit)
{
switch(rb->do_menu(&menu, &selection, NULL, false))
{
case 0:
- menu_quit = true;
+ /* use system font and get the size of char */
+ rb->lcd_setfont(FONT_SYSFIXED);
+ rb->lcd_getstringsize("a", &char_width, &char_height);
+ star_run_game(level-1);
+ rb->lcd_setfont(FONT_UI);
break;
case 1:
rb->set_int("Level", "", UNIT_INT, &level,
@@ -1072,19 +1074,17 @@ static int star_menu(void)
if(star_help())
usb_detected = true;
break;
- default:
+ case 3:
+ playback_control(NULL);
+ break;
+ case 4:
menu_quit = true;
break;
}
+ if(usb_detected)
+ return PLUGIN_USB_CONNECTED;
}
- if (selection == MENU_START)
- {
- rb->lcd_setfont(FONT_SYSFIXED);
- rb->lcd_getstringsize("a", &char_width, &char_height);
- level--;
- star_run_game(level);
- }
return PLUGIN_OK;
}