aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-26 02:19:41 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-03-26 08:37:15 +0300
commit405347769a2f8c73aead3bc2b64fdc4d81763921 (patch)
tree65ab3580caa279407436c0b5ed97b8a329d4f537 /src/main.cpp
parent5b31d32da8b1dc8b5e60b495bdfc20a563487cc7 (diff)
downloadminetest-405347769a2f8c73aead3bc2b64fdc4d81763921.tar.gz
minetest-405347769a2f8c73aead3bc2b64fdc4d81763921.tar.bz2
minetest-405347769a2f8c73aead3bc2b64fdc4d81763921.zip
New world removal GUI code
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 41b62b1dd..8a6504194 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1446,6 +1446,24 @@ int main(int argc, char *argv[])
if(skip_main_menu == false)
{
+ video::IVideoDriver* driver = device->getVideoDriver();
+
+ infostream<<"Waiting for other menus"<<std::endl;
+ while(device->run() && kill == false)
+ {
+ if(noMenuActive())
+ break;
+ driver->beginScene(true, true,
+ video::SColor(255,128,128,128));
+ drawMenuBackground(driver);
+ guienv->drawAll();
+ driver->endScene();
+ // On some computers framerate doesn't seem to be
+ // automatically limited
+ sleep_ms(25);
+ }
+ infostream<<"Waited for other menus"<<std::endl;
+
GUIMainMenu *menu =
new GUIMainMenu(guienv, guiroot, -1,
&g_menumgr, &menudata, g_gamecallback);
@@ -1463,8 +1481,6 @@ int main(int argc, char *argv[])
error_message = L"";
}
- video::IVideoDriver* driver = device->getVideoDriver();
-
infostream<<"Created main menu"<<std::endl;
while(device->run() && kill == false)
@@ -1538,19 +1554,13 @@ int main(int argc, char *argv[])
infostream<<"Selected world: "<<worldspec.name
<<" ["<<worldspec.path<<"]"<<std::endl;
}
-
- // Delete world if requested
- if(menudata.delete_world_spec.isValid())
- {
- bool r = fs::RecursiveDeleteContent(
- menudata.delete_world_spec.path);
- if(r == false){
- error_message = L"World delete failed";
- errorstream<<wide_to_narrow(error_message)<<std::endl;
- }
+
+ // Only refresh if so requested
+ if(menudata.only_refresh){
+ infostream<<"Refreshing menu"<<std::endl;
continue;
}
-
+
// Create new world if requested
if(menudata.create_world_name != L"")
{