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);
56 static int done_enter(void)
58 const char *s1 = _("New Set Record");
59 const char *s2 = _("Set Complete");
63 int high = (curr_lg()->times_rank < 3) || (curr_lg()->score_rank < 3);
67 level_update_player_name();
71 if ((id = gui_vstack(0)))
76 gid = gui_label(id, s1, GUI_MED, GUI_ALL, gui_grn, gui_grn);
78 gid = gui_label(id, s2, GUI_MED, GUI_ALL, gui_blu, gui_grn);
82 if ((jd = gui_harray(id)))
84 gui_most_coins(jd, 1);
85 gui_best_times(jd, 1);
90 if ((jd = gui_harray(id)))
92 /* FIXME, I'm ugly. */
95 gui_state(jd, _("Change Player Name"), GUI_SML, DONE_NAME, 0);
97 gui_start(jd, _("OK"), GUI_SML, DONE_OK, 0);
100 gui_layout(id, 0, 0);
101 gui_pulse(gid, 1.2f);
104 set_best_times(set_time_score(curr_set()), curr_lg()->times_rank, 0);
105 set_most_coins(set_coin_score(curr_set()), curr_lg()->score_rank);
110 static int done_buttn(int b, int d)
114 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
115 return done_action(gui_token(gui_click()));
116 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
117 return done_action(DONE_OK);
122 /*---------------------------------------------------------------------------*/
124 struct state st_done = {