Subversion Repositories spk

Rev

Rev 94 | Rev 125 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 94 Rev 102
Line 161... Line 161...
161
				game = m_pPackage->FindFirstGameInPackage();
161
				game = m_pPackage->FindFirstGameInPackage();
162
			}
162
			}
163
 
163
 
164
			SaveFileDialog ^ofd = gcnew SaveFileDialog();
164
			SaveFileDialog ^ofd = gcnew SaveFileDialog();
165
			ofd->Filter = "Zip Archive (*.zip)|*.zip";
165
			ofd->Filter = "Zip Archive (*.zip)|*.zip";
166
			ofd->FileName = SystemStringFromCyString((CFileIO(m_pPackage->filename()).GetDir() + "/" + CFileIO(m_pPackage->filename()).baseName() + "_" + CBaseFile::ConvertGameToString(game) + ".zip").FindReplace("/", "\\"));
166
			ofd->FileName = _US((CFileIO(m_pPackage->filename()).dir() + "/" + CFileIO(m_pPackage->filename()).baseName() + "_" + CBaseFile::ConvertGameToString(game) + ".zip").findReplace("/", "\\"));
167
			ofd->FilterIndex = 1;
167
			ofd->FilterIndex = 1;
168
			ofd->RestoreDirectory = true;
168
			ofd->RestoreDirectory = true;
169
			ofd->AddExtension =  true;
169
			ofd->AddExtension =  true;
170
			ofd->Title = "Select the archive to export to";
170
			ofd->Title = "Select the archive to export to";
171
			if ( ofd->ShowDialog(this) == Windows::Forms::DialogResult::OK )
171
			if ( ofd->ShowDialog(this) == Windows::Forms::DialogResult::OK )
Line 4992... Line 4992...
4992
						if ( type == -1 )
4992
						if ( type == -1 )
4993
							continue;
4993
							continue;
4994
 
4994
 
4995
						int filetype = m_pP->AdjustFileType(str->str, type);
4995
						int filetype = m_pP->AdjustFileType(str->str, type);
4996
						CyString dir = (filetype == FILETYPE_EXTRA) ? "PluginManager/Extras/$scriptname" : "";
4996
						CyString dir = (filetype == FILETYPE_EXTRA) ? "PluginManager/Extras/$scriptname" : "";
4997
						CyString checkDir = CFileIO(str->str).GetDir().GetToken("/", -1);
4997
						CyString checkDir = CFileIO(str->str).dir().token("/", -1);
4998
						if ( checkDir.Compare("types") )
4998
						if ( checkDir.Compare("types") )
4999
							dir = checkDir;
4999
							dir = checkDir;
5000
 
5000
 
5001
						C_File *f = m_pPackage->AddFile(str->str, dir, filetype);
5001
						C_File *f = m_pPackage->AddFile(str->str, dir, filetype);
5002
						if ( filetype == FILETYPE_MOD && CFileIO(str->str).CheckFileExtension("cat"))
5002
						if ( filetype == FILETYPE_MOD && CFileIO(str->str).CheckFileExtension("cat"))
Line 5375... Line 5375...
5375
				 MessageBox::Show(this, "You dont have a primary web address set, you need an address for automatic updates to work", "No Web Address", MessageBoxButtons::OK, MessageBoxIcon::Asterisk);
5375
				 MessageBox::Show(this, "You dont have a primary web address set, you need an address for automatic updates to work", "No Web Address", MessageBoxButtons::OK, MessageBoxIcon::Asterisk);
5376
			 else
5376
			 else
5377
			 {
5377
			 {
5378
				FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
5378
				FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
5379
				fbd->Description = "Select the path to save the update file to";
5379
				fbd->Description = "Select the path to save the update file to";
5380
				fbd->SelectedPath = SystemStringFromCyString(CFileIO(m_pPackage->filename()).GetDir().FindReplace("/", "\\"));
5380
				fbd->SelectedPath = SystemStringFromCyString(CFileIO(m_pPackage->filename()).dir().findReplace("/", "\\"));
5381
				if ( fbd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
5381
				if ( fbd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
5382
				{
5382
				{
5383
					CyString file = m_pPackage->CreateUpdateFile(CyStringFromSystemString(fbd->SelectedPath));
5383
					CyString file = m_pPackage->CreateUpdateFile(CyStringFromSystemString(fbd->SelectedPath));
5384
					if ( !file.Empty() )
5384
					if ( !file.Empty() )
5385
						MessageBox::Show(this, "Update file has been created\n" + SystemStringFromCyString(file) + "\n\nRemember to upload it your web server so its accessable\n" + _US(m_pPackage->webAddress()), "Update File Created", MessageBoxButtons::OK, MessageBoxIcon::Information);
5385
						MessageBox::Show(this, "Update file has been created\n" + SystemStringFromCyString(file) + "\n\nRemember to upload it your web server so its accessable\n" + _US(m_pPackage->webAddress()), "Update File Created", MessageBoxButtons::OK, MessageBoxIcon::Information);