1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-12 15:26:00 +00:00

do not use emptyscreen. Use gamescreen but with NOSCR

This commit is contained in:
Zeno Rogue
2025-08-25 21:51:57 +02:00
parent 02ba3ee404
commit 6b30441ea1
9 changed files with 29 additions and 35 deletions

View File

@@ -2160,8 +2160,8 @@ EX void menuitem_sightrange_style(key_type c IS('c')) {
c c
); );
dialog::add_action_push([] { dialog::add_action_push([] {
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR;
emptyscreen(); gamescreen();
dialog::init(XLAT("draw range based on")); dialog::init(XLAT("draw range based on"));
dialog::addBoolItem(XLAT("draw range based on distance"), vid.use_smart_range == 0, 'd'); dialog::addBoolItem(XLAT("draw range based on distance"), vid.use_smart_range == 0, 'd');
dialog::add_action([] () { vid.use_smart_range = 0; popScreen(); edit_sightrange(); }); dialog::add_action([] () { vid.use_smart_range = 0; popScreen(); edit_sightrange(); });
@@ -3888,8 +3888,8 @@ EX void show_color_dialog() {
#if CAP_CONFIG #if CAP_CONFIG
EX void resetConfigMenu() { EX void resetConfigMenu() {
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR;
emptyscreen(); gamescreen();
dialog::init(XLAT("reset all configuration")); dialog::init(XLAT("reset all configuration"));
dialog::addInfo("Are you sure?"); dialog::addInfo("Are you sure?");
dialog::addItem("yes, and delete the config file", 'd'); dialog::addItem("yes, and delete the config file", 'd');

View File

@@ -1094,7 +1094,7 @@ EX namespace dialog {
void color_dialog::draw() { void color_dialog::draw() {
cmode = sm::NUMBER | dialogflags; cmode = sm::NUMBER | dialogflags;
if(cmode & sm::SIDE) gamescreen(); if(cmode & sm::SIDE) gamescreen();
else emptyscreen(); else stillscreen = true, emptyscreen();
dcenter = vid.xres/2; dcenter = vid.xres/2;
dwidth = vid.xres; dwidth = vid.xres;

View File

@@ -1193,8 +1193,8 @@ EX named_functionality get_o_key() {
if(isize(res) == 1) return res[0]; if(isize(res) == 1) return res[0];
return named_dialog(res[0].first + "/...", [res] { return named_dialog(res[0].first + "/...", [res] {
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR;
emptyscreen(); gamescreen();
dialog::init(); dialog::init();
char id = 'o'; char id = 'o';
for(auto& r: res) { for(auto& r: res) {

View File

@@ -109,8 +109,7 @@ void load_hiscores() {
int hi_sort_by = 3; int hi_sort_by = 3;
void hiscore_menu() { void hiscore_menu() {
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
emptyscreen();
dialog::init("High scores"); dialog::init("High scores");
fill_gamedata(); fill_gamedata();
vector<gamedata*> v; vector<gamedata*> v;

View File

@@ -1282,8 +1282,7 @@ void create_game();
void geometry_menu() { void geometry_menu() {
clearMessages(); clearMessages();
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
emptyscreen();
dialog::init("Bringris geometries"); dialog::init("Bringris geometries");
dialog::addBreak(100); dialog::addBreak(100);
int total_stars = 0; int total_stars = 0;
@@ -1400,8 +1399,7 @@ void visual_menu() {
} }
void settings_menu() { void settings_menu() {
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
emptyscreen();
dialog::init("Bringris settings"); dialog::init("Bringris settings");
dialog::addItem("alternative geometry", 'g'); dialog::addItem("alternative geometry", 'g');
dialog::add_action_push(geometry_menu); dialog::add_action_push(geometry_menu);
@@ -1432,8 +1430,7 @@ void settings_menu() {
bool hi_pro; bool hi_pro;
void hiscore_menu() { void hiscore_menu() {
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
emptyscreen();
dialog::init("High scores"); dialog::init("High scores");
string s = bgeoms[bgeom].name; string s = bgeoms[bgeom].name;
if(cur.max_piece != bgeoms[bgeom].default_max_piece) s = s + " (block " + its(cur.max_piece) + ")"; if(cur.max_piece != bgeoms[bgeom].default_max_piece) s = s + " (block " + its(cur.max_piece) + ")";
@@ -1449,8 +1446,7 @@ void hiscore_menu() {
for(auto ad: v) { for(auto ad: v) {
dialog::addSelItem(ad->myname, hi_pro ? fts(ad->score) : its(ad->completed), dialog::list_fake_key++); dialog::addSelItem(ad->myname, hi_pro ? fts(ad->score) : its(ad->completed), dialog::list_fake_key++);
dialog::add_action_push([ad] { dialog::add_action_push([ad] {
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
emptyscreen();
dialog::init(); dialog::init();
if(hi_pro) dialog::addSelItem("score", fts(ad->score), 's'); if(hi_pro) dialog::addSelItem("score", fts(ad->score), 's');
dialog::addSelItem("levels", fts(ad->completed), 'l'); dialog::addSelItem("levels", fts(ad->completed), 'l');

View File

@@ -334,8 +334,7 @@ string fname = "horizontal.nrl";
ld total_stars = 0; ld total_stars = 0;
void pick_level() { void pick_level() {
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
emptyscreen();
dialog::init(XLAT("select the track"), 0xC0C0FFFF, 150, 100); dialog::init(XLAT("select the track"), 0xC0C0FFFF, 150, 100);
ld cur_stars = 0; ld cur_stars = 0;
for(auto l: all_levels) { for(auto l: all_levels) {
@@ -388,8 +387,7 @@ void pick_level() {
void layer_selection_screen() { void layer_selection_screen() {
poly_outline = 0xFF; poly_outline = 0xFF;
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
emptyscreen();
dialog::init(XLAT("layer selection"), 0xC0C0FFFF, 150, 100); dialog::init(XLAT("layer selection"), 0xC0C0FFFF, 150, 100);
dialog::addBreak(50); dialog::addBreak(50);
auto layers = curlev->gen_layer_list(); auto layers = curlev->gen_layer_list();
@@ -404,8 +402,7 @@ void layer_selection_screen() {
void pick_game() { void pick_game() {
clearMessages(); clearMessages();
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
emptyscreen();
dialog::init(); dialog::init();
poly_outline = 0xFF; poly_outline = 0xFF;
dialog::addBigItem(curlev->name, 't'); dialog::addBigItem(curlev->name, 't');
@@ -456,8 +453,7 @@ void nil_set_perspective() {
} }
void nil_projection() { void nil_projection() {
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
emptyscreen();
dialog::init(XLAT("projection of Nil"), 0xC0C0FFFF, 150, 100); dialog::init(XLAT("projection of Nil"), 0xC0C0FFFF, 150, 100);
dialog::addBoolItem("geodesics", pmodel == mdGeodesic, 'g'); dialog::addBoolItem("geodesics", pmodel == mdGeodesic, 'g');
dialog::add_action([] { popScreen(); nil_set_geodesic(); }); dialog::add_action([] { popScreen(); nil_set_geodesic(); });
@@ -472,8 +468,7 @@ void nil_projection() {
} }
void settings() { void settings() {
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
emptyscreen();
dialog::init(XLAT("settings"), 0xC0C0FFFF, 150, 100); dialog::init(XLAT("settings"), 0xC0C0FFFF, 150, 100);
add_edit(aimspeed_key_x); add_edit(aimspeed_key_x);
add_edit(aimspeed_key_y); add_edit(aimspeed_key_y);
@@ -530,8 +525,7 @@ template<class T, class U, class V> void replays_of_type(vector<T>& v, const U&
dialog::addItem(r.name, 'a'); dialog::addItem(r.name, 'a');
dialog::add_action([&v, i, loader, ghost_loader] { dialog::add_action([&v, i, loader, ghost_loader] {
pushScreen([&v, i, loader, ghost_loader] { pushScreen([&v, i, loader, ghost_loader] {
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
emptyscreen();
dialog::init(XLAT(planning_mode ? "saved plan" : "replay"), 0xC0C0FFFF, 150, 100); dialog::init(XLAT(planning_mode ? "saved plan" : "replay"), 0xC0C0FFFF, 150, 100);
dialog::addInfo(v[i].name); dialog::addInfo(v[i].name);
@@ -567,8 +561,7 @@ template<class T, class U, class V> void replays_of_type(vector<T>& v, const U&
#if CAP_SAVE #if CAP_SAVE
void replays() { void replays() {
cmode = sm::VR_MENU; cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
emptyscreen();
dialog::init(XLAT(planning_mode ? "saved plans" : "replays"), 0xC0C0FFFF, 150, 100); dialog::init(XLAT(planning_mode ? "saved plans" : "replays"), 0xC0C0FFFF, 150, 100);
if(!planning_mode) replays_of_type(curlev->manual_replays, [] (manual_replay& r) { if(!planning_mode) replays_of_type(curlev->manual_replays, [] (manual_replay& r) {
view_replay = false; view_replay = false;
@@ -666,9 +659,8 @@ void help_instruments() {
void main_menu() { void main_menu() {
clearMessages(); clearMessages();
cmode = sm::VR_MENU;
poly_outline = 0xFF; poly_outline = 0xFF;
emptyscreen(); cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
dialog::init(XLAT("Nil Rider"), 0xC0C0FFFF, 150, 100); dialog::init(XLAT("Nil Rider"), 0xC0C0FFFF, 150, 100);
dialog::addItem("continue", 'c'); dialog::addItem("continue", 'c');

View File

@@ -319,7 +319,7 @@ void model_data::render(const shiftmatrix& V) {
} }
void model_settings() { void model_settings() {
emptyscreen(); cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
dialog::init(); dialog::init();
add_edit(prec); add_edit(prec);
dialog::addBack(); dialog::addBack();

View File

@@ -121,6 +121,8 @@ void empty_screen(presmode mode, color_t col) {
void slide_error(presmode mode, string s) { void slide_error(presmode mode, string s) {
empty_screen(mode, 0x400000); empty_screen(mode, 0x400000);
add_stat(mode, [s] { add_stat(mode, [s] {
cmode = sm::VR_MENU | sm::NOSCR;
gamescreen();
dialog::init(); dialog::init();
dialog::addTitle(s, 0xFF0000, 150); dialog::addTitle(s, 0xFF0000, 150);
dialog::display(); dialog::display();
@@ -434,7 +436,7 @@ void show_animation(presmode mode, string s, int sx, int sy, int frames, int fps
} }
void choose_presentation() { void choose_presentation() {
cmode = sm::NOSCR; cmode = sm::NOSCR | sm::VR_MENU;
gamescreen(); gamescreen();
getcstat = ' '; getcstat = ' ';

View File

@@ -479,6 +479,8 @@ EX namespace ss {
} }
EX void slideshow_menu() { EX void slideshow_menu() {
cmode = sm::VR_MENU | sm::NOSCR;
gamescreen();
dialog::init(XLAT("slideshows"), forecolor, 150, 100); dialog::init(XLAT("slideshows"), forecolor, 150, 100);
for_all_slideshows([] (string title, slide *sl, char ch) { for_all_slideshows([] (string title, slide *sl, char ch) {
dialog::addBoolItem(title, wts == sl, ch); dialog::addBoolItem(title, wts == sl, ch);
@@ -491,6 +493,9 @@ EX namespace ss {
EX void showMenu() { EX void showMenu() {
if(!wts) wts = slides; if(!wts) wts = slides;
cmode = sm::VR_MENU | sm::NOSCR;
gamescreen();
dialog::init(XLAT("slides"), forecolor, 150, 100); dialog::init(XLAT("slides"), forecolor, 150, 100);
string cftrans, cftransbuild; string cftrans, cftransbuild;