Remove the unhide option from solitaire because it was pretty useless. This also solves a bug when auto unhide was disabled: FS #8988

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17540 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Peter D'Hoye 2008-05-16 20:03:27 +00:00
parent 4575b713ed
commit f1dd7bbcd7

View file

@ -662,19 +662,16 @@ enum help solitaire_help( void )
struct sol_config { struct sol_config {
int draw_type; int draw_type;
int auto_unhide;
}; };
struct sol_config sol_disk = {0, 0}; struct sol_config sol_disk = {0};
struct sol_config sol; struct sol_config sol;
static struct configdata config[] = { static struct configdata config[] = {
{ TYPE_INT, 0, 1, &sol_disk.draw_type, "draw_type", NULL, NULL }, { TYPE_INT, 0, 1, &sol_disk.draw_type, "draw_type", NULL, NULL },
{ TYPE_INT, 0, 1, &sol_disk.auto_unhide, "auto_unhide", NULL, NULL }
}; };
char draw_option_string[32]; char draw_option_string[32];
char unhide_option_string[32];
static void create_draw_option_string(void) static void create_draw_option_string(void)
{ {
@ -684,14 +681,6 @@ static void create_draw_option_string(void)
rb->strcpy(draw_option_string, "Draw One Card"); rb->strcpy(draw_option_string, "Draw One Card");
} }
static void create_unhide_option_string(void)
{
if (sol.auto_unhide == 0)
rb->strcpy(unhide_option_string, "Unhide manually");
else
rb->strcpy(unhide_option_string, "Unhide automatically");
}
void solitaire_init(void); void solitaire_init(void);
/* menu return codes */ /* menu return codes */
@ -703,7 +692,7 @@ int solitaire_menu(bool in_game)
int result = -1; int result = -1;
int i = 0; int i = 0;
struct menu_item items[7]; struct menu_item items[6];
if( in_game ) if( in_game )
{ {
@ -715,7 +704,6 @@ int solitaire_menu(bool in_game)
items[i++].desc = "Start Game"; items[i++].desc = "Start Game";
items[i++].desc = draw_option_string; items[i++].desc = draw_option_string;
} }
items[i++].desc = unhide_option_string;
items[i++].desc = "Help"; items[i++].desc = "Help";
items[i++].desc = "Audio Playback"; items[i++].desc = "Audio Playback";
if( in_game ) if( in_game )
@ -725,7 +713,6 @@ int solitaire_menu(bool in_game)
items[i++].desc = "Quit"; items[i++].desc = "Quit";
create_draw_option_string(); create_draw_option_string();
create_unhide_option_string();
m = menu_init(rb, items, i, NULL, NULL, NULL, NULL); m = menu_init(rb, items, i, NULL, NULL, NULL, NULL);
while (result < 0) while (result < 0)
{ {
@ -757,28 +744,23 @@ int solitaire_menu(bool in_game)
break; break;
case 2: case 2:
sol.auto_unhide = (sol.auto_unhide + 1) % 2;
create_unhide_option_string();
break;
case 3:
rb->lcd_setmargins(0, 0); rb->lcd_setmargins(0, 0);
if (solitaire_help() == HELP_USB) if (solitaire_help() == HELP_USB)
result = MENU_USB; result = MENU_USB;
break; break;
case 4: case 3:
playback_control(rb, NULL); playback_control(rb, NULL);
break; break;
case 5: case 4:
if( in_game ) if( in_game )
result = MENU_SAVE_AND_QUIT; result = MENU_SAVE_AND_QUIT;
else else
result = MENU_QUIT; result = MENU_QUIT;
break; break;
case 6: case 5:
result = MENU_QUIT; result = MENU_QUIT;
break; break;
} }
@ -1135,12 +1117,9 @@ enum move move_card( int dest_col, int src_card )
else else
{ {
deck[src_card_prev].next = NOT_A_CARD; deck[src_card_prev].next = NOT_A_CARD;
if (sol.auto_unhide)
{
deck[src_card_prev].known = true; deck[src_card_prev].known = true;
} }
} }
}
sel_card = NOT_A_CARD; sel_card = NOT_A_CARD;
/* tada ! */ /* tada ! */
return MOVE_OK; return MOVE_OK;