mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00:34 +00:00
save/load rug in menus
This commit is contained in:
parent
244188283b
commit
72a46b9029
2
rug.cpp
2
rug.cpp
@ -1511,7 +1511,7 @@ EX void show() {
|
||||
edit_levellines('L');
|
||||
|
||||
#if CAP_SURFACE
|
||||
if(hyperbolic && rug_euclid())
|
||||
if(hyperbolic)
|
||||
dialog::addItem(XLAT("smooth surfaces"), 'c');
|
||||
else
|
||||
dialog::addBreak(100);
|
||||
|
17
surface.cpp
17
surface.cpp
@ -605,6 +605,7 @@ EX void run_shape(eShape s) {
|
||||
sh = s;
|
||||
|
||||
if(rug::rugged) rug::close();
|
||||
rug::gwhere = rug::rgEuclid;
|
||||
|
||||
rug::init();
|
||||
// if(!rug::rugged) rug::reopen();
|
||||
@ -707,6 +708,13 @@ EX void show_surfaces() {
|
||||
dialog::addSelItem(XLAT("display coverage"), cstyles[coverage_style], 'c');
|
||||
else dialog::addBreak(100);
|
||||
|
||||
#if CAP_FILES
|
||||
if(rug::rugged)
|
||||
dialog::addItem(XLAT("save the current embedding"), 's');
|
||||
else
|
||||
dialog::addItem(XLAT("load a saved embedding"), 's');
|
||||
#endif
|
||||
|
||||
dialog::addHelp();
|
||||
dialog::addBack();
|
||||
|
||||
@ -725,6 +733,15 @@ EX void show_surfaces() {
|
||||
"For convenience, you can also choose other 3D models from this menu."
|
||||
));
|
||||
|
||||
#if CAP_FILES
|
||||
else if(uni == 's') {
|
||||
static string rugname = "saved.rug";
|
||||
if(rug::rugged)
|
||||
dialog::openFileDialog(rugname, XLAT("save embedding to:"), ".rug", [] () { rug::rug_save(rugname); return true; });
|
||||
else
|
||||
dialog::openFileDialog(rugname, XLAT("load embedding from:"), ".rug", [] () { rug::init(); rug::rug_load(rugname); return true; });
|
||||
}
|
||||
#endif
|
||||
else if(uni == '1')
|
||||
run_shape(dsTractricoid);
|
||||
else if(uni == '2')
|
||||
|
Loading…
Reference in New Issue
Block a user