Esempio n. 1
0
OPENFILENAME GetScSaveOfn(char* szFileName)
{
    return GetOfn(
        szFileName,
        "Starcraft Map(*.scm)\0*.scm\0Starcraft Hybrid Map(*.scm)\0*.scm\0Broodwar Map(*.scx)\0*.scx\0Raw Starcraft Map(*.chk)\0*.chk\0Raw Starcraft Hybrid Map(*.chk)\0*.chk\0Raw Broodwar Map(*.chk)\0*.chk\0All Maps\0*.scm;*.scx;*.chk\0",
        7 );
}
Esempio n. 2
0
OPENFILENAME GetWavSaveOfn(char* szFileName)
{
    return GetOfn(
        szFileName,
        "WAV File\0*.wav\0All Files\0*.*\0",
        1 );
}
Esempio n. 3
0
void StringEditorWindow::saveStrings()
{
	char filePath[MAX_PATH] = { };
	OPENFILENAME ofn = GetOfn(filePath, "Text Documents(*.txt)\0*.txt\0All Files\0*\0", 0);
	if ( GetSaveFileName(&ofn) )
	{
		if ( ofn.nFilterIndex == 1 && std::strstr(filePath, ".txt") == nullptr )
			std::strcat(filePath, ".txt");

		DeleteFileA(filePath);

		std::ofstream outFile(filePath, std::ofstream::out);
		if ( outFile.is_open() )
		{
			ChkdString str;
			for ( u32 i=0; i<chkd.maps.curr->numStrSlots(); i++ )
			{
				if ( chkd.maps.curr->GetString(str, i) && str.size() > 0 )
					outFile << i << ": " << str << "\r\n";
			}
			outFile.close();
		}
	}
}