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 "st_shared.h"
31 /*---------------------------------------------------------------------------*/
40 static int done_action(int i)
42 audio_play(AUD_MENU, 1.0f);
47 return goto_state(&st_start);
51 return goto_name(&st_done, &st_done, 0);
58 return goto_state(&st_done);
63 static int done_enter(void)
65 const char *s1 = _("New Set Record");
66 const char *s2 = _("Set Complete");
70 int high = progress_set_high();
78 if ((id = gui_vstack(0)))
83 gid = gui_label(id, s1, GUI_MED, GUI_ALL, gui_grn, gui_grn);
85 gid = gui_label(id, s2, GUI_MED, GUI_ALL, gui_blu, gui_grn);
89 if ((jd = gui_hstack(id)))
90 gui_score_board(jd, GUI_MOST_COINS |
91 GUI_BEST_TIMES, 1, high);
95 gui_start(id, _("Select Level"), GUI_SML, DONE_OK, 0);
100 gui_layout(id, 0, 0);
103 set_score_board(set_coin_score(curr_set()), progress_score_rank(),
104 set_time_score(curr_set()), progress_times_rank(),
105 set_time_score(curr_set()), progress_times_rank());
113 static int done_keybd(int c, int d)
115 if (d && config_tst_d(CONFIG_KEY_SCORE_NEXT, c))
116 return done_action(gui_score_next(gui_score_get()));
121 static int done_buttn(int b, int d)
125 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
126 return done_action(gui_token(gui_click()));
127 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
128 return done_action(DONE_OK);
133 /*---------------------------------------------------------------------------*/
135 struct state st_done = {