made main menu friendlier
This commit is contained in:
@ -8,7 +8,7 @@ CC3K::CC3K(const feature enabled_features,
|
||||
in{in}, out{out}, rng{rng} {
|
||||
curr_menu = std::make_unique<menu>(enabled_features);
|
||||
out->clear();
|
||||
curr_menu->print(out);
|
||||
curr_menu->print(out, rng->get_init_seed());
|
||||
out->render();
|
||||
gresult.status = game_status::main_menu;
|
||||
}
|
||||
@ -34,7 +34,7 @@ game_status CC3K::run() {
|
||||
}
|
||||
|
||||
out->clear();
|
||||
curr_menu->print(out);
|
||||
curr_menu->print(out, rng->get_init_seed());
|
||||
out->render();
|
||||
return main_menu;
|
||||
}
|
||||
@ -46,7 +46,7 @@ game_status CC3K::run() {
|
||||
curr_game = nullptr;
|
||||
curr_menu = std::make_unique<menu>(enabled_features);
|
||||
out->clear();
|
||||
curr_menu->print(out);
|
||||
curr_menu->print(out, rng->get_init_seed());
|
||||
out->render();
|
||||
gresult.status = main_menu;
|
||||
return main_menu;
|
||||
|
29
src/menu.cc
29
src/menu.cc
@ -36,7 +36,7 @@ const char *NORMAL_SCREEN =
|
||||
| | \\_ | \\_ _\\ || \\ |\
|
||||
| \\____/\\____//____/\\_|\\_\\ |\
|
||||
+-----------------------------------------------------------------------------+\
|
||||
| Choose your race | |\
|
||||
| Choose your race: |\
|
||||
+-----------------------------------------------------------------------------+\
|
||||
| Shade | |\
|
||||
+-----------------------------------------------------------------------------+\
|
||||
@ -51,7 +51,7 @@ const char *NORMAL_SCREEN =
|
||||
| |\
|
||||
| |\
|
||||
| |\
|
||||
| |\
|
||||
|-----------------------------------------------------------------------------|\
|
||||
| |\
|
||||
+-----------------------------------------------------------------------------+";
|
||||
|
||||
@ -63,7 +63,7 @@ const char *EXTRA_SCREEN =
|
||||
| | \\_ | \\_ _\\ || \\ |\
|
||||
| \\____/\\____//____/\\_|\\_\\ |\
|
||||
+-----------------------------------------------------------------------------+\
|
||||
| Choose your race | |\
|
||||
| Choose your race: |\
|
||||
+-----------------------------------------------------------------------------+\
|
||||
| Shade | |\
|
||||
+-----------------------------------------------------------------------------+\
|
||||
@ -78,7 +78,7 @@ const char *EXTRA_SCREEN =
|
||||
| |\
|
||||
| |\
|
||||
| |\
|
||||
| |\
|
||||
|-----------------------------------------------------------------------------|\
|
||||
| |\
|
||||
+-----------------------------------------------------------------------------+";
|
||||
|
||||
@ -152,10 +152,27 @@ int menu::run(input *in) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
void menu::print(display *out) {
|
||||
const position MSG_POS = {2, 23};
|
||||
const char *MSG_NORMAL =
|
||||
"Move with movement commands, 'yes' to confirm, 'q' to quit.";
|
||||
const char *MSG_NCURSES =
|
||||
"Move with movement commands, press 'e' to confirm, 'q' to quit.";
|
||||
const position SEED_POS = {1, 25};
|
||||
|
||||
void menu::print(display *out, const unsigned int seed) {
|
||||
if (enabled_features & FEATURE_EXTRA_STUFF)
|
||||
out->print_str({0, 0}, NORMAL_SCREEN);
|
||||
else
|
||||
out->print_str({0, 0}, EXTRA_SCREEN);
|
||||
out->print_str(cur, "->", COLOR_PAIR(COLOR_BLUE));
|
||||
|
||||
if (enabled_features & FEATURE_NCURSES)
|
||||
out->print_str(MSG_POS, MSG_NCURSES, COLOR_PAIR(COLOR_YELLOW));
|
||||
else
|
||||
out->print_str(MSG_POS, MSG_NORMAL, COLOR_PAIR(COLOR_YELLOW));
|
||||
|
||||
out->print_str(SEED_POS, "Seed: " + std::to_string(seed),
|
||||
COLOR_PAIR(COLOR_BLUE));
|
||||
|
||||
out->print_str(cur, "->", COLOR_PAIR(COLOR_GREEN));
|
||||
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ private:
|
||||
public:
|
||||
menu(const feature enabled_features);
|
||||
int run(input *in);
|
||||
void print(display *out);
|
||||
void print(display *out, const unsigned int seed);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user