| Line 11... |
Line 11... |
| 11 |
#include "../../ModMerge/src/Forms/Form1.h"
|
11 |
#include "../../ModMerge/src/Forms/Form1.h"
|
| 12 |
#include "ModDiff.h"
|
12 |
#include "ModDiff.h"
|
| 13 |
#include "Waiting.h"
|
13 |
#include "Waiting.h"
|
| 14 |
#include "FileExplorer.h"
|
14 |
#include "FileExplorer.h"
|
| 15 |
#include "SelectGame.h"
|
15 |
#include "SelectGame.h"
|
| - |
|
16 |
#include "SelectFilesystem.h"
|
| - |
|
17 |
#include <VirtualFileSystem.h>
|
| - |
|
18 |
|
| 16 |
|
19 |
|
| 17 |
using namespace System;
|
20 |
using namespace System;
|
| 18 |
using namespace System::IO;
|
21 |
using namespace System::IO;
|
| 19 |
|
22 |
|
| 20 |
namespace Creator {
|
23 |
namespace Creator {
|
| Line 38... |
Line 41... |
| 38 |
/// resources associated with this form.
|
41 |
/// resources associated with this form.
|
| 39 |
/// </summary>
|
42 |
/// </summary>
|
| 40 |
public ref class Form1 : public System::Windows::Forms::Form
|
43 |
public ref class Form1 : public System::Windows::Forms::Form
|
| 41 |
{
|
44 |
{
|
| 42 |
public:
|
45 |
public:
|
| 43 |
Form1(array<System::String ^> ^args)
|
46 |
Form1(array<System::String ^> ^args);
|
| 44 |
{
|
- |
|
| 45 |
InitializeComponent();
|
- |
|
| 46 |
|
- |
|
| 47 |
m_bAutoClose = false;
|
- |
|
| 48 |
m_pWait = nullptr;
|
- |
|
| 49 |
m_bTextLoaded = false;
|
- |
|
| 50 |
this->shipToolStripMenuItem->Image = this->imageList1->Images[1];
|
- |
|
| 51 |
this->shipToolStripMenuItem1->Image = this->imageList1->Images[1];
|
- |
|
| 52 |
this->multiPackageToolStripMenuItem->Image = this->imageList1->Images[this->imageList1->Images->IndexOfKey("multi")];
|
- |
|
| 53 |
this->Closed += gcnew System::EventHandler(this, &Form1::CloseEvent);
|
- |
|
| 54 |
|
- |
|
| 55 |
textList = gcnew Hashtable();
|
- |
|
| 56 |
|
- |
|
| 57 |
this->Text = "Package Creator " + GetVersionString();
|
- |
|
| 58 |
m_pLoadedList = new CyStringList;
|
- |
|
| 59 |
m_pGameDir = new CLinkList<SGameDir>;
|
- |
|
| 60 |
|
- |
|
| 61 |
// default settings
|
- |
|
| 62 |
m_settings = new SSettings;
|
- |
|
| 63 |
m_settings->bGenerateUpdate = false;
|
- |
|
| 64 |
|
- |
|
| 65 |
m_pComponents = NULL;
|
- |
|
| 66 |
m_pDummies = NULL;
|
- |
|
| 67 |
m_pBodies = NULL;
|
- |
|
| 68 |
m_pShields = NULL;
|
- |
|
| 69 |
m_pCockpits = new CLinkList<CyStringList>;
|
- |
|
| 70 |
m_pLasers = new CLinkList<CyStringList>;
|
- |
|
| 71 |
m_pMissiles = new CLinkList<CyStringList>;
|
- |
|
| 72 |
|
- |
|
| 73 |
m_iLocX = m_iLocY = -1;
|
- |
|
| 74 |
this->LoadData();
|
- |
|
| 75 |
|
- |
|
| 76 |
this->toolTip1->SetToolTip(this->button1, "Closes all open windows, will ask about saving any that have been modified when they close");
|
- |
|
| 77 |
|
- |
|
| 78 |
m_pPackages = new CPackages;
|
- |
|
| 79 |
m_pPackages->Startup(".", CyStringFromSystemString(IO::Path::GetTempPath()), CyStringFromSystemString(Environment::GetFolderPath(Environment::SpecialFolder::Personal )));
|
- |
|
| 80 |
m_pPackages->SetLanguage(44);
|
- |
|
| 81 |
|
- |
|
| 82 |
this->UpdateDisplay();
|
- |
|
| 83 |
|
- |
|
| 84 |
// parse any switches
|
- |
|
| 85 |
int switchType = SWITCH_NONE;
|
- |
|
| 86 |
|
- |
|
| 87 |
if ( args ) {
|
- |
|
| 88 |
ArrayList ^list = gcnew ArrayList();
|
- |
|
| 89 |
for ( int i = 0; i < args->Length; i++ ) {
|
- |
|
| 90 |
String ^str = args[i];
|
- |
|
| 91 |
if ( switchType != SWITCH_NONE ) {
|
- |
|
| 92 |
switch(switchType) {
|
- |
|
| 93 |
case SWITCH_CREATE:
|
- |
|
| 94 |
this->SavePackagerScript(str);
|
- |
|
| 95 |
m_bAutoClose = true;
|
- |
|
| 96 |
break;
|
- |
|
| 97 |
case SWITCH_EXTRACT:
|
- |
|
| 98 |
this->ExtractPackage(str, false);
|
- |
|
| 99 |
m_bAutoClose = true;
|
- |
|
| 100 |
break;
|
- |
|
| 101 |
case SWITCH_EXTRACTHERE:
|
- |
|
| 102 |
this->ExtractPackage(str, true);
|
- |
|
| 103 |
m_bAutoClose = true;
|
- |
|
| 104 |
break;
|
- |
|
| 105 |
case SWITCH_EXPORT:
|
- |
|
| 106 |
this->ExportPackage(str);
|
- |
|
| 107 |
m_bAutoClose = true;
|
- |
|
| 108 |
break;
|
- |
|
| 109 |
}
|
- |
|
| 110 |
switchType = SWITCH_NONE;
|
- |
|
| 111 |
}
|
- |
|
| 112 |
else if ( !String::Compare(str, "--create", true) ) {
|
- |
|
| 113 |
switchType = SWITCH_CREATE;
|
- |
|
| 114 |
}
|
- |
|
| 115 |
else if ( !String::Compare(str, "--extract", true) ) {
|
- |
|
| 116 |
switchType = SWITCH_EXTRACT;
|
- |
|
| 117 |
}
|
- |
|
| 118 |
else if ( !String::Compare(str, "--extracthere", true) ) {
|
- |
|
| 119 |
switchType = SWITCH_EXTRACTHERE;
|
- |
|
| 120 |
}
|
- |
|
| 121 |
else if ( !String::Compare(str, "--export", true) ) {
|
- |
|
| 122 |
switchType = SWITCH_EXPORT;
|
- |
|
| 123 |
}
|
- |
|
| 124 |
else {
|
- |
|
| 125 |
list->Add(args[i]);
|
- |
|
| 126 |
}
|
- |
|
| 127 |
}
|
- |
|
| 128 |
|
47 |
|
| 129 |
if ( list->Count ) {
|
- |
|
| 130 |
this->OpenFiles(list, true, true);
|
48 |
void parseCommandArguments(array<System::String ^> ^args);
|
| 131 |
m_bAutoClose = false;
|
- |
|
| 132 |
}
|
- |
|
| 133 |
}
|
- |
|
| 134 |
}
|
- |
|
| 135 |
|
49 |
|
| 136 |
int GetHighestGame()
|
50 |
int GetHighestGame()
|
| 137 |
{
|
51 |
{
|
| 138 |
int highest = 1;
|
52 |
int highest = 1;
|
| 139 |
for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
|
53 |
for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
|
| Line 674... |
Line 588... |
| 674 |
}
|
588 |
}
|
| 675 |
}
|
589 |
}
|
| 676 |
return t;
|
590 |
return t;
|
| 677 |
}
|
591 |
}
|
| 678 |
|
592 |
|
| - |
|
593 |
SGameDir *findGameDir(int iGame)
|
| - |
|
594 |
{
|
| - |
|
595 |
for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() ) {
|
| - |
|
596 |
int checkgame = gd->sGame.GetToken(" ", 1, 1).ToInt();
|
| - |
|
597 |
if ( checkgame == iGame ) return gd;
|
| - |
|
598 |
}
|
| - |
|
599 |
|
| - |
|
600 |
return NULL;
|
| - |
|
601 |
}
|
| - |
|
602 |
|
| 679 |
String ^FindText(int game, int page, int id)
|
603 |
String ^FindText(int game, int page, int id)
|
| 680 |
{
|
604 |
{
|
| 681 |
this->LoadText(false, false);
|
605 |
this->LoadText(false, false);
|
| - |
|
606 |
|
| 682 |
String ^text;
|
607 |
String ^text;
|
| 683 |
if ( game == -1 )
|
608 |
if ( game == -1 ) {
|
| 684 |
{
|
- |
|
| 685 |
for ( int game = (GAME_MAX - 1); game >= 0; game-- )
|
609 |
for ( int game = (GAME_MAX - 1); game >= 0; game-- ) {
|
| 686 |
{
|
- |
|
| 687 |
String ^key = Convert::ToString(game) + "," + Convert::ToString(page) + "," + Convert::ToString(id);
|
610 |
SGameDir *gd = findGameDir(game - 1);
|
| - |
|
611 |
if ( !gd ) continue;
|
| 688 |
if ( this->textList->ContainsKey(key) )
|
612 |
if ( gd->pVfs->textExists(44, page, id) ) {
|
| 689 |
{
|
- |
|
| 690 |
text = ParseText(game, Convert::ToString(this->textList[key]));
|
613 |
text = ParseText(game, SystemStringFromCyString(gd->pVfs->findText(44, page, id)));
|
| 691 |
break;
|
614 |
break;
|
| 692 |
}
|
615 |
}
|
| 693 |
}
|
616 |
}
|
| 694 |
}
|
617 |
}
|
| 695 |
else
|
618 |
else
|
| 696 |
{
|
619 |
{
|
| 697 |
String ^key = Convert::ToString(game) + "," + Convert::ToString(page) + "," + Convert::ToString(id);
|
620 |
SGameDir *gd = findGameDir(game);
|
| - |
|
621 |
if ( gd ) {
|
| 698 |
if ( this->textList->ContainsKey(key) )
|
622 |
if ( gd->pVfs->textExists(44, page, id) ) {
|
| 699 |
text = ParseText(game, Convert::ToString(this->textList[key]));
|
623 |
text = ParseText(game, SystemStringFromCyString(gd->pVfs->findText(44, page, id)));
|
| - |
|
624 |
}
|
| - |
|
625 |
}
|
| 700 |
}
|
626 |
}
|
| 701 |
|
627 |
|
| 702 |
return text;
|
628 |
return text;
|
| 703 |
}
|
629 |
}
|
| 704 |
|
630 |
|
| Line 824... |
Line 750... |
| 824 |
bool m_bTextLoaded;
|
750 |
bool m_bTextLoaded;
|
| 825 |
String ^m_sConvertFile;
|
751 |
String ^m_sConvertFile;
|
| 826 |
Waiting ^m_pWait;
|
752 |
Waiting ^m_pWait;
|
| 827 |
CBaseFile *m_pConverted;
|
753 |
CBaseFile *m_pConverted;
|
| 828 |
|
754 |
|
| 829 |
System::Collections::Hashtable ^textList;
|
755 |
//System::Collections::Hashtable ^textList;
|
| 830 |
|
756 |
|
| 831 |
private: System::Windows::Forms::MenuStrip^ menuStrip1;
|
757 |
private: System::Windows::Forms::MenuStrip^ menuStrip1;
|
| 832 |
private: System::Windows::Forms::ToolStripMenuItem^ fileToolStripMenuItem;
|
758 |
private: System::Windows::Forms::ToolStripMenuItem^ fileToolStripMenuItem;
|
| 833 |
private: System::Windows::Forms::ToolStripMenuItem^ newToolStripMenuItem;
|
759 |
private: System::Windows::Forms::ToolStripMenuItem^ newToolStripMenuItem;
|
| 834 |
private: System::Windows::Forms::ToolStripMenuItem^ packageToolStripMenuItem;
|
760 |
private: System::Windows::Forms::ToolStripMenuItem^ packageToolStripMenuItem;
|
| Line 892... |
Line 818... |
| 892 |
private: System::Windows::Forms::ToolStripMenuItem^ fromArchiveToolStripMenuItem;
|
818 |
private: System::Windows::Forms::ToolStripMenuItem^ fromArchiveToolStripMenuItem;
|
| 893 |
private: System::ComponentModel::BackgroundWorker^ backgroundWorker1;
|
819 |
private: System::ComponentModel::BackgroundWorker^ backgroundWorker1;
|
| 894 |
private: System::Windows::Forms::ToolStripMenuItem^ generatePackageUpdatesToolStripMenuItem;
|
820 |
private: System::Windows::Forms::ToolStripMenuItem^ generatePackageUpdatesToolStripMenuItem;
|
| 895 |
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator11;
|
821 |
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator11;
|
| 896 |
private: System::Windows::Forms::ToolStripMenuItem^ fileExplorerToolStripMenuItem;
|
822 |
private: System::Windows::Forms::ToolStripMenuItem^ fileExplorerToolStripMenuItem;
|
| - |
|
823 |
private: System::Windows::Forms::ToolStripMenuItem^ importShipFromVFSToolStripMenuItem;
|
| 897 |
|
824 |
|
| 898 |
private: System::Windows::Forms::ToolStripMenuItem^ exitToolStripMenuItem;
|
825 |
private: System::Windows::Forms::ToolStripMenuItem^ exitToolStripMenuItem;
|
| 899 |
|
826 |
|
| 900 |
|
827 |
|
| 901 |
private:
|
828 |
private:
|
| Line 912... |
Line 839... |
| 912 |
}
|
839 |
}
|
| 913 |
|
840 |
|
| 914 |
return nullptr;
|
841 |
return nullptr;
|
| 915 |
}
|
842 |
}
|
| 916 |
|
843 |
|
| - |
|
844 |
void ImportShip();
|
| - |
|
845 |
void ImportShipFromVFS();
|
| 917 |
|
846 |
|
| 918 |
void ImportShip()
|
- |
|
| 919 |
{
|
- |
|
| 920 |
OpenFileDialog ^ofd = gcnew OpenFileDialog();
|
- |
|
| 921 |
ofd->Filter = "X Catalog Files (*.cat)|*.cat";
|
- |
|
| 922 |
ofd->Title = "Select the mod file to import a ship from";
|
- |
|
| 923 |
ofd->FilterIndex = 1;
|
- |
|
| 924 |
ofd->RestoreDirectory = true;
|
- |
|
| 925 |
ofd->Multiselect = false;
|
- |
|
| 926 |
|
- |
|
| 927 |
if ( ofd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
|
- |
|
| 928 |
{
|
- |
|
| 929 |
this->UseWaitCursor = true;
|
- |
|
| 930 |
// if its a cat file, lets load the text
|
- |
|
| 931 |
Hashtable ^catText = gcnew Hashtable();
|
- |
|
| 932 |
CyStringList readText;
|
- |
|
| 933 |
if ( m_pPackages->ReadTextPage(CyStringFromSystemString(ofd->FileName), &readText, false, 17) )
|
- |
|
| 934 |
{
|
- |
|
| 935 |
for ( SStringList *str = readText.Head(); str; str = str->next )
|
- |
|
| 936 |
{
|
- |
|
| 937 |
String ^key = SystemStringFromCyString(str->str);
|
847 |
String ^getShipSelection(CVirtualFileSystem *pVfs);
|
| 938 |
if ( catText->ContainsKey(key) )
|
- |
|
| 939 |
catText[key] = SystemStringFromCyString(str->data);
|
- |
|
| 940 |
else
|
- |
|
| 941 |
catText->Add(key, SystemStringFromCyString(str->data));
|
- |
|
| 942 |
}
|
- |
|
| 943 |
}
|
- |
|
| 944 |
|
- |
|
| 945 |
CyStringList list;
|
- |
|
| 946 |
if ( m_pPackages->LoadShipData(CyStringFromSystemString(ofd->FileName), &list) )
|
- |
|
| 947 |
{
|
- |
|
| 948 |
LoadShip ^ls = gcnew LoadShip();
|
- |
|
| 949 |
for ( SStringList *str = list.Head(); str; str = str->next )
|
- |
|
| 950 |
{
|
- |
|
| 951 |
int tId = str->data.GetToken(";", 7, 7).ToInt();
|
- |
|
| 952 |
String ^name;
|
- |
|
| 953 |
if ( catText->ContainsKey(Convert::ToString(tId)) )
|
- |
|
| 954 |
name = Convert::ToString(catText[Convert::ToString(tId)]);
|
- |
|
| 955 |
else
|
- |
|
| 956 |
name = this->FindText(-1, 17, tId);
|
- |
|
| 957 |
String ^text = this->FindText(-1, 1266, str->data.GetToken(";", 46, 46).ToInt()) + " " + name;
|
- |
|
| 958 |
int variation = str->data.GetToken(";", 51, 51).ToInt();
|
- |
|
| 959 |
if ( variation )
|
- |
|
| 960 |
text = text + " " + this->FindText(-1, 17, 10000 + variation);
|
- |
|
| 961 |
ls->AddShip(SystemStringFromCyString(str->str), text);
|
- |
|
| 962 |
}
|
- |
|
| 963 |
|
848 |
|
| 964 |
if ( ls->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
|
- |
|
| 965 |
{
|
- |
|
| 966 |
SStringList *str = list.FindString(CyStringFromSystemString(ls->GetData()));
|
- |
|
| 967 |
if ( str )
|
- |
|
| 968 |
{
|
- |
|
| 969 |
Creator::ImportShip ^import = gcnew Creator::ImportShip(m_pPackages, ofd->FileName, ls->GetData(), nullptr);
|
- |
|
| 970 |
import->ShowDialog(this);
|
- |
|
| 971 |
CXspFile *newShip = (import->Error()) ? NULL : import->GetShip();
|
- |
|
| 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 ) {
|
- |
|
| 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);
|
- |
|
| 982 |
}
|
- |
|
| 983 |
}
|
- |
|
| 984 |
}
|
- |
|
| 985 |
|
- |
|
| 986 |
}
|
- |
|
| 987 |
if ( newShip ) {
|
- |
|
| 988 |
PackageForm ^childForm = this->OpenPackage(true, newShip, "", "Imported Ship");
|
- |
|
| 989 |
childForm->Text = "Imported Ship";
|
- |
|
| 990 |
newShip->SetChanged(true);
|
- |
|
| 991 |
childForm->UpdateChanged();
|
- |
|
| 992 |
}
|
- |
|
| 993 |
}
|
- |
|
| 994 |
}
|
- |
|
| 995 |
}
|
- |
|
| 996 |
else
|
- |
|
| 997 |
MessageBox::Show(this, "Unable to load ship data from mod file\n" + ofd->FileName, "Error Importing", MessageBoxButtons::OK, MessageBoxIcon::Error);
|
- |
|
| 998 |
this->UseWaitCursor = false;
|
- |
|
| 999 |
}
|
- |
|
| 1000 |
}
|
- |
|
| 1001 |
|
849 |
|
| 1002 |
void OpenDirectory(System::String ^dir)
|
850 |
void OpenDirectory(System::String ^dir)
|
| 1003 |
{
|
851 |
{
|
| 1004 |
if ( !System::IO::Directory::Exists(dir) )
|
852 |
if ( !System::IO::Directory::Exists(dir) )
|
| 1005 |
{
|
853 |
{
|
| Line 1289... |
Line 1137... |
| 1289 |
tp->ImageIndex = this->imageList1->Images->IndexOfKey(file);
|
1137 |
tp->ImageIndex = this->imageList1->Images->IndexOfKey(file);
|
| 1290 |
if ( tp->ImageIndex == -1 )
|
1138 |
if ( tp->ImageIndex == -1 )
|
| 1291 |
tp->ImageIndex = 0;
|
1139 |
tp->ImageIndex = 0;
|
| 1292 |
|
1140 |
|
| 1293 |
ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem((file->Empty) ? title : file, this->imageList1->Images[tp->ImageIndex]);
|
1141 |
ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem((file->Empty) ? title : file, this->imageList1->Images[tp->ImageIndex]);
|
| 1294 |
MultiForm ^childForm = gcnew MultiForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->textList, this->m_settings);
|
1142 |
MultiForm ^childForm = gcnew MultiForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->m_settings);
|
| 1295 |
|
1143 |
|
| 1296 |
childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames);
|
1144 |
childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames);
|
| 1297 |
this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
|
1145 |
this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
|
| 1298 |
childForm->WindowState = FormWindowState::Minimized;
|
1146 |
childForm->WindowState = FormWindowState::Minimized;
|
| 1299 |
|
1147 |
|
| Line 1337... |
Line 1185... |
| 1337 |
tp->ImageIndex = this->imageList1->Images->IndexOfKey(file);
|
1185 |
tp->ImageIndex = this->imageList1->Images->IndexOfKey(file);
|
| 1338 |
if ( tp->ImageIndex == -1 )
|
1186 |
if ( tp->ImageIndex == -1 )
|
| 1339 |
tp->ImageIndex = 0;
|
1187 |
tp->ImageIndex = 0;
|
| 1340 |
|
1188 |
|
| 1341 |
ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem((file->Empty) ? title : file, this->imageList1->Images[tp->ImageIndex]);
|
1189 |
ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem((file->Empty) ? title : file, this->imageList1->Images[tp->ImageIndex]);
|
| 1342 |
PackageForm ^childForm = gcnew PackageForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->textList, this->m_settings);
|
1190 |
PackageForm ^childForm = gcnew PackageForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->m_settings);
|
| 1343 |
childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames, this->imageListFiles);
|
1191 |
childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames, this->imageListFiles);
|
| 1344 |
this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
|
1192 |
this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
|
| 1345 |
childForm->WindowState = FormWindowState::Minimized;
|
1193 |
childForm->WindowState = FormWindowState::Minimized;
|
| 1346 |
|
1194 |
|
| 1347 |
this->ProcessOpen(false, tp, childForm);
|
1195 |
this->ProcessOpen(false, tp, childForm);
|
| Line 1599... |
Line 1447... |
| 1599 |
tp->Text = "New Ship";
|
1447 |
tp->Text = "New Ship";
|
| 1600 |
else
|
1448 |
else
|
| 1601 |
tp->Text = "New Package";
|
1449 |
tp->Text = "New Package";
|
| 1602 |
ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem(tp->Text, this->imageList1->Images[tp->ImageIndex]);
|
1450 |
ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem(tp->Text, this->imageList1->Images[tp->ImageIndex]);
|
| 1603 |
this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
|
1451 |
this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
|
| 1604 |
PackageForm ^childForm = gcnew PackageForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->textList, this->m_settings);
|
1452 |
PackageForm ^childForm = gcnew PackageForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->m_settings);
|
| 1605 |
childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames, this->imageListFiles);
|
1453 |
childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames, this->imageListFiles);
|
| 1606 |
tp->Parent = tabControl1;
|
1454 |
tp->Parent = tabControl1;
|
| 1607 |
tabControl1->SelectedTab = tp;
|
1455 |
tabControl1->SelectedTab = tp;
|
| 1608 |
|
1456 |
|
| 1609 |
if ( ship )
|
1457 |
if ( ship )
|
| Line 1621... |
Line 1469... |
| 1621 |
TabPage ^tp = gcnew TabPage();
|
1469 |
TabPage ^tp = gcnew TabPage();
|
| 1622 |
tp->ImageIndex = 0;
|
1470 |
tp->ImageIndex = 0;
|
| 1623 |
tp->Text = "New Mutli Package";
|
1471 |
tp->Text = "New Mutli Package";
|
| 1624 |
ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem(tp->Text, this->imageList1->Images[tp->ImageIndex]);
|
1472 |
ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem(tp->Text, this->imageList1->Images[tp->ImageIndex]);
|
| 1625 |
this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
|
1473 |
this->windowsToolStripMenuItem->DropDownItems->Add(toolBut);
|
| 1626 |
MultiForm ^childForm = gcnew MultiForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->textList, this->m_settings);
|
1474 |
MultiForm ^childForm = gcnew MultiForm(this, tabControl1, tp, toolBut, m_pPackages, this->imageList1, this->m_settings);
|
| 1627 |
childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames);
|
1475 |
childForm->SetImageLists(this->imageListSmall, this->imageListLarge, this->imageListGames);
|
| 1628 |
tp->Parent = tabControl1;
|
1476 |
tp->Parent = tabControl1;
|
| 1629 |
tabControl1->SelectedTab = tp;
|
1477 |
tabControl1->SelectedTab = tp;
|
| 1630 |
|
1478 |
|
| 1631 |
childForm->CreatePackage();
|
1479 |
childForm->CreatePackage();
|
| Line 1862... |
Line 1710... |
| 1862 |
else if ( start.Compare("GameDir") )
|
1710 |
else if ( start.Compare("GameDir") )
|
| 1863 |
{
|
1711 |
{
|
| 1864 |
SGameDir *gd = new SGameDir;
|
1712 |
SGameDir *gd = new SGameDir;
|
| 1865 |
gd->sDir = rest.GetToken(";", 1, 1);
|
1713 |
gd->sDir = rest.GetToken(";", 1, 1);
|
| 1866 |
gd->sGame = rest.GetToken(";", 2, 2);
|
1714 |
gd->sGame = rest.GetToken(";", 2, 2);
|
| - |
|
1715 |
gd->iGame = gd->sGame.GetToken(" ", 1, 1).ToInt();
|
| - |
|
1716 |
|
| - |
|
1717 |
SGameExe *exe = m_pPackages->GetGameExe()->GetGame(gd->iGame);
|
| - |
|
1718 |
|
| 1867 |
gd->bLoad = rest.GetToken(";", 3, 3).ToBool();
|
1719 |
gd->bLoad = rest.GetToken(";", 3, 3).ToBool();
|
| - |
|
1720 |
gd->pVfs = new CVirtualFileSystem();
|
| - |
|
1721 |
gd->pVfs->setLanguage(44);
|
| - |
|
1722 |
gd->pVfs->LoadFilesystem(gd->sDir.ToString());
|
| - |
|
1723 |
if ( exe ) {
|
| - |
|
1724 |
gd->pVfs->SetAddon(exe->sAddon.ToString());
|
| - |
|
1725 |
}
|
| 1868 |
m_pGameDir->push_back(gd);
|
1726 |
m_pGameDir->push_back(gd);
|
| 1869 |
}
|
1727 |
}
|
| 1870 |
}
|
1728 |
}
|
| 1871 |
|
1729 |
|
| 1872 |
delete lines;
|
1730 |
delete lines;
|
| Line 1879... |
Line 1737... |
| 1879 |
{
|
1737 |
{
|
| 1880 |
if ( m_bTextLoaded && !reload )
|
1738 |
if ( m_bTextLoaded && !reload )
|
| 1881 |
return;
|
1739 |
return;
|
| 1882 |
m_bTextLoaded = true;
|
1740 |
m_bTextLoaded = true;
|
| 1883 |
|
1741 |
|
| 1884 |
textList->Clear();
|
- |
|
| 1885 |
if ( m_pGameDir->empty() )
|
1742 |
if ( m_pGameDir->empty() )
|
| 1886 |
return;
|
1743 |
return;
|
| 1887 |
|
1744 |
|
| 1888 |
Creator::LoadText ^load = gcnew Creator::LoadText(m_pGameDir, m_pPackages, textList);
|
1745 |
Creator::LoadText ^load = gcnew Creator::LoadText(m_pGameDir, m_pPackages);
|
| 1889 |
if ( center )
|
1746 |
if ( center )
|
| 1890 |
load->StartPosition = Windows::Forms::FormStartPosition::CenterScreen;
|
1747 |
load->StartPosition = Windows::Forms::FormStartPosition::CenterScreen;
|
| 1891 |
|
1748 |
|
| 1892 |
load->ShowDialog(this);
|
1749 |
load->ShowDialog(this);
|
| 1893 |
}
|
1750 |
}
|
| Line 1972... |
Line 1829... |
| 1972 |
this->toolTip1 = (gcnew System::Windows::Forms::ToolTip(this->components));
|
1829 |
this->toolTip1 = (gcnew System::Windows::Forms::ToolTip(this->components));
|
| 1973 |
this->imageListSmall = (gcnew System::Windows::Forms::ImageList(this->components));
|
1830 |
this->imageListSmall = (gcnew System::Windows::Forms::ImageList(this->components));
|
| 1974 |
this->imageListLarge = (gcnew System::Windows::Forms::ImageList(this->components));
|
1831 |
this->imageListLarge = (gcnew System::Windows::Forms::ImageList(this->components));
|
| 1975 |
this->imageListFiles = (gcnew System::Windows::Forms::ImageList(this->components));
|
1832 |
this->imageListFiles = (gcnew System::Windows::Forms::ImageList(this->components));
|
| 1976 |
this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
|
1833 |
this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
|
| - |
|
1834 |
this->importShipFromVFSToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
|
| 1977 |
this->menuStrip1->SuspendLayout();
|
1835 |
this->menuStrip1->SuspendLayout();
|
| 1978 |
this->PanelTab->SuspendLayout();
|
1836 |
this->PanelTab->SuspendLayout();
|
| 1979 |
this->toolStrip1->SuspendLayout();
|
1837 |
this->toolStrip1->SuspendLayout();
|
| 1980 |
this->statusStrip1->SuspendLayout();
|
1838 |
this->statusStrip1->SuspendLayout();
|
| 1981 |
this->SuspendLayout();
|
1839 |
this->SuspendLayout();
|
| Line 2248... |
Line 2106... |
| 2248 |
this->toolStrip1->TabIndex = 7;
|
2106 |
this->toolStrip1->TabIndex = 7;
|
| 2249 |
this->toolStrip1->Text = L"toolStrip1";
|
2107 |
this->toolStrip1->Text = L"toolStrip1";
|
| 2250 |
//
|
2108 |
//
|
| 2251 |
// toolStripButton1
|
2109 |
// toolStripButton1
|
| 2252 |
//
|
2110 |
//
|
| 2253 |
this->toolStripButton1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(9) {this->packageToolStripMenuItem1,
|
2111 |
this->toolStripButton1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(10) {this->packageToolStripMenuItem1,
|
| 2254 |
this->shipToolStripMenuItem1, this->multiPackageToolStripMenuItem, this->toolStripSeparator4, this->fromPackagerScriptToolStripMenuItem,
|
2112 |
this->shipToolStripMenuItem1, this->multiPackageToolStripMenuItem, this->toolStripSeparator4, this->fromPackagerScriptToolStripMenuItem,
|
| 2255 |
this->fromArchiveToolStripMenuItem, this->importShipFromModToolStripMenuItem, this->toolStripSeparator7, this->packageCreationWizardToolStripMenuItem1});
|
2113 |
this->fromArchiveToolStripMenuItem, this->importShipFromModToolStripMenuItem, this->importShipFromVFSToolStripMenuItem, this->toolStripSeparator7,
|
| - |
|
2114 |
this->packageCreationWizardToolStripMenuItem1});
|
| 2256 |
this->toolStripButton1->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"toolStripButton1.Image")));
|
2115 |
this->toolStripButton1->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"toolStripButton1.Image")));
|
| 2257 |
this->toolStripButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
|
2116 |
this->toolStripButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
|
| 2258 |
this->toolStripButton1->Name = L"toolStripButton1";
|
2117 |
this->toolStripButton1->Name = L"toolStripButton1";
|
| 2259 |
this->toolStripButton1->Size = System::Drawing::Size(76, 36);
|
2118 |
this->toolStripButton1->Size = System::Drawing::Size(76, 36);
|
| 2260 |
this->toolStripButton1->Text = L"New";
|
2119 |
this->toolStripButton1->Text = L"New";
|
| Line 2509... |
Line 2368... |
| 2509 |
this->backgroundWorker1->WorkerReportsProgress = true;
|
2368 |
this->backgroundWorker1->WorkerReportsProgress = true;
|
| 2510 |
this->backgroundWorker1->WorkerSupportsCancellation = true;
|
2369 |
this->backgroundWorker1->WorkerSupportsCancellation = true;
|
| 2511 |
this->backgroundWorker1->DoWork += gcnew System::ComponentModel::DoWorkEventHandler(this, &Form1::backgroundWorker1_DoWork);
|
2370 |
this->backgroundWorker1->DoWork += gcnew System::ComponentModel::DoWorkEventHandler(this, &Form1::backgroundWorker1_DoWork);
|
| 2512 |
this->backgroundWorker1->RunWorkerCompleted += gcnew System::ComponentModel::RunWorkerCompletedEventHandler(this, &Form1::backgroundWorker1_RunWorkerCompleted);
|
2371 |
this->backgroundWorker1->RunWorkerCompleted += gcnew System::ComponentModel::RunWorkerCompletedEventHandler(this, &Form1::backgroundWorker1_RunWorkerCompleted);
|
| 2513 |
//
|
2372 |
//
|
| - |
|
2373 |
// importShipFromVFSToolStripMenuItem
|
| - |
|
2374 |
//
|
| - |
|
2375 |
this->importShipFromVFSToolStripMenuItem->Name = L"importShipFromVFSToolStripMenuItem";
|
| - |
|
2376 |
this->importShipFromVFSToolStripMenuItem->Size = System::Drawing::Size(221, 38);
|
| - |
|
2377 |
this->importShipFromVFSToolStripMenuItem->Text = L"Import Ship from VFS";
|
| - |
|
2378 |
this->importShipFromVFSToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::importShipFromVFSToolStripMenuItem_Click);
|
| - |
|
2379 |
//
|
| 2514 |
// Form1
|
2380 |
// Form1
|
| 2515 |
//
|
2381 |
//
|
| 2516 |
this->AllowDrop = true;
|
2382 |
this->AllowDrop = true;
|
| 2517 |
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
|
2383 |
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
|
| 2518 |
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
|
2384 |
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
|
| Line 2741... |
Line 2607... |
| 2741 |
GeneratePackageUpdates();
|
2607 |
GeneratePackageUpdates();
|
| 2742 |
}
|
2608 |
}
|
| 2743 |
private: System::Void fileExplorerToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
2609 |
private: System::Void fileExplorerToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
| 2744 |
OpenFileExplorer();
|
2610 |
OpenFileExplorer();
|
| 2745 |
}
|
2611 |
}
|
| - |
|
2612 |
private: System::Void importShipFromVFSToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
| - |
|
2613 |
ImportShipFromVFS();
|
| - |
|
2614 |
}
|
| 2746 |
};
|
2615 |
};
|
| 2747 |
}
|
2616 |
}
|
| 2748 |
|
2617 |
|