bool ProjectManager::SaveAs() { FILE_FORM_FILTER filter(GS_L("Ethanon Project files (*.ethproj)"), GS_L("ethproj")); char path[___OUTPUT_LENGTH], file[___OUTPUT_LENGTH]; std::string sLastDir = ReadLastDir(); if (SaveForm(filter, sLastDir.c_str(), path, file)) { std::string sOut; AddExtension(path, ".ethproj", sOut); std::ofstream ofs(sOut.c_str()); if (ofs.is_open()) { ofs << "Ethanon Engine project file"; ofs.close(); } SetCurrentFile(sOut.c_str()); SetCurrentProject(sOut.c_str()); SaveLastDir(Platform::GetFileDirectory(sOut.c_str()).c_str()); PrepareProjectDir(); } return true; }
bool ProjectManager::SaveAs() { char filter[] = "Ethanon Project files (*.ethproj)\0*.ethproj\0\0"; char path[___OUTPUT_LENGTH], file[___OUTPUT_LENGTH]; string sLastDir = ReadLastDir(); if (SaveForm(filter, "", path, file, sLastDir.c_str())) { string sOut; AddExtension(path, ".ethproj", sOut); std::ofstream ofs(sOut.c_str()); if (ofs.is_open()) { ofs << "Ethanon Engine project file"; ofs.close(); } SetCurrentFile(sOut.c_str()); SetCurrentProject(sOut.c_str()); SaveLastDir(ETHGlobal::GetPathName(sOut.c_str(), true).c_str()); PrepareProjectDir(); } return true; }