static int start_score(int d) { int s = (d < 0 ? GUI_SCORE_PREV(gui_score_get()) : GUI_SCORE_NEXT(gui_score_get())); return start_action(GUI_SCORE, s); }
static int done_keybd(int c, int d) { if (d) { if (c == KEY_EXIT) return done_action(GUI_BACK, 0); if (config_tst_d(CONFIG_KEY_SCORE_NEXT, c)) return done_action(GUI_SCORE, GUI_SCORE_NEXT(gui_score_get())); } return 1; }
static int goal_keybd(int c, int d) { if (d) { if (c == KEY_EXIT) return goal_action(GUI_BACK, 0); if (config_tst_d(CONFIG_KEY_SCORE_NEXT, c)) return goal_action(GUI_SCORE, GUI_SCORE_NEXT(gui_score_get())); if (config_tst_d(CONFIG_KEY_RESTART, c) && progress_same_avail()) return goal_action(GOAL_SAME, 0); } return 1; }
void gui_score_board(int pd, unsigned int types, int e, int h) { int id, jd;//, kd; assert((types & GUI_SCORE_COIN) || (types & GUI_SCORE_TIME) || (types & GUI_SCORE_GOAL) ); /* Make sure current score type matches the spec. */ while (!(types & score_type)) score_type = GUI_SCORE_NEXT(score_type); if ((id = video.device_w < video.device_h ? gui_vstack(pd) : gui_hstack(pd))) { gui_filler(id); if (video.device_w < video.device_h) { gui_scores(id, e); gui_space(id); gui_filler(id); } if ((jd = gui_vstack(id))) { gui_filler(jd); if (types & GUI_SCORE_COIN) { coin_btn_id = gui_state(jd, _("Most Coins"), GUI_MED, GUI_SCORE, GUI_SCORE_COIN); gui_set_hilite(coin_btn_id, score_type == GUI_SCORE_COIN); } if (types & GUI_SCORE_TIME) { time_btn_id = gui_state(jd, _("Best Times"), GUI_MED, GUI_SCORE, GUI_SCORE_TIME); gui_set_hilite(time_btn_id, score_type == GUI_SCORE_TIME); } if (types & GUI_SCORE_GOAL) { goal_btn_id = gui_state(jd, _("Fast Unlock"), GUI_MED, GUI_SCORE, GUI_SCORE_GOAL); gui_set_hilite(goal_btn_id, score_type == GUI_SCORE_GOAL); } if (h || (types & GUI_SCORE_SAVE)) gui_space(jd); if (h) { gui_state(jd, _("Change Name"), GUI_MED, GUI_NAME, 0); } if ((types & GUI_SCORE_SAVE)) { gui_state(jd, _("Save Replay"), GUI_MED, GUI_SAVE, 0); } gui_filler(jd); } if (video.device_w >= video.device_h) { gui_space(id); gui_filler(id); gui_scores(id, e); } gui_filler(id); } }