mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-18 17:02:49 +00:00
fixed slide-backups restoration on tour quit
This commit is contained in:
parent
88d0188dee
commit
f962d5609d
28
system.cpp
28
system.cpp
@ -1547,13 +1547,6 @@ EX void set_variation(eVariation target) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void stop_tour() {
|
|
||||||
while(gamestack::pushed()) {
|
|
||||||
gamestack::pop();
|
|
||||||
stop_game();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EX void switch_game_mode(char switchWhat) {
|
EX void switch_game_mode(char switchWhat) {
|
||||||
DEBBI(DF_INIT, ("switch_game_mode ", switchWhat));
|
DEBBI(DF_INIT, ("switch_game_mode ", switchWhat));
|
||||||
switch(switchWhat) {
|
switch(switchWhat) {
|
||||||
@ -1566,7 +1559,6 @@ EX void switch_game_mode(char switchWhat) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case rg::dualmode:
|
case rg::dualmode:
|
||||||
stop_tour(); tour::on = false;
|
|
||||||
racing::on = false;
|
racing::on = false;
|
||||||
yendor::on = tactic::on = princess::challenge = false;
|
yendor::on = tactic::on = princess::challenge = false;
|
||||||
bow::weapon = bow::wBlade;
|
bow::weapon = bow::wBlade;
|
||||||
@ -1592,7 +1584,6 @@ EX void switch_game_mode(char switchWhat) {
|
|||||||
|
|
||||||
#if CAP_TOUR
|
#if CAP_TOUR
|
||||||
case rg::tour:
|
case rg::tour:
|
||||||
if(tour::on) stop_tour();
|
|
||||||
geometry = gNormal;
|
geometry = gNormal;
|
||||||
yendor::on = tactic::on = princess::challenge = peace::on = inv::on = false;
|
yendor::on = tactic::on = princess::challenge = peace::on = inv::on = false;
|
||||||
dual::disable();
|
dual::disable();
|
||||||
@ -1603,7 +1594,6 @@ EX void switch_game_mode(char switchWhat) {
|
|||||||
gp::param = gp::loc(1, 1);
|
gp::param = gp::loc(1, 1);
|
||||||
#endif
|
#endif
|
||||||
shmup::on = false;
|
shmup::on = false;
|
||||||
tour::on = !tour::on;
|
|
||||||
racing::on = false;
|
racing::on = false;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@ -1626,7 +1616,6 @@ EX void switch_game_mode(char switchWhat) {
|
|||||||
racing::on = !racing::on;
|
racing::on = !racing::on;
|
||||||
shmup::on = racing::on;
|
shmup::on = racing::on;
|
||||||
peace::on = false;
|
peace::on = false;
|
||||||
tour::on = false;
|
|
||||||
inv::on = false;
|
inv::on = false;
|
||||||
yendor::on = false;
|
yendor::on = false;
|
||||||
land_structure = racing::on ? lsSingle : lsNiceWalls;
|
land_structure = racing::on ? lsSingle : lsNiceWalls;
|
||||||
@ -1738,6 +1727,12 @@ EX void start_game() {
|
|||||||
// popAllScreens + popAllGames + stop_game + switch_game_mode + start_game
|
// popAllScreens + popAllGames + stop_game + switch_game_mode + start_game
|
||||||
EX void restart_game(char switchWhat IS(rg::nothing)) {
|
EX void restart_game(char switchWhat IS(rg::nothing)) {
|
||||||
popScreenAll();
|
popScreenAll();
|
||||||
|
stop_game_and_switch_mode(switchWhat);
|
||||||
|
start_game();
|
||||||
|
}
|
||||||
|
|
||||||
|
// stop_game + switch_game_mode
|
||||||
|
EX void stop_game_and_switch_mode(char switchWhat IS(rg::nothing)) {
|
||||||
#if CAP_RACING
|
#if CAP_RACING
|
||||||
if(switchWhat == rg::nothing && racing::on) {
|
if(switchWhat == rg::nothing && racing::on) {
|
||||||
racing::restore_goals();
|
racing::restore_goals();
|
||||||
@ -1746,15 +1741,12 @@ EX void restart_game(char switchWhat IS(rg::nothing)) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
bool b = (switchWhat == rg::tour && !tour::on);
|
||||||
|
if(tour::on && among(switchWhat, rg::racing, rg::tour, rg::dualmode))
|
||||||
|
tour::stop_tour();
|
||||||
stop_game();
|
stop_game();
|
||||||
switch_game_mode(switchWhat);
|
switch_game_mode(switchWhat);
|
||||||
start_game();
|
if(b) tour::on = true;
|
||||||
}
|
|
||||||
|
|
||||||
// stop_game + switch_game_mode
|
|
||||||
EX void stop_game_and_switch_mode(char switchWhat IS(rg::nothing)) {
|
|
||||||
stop_game();
|
|
||||||
switch_game_mode(switchWhat);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EX purehookset hooks_clearmemory;
|
EX purehookset hooks_clearmemory;
|
||||||
|
17
tour.cpp
17
tour.cpp
@ -234,6 +234,18 @@ void return_geometry() {
|
|||||||
addMessage(XLAT("Returned to your game."));
|
addMessage(XLAT("Returned to your game."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EX void return_geometries() {
|
||||||
|
while(gamestack::pushed()) return_geometry();
|
||||||
|
}
|
||||||
|
|
||||||
|
EX void stop_tour() {
|
||||||
|
if(!tour::on) return;
|
||||||
|
while(gamestack::pushed()) return_geometry();
|
||||||
|
presentation(pmStop);
|
||||||
|
slide_restore_all();
|
||||||
|
tour::on = false;
|
||||||
|
}
|
||||||
|
|
||||||
EX bool next_slide() {
|
EX bool next_slide() {
|
||||||
flagtype flags = slides[currentslide].flags;
|
flagtype flags = slides[currentslide].flags;
|
||||||
popScreenAll();
|
popScreenAll();
|
||||||
@ -575,11 +587,6 @@ EX void start() {
|
|||||||
if(!tour::on) {
|
if(!tour::on) {
|
||||||
initialize_slides();
|
initialize_slides();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
presentation(pmStop);
|
|
||||||
stop_game();
|
|
||||||
firstland = specialland = laIce;
|
|
||||||
}
|
|
||||||
restart_game(rg::tour);
|
restart_game(rg::tour);
|
||||||
if(tour::on) {
|
if(tour::on) {
|
||||||
if(texts) slidehelp();
|
if(texts) slidehelp();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user