1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-14 18:18: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;
}
}
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) {
create_yasc_message();
achievement_final(true);
if(cmode & sm::NORMAL) showMissionScreen();
if(cmode & sm::NORMAL) showMissionScreen(true);
}
else yasc_message = "";

View File

@@ -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) {

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]++;
if(last && !kills[moBomberbird]) {
mine::victory_time = getgametime();
showMissionScreen();
showMissionScreen(true);
}
}

View File

@@ -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.");

View File

@@ -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;
}

View File

@@ -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)

View File

@@ -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)

View File

@@ -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;
}