| Line 137... |
Line 137... |
| 137 |
/// Clean up any resources being used.
|
137 |
/// Clean up any resources being used.
|
| 138 |
/// </summary>
|
138 |
/// </summary>
|
| 139 |
~PackageForm();
|
139 |
~PackageForm();
|
| 140 |
|
140 |
|
| 141 |
private:
|
141 |
private:
|
| 142 |
void DropGetDirectories(String ^dir, CyStringList *list, bool packages);
|
142 |
void DropGetDirectories(String ^dir, Utils::CStringList *list, bool packages);
|
| 143 |
void UpdateMirrors();
|
143 |
void UpdateMirrors();
|
| 144 |
void UpdatePackageNames();
|
144 |
void UpdatePackageNames();
|
| 145 |
void UpdateView();
|
145 |
void UpdateView();
|
| 146 |
void Setup();
|
146 |
void Setup();
|
| 147 |
void AddFile(C_File *file);
|
147 |
void AddFile(C_File *file);
|
| Line 5112... |
Line 5112... |
| 5112 |
}
|
5112 |
}
|
| 5113 |
private: System::Void ListFiles_DragDrop(System::Object^ sender, System::Windows::Forms::DragEventArgs^ e) {
|
5113 |
private: System::Void ListFiles_DragDrop(System::Object^ sender, System::Windows::Forms::DragEventArgs^ e) {
|
| 5114 |
// dropping from outside
|
5114 |
// dropping from outside
|
| 5115 |
if ( e->Data->GetDataPresent(DataFormats::FileDrop) )
|
5115 |
if ( e->Data->GetDataPresent(DataFormats::FileDrop) )
|
| 5116 |
{
|
5116 |
{
|
| 5117 |
CyStringList fileList;
|
5117 |
Utils::CStringList fileList;
|
| 5118 |
cli::array<String ^> ^a = (cli::array<String ^> ^)e->Data->GetData(DataFormats::FileDrop, false);
|
5118 |
cli::array<String ^> ^a = (cli::array<String ^> ^)e->Data->GetData(DataFormats::FileDrop, false);
|
| 5119 |
int i;
|
5119 |
int i;
|
| 5120 |
for(i = 0; i < a->Length; i++)
|
5120 |
for(i = 0; i < a->Length; i++)
|
| 5121 |
{
|
5121 |
{
|
| 5122 |
if ( IO::DirectoryInfo(a[i]).Exists )
|
5122 |
if ( IO::DirectoryInfo(a[i]).Exists )
|
| 5123 |
this->DropGetDirectories(a[i], &fileList, false);
|
5123 |
this->DropGetDirectories(a[i], &fileList, false);
|
| 5124 |
else
|
5124 |
else
|
| 5125 |
fileList.PushBack(CyStringFromSystemString(a[i]), CyString::Number(SPK::GetAutomaticFiletype(_S(a[i]), NULL, false)));
|
5125 |
fileList.pushBack(_S(a[i]), Utils::String::Number(SPK::GetAutomaticFiletype(_S(a[i]), NULL, false)));
|
| 5126 |
}
|
5126 |
}
|
| 5127 |
|
5127 |
|
| 5128 |
SPK::AssignAutomaticFiletypes(&fileList);
|
5128 |
SPK::AssignAutomaticFiletypes(fileList);
|
| 5129 |
|
5129 |
|
| 5130 |
if ( !fileList.Empty() )
|
5130 |
if ( !fileList.empty() )
|
| 5131 |
{
|
5131 |
{
|
| 5132 |
SpkExplorer::DropFileDialog ^dropType = gcnew SpkExplorer::DropFileDialog(&fileList);
|
5132 |
SpkExplorer::DropFileDialog ^dropType = gcnew SpkExplorer::DropFileDialog(&fileList);
|
| 5133 |
if ( dropType->ShowDialog(this) == Windows::Forms::DialogResult::OK )
|
5133 |
if ( dropType->ShowDialog(this) == Windows::Forms::DialogResult::OK )
|
| 5134 |
{
|
5134 |
{
|
| 5135 |
for ( SStringList *str = fileList.Head(); str; str = str->next )
|
5135 |
for(auto itr = fileList.begin(); itr != fileList.end(); itr++)
|
| 5136 |
{
|
5136 |
{
|
| 5137 |
FileType type = static_cast<FileType>(str->data.GetToken(" ", 1, 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(str->str.ToString(), type);
|
5141 |
FileType filetype = m_pP->adjustFileType((*itr)->str, type);
|
| 5142 |
Utils::String dir = (filetype == FILETYPE_EXTRA) ? "PluginManager/Extras/$scriptname" : "";
|
5142 |
Utils::String dir = (filetype == FILETYPE_EXTRA) ? "PluginManager/Extras/$scriptname" : "";
|
| 5143 |
Utils::String checkDir = CFileIO(str->str).dir().token("/", -1);
|
5143 |
Utils::String checkDir = CFileIO((*itr)->str).dir().token("/", -1);
|
| 5144 |
if ( checkDir.Compare("types") )
|
5144 |
if ( checkDir.Compare("types") )
|
| 5145 |
dir = checkDir;
|
5145 |
dir = checkDir;
|
| 5146 |
|
5146 |
|
| 5147 |
C_File *f = m_pPackage->addFile(str->str.ToString(), dir, filetype);
|
5147 |
C_File *f = m_pPackage->addFile((*itr)->str, dir, filetype);
|
| 5148 |
if ( filetype == FILETYPE_MOD && CFileIO(str->str).isFileExtension("cat"))
|
5148 |
if ( filetype == FILETYPE_MOD && CFileIO((*itr)->str).isFileExtension("cat"))
|
| 5149 |
m_pPackage->addFile(CFileIO(str->str).changeFileExtension("dat"), "", filetype);
|
5149 |
m_pPackage->addFile(CFileIO((*itr)->str).changeFileExtension("dat"), "", filetype);
|
| 5150 |
else if ( filetype == FILETYPE_MOD && CFileIO(str->str).isFileExtension("dat"))
|
5150 |
else if ( filetype == FILETYPE_MOD && CFileIO((*itr)->str).isFileExtension("dat"))
|
| 5151 |
m_pPackage->addFile(CFileIO(str->str).changeFileExtension("cat"), "", filetype);
|
5151 |
m_pPackage->addFile(CFileIO((*itr)->str).changeFileExtension("cat"), "", filetype);
|
| 5152 |
}
|
5152 |
}
|
| 5153 |
this->UpdateFileList();
|
5153 |
this->UpdateFileList();
|
| 5154 |
this->UpdateDisplayPic();
|
5154 |
this->UpdateDisplayPic();
|
| 5155 |
this->UpdateChanged();
|
5155 |
this->UpdateChanged();
|
| 5156 |
}
|
5156 |
}
|