| Line 438... |
Line 438... |
| 438 |
ofd->RestoreDirectory = true;
|
438 |
ofd->RestoreDirectory = true;
|
| 439 |
ofd->AddExtension = true;
|
439 |
ofd->AddExtension = true;
|
| 440 |
ofd->Title = "Select the diff file to save changes to";
|
440 |
ofd->Title = "Select the diff file to save changes to";
|
| 441 |
if ( ofd->ShowDialog(this) == Windows::Forms::DialogResult::OK )
|
441 |
if ( ofd->ShowDialog(this) == Windows::Forms::DialogResult::OK )
|
| 442 |
{
|
442 |
{
|
| 443 |
CModDiff Diff(CyStringFromSystemString(this->comboBox1->Text).GetToken(" (", 1, 1), this->comboBox2->SelectedIndex);
|
443 |
CModDiff Diff(_S(this->comboBox1->Text).token(" (", 1), "addon", this->comboBox2->SelectedIndex);
|
| 444 |
if ( !Diff.CreateDiff(CyStringFromSystemString(this->textBox1->Text)) )
|
444 |
if ( !Diff.CreateDiff(_S(this->textBox1->Text)) )
|
| 445 |
{
|
445 |
{
|
| 446 |
MessageBox::Show(this, "Unable to create diff from mod:\n" + this->textBox1->Text, "Create Diff", MessageBoxButtons::OK, MessageBoxIcon::Error);
|
446 |
MessageBox::Show(this, "Unable to create diff from mod:\n" + this->textBox1->Text, "Create Diff", MessageBoxButtons::OK, MessageBoxIcon::Error);
|
| 447 |
Close();
|
447 |
Close();
|
| 448 |
}
|
448 |
}
|
| 449 |
|
449 |
|
| 450 |
if ( !Diff.WriteDiff(CyStringFromSystemString(ofd->FileName)) )
|
450 |
if ( !Diff.WriteDiff(_S(ofd->FileName)) )
|
| 451 |
{
|
451 |
{
|
| 452 |
MessageBox::Show(this, "Unable to write diff file:\n" + ofd->FileName, "Create Diff", MessageBoxButtons::OK, MessageBoxIcon::Error);
|
452 |
MessageBox::Show(this, "Unable to write diff file:\n" + ofd->FileName, "Create Diff", MessageBoxButtons::OK, MessageBoxIcon::Error);
|
| 453 |
Close();
|
453 |
Close();
|
| 454 |
}
|
454 |
}
|
| 455 |
|
455 |
|
| Line 463... |
Line 463... |
| 463 |
ofd->FilterIndex = 1;
|
463 |
ofd->FilterIndex = 1;
|
| 464 |
ofd->RestoreDirectory = true;
|
464 |
ofd->RestoreDirectory = true;
|
| 465 |
ofd->Title = "Select the diff file to apply to the mod";
|
465 |
ofd->Title = "Select the diff file to apply to the mod";
|
| 466 |
if ( ofd->ShowDialog(this) == Windows::Forms::DialogResult::OK )
|
466 |
if ( ofd->ShowDialog(this) == Windows::Forms::DialogResult::OK )
|
| 467 |
{
|
467 |
{
|
| 468 |
CModDiff Diff(CyStringFromSystemString(this->comboBox1->Text).GetToken(" (", 1, 1), this->comboBox2->SelectedIndex);
|
468 |
CModDiff Diff(_S(this->comboBox1->Text).token(" (", 1), "addon", this->comboBox2->SelectedIndex);
|
| 469 |
Diff.ApplyDiff(CyStringFromSystemString(this->textBox1->Text));
|
469 |
Diff.ApplyDiff(_S(this->textBox1->Text));
|
| 470 |
if ( !Diff.ReadDiff(CyStringFromSystemString(ofd->FileName)) )
|
470 |
if ( !Diff.ReadDiff(_S(ofd->FileName)) )
|
| 471 |
{
|
471 |
{
|
| 472 |
MessageBox::Show(this, "Unable to read diff file:\n" + ofd->FileName, "Apply Diff", MessageBoxButtons::OK, MessageBoxIcon::Error);
|
472 |
MessageBox::Show(this, "Unable to read diff file:\n" + ofd->FileName, "Apply Diff", MessageBoxButtons::OK, MessageBoxIcon::Error);
|
| 473 |
Close();
|
473 |
Close();
|
| 474 |
}
|
474 |
}
|
| 475 |
|
475 |
|
| 476 |
if ( !Diff.ApplyDiff(CyStringFromSystemString(this->textBox1->Text)) )
|
476 |
if ( !Diff.ApplyDiff(_S(this->textBox1->Text)) )
|
| 477 |
{
|
477 |
{
|
| 478 |
MessageBox::Show(this, "Unable to apply diff to mod:\n" + this->textBox1->Text, "Apply Diff", MessageBoxButtons::OK, MessageBoxIcon::Error);
|
478 |
MessageBox::Show(this, "Unable to apply diff to mod:\n" + this->textBox1->Text, "Apply Diff", MessageBoxButtons::OK, MessageBoxIcon::Error);
|
| 479 |
Close();
|
479 |
Close();
|
| 480 |
}
|
480 |
}
|
| 481 |
|
481 |
|