#include "gui.h"
#include "set.h"
-#include "levels.h"
-#include "game.h"
+#include "progress.h"
#include "audio.h"
#include "config.h"
#include "util.h"
-#include "st_shared.h"
+#include "common.h"
+
+#include "game_common.h"
#include "st_set.h"
#include "st_title.h"
#include "st_start.h"
+#include "st_shared.h"
/*---------------------------------------------------------------------------*/
-#define SET_STEP 5
+#define SET_STEP 6
static int total = 0;
static int first = 0;
static int shot_id;
static int desc_id;
-static int should_prompt = 1;
+static int do_init = 1;
static int set_action(int i)
{
switch (i)
{
case GUI_BACK:
+ set_quit();
return goto_state(&st_title);
break;
first -= SET_STEP;
- should_prompt = 0;
+ do_init = 0;
return goto_state(&st_set);
break;
first += SET_STEP;
- should_prompt = 0;
+ do_init = 0;
return goto_state(&st_set);
break;
static void gui_set(int id, int i)
{
- const struct set *s;
-
- if ((s = get_set(i)))
- gui_state(id, _(s->name), GUI_SML, i, 0);
+ if (set_exists(i))
+ gui_state(id, set_name(i), GUI_SML, i, 0);
else
gui_label(id, "", GUI_SML, GUI_ALL, 0, 0);
}
int i;
- total = set_init();
-
- audio_music_fade_to(0.5f, "bgm/inter.ogg");
+ if (do_init)
+ {
+ total = set_init();
+ first = MIN(first, (total - 1) - ((total - 1) % SET_STEP));
- if (should_prompt)
+ audio_music_fade_to(0.5f, "bgm/inter.ogg");
audio_play(AUD_START, 1.f);
- else should_prompt = 1;
+ }
+ else do_init = 1;
if ((id = gui_vstack(0)))
{
{
gui_label(jd, _("Level Set"), GUI_SML, GUI_ALL, gui_yel, gui_red);
gui_filler(jd);
- gui_back_prev_next(jd, first > 0, first + SET_STEP < total);
+ gui_navig(jd, first > 0, first + SET_STEP < total);
}
+ gui_space(id);
+
if ((jd = gui_harray(id)))
{
- shot_id = gui_image(jd, get_set(first)->shot,
- 7 * w / 16, 7 * h / 16);
+ shot_id = gui_image(jd, set_shot(first), 7 * w / 16, 7 * h / 16);
if ((kd = gui_varray(jd)))
{
static void set_over(int i)
{
- gui_set_image(shot_id, get_set(i)->shot);
- gui_set_multi(desc_id, _(get_set(i)->desc));
+ gui_set_image(shot_id, set_shot(i));
+ gui_set_multi(desc_id, set_desc(i));
}
static void set_point(int id, int x, int y, int dx, int dy)
shared_timer,
set_point,
set_stick,
+ shared_angle,
shared_click,
NULL,
set_buttn,