int timer; /* time elapsed */
int state_value; /* more precision about the state: skip for goal */
- int dead; /* Is the game over and lost? */
- int win; /* Is the game over and win? */
-
/* rank = 3 => unclassed */
int coin_rank; /* rank in the level high-scores */
int goal_rank; /* rank in the level high-scores */
int score_rank; /* rank in the set high-scores */
int times_rank; /* rank in the set high-scores */
+ /* What about the game and the set? */
+ int dead; /* Is the game over and lost? */
+ int win; /* Is the game over and win? */
+ int unlock; /* Is the next level newly unlocked */
const struct level *next_level; /* next level (NULL no next level) */
};
lg->timer = lg->time;
lg->coin_rank = lg->goal_rank = lg->time_rank =
lg->score_rank = lg-> times_rank = 3;
- lg->win = lg->dead = 0;
+ lg->win = lg->dead = lg->unlock = 0;
lg->next_level = NULL;
return demo_play_init(USER_REPLAY_FILE, l, lg);
if ((jd = gui_harray(id)))
{
+ int nlid = 0;
if (lg->win)
gui_start(jd, _("Finish"), GUI_SML, GOAL_DONE, 0);
else if (lg->next_level != NULL)
- gui_state(jd, _("Next Level"), GUI_SML, GOAL_NEXT, 0);
+ nlid = gui_start(jd, _("Next Level"), GUI_SML, GOAL_NEXT, 0);
else if (mode != MODE_SINGLE)
gui_label(jd, _("Next Level"), GUI_SML, GUI_ALL, gui_blk, gui_blk);
gui_state(jd, _("Save Replay"), GUI_SML, GOAL_SAVE, 0);
else
gui_label(jd, _("Save Replay"), GUI_SML, GUI_ALL, gui_blk, gui_blk);
-
+
+ /* default is next if the next level is newly unkocked */
+ if (nlid != 0 && lg->unlock)
+ gui_focus(nlid);
}
if (high)