Line 116... |
Line 116... |
116 |
game = m_pPackage->FindFirstGameInPackage();
|
116 |
game = m_pPackage->FindFirstGameInPackage();
|
117 |
}
|
117 |
}
|
118 |
|
118 |
|
119 |
SaveFileDialog ^ofd = gcnew SaveFileDialog();
|
119 |
SaveFileDialog ^ofd = gcnew SaveFileDialog();
|
120 |
ofd->Filter = "Zip Archive (*.zip)|*.zip";
|
120 |
ofd->Filter = "Zip Archive (*.zip)|*.zip";
|
121 |
ofd->FileName = _US((CFileIO(m_pPackage->filename()).dir() + "/" + CFileIO(m_pPackage->filename()).baseName() + "_" + CBaseFile::ConvertGameToString(game) + ".zip").findReplace("/", "\\"));
|
121 |
ofd->FileName = _US((CFileIO(m_pPackage->filename()).dir() + L"/" + CFileIO(m_pPackage->filename()).baseName() + L"_" + CBaseFile::ConvertGameToString(game).toWString() + L".zip").findReplace(L"/", L"\\"));
|
122 |
ofd->FilterIndex = 1;
|
122 |
ofd->FilterIndex = 1;
|
123 |
ofd->RestoreDirectory = true;
|
123 |
ofd->RestoreDirectory = true;
|
124 |
ofd->AddExtension = true;
|
124 |
ofd->AddExtension = true;
|
125 |
ofd->Title = "Select the archive to export to";
|
125 |
ofd->Title = "Select the archive to export to";
|
126 |
if ( ofd->ShowDialog(this) == Windows::Forms::DialogResult::OK )
|
126 |
if ( ofd->ShowDialog(this) == Windows::Forms::DialogResult::OK )
|
Line 5137... |
Line 5137... |
5137 |
FileType type = static_cast<FileType>((*itr)->data.token(" ", 1).toInt());
|
5137 |
FileType type = static_cast<FileType>((*itr)->data.token(" ", 1).toInt());
|
5138 |
if ( type == FileType::FILETYPE_UNKNOWN)
|
5138 |
if ( type == FileType::FILETYPE_UNKNOWN)
|
5139 |
continue;
|
5139 |
continue;
|
5140 |
|
5140 |
|
5141 |
FileType filetype = m_pP->adjustFileType((*itr)->str, type);
|
5141 |
FileType filetype = m_pP->adjustFileType((*itr)->str, type);
|
5142 |
Utils::String dir = (filetype == FILETYPE_EXTRA) ? "PluginManager/Extras/$scriptname" : "";
|
5142 |
Utils::WString dir = (filetype == FILETYPE_EXTRA) ? L"PluginManager/Extras/$scriptname" : L"";
|
5143 |
Utils::String checkDir = CFileIO((*itr)->str).dir().token("/", -1);
|
5143 |
Utils::WString checkDir = CFileIO((*itr)->str).dir().token(L"/", -1);
|
5144 |
if ( checkDir.Compare("types") )
|
5144 |
if ( checkDir.Compare(L"types") )
|
5145 |
dir = checkDir;
|
5145 |
dir = checkDir;
|
5146 |
|
5146 |
|
5147 |
C_File *f = m_pPackage->addFile((*itr)->str, dir, filetype);
|
5147 |
C_File *f = m_pPackage->addFile((*itr)->str, dir.toString(), filetype);
|
5148 |
if ( filetype == FILETYPE_MOD && CFileIO((*itr)->str).isFileExtension("cat"))
|
5148 |
if ( filetype == FILETYPE_MOD && CFileIO((*itr)->str).isFileExtension(L"cat"))
|
5149 |
m_pPackage->addFile(CFileIO((*itr)->str).changeFileExtension("dat"), "", filetype);
|
5149 |
m_pPackage->addFile(CFileIO((*itr)->str).changeFileExtension(L"dat").toString(), "", filetype);
|
5150 |
else if ( filetype == FILETYPE_MOD && CFileIO((*itr)->str).isFileExtension("dat"))
|
5150 |
else if ( filetype == FILETYPE_MOD && CFileIO((*itr)->str).isFileExtension(L"dat"))
|
5151 |
m_pPackage->addFile(CFileIO((*itr)->str).changeFileExtension("cat"), "", filetype);
|
5151 |
m_pPackage->addFile(CFileIO((*itr)->str).changeFileExtension(L"cat").toString(), "", filetype);
|
5152 |
}
|
5152 |
}
|
5153 |
this->UpdateFileList();
|
5153 |
this->UpdateFileList();
|
5154 |
this->UpdateDisplayPic();
|
5154 |
this->UpdateDisplayPic();
|
5155 |
this->UpdateChanged();
|
5155 |
this->UpdateChanged();
|
5156 |
}
|
5156 |
}
|
Line 5524... |
Line 5524... |
5524 |
FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
|
5524 |
FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
|
5525 |
fbd->Description = "Select the path to save the update file to";
|
5525 |
fbd->Description = "Select the path to save the update file to";
|
5526 |
fbd->SelectedPath = _US(CFileIO(m_pPackage->filename()).dir().findReplace("/", "\\"));
|
5526 |
fbd->SelectedPath = _US(CFileIO(m_pPackage->filename()).dir().findReplace("/", "\\"));
|
5527 |
if ( fbd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
|
5527 |
if ( fbd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
|
5528 |
{
|
5528 |
{
|
5529 |
Utils::String file = m_pPackage->createUpdateFile(_S(fbd->SelectedPath));
|
5529 |
Utils::WString file = m_pPackage->createUpdateFile(_WS(fbd->SelectedPath));
|
5530 |
if ( !file.empty() )
|
5530 |
if ( !file.empty() )
|
5531 |
MessageBox::Show(this, "Update file has been created\n" + _US(file) + "\n\nRemember to upload it your web server so its accessable\n" + _US(m_pPackage->webAddress()), "Update File Created", MessageBoxButtons::OK, MessageBoxIcon::Information);
|
5531 |
MessageBox::Show(this, "Update file has been created\n" + _US(file) + "\n\nRemember to upload it your web server so its accessable\n" + _US(m_pPackage->webAddress()), "Update File Created", MessageBoxButtons::OK, MessageBoxIcon::Information);
|
5532 |
}
|
5532 |
}
|
5533 |
}
|
5533 |
}
|
5534 |
}
|
5534 |
}
|