2 * Copyright (C) 2003 Robert Kooima
4 * NEVERBALL is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published
6 * by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
25 #include "game_common.h"
30 #include "st_shared.h"
32 /*---------------------------------------------------------------------------*/
38 static int done_action(int i)
40 audio_play(AUD_MENU, 1.0f);
45 return goto_state(&st_exit);
48 return goto_name(&st_done, &st_done, 0);
54 return goto_state(&st_done);
59 static int done_gui(void)
61 const char *s1 = _("New Set Record");
62 const char *s2 = _("Set Complete");
66 int high = progress_set_high();
69 if ((id = gui_vstack(0)))
74 gid = gui_label(id, s1, GUI_MED, GUI_ALL, gui_grn, gui_grn);
76 gid = gui_label(id, s2, GUI_MED, GUI_ALL, gui_blu, gui_grn);
79 gui_score_board(id, GUI_SCORE_COIN | GUI_SCORE_TIME, 1, high);
82 gui_start(id, _("Select Level"), GUI_SML, DONE_OK, 0);
90 set_score_board(set_score(curr_set(), SCORE_COIN), progress_score_rank(),
91 set_score(curr_set(), SCORE_TIME), progress_times_rank(),
97 static int done_enter(struct state *st, struct state *prev)
102 resume = (prev == &st_done);
107 static int done_keybd(int c, int d)
109 if (d && config_tst_d(CONFIG_KEY_SCORE_NEXT, c))
110 return done_action(gui_score_next(gui_score_get()));
115 static int done_buttn(int b, int d)
119 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
120 return done_action(gui_token(gui_click()));
121 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
122 return done_action(DONE_OK);
127 /*---------------------------------------------------------------------------*/
129 struct state st_done = {