Line 964... |
Line 964... |
964 |
if ( ls->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
|
964 |
if ( ls->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
|
965 |
{
|
965 |
{
|
966 |
SStringList *str = list.FindString(CyStringFromSystemString(ls->GetData()));
|
966 |
SStringList *str = list.FindString(CyStringFromSystemString(ls->GetData()));
|
967 |
if ( str )
|
967 |
if ( str )
|
968 |
{
|
968 |
{
|
969 |
Creator::ImportShip ^import = gcnew Creator::ImportShip(m_pPackages, ofd->FileName, ls->GetData());
|
969 |
Creator::ImportShip ^import = gcnew Creator::ImportShip(m_pPackages, ofd->FileName, ls->GetData(), nullptr);
|
970 |
import->ShowDialog(this);
|
970 |
import->ShowDialog(this);
|
971 |
CXspFile *newShip = (import->Error()) ? NULL : import->GetShip();
|
971 |
CXspFile *newShip = (import->Error()) ? NULL : import->GetShip();
|
972 |
if ( !newShip )
|
972 |
if ( !newShip ) {
|
- |
|
973 |
if ( MessageBox::Show(this, "There was a problem when trying to import the ship\n" + ofd->FileName + " (" + ls->GetData() + ")\n\nError: " + import->getErrorString() + "\n\nWould you like to read files from another mod as well?", "Error Importing Ship", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == System::Windows::Forms::DialogResult::Yes ) {
|
- |
|
974 |
// load in another file
|
- |
|
975 |
System::String ^sFilename = ofd->FileName;
|
- |
|
976 |
if ( ofd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK ) {
|
- |
|
977 |
Creator::ImportShip ^import = gcnew Creator::ImportShip(m_pPackages, sFilename, ls->GetData(), ofd->FileName);
|
- |
|
978 |
import->ShowDialog(this);
|
- |
|
979 |
newShip = (import->Error()) ? NULL : import->GetShip();
|
- |
|
980 |
if ( !newShip ) {
|
973 |
MessageBox::Show(this, "There was a problem when trying to import the ship\n" + ofd->FileName + " (" + ls->GetData() + ")\n\nError: " + import->getErrorString(), "Error Importing Ship", MessageBoxButtons::OK, MessageBoxIcon::Error);
|
981 |
MessageBox::Show(this, "There was a problem when trying to import the ship\n" + ofd->FileName + " (" + ls->GetData() + ")\n\nError: " + import->getErrorString(), "Error Importing Ship", MessageBoxButtons::OK, MessageBoxIcon::Error);
|
974 |
else
|
982 |
}
|
- |
|
983 |
}
|
- |
|
984 |
}
|
- |
|
985 |
|
975 |
{
|
986 |
}
|
- |
|
987 |
if ( newShip ) {
|
976 |
PackageForm ^childForm = this->OpenPackage(true, newShip, "", "Imported Ship");
|
988 |
PackageForm ^childForm = this->OpenPackage(true, newShip, "", "Imported Ship");
|
977 |
childForm->Text = "Imported Ship";
|
989 |
childForm->Text = "Imported Ship";
|
978 |
newShip->SetChanged(true);
|
990 |
newShip->SetChanged(true);
|
979 |
childForm->UpdateChanged();
|
991 |
childForm->UpdateChanged();
|
980 |
}
|
992 |
}
|