| 55 | } |
| 56 | |
| 57 | void SaveWorldMenu::execute() { |
| 58 | World* world = World::getWorld(); |
| 59 | if (world == NULL) { |
| 60 | status->setString("No world loaded to save"); |
| 61 | } |
| 62 | else { |
| 63 | std::string fullname; |
| 64 | BZDB.set("saveAsMeshes", "0"); |
| 65 | BZDB.set("saveFlatFile", "0"); |
| 66 | BZDB.set("saveAsOBJ", "0"); |
| 67 | if (world->writeWorld(filename->getString(), fullname)) { |
| 68 | std::string newLabel = "World Saved: "; |
| 69 | newLabel += fullname; |
| 70 | status->setString(newLabel); |
| 71 | } |
| 72 | else { |
| 73 | std::string newLabel = "Error Saving: "; |
| 74 | newLabel += fullname; |
| 75 | status->setString(newLabel); |
| 76 | } |
| 77 | } |
| 78 | FontManager& fm = FontManager::instance(); |
| 79 | const float statusWidth = fm.getStringWidth(status->getFontFace()->getFMFace(), |
| 80 | status->getFontSize(), status->getString()); |
| 81 | status->setPosition(0.5f * ((float)width - statusWidth), status->getY()); |
| 82 | } |
| 83 | |
| 84 | void SaveWorldMenu::resize(int _width, int _height) { |
| 85 | HUDDialog::resize(_width, _height); |
nothing calls this directly
no test coverage detected