mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-22 23:17:04 +00:00
mapeditor now saves/loads file online
This commit is contained in:
parent
9f1762f0c1
commit
a0865998db
@ -1349,6 +1349,10 @@ EX namespace mapeditor {
|
||||
}
|
||||
|
||||
void save_level() {
|
||||
#if ISWEB
|
||||
mapstream::saveMap("web.lev");
|
||||
offer_download("web.lev", "mime/type");
|
||||
#else
|
||||
dialog::openFileDialog(levelfile, XLAT("level to save:"), ".lev", [] () {
|
||||
if(mapstream::saveMap(levelfile.c_str())) {
|
||||
addMessage(XLAT("Map saved to %1", levelfile));
|
||||
@ -1359,9 +1363,15 @@ EX namespace mapeditor {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
void load_level() {
|
||||
#if ISWEB
|
||||
offer_choose_file([] {
|
||||
mapstream::loadMap("data.txt");
|
||||
});
|
||||
#else
|
||||
dialog::openFileDialog(levelfile, XLAT("level to load:"), ".lev", [] () {
|
||||
if(mapstream::loadMap(levelfile.c_str())) {
|
||||
addMessage(XLAT("Map loaded from %1", levelfile));
|
||||
@ -1372,6 +1382,7 @@ EX namespace mapeditor {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
void showList() {
|
||||
|
Loading…
Reference in New Issue
Block a user