taisei/src/menu/stageselect.c
Andrei "Akari" Alexeyev 1e6011433c Initial support for single-spell stages
Adapted all of the current spellcards into spellstages, which will
later be used in a spell practice mode a-la IN.
For now they are only accessible through the stage select menu or
by specifying their ID on the command line; both available only
if you built with -DTAISEI_DEBUG=1
2017-02-19 03:28:00 +01:00

46 lines
1.1 KiB
C

/*
* This software is licensed under the terms of the MIT-License
* See COPYING for further information.
* ---
* Copyright (C) 2011, Lukas Weber <laochailan@web.de>
* Copyright (C) 2011, Alexeyew Andrew <http://akari.thebadasschoobs.org/>
*/
#include "global.h"
#include "menu.h"
#include "options.h"
#include "stage.h"
#include "stageselect.h"
#include "common.h"
void create_stage_menu(MenuData *m) {
char title[STGMENU_MAX_TITLE_LENGTH];
Difficulty lastdiff = D_Any;
create_menu(m);
m->flags = MF_Abortable;
for(int i = 0; stages[i].loop; ++i) {
if(stages[i].difficulty < lastdiff || (stages[i].difficulty && !lastdiff)) {
add_menu_separator(m);
}
snprintf(title, STGMENU_MAX_TITLE_LENGTH, "%s: %s", stages[i].title, stages[i].subtitle);
add_menu_entry(m, title, start_game, &(stages[i]));
lastdiff = stages[i].difficulty;
}
add_menu_entry(m, "Back", menu_commonaction_close, NULL);
}
void draw_stage_menu(MenuData *m) {
draw_options_menu_bg(m);
draw_menu_title(m, "Select Stage");
animate_menu_list(m);
draw_menu_list(m, 100, 100, NULL);
}
int stage_menu_loop(MenuData *m) {
return menu_loop(m, NULL, draw_stage_menu, NULL);
}