From e2e7ecf350a4d085f6f58052f55ba29e8fe77718 Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Wed, 5 Aug 2009 14:29:29 +0000 Subject: 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 --- apps/plugins/snake.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'apps/plugins/snake.c') diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c index 739fce9a3e..8cba920840 100644 --- a/apps/plugins/snake.c +++ b/apps/plugins/snake.c @@ -34,6 +34,7 @@ dir is the current direction of the snake - 0=up, 1=right, 2=down, 3=left; #include "plugin.h" #ifdef HAVE_LCD_BITMAP +#include "lib/playback_control.h" PLUGIN_HEADER @@ -393,7 +394,7 @@ void game (void) { rb->sleep(HZ/level); button=rb->button_get(false); - + #ifdef HAS_BUTTON_HOLD if (rb->button_hold()) button = SNAKE_PLAYPAUSE; @@ -445,23 +446,28 @@ void game_init(void) { apple=false; snakelength=4; score=0; - board[11][7]=1; - - MENUITEM_STRINGLIST(menu,"Snake Menu",NULL,"Start New Game","Starting Level", - "Quit"); - + board[11][7]=1; + + MENUITEM_STRINGLIST(menu, "Snake Menu", NULL, + "Start New Game", "Starting Level", + "Playback Control", "Quit"); + while (!menu_quit) { switch(rb->do_menu(&menu, &selection, NULL, false)) { case 0: menu_quit = true; /* start playing */ break; - + case 1: rb->set_int("Starting Level", "", UNIT_INT, &level, NULL, 1, 1, 9, NULL ); break; - + + case 2: + playback_control(NULL); + break; + default: dead=1; /* quit program */ menu_quit = true; -- cgit v1.2.3