1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

moved the remaining slides away from rogueviz.cpp

This commit is contained in:
Zeno Rogue 2020-03-29 13:52:10 +02:00
parent 505046e32f
commit 4384f65962
5 changed files with 101 additions and 81 deletions

View File

@ -553,6 +553,46 @@ int readArgs() {
auto hook = addHook(hooks_args, 100, readArgs)
+ addHook(hooks_initgame, 100, bantar)
+ addHook(hooks_frame, 100, bantar_stats);
+ addHook(hooks_frame, 100, bantar_stats)
+ addHook(rvtour::hooks_build_rvtour, 100, [] (vector<tour::slide>& v) {
using namespace rvtour;
v.push_back(
tour::slide{"Banach-Tarski-like", 62, LEGAL::NONE,
"Banach-Tarski-like decomposition. Break a hyperbolic plane into two hyperbolic planes.\n\n"
"Press '5' to show the decomposition. Press any key to stop.\n\n"
"You will see a map of the decomposition. Press '5' again to return.",
[] (presmode mode) {
slidecommand = "Banach-Tarski switch";
if(mode == 3) {
while(gamestack::pushed()) stop_game(), gamestack::pop();
banachtarski::bmap = false;
banachtarski::on = false;
}
if(mode == 4) {
if(!banachtarski::on) {
bool b = mapeditor::drawplayer;
specialland = cwt.at->land;
gamestack::push();
banachtarski::init_bantar();
airmap.clear();
dynamicval<int> vs(sightrange_bonus, 3);
dynamicval<int> vg(genrange_bonus, 3);
doOvergenerate();
banachtarski::bantar_anim();
quitmainloop = false;
mapeditor::drawplayer = b;
banachtarski::init_bantar_map();
resetview();
}
else if(banachtarski::on && banachtarski::bmap) {
banachtarski::bmap = false;
banachtarski::on = false;
gamestack::pop();
}
}
}}
);
});
}}

View File

@ -344,7 +344,29 @@ bool handleKey(int sym, int uni) {
auto xhook = addHook(hooks_args, 100, readArgs)
+ addHook(hooks_handleKey, 0, handleKey)
+ addHook(hooks_prestats, 0, frame)
+ addHook(clearmemory, 40, [] () { snubon = false; } );
+ addHook(clearmemory, 40, [] () { snubon = false; } )
+ addHook(rvtour::hooks_build_rvtour, 100, [] (vector<tour::slide>& v) {
using namespace tour;
v.push_back(
tour::slide{"Pentagonal Exploration", 62, LEGAL::NONE | QUICKGEO,
"Pentagonal Exploration explained at: http://www.roguetemple.com/z/sims/snub/\n\n"
"Move the mouse nearer and further away from the X.\n\n"
"Press 3 4 5 6 7 8 9 shift+4 shift+5 shift+6 to change the geometry.",
[] (presmode mode) {
if(mode == 1) {
pentagonal::run_snub(5, 3);
}
if(mode == 3) {
printf("stopping\n");
set_geometry(gNormal);
set_variation(eVariation::bitruncated);
rug::close();
start_game();
}
}}
);
});
}
#endif

View File

@ -1416,83 +1416,6 @@ vector<slide> rvslides_default = {
if(mode == 3) patPalace.color = 0xFFD50000;
}
},
{"Tree of Life", 61, LEGAL::UNLIMITED | QUICKGEO,
"Not described.",
roguevizslide('0', [] () {
rogueviz::dftcolor = 0x206020FF;
rogueviz::showlabels = true;
rogueviz::on = true;
gmatrix.clear();
drawthemap();
gmatrix0 = gmatrix;
rogueviz::tree::read(RVPATH "treeoflife/tol.txt");
})},
{"Spiral Staircase", 62, LEGAL::NONE | QUICKGEO,
"Spiral Staircase Demo. Press '5' to change the curvature or other parameters.",
[] (presmode mode) {
if(mode == 1) staircase::make_staircase();
if(mode == 3) rug::close();
slidecommand = "staircase menu";
if(mode == 4) pushScreen(staircase::showMenu);
}},
{"Banach-Tarski-like", 62, LEGAL::NONE,
"Banach-Tarski-like decomposition. Break a hyperbolic plane into two hyperbolic planes.\n\n"
"Press '5' to show the decomposition. Press any key to stop.\n\n"
"You will see a map of the decomposition. Press '5' again to return.",
[] (presmode mode) {
slidecommand = "staircase menu";
if(mode == 3) {
while(gamestack::pushed()) stop_game(), gamestack::pop();
banachtarski::bmap = false;
banachtarski::on = false;
}
if(mode == 4) {
if(!banachtarski::on) {
bool b = mapeditor::drawplayer;
specialland = cwt.at->land;
gamestack::push();
banachtarski::init_bantar();
airmap.clear();
dynamicval<int> vs(sightrange_bonus, 3);
dynamicval<int> vg(genrange_bonus, 3);
doOvergenerate();
banachtarski::bantar_anim();
quitmainloop = false;
mapeditor::drawplayer = b;
banachtarski::init_bantar_map();
resetview();
}
else if(banachtarski::on && banachtarski::bmap) {
banachtarski::bmap = false;
banachtarski::on = false;
gamestack::pop();
}
}
}},
{"Pentagonal Exploration", 62, LEGAL::NONE | QUICKGEO,
"Pentagonal Exploration explained at: http://www.roguetemple.com/z/sims/snub/\n\n"
"Move the mouse nearer and further away from the X.\n\n"
"Press 3 4 5 6 7 8 9 shift+4 shift+5 shift+6 to change the geometry.",
[] (presmode mode) {
if(mode == 1) {
pentagonal::run_snub(5, 3);
}
if(mode == 3) {
printf("stopping\n");
set_geometry(gNormal);
set_variation(eVariation::bitruncated);
rug::close();
start_game();
}
}},
};
int rvtour_hooks =

View File

@ -346,6 +346,20 @@ int readArgs() {
#endif
int phooks = addHook(hooks_args, 100, readArgs)
+ addHook(hooks_fixticks, 100, check);
+ addHook(hooks_fixticks, 100, check)
+ addHook(rvtour::hooks_build_rvtour, 100, [] (vector<tour::slide>& v) {
using namespace tour;
v.push_back(
tour::slide{"Spiral Staircase", 62, LEGAL::NONE | QUICKGEO,
"Spiral Staircase Demo. Press '5' to change the curvature or other parameters.",
[] (presmode mode) {
if(mode == 1) staircase::make_staircase();
if(mode == 3) rug::close();
slidecommand = "staircase menu";
if(mode == 4) pushScreen(staircase::showMenu);
}}
);
});
}}

View File

@ -119,7 +119,28 @@ int readArgs() {
return 0;
}
int ah = addHook(hooks_args, 100, readArgs);
int ah = addHook(hooks_args, 100, readArgs)
+ addHook(rvtour::hooks_build_rvtour, 100, [] (vector<tour::slide>& v) {
using namespace rvtour;
v.push_back(
tour::slide{"Tree of Life", 61, LEGAL::UNLIMITED | QUICKGEO,
"Not described.",
roguevizslide('0', [] () {
rogueviz::dftcolor = 0x206020FF;
rogueviz::showlabels = true;
rogueviz::on = true;
gmatrix.clear();
drawthemap();
gmatrix0 = gmatrix;
rogueviz::tree::read(RVPATH "treeoflife/tol.txt");
})}
);
});
#endif
}