1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-24 05:17:17 +00:00

rogueviz:: slide_error used

This commit is contained in:
Zeno Rogue 2021-03-31 12:19:11 +02:00
parent 367ff6f035
commit 4af75fe611
2 changed files with 7 additions and 8 deletions

View File

@ -354,13 +354,18 @@ auto fifteen_hook =
fifteen_slides.emplace_back( fifteen_slides.emplace_back(
tour::slide{s, 100, LEGAL::NONE | QUICKGEO, text, tour::slide{s, 100, LEGAL::NONE | QUICKGEO, text,
[=] (presmode mode) { [=] (presmode mode) {
string fname = "fifteen/" + lev + ".lev";
if(!file_exists(fname)) {
slide_error(mode, "file " + fname + " not found");
return;
}
setCanvas(mode, '0'); setCanvas(mode, '0');
if(mode == pmStart) { if(mode == pmStart) {
slide_backup(mapeditor::drawplayer, mapeditor::drawplayer); slide_backup(mapeditor::drawplayer, mapeditor::drawplayer);
slide_backup(vid.wallmode, 2); slide_backup(vid.wallmode, 2);
slide_backup(pconf.scale, .6); slide_backup(pconf.scale, .6);
stop_game(); stop_game();
mapstream::loadMap("fifteen/" + lev + ".lev"); mapstream::loadMap(fname);
fullcenter(); fullcenter();
if(lev == "coiled" || lev == "mobiusband") if(lev == "coiled" || lev == "mobiusband")
View = spin(90*degree) * View; View = spin(90*degree) * View;

View File

@ -373,13 +373,7 @@ void brick_slide(int i, presmode mode, eGeometry geom, eModel md, int anim) {
void ply_slide(tour::presmode mode, eGeometry geom, eModel md, bool anim) { void ply_slide(tour::presmode mode, eGeometry geom, eModel md, bool anim) {
using namespace tour; using namespace tour;
if(!ply::staircase.available()) { if(!ply::staircase.available()) {
empty_screen(mode, 0x400000); slide_error(mode, "(model not available)");
add_stat(mode, [] {
dialog::init();
dialog::addTitle("(model not available)", 0xFF0000, 150);
dialog::display();
return true;
});
return; return;
} }
if(mode == pmStartAll) { if(mode == pmStartAll) {