From 3328981004c659bb5539e3e5566b4bf8efe0d45f Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 12 Dec 2025 00:02:31 +0100 Subject: [PATCH] an option to have 'quest status' and 'main menu' on separate screens --- attack.cpp | 2 +- checkmove.cpp | 2 +- complex.cpp | 2 +- complex2.cpp | 2 +- config.cpp | 7 ++++++- control.cpp | 10 +++++----- multi.cpp | 2 +- quit.cpp | 54 +++++++++++++++++++++++++++++++++++++-------------- shmup.cpp | 4 ++-- 9 files changed, 57 insertions(+), 28 deletions(-) diff --git a/attack.cpp b/attack.cpp index 25201180..abac37f2 100644 --- a/attack.cpp +++ b/attack.cpp @@ -580,7 +580,7 @@ EX void killMonster(cell *c, eMonster who, flagtype deathflags IS(0)) { princess::reviveAt = gold(NO_LOVE) + 20; } } - if(princess::challenge) changes.at_commit([] { showMissionScreen(); }); + if(princess::challenge) changes.at_commit([] { showMissionScreen(true); }); } } diff --git a/checkmove.cpp b/checkmove.cpp index 9de1a157..adf742d9 100644 --- a/checkmove.cpp +++ b/checkmove.cpp @@ -469,7 +469,7 @@ EX void checkmove() { if(!canmove) { create_yasc_message(); achievement_final(true); - if(cmode & sm::NORMAL) showMissionScreen(); + if(cmode & sm::NORMAL) showMissionScreen(true); } else yasc_message = ""; diff --git a/complex.cpp b/complex.cpp index 6da93826..5b96aa33 100644 --- a/complex.cpp +++ b/complex.cpp @@ -653,7 +653,7 @@ struct info { addMessage(XLAT("Congratulations! Your score is %1.", its(i->value))); achievement_gain_once("PRINCESS2", rg::princess); if(!cheater) achievement_score(LB_PRINCESS, i->value); - LATE( showMissionScreen(); ) + LATE( showMissionScreen(true); ) } } if(i->princess->land == laDungeon && !saved && !nodungeon) { diff --git a/complex2.cpp b/complex2.cpp index 08da1681..b550563e 100644 --- a/complex2.cpp +++ b/complex2.cpp @@ -528,7 +528,7 @@ EX void count_status() { for(cell *c: currentmap->allcells()) if(among(c->wall, waMineMine, waMineUnknown) && mine::marked_mine(c)) kills[moTameBomberbird]++; if(last && !kills[moBomberbird]) { mine::victory_time = getgametime(); - showMissionScreen(); + showMissionScreen(true); } } diff --git a/config.cpp b/config.cpp index 327f0524..f340453d 100644 --- a/config.cpp +++ b/config.cpp @@ -1101,6 +1101,7 @@ EX void initConfig() { dialog::dialog_font_scale = 3; dialog::display_keys = 3; qm = false; + separate_status = true; } } } @@ -1111,7 +1112,11 @@ EX void initConfig() { param_i(vid.msglimit, "message limit", 5); param_i(vid.timeformat, "message log time format", 0); - + + param_b(separate_status, "separate_status") + -> editable("separate status", 's') + -> help("Make quest status and main menu separate screens."); + param_b(resizable, "resizable", true) -> editable("resizable window", 'r') -> help("This lets your operating system resize the window."); diff --git a/control.cpp b/control.cpp index 9a49c7c9..99406f43 100644 --- a/control.cpp +++ b/control.cpp @@ -133,7 +133,7 @@ EX movedir vectodir(hyperpoint P) { } EX void remission() { - if(!canmove && (cmode & sm::NORMAL) && !game_keys_scroll) showMissionScreen(); + if(!canmove && (cmode & sm::NORMAL) && !game_keys_scroll) showMissionScreen(true); } EX hyperpoint move_destination_vec(int d) { @@ -656,7 +656,7 @@ EX void handleKeyNormal(int sym, int uni) { else if(viewdists) viewdists = false; else - showMissionScreen(); + showMissionScreen(true); } if(sym == SDLK_F10) { @@ -682,10 +682,10 @@ EX void handleKeyNormal(int sym, int uni) { } if(sym == 'v' && DEFAULTNOR(sym)) - showMissionScreen(); + showMissionScreen(false); if(sym == PSEUDOKEY_MENU) - showMissionScreen(); + showMissionScreen(false); if(sym == PSEUDOKEY_NOHINT) no_find_player = true; @@ -1425,7 +1425,7 @@ EX void handle_event(SDL_Event& ev) { if(daily::on) daily::handleQuit(3); else #endif - if(needConfirmation() && !(cmode & sm::MISSION)) showMissionScreen(); + if(needConfirmation() && !(cmode & sm::MISSION)) showMissionScreen(false); else quitmainloop = true; } diff --git a/multi.cpp b/multi.cpp index fc9fc713..20be5a35 100644 --- a/multi.cpp +++ b/multi.cpp @@ -904,7 +904,7 @@ EX void handleInput(int delta, config &scfg) { get_o_key().second(); if(act[panReviewQuest].pressed()) - showMissionScreen(); + showMissionScreen(true); #if CAP_INV if(act[panInventory].pressed() && inv::on) diff --git a/quit.cpp b/quit.cpp index 599635e8..4abe2a69 100644 --- a/quit.cpp +++ b/quit.cpp @@ -136,7 +136,7 @@ EX hint hints[] = { { 0, - []() { return !canmove; }, + []() { return !canmove && dialog::display_keys != 3; }, []() { dialog::addInfo(XLAT( "Press ESC to view this screen during the game." @@ -149,11 +149,10 @@ EX hint hints[] = { []() { return in_full_game(); }, []() { dialog::addInfo( -#if ISMOBILE + (ISMOBILE || dialog::display_keys == 3) ? XLAT("The 'world overview' shows all the lands in HyperRogue.") -#else + : XLAT("Press 'o' to see all the lands in HyperRogue.") -#endif ); dialog::addBreak(50); dialog::addItem(XLAT("world overview") + " ", 'z'); @@ -330,13 +329,20 @@ eLand nextHyperstone() { return laCrossroads; } +EX bool separate_status = true; +EX bool showing_status = true; + EX void showGameMenu() { cmode = sm::DOTOUR | sm::MISSION | sm::CENTER | sm::MAYDARK | sm::SIDE; gamescreen(); drawStats(); getcstat = SDLK_ESCAPE; - dialog::init( + bool skip_status = separate_status && !showing_status; + + if(skip_status) dialog::init(XLAT("main menu")); + + else dialog::init( #if CAP_TOUR tour::on ? (canmove ? XLAT("guided tour") : XLAT("GAME OVER")) : #endif @@ -347,7 +353,8 @@ EX void showGameMenu() { XLAT("GAME OVER"), 0xC00000, 200, 100 ); - if(!canmove && yasc_message != "") dialog::addInfo(yasc_message); + + if(!canmove && yasc_message != "" && !skip_status) dialog::addInfo(yasc_message); #if CAP_COMPLEX2 bool sweeper = mine::in_minesweeper(); @@ -355,14 +362,15 @@ EX void showGameMenu() { const bool sweeper = false; #endif - if(!peace::on && !racing::on && !sweeper && !in_lovasz()) + if(!peace::on && !racing::on && !sweeper && !in_lovasz() && !skip_status) dialog::addInfo(XLAT("Your score: %1", its(gold()))); - if(!peace::on && !racing::on && !sweeper && !in_lovasz()) + if(!peace::on && !racing::on && !sweeper && !in_lovasz() && !skip_status) dialog::addInfo(XLAT("Enemies killed: %1", its(tkills()))); #if CAP_TOUR if(tour::on) ; else #endif + if(skip_status) ; else if(items[itOrbYendor]) { dialog::addInfo(XLAT("Orbs of Yendor found: %1", its(items[itOrbYendor])), iinf[itOrbYendor].color); dialog::addInfo(XLAT("CONGRATULATIONS!"), iinf[itOrbYendor].color); @@ -426,7 +434,8 @@ EX void showGameMenu() { if(canmove && !timerstart) timerstart = time(NULL); - if(princess::challenge) ; + if(skip_status) ; + else if(princess::challenge) ; #if CAP_TOUR else if(tour::on) ; #endif @@ -450,17 +459,17 @@ EX void showGameMenu() { dialog::addInfo(XLAT("Hyperstone Quest completed!"), iinf[itHyperstone].color); } else dialog::addInfo(XLAT("Some lands unlock at specific treasures or kills")); - if(cheater && !autocheat) { + if(cheater && !autocheat && !skip_status) { dialog::addInfo(XLAT("you have cheated %1 times", its(cheater)), 0xFF2020); } - if(!racing::on) { + if(!racing::on && !skip_status) { dialog::addInfo(timeline(), dialog::dialogcolor); } - dialog::addBreak(100); + if(!skip_status) dialog::addBreak(100); #if CAP_TOUR - if(!tour::on) { + if(!tour::on && !skip_status) { hints[hinttoshow].display(); dialog::addBreak(100); } @@ -472,6 +481,19 @@ EX void showGameMenu() { intour = tour::on; #endif + if(separate_status && showing_status) { + dialog::addItem(XLAT("menu"), 'v'); + dialog::add_action([] { showing_status = false; }); + dialog::addBack(); + dialog::display(); + return; + } + + if(skip_status) { + dialog::addItem(XLAT("show the status screen"), 'v'); + dialog::add_action([] { showing_status = !showing_status; }); + } + if(intour) { #if CAP_TOUR if(canmove) { @@ -681,7 +703,7 @@ EX int counthints() { for(int h=0;; h++) if(hints[h].last < 0) return h; } -EX void showMissionScreen() { +EX void showMissionScreen(bool start_showing_status) { cancel(); cancel = noaction; popScreenAll(); achievement_final(false); @@ -691,8 +713,10 @@ EX void showMissionScreen() { pushScreen(daily::showMenu); #endif } - else + else { + showing_status = start_showing_status; pushScreen(showGameMenu); + } #if CAP_TOUR if(!tour::on) diff --git a/shmup.cpp b/shmup.cpp index 9d86caa8..1a4f1fff 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -1645,7 +1645,7 @@ EX eItem targetRangedOrb(orbAction a) { useupOrb(itOrbMorph, 3); if(orig == moPlayer) { achievement_final(true); - showMissionScreen(); + showMissionScreen(true); } return itOrbMorph; } @@ -2874,7 +2874,7 @@ EX void turn(int delta) { } lastdead = pc[i]->dead; - if(lastcanmove && pc[i]->dead) showMissionScreen(); + if(lastcanmove && pc[i]->dead) showMissionScreen(true); canmove = canmove && !pc[i]->dead; }