2012-07-14 10:40:21 +02:00
|
|
|
/*
|
|
|
|
* This software is licensed under the terms of the MIT-License
|
2017-02-11 04:52:08 +01:00
|
|
|
* See COPYING for further information.
|
2012-07-14 10:40:21 +02:00
|
|
|
* ---
|
|
|
|
* Copyright (C) 2011, Lukas Weber <laochailan@web.de>
|
|
|
|
* Copyright (C) 2011, Alexeyew Andrew <http://akari.thebadasschoobs.org/>
|
|
|
|
*/
|
2017-02-11 04:52:08 +01:00
|
|
|
|
2012-07-14 10:40:21 +02:00
|
|
|
#include "global.h"
|
|
|
|
#include "menu.h"
|
|
|
|
#include "options.h"
|
|
|
|
#include "stage.h"
|
|
|
|
#include "stageselect.h"
|
2017-02-12 04:43:52 +01:00
|
|
|
#include "common.h"
|
2012-07-14 10:40:21 +02:00
|
|
|
|
|
|
|
void create_stage_menu(MenuData *m) {
|
|
|
|
char title[STGMENU_MAX_TITLE_LENGTH];
|
2017-02-10 11:39:42 +01:00
|
|
|
Difficulty lastdiff = D_Any;
|
2017-02-11 04:52:08 +01:00
|
|
|
|
2012-07-14 10:40:21 +02:00
|
|
|
create_menu(m);
|
2017-02-16 17:19:52 +01:00
|
|
|
m->flags = MF_Abortable;
|
2017-02-11 04:52:08 +01:00
|
|
|
|
2017-02-10 11:39:42 +01:00
|
|
|
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;
|
2012-07-14 10:40:21 +02:00
|
|
|
}
|
2017-02-11 04:52:08 +01:00
|
|
|
|
2017-02-19 03:12:44 +01:00
|
|
|
add_menu_separator(m);
|
2017-02-16 17:55:46 +01:00
|
|
|
add_menu_entry(m, "Back", menu_commonaction_close, NULL);
|
2012-07-14 10:40:21 +02:00
|
|
|
}
|
2012-07-16 19:59:55 +02:00
|
|
|
|
2012-08-12 16:54:48 +02:00
|
|
|
void draw_stage_menu(MenuData *m) {
|
|
|
|
draw_options_menu_bg(m);
|
2017-02-19 01:29:42 +01:00
|
|
|
draw_menu_title(m, "Select Stage");
|
2017-02-12 04:43:52 +01:00
|
|
|
animate_menu_list(m);
|
2012-08-12 16:54:48 +02:00
|
|
|
draw_menu_list(m, 100, 100, NULL);
|
2012-07-14 10:40:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int stage_menu_loop(MenuData *m) {
|
2012-08-12 16:54:48 +02:00
|
|
|
return menu_loop(m, NULL, draw_stage_menu, NULL);
|
2012-07-14 10:40:21 +02:00
|
|
|
}
|