Exemplo n.º 1
0
void ProjectManager::ProccessFileOpenRequests()
{
	if (!m_requestedProjectFileNameToOpen.empty())
	{
		SetCurrentProject(m_requestedProjectFileNameToOpen.c_str());
		SetCurrentFile(m_requestedProjectFileNameToOpen.c_str());
		SaveLastDir(Platform::GetFileDirectory(m_requestedProjectFileNameToOpen.c_str()).c_str());
	}
	m_requestedProjectFileNameToOpen.clear();
}
Exemplo n.º 2
0
bool ProjectManager::Open()
{
	char filter[] = "Ethanon Project files (*.ethproj)\0*.ethproj\0\0";
	char path[512], file[512];
	string sLastDir = ReadLastDir();
	if (OpenForm(filter, "", path, file, sLastDir.c_str()))
	{
		SetCurrentProject(path);
		SetCurrentFile(path);
		SaveLastDir(ETHGlobal::GetPathName(path, true).c_str());
	}
	return true;
}
Exemplo n.º 3
0
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;
}
Exemplo n.º 4
0
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;
}