1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-16 02:58:05 +00:00

an option to have 'quest status' and 'main menu' on separate screens

This commit is contained in:
Zeno Rogue
2025-12-12 00:02:31 +01:00
parent f20ea8bac8
commit 3328981004
9 changed files with 57 additions and 28 deletions

View File

@@ -580,7 +580,7 @@ EX void killMonster(cell *c, eMonster who, flagtype deathflags IS(0)) {
princess::reviveAt = gold(NO_LOVE) + 20; princess::reviveAt = gold(NO_LOVE) + 20;
} }
} }
if(princess::challenge) changes.at_commit([] { showMissionScreen(); }); if(princess::challenge) changes.at_commit([] { showMissionScreen(true); });
} }
} }

View File

@@ -469,7 +469,7 @@ EX void checkmove() {
if(!canmove) { if(!canmove) {
create_yasc_message(); create_yasc_message();
achievement_final(true); achievement_final(true);
if(cmode & sm::NORMAL) showMissionScreen(); if(cmode & sm::NORMAL) showMissionScreen(true);
} }
else yasc_message = ""; else yasc_message = "";

View File

@@ -653,7 +653,7 @@ struct info {
addMessage(XLAT("Congratulations! Your score is %1.", its(i->value))); addMessage(XLAT("Congratulations! Your score is %1.", its(i->value)));
achievement_gain_once("PRINCESS2", rg::princess); achievement_gain_once("PRINCESS2", rg::princess);
if(!cheater) achievement_score(LB_PRINCESS, i->value); if(!cheater) achievement_score(LB_PRINCESS, i->value);
LATE( showMissionScreen(); ) LATE( showMissionScreen(true); )
} }
} }
if(i->princess->land == laDungeon && !saved && !nodungeon) { if(i->princess->land == laDungeon && !saved && !nodungeon) {

View File

@@ -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]++; for(cell *c: currentmap->allcells()) if(among(c->wall, waMineMine, waMineUnknown) && mine::marked_mine(c)) kills[moTameBomberbird]++;
if(last && !kills[moBomberbird]) { if(last && !kills[moBomberbird]) {
mine::victory_time = getgametime(); mine::victory_time = getgametime();
showMissionScreen(); showMissionScreen(true);
} }
} }

View File

@@ -1101,6 +1101,7 @@ EX void initConfig() {
dialog::dialog_font_scale = 3; dialog::dialog_font_scale = 3;
dialog::display_keys = 3; dialog::display_keys = 3;
qm = false; qm = false;
separate_status = true;
} }
} }
} }
@@ -1111,7 +1112,11 @@ EX void initConfig() {
param_i(vid.msglimit, "message limit", 5); param_i(vid.msglimit, "message limit", 5);
param_i(vid.timeformat, "message log time format", 0); 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) param_b(resizable, "resizable", true)
-> editable("resizable window", 'r') -> editable("resizable window", 'r')
-> help("This lets your operating system resize the window."); -> help("This lets your operating system resize the window.");

View File

