summaryrefslogtreecommitdiffstats
path: root/apps/plugins/dice.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/dice.c
parenteac0a5b840571a11b181fdfd463be61aca466976 (diff)
downloadrockbox-e2e7ecf350a4d085f6f58052f55ba29e8fe77718.tar.gz
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/dice.c')
-rw-r--r--apps/plugins/dice.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/plugins/dice.c b/apps/plugins/dice.c
index 5ef5d5099d..ddbc0cc60e 100644
--- a/apps/plugins/dice.c
+++ b/apps/plugins/dice.c
@@ -22,6 +22,7 @@
#include "plugin.h"
#include "lib/pluginlib_actions.h"
#include "lib/configfile.h"
+#include "lib/playback_control.h"
#define MAX_DICES 12
#define INITIAL_NB_DICES 1
@@ -79,7 +80,7 @@ enum plugin_status plugin_start(const void* parameter) {
dice_init(&dice);
rb->srand(*rb->current_tick);
-
+
configfile_load(CFG_FILE, config, 2, 0);
dice.nb_sides = nb_sides_values[sides_index];
if(!dice_menu(&dice))
@@ -171,8 +172,10 @@ bool dice_menu(struct dices * dice) {
int selection;
bool menu_quit = false, result = false;
- MENUITEM_STRINGLIST(menu,"Dice Menu",NULL,"Roll Dice","Number of Dice",
- "Number of Sides","Quit");
+ MENUITEM_STRINGLIST(menu, "Dice Menu", NULL,
+ "Roll Dice",
+ "Number of Dice", "Number of Sides",
+ "Playback Control", "Quit");
while (!menu_quit) {
@@ -194,11 +197,15 @@ bool dice_menu(struct dices * dice) {
dice->nb_sides=nb_sides_values[sides_index];
break;
+ case 3:
+ playback_control(NULL);
+ break;
+
default:
menu_quit = true;
result = false;
break;
- }
+ }
}
return result;
}