Subversion Repositories spk

Rev

Rev 95 | Rev 107 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 95 Rev 101
Line 9... Line 9...
9
 
9
 
10
	System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
10
	System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
11
 
11
 
12
	m_bAutoClose = false;
12
	m_bAutoClose = false;
13
	m_pWait = nullptr;
13
	m_pWait = nullptr;
14
	m_bTextLoaded = false;
-
 
15
	this->shipToolStripMenuItem->Image = this->imageList1->Images[1];
14
	this->shipToolStripMenuItem->Image = this->imageList1->Images[1];
16
	this->shipToolStripMenuItem1->Image = this->imageList1->Images[1];
15
	this->shipToolStripMenuItem1->Image = this->imageList1->Images[1];
17
	this->multiPackageToolStripMenuItem->Image = this->imageList1->Images[this->imageList1->Images->IndexOfKey("multi")];
16
	this->multiPackageToolStripMenuItem->Image = this->imageList1->Images[this->imageList1->Images->IndexOfKey("multi")];
18
	this->Closed += gcnew System::EventHandler(this, &Form1::CloseEvent);
17
	this->Closed += gcnew System::EventHandler(this, &Form1::CloseEvent);
19
 
18
 
Line 99... Line 98...
99
}
98
}
100
 
99
 
101
 
100
 
102
String ^Form1::getShipSelection(CVirtualFileSystem *pVfs)
101
String ^Form1::getShipSelection(CVirtualFileSystem *pVfs)
103
{
102
{
104
	CyStringList list;
103
	Utils::CStringList *ships = pVfs->getTShipsEntries();
105
	if ( pVfs->loadShipData(&list) ) {
104
	if ( ships ) {
106
 
-
 
107
		this->LoadText();
105
		this->LoadText(pVfs);
108
 
106
 
109
		LoadShip ^ls = gcnew LoadShip();
107
		LoadShip ^ls = gcnew LoadShip();
110
		for ( SStringList *str = list.Head(); str; str = str->next )
108
		for(Utils::SStringList *str = ships->First(); str; str = ships->Next()) {
111
		{
-
 
112
			int tId = str->data.GetToken(";", 7, 7).ToInt();
109
			int tId = str->str.token(";", 7).toLong();
113
			String ^name = _US(pVfs->findText(0, 17, tId));
110
			String ^name = _US(pVfs->findText(0, 17, tId));
114
			String ^race = _US(pVfs->findText(0, 1266, str->data.GetToken(";", 46, 46).ToInt()));
111
			String ^race = _US(pVfs->findText(0, 1266, str->str.token(";", 46).toLong()));
115
			String ^text = race + " " + name;
112
			String ^text = race + " " + name;
116
			int variation = str->data.GetToken(";", 51, 51).ToInt();
113
			int variation = str->str.token(";", 51).toLong();
117
			if ( variation )
114
			if ( variation )
118
				text = text + " " + _US(pVfs->findText(0, 17, 10000 + variation));
115
				text = text + " " + _US(pVfs->findText(0, 17, 10000 + variation));
119
			ls->AddShip(SystemStringFromCyString(str->str), text);
116
			ls->AddShip(_US(str->data), text);
120
		}
117
		}
121
 
118
 
122
		if ( ls->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )	{
119
		if ( ls->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )	{
123
			SStringList *str = list.FindString(CyStringFromSystemString(ls->GetData()));
120
			Utils::String line = pVfs->getTShipsEntry(_S(ls->GetData()));
-
 
121
	
124
			if ( str )	{
122
			if ( !line.empty() ) {
125
				return ls->GetData();
123
				return ls->GetData();
126
			}
124
			}
127
		}
125
		}
128
		else return "";
126
		else return "";
129
	}
127
	}