@@ -133,7 +133,7 @@ EX movedir vectodir(hyperpoint P) {
} }
EX void remission() { 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) { EX hyperpoint move_destination_vec(int d) {
@@ -656,7 +656,7 @@ EX void handleKeyNormal(int sym, int uni) {
else if(viewdists) else if(viewdists)
viewdists = false; viewdists = false;
else else
showMissionScreen(); showMissionScreen(true);
} }
if(sym == SDLK_F10) { if(sym == SDLK_F10) {
@@ -682,10 +682,10 @@ EX void handleKeyNormal(int sym, int uni) {
} }
if(sym == 'v' && DEFAULTNOR(sym)) if(sym == 'v' && DEFAULTNOR(sym))
showMissionScreen(); showMissionScreen(false);
if(sym == PSEUDOKEY_MENU) if(sym == PSEUDOKEY_MENU)
showMissionScreen(); showMissionScreen(false);
if(sym == PSEUDOKEY_NOHINT) if(sym == PSEUDOKEY_NOHINT)
no_find_player = true; no_find_player = true;
@@ -1425,7 +1425,7 @@ EX void handle_event(SDL_Event& ev) {
if(daily::on) daily::handleQuit(3); if(daily::on) daily::handleQuit(3);
else else
#endif #endif
if(needConfirmation() && !(cmode & sm::MISSION)) showMissionScreen(); if(needConfirmation() && !(cmode & sm::MISSION)) showMissionScreen(false);
else quitmainloop = true; else quitmainloop = true;
} }

View File

@@ -904,7 +904,7 @@ EX void handleInput(int delta, config &scfg) {
get_o_key().second(); get_o_key().second();
if(act[panReviewQuest].pressed()) if(act[panReviewQuest].pressed())
showMissionScreen(); showMissionScreen(true);
#if CAP_INV #if CAP_INV
if(act[panInventory].pressed() && inv::on) if(act[panInventory].pressed() && inv::on)

View File

@@ -136,7 +136,7 @@ EX hint hints[] = {
{ {
0, 0,
[]() { return !canmove; }, []() { return !canmove && dialog::display_keys != 3; },
[]() { []() {
dialog::addInfo(XLAT( dialog::addInfo(XLAT(
"Press ESC to view this screen during the game." "Press ESC to view this screen during the game."
@@ -149,11 +149,10 @@ EX hint hints[] = {
[]() { return in_full_game(); }, []() { return in_full_game(); },
[]() { []() {
dialog::addInfo( dialog::addInfo(
#if ISMOBILE (ISMOBILE || dialog::display_keys == 3) ?
XLAT("The 'world overview' shows all the lands in HyperRogue.") XLAT("The 'world overview' shows all the lands in HyperRogue.")
#else :
XLAT("Press 'o' to see all the lands in HyperRogue.") XLAT("Press 'o' to see all the lands in HyperRogue.")
#endif
); );
dialog::addBreak(50); dialog::addBreak(50);
dialog::addItem(XLAT("world overview") + " ", 'z'); dialog::addItem(XLAT("world overview") + " ", 'z');
@@ -330,13 +329,20 @@ eLand nextHyperstone() {
return laCrossroads; return laCrossroads;
} }
EX bool separate_status = true;
EX bool showing_status = true;
EX void showGameMenu() { EX void showGameMenu() {
cmode = sm::DOTOUR | sm::MISSION | sm::CENTER | sm::MAYDARK | sm::SIDE; cmode = sm::DOTOUR | sm::MISSION | sm::CENTER | sm::MAYDARK | sm::SIDE;
gamescreen(); drawStats(); gamescreen(); drawStats();
getcstat = SDLK_ESCAPE; 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 #if CAP_TOUR
tour::on ? (canmove ? XLAT("guided tour") : XLAT("GAME OVER")) : tour::on ? (canmove ? XLAT("guided tour") : XLAT("GAME OVER")) :
#endif #endif
@@ -347,7 +353,8 @@ EX void showGameMenu() {
XLAT("GAME OVER"), XLAT("GAME OVER"),
0xC00000, 200, 100 0xC00000, 200, 100
); );
if(!canmove && yasc_message != "") dialog::addInfo(yasc_message);
if(!canmove && yasc_message != "" && !skip_status) dialog::addInfo(yasc_message);
#if CAP_COMPLEX2 #if CAP_COMPLEX2
bool sweeper = mine::in_minesweeper(); bool sweeper = mine::in_minesweeper();
@@ -355,14 +362,15 @@ EX void showGameMenu() {
const bool sweeper = false; const bool sweeper = false;
#endif #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()))); 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()))); dialog::addInfo(XLAT("Enemies killed: %1", its(tkills())));
#if CAP_TOUR #if CAP_TOUR
if(tour::on) ; else if(tour::on) ; else
#endif #endif
if(skip_status) ; else
if(items[itOrbYendor]) { if(items[itOrbYendor]) {
dialog::addInfo(XLAT("Orbs of Yendor found: %1", its(items[itOrbYendor])), iinf[itOrbYendor].color); dialog::addInfo(XLAT("Orbs of Yendor found: %1", its(items[itOrbYendor])), iinf[itOrbYendor].color);
dialog::addInfo(XLAT("CONGRATULATIONS!"), iinf[itOrbYendor].color); dialog::addInfo(XLAT("CONGRATULATIONS!"), iinf[itOrbYendor].color);
@@ -426,7 +434,8 @@ EX void showGameMenu() {
if(canmove && !timerstart) if(canmove && !timerstart)
timerstart = time(NULL); timerstart = time(NULL);
if(princess::challenge) ; if(skip_status) ;
else if(princess::challenge) ;
#if CAP_TOUR #if CAP_TOUR
else if(tour::on) ; else if(tour::on) ;
#endif #endif
@@ -450,17 +459,17 @@ EX void showGameMenu() {
dialog::addInfo(XLAT("Hyperstone Quest completed!"), iinf[itHyperstone].color); dialog::addInfo(XLAT("Hyperstone Quest completed!"), iinf[itHyperstone].color);
} }
else dialog::addInfo(XLAT("Some lands unlock at specific treasures or kills")); 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); 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::addInfo(timeline(), dialog::dialogcolor);
} }
dialog::addBreak(100); if(!skip_status) dialog::addBreak(100);
#if CAP_TOUR #if CAP_TOUR
if(!tour::on) { if(!tour::on && !skip_status) {
hints[hinttoshow].display(); hints[hinttoshow].display();
dialog::addBreak(100); dialog::addBreak(100);
} }
@@ -472,6 +481,19 @@ EX void showGameMenu() {
intour = tour::on; intour = tour::on;
#endif #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(intour) {
#if CAP_TOUR #if CAP_TOUR
if(canmove) { if(canmove) {
@@ -681,7 +703,7 @@ EX int counthints() {
for(int h=0;; h++) if(hints[h].last < 0) return h; 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; cancel(); cancel = noaction;
popScreenAll(); popScreenAll();
achievement_final(false); achievement_final(false);
@@ -691,8 +713,10 @@ EX void showMissionScreen() {
pushScreen(daily::showMenu); pushScreen(daily::showMenu);
#endif #endif
} }
else else {
showing_status = start_showing_status;
pushScreen(showGameMenu); pushScreen(showGameMenu);
}
#if CAP_TOUR #if CAP_TOUR
if(!tour::on) if(!tour::on)

View File

@@ -1645,7 +1645,7 @@ EX eItem targetRangedOrb(orbAction a) {
useupOrb(itOrbMorph, 3); useupOrb(itOrbMorph, 3);
if(orig == moPlayer) { if(orig == moPlayer) {
achievement_final(true); achievement_final(true);
showMissionScreen(); showMissionScreen(true);
} }
return itOrbMorph; return itOrbMorph;
} }
@@ -2874,7 +2874,7 @@ EX void turn(int delta) {
} }
lastdead = pc[i]->dead; lastdead = pc[i]->dead;
if(lastcanmove && pc[i]->dead) showMissionScreen(); if(lastcanmove && pc[i]->dead) showMissionScreen(true);
canmove = canmove && !pc[i]->dead; canmove = canmove && !pc[i]->dead;
} }