MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / execute

Method execute

src/bzflag/SaveWorldMenu.cpp:57–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void 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
84void SaveWorldMenu::resize(int _width, int _height) {
85 HUDDialog::resize(_width, _height);

Callers

nothing calls this directly

Calls 10

writeWorldMethod · 0.80
getStringWidthMethod · 0.80
getFMFaceMethod · 0.80
setStringMethod · 0.45
setMethod · 0.45
getStringMethod · 0.45
getFontFaceMethod · 0.45
getFontSizeMethod · 0.45
setPositionMethod · 0.45
getYMethod · 0.45

Tested by

no test coverage detected