Subversion Repositories spk

Rev

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

Rev 191 Rev 197
Line 186... Line 186...
186
			this->ComboGame->Items->Clear();
186
			this->ComboGame->Items->Clear();
187
 
187
 
188
			CPackages p;
188
			CPackages p;
189
			p.startup(".", ".", ".");
189
			p.startup(".", ".", ".");
190
			// start at 1 to skip X2
190
			// start at 1 to skip X2
191
			for ( int i = 1; i < p.GetGameExe()->GetNumGames(); i++ )
191
			for ( int i = 1; i < p.GetGameExe()->numGames(); i++ )
192
			{
192
			{
193
				bool added = false;
193
				bool added = false;
194
				if ( m_pDirList->FindData(CyString::Number(i)) )
194
				if ( m_pDirList->FindData(CyString::Number(i)) )
195
				{
195
				{
196
					if ( m_pDirList->FindData(CyString::Number(i))->str != "-1" )
196
					if ( m_pDirList->FindData(CyString::Number(i))->str != "-1" )
197
						added = true;
197
						added = true;
198
				}
198
				}
199
 
199
 
200
				SGameExe *exe = p.GetGameExe()->GetGame(i);
200
				SGameExe *exe = p.GetGameExe()->game(i);
201
				this->ComboGame->Items->Add(_US(exe->sName));
201
				this->ComboGame->Items->Add(_US(exe->sName));
202
				System::Windows::Forms::ToolStripMenuItem ^newMenu = gcnew System::Windows::Forms::ToolStripMenuItem;
202
				System::Windows::Forms::ToolStripMenuItem ^newMenu = gcnew System::Windows::Forms::ToolStripMenuItem;
203
				newMenu->Text = _US(exe->sName);
203
				newMenu->Text = _US(exe->sName);
204
				this->gamesToolStripMenuItem->DropDownItems->Add(newMenu);
204
				this->gamesToolStripMenuItem->DropDownItems->Add(newMenu);
205
				System::Windows::Forms::ToolStripMenuItem ^newMenuDir = gcnew System::Windows::Forms::ToolStripMenuItem;
205
				System::Windows::Forms::ToolStripMenuItem ^newMenuDir = gcnew System::Windows::Forms::ToolStripMenuItem;
Line 246... Line 246...
246
			if ( !m_pLoadedShip )
246
			if ( !m_pLoadedShip )
247
				MessageBox::Show(this, "There is currently no ship loaded to convert", "Ship Save", MessageBoxButtons::OK, MessageBoxIcon::Warning);
247
				MessageBox::Show(this, "There is currently no ship loaded to convert", "Ship Save", MessageBoxButtons::OK, MessageBoxIcon::Warning);
248
			else
248
			else
249
			{
249
			{
250
				this->SaveMasks();
250
				this->SaveMasks();
251
				if ( m_pLoadedShip->writeFile(m_pLoadedShip->filename()) )
251
				if ( m_pLoadedShip->writeFile(m_pLoadedShip->filename().toString()) )
252
				{
252
				{
253
					MessageBox::Show(this, "Ship File: " + _US(m_pLoadedShip->filename()) + "\n\nHas been written", "Ship Saved", MessageBoxButtons::OK, MessageBoxIcon::Information);
253
					MessageBox::Show(this, "Ship File: " + _US(m_pLoadedShip->filename()) + "\n\nHas been written", "Ship Saved", MessageBoxButtons::OK, MessageBoxIcon::Information);
254
					m_bChanged = false;
254
					m_bChanged = false;
255
				}
255
				}
256
			}
256
			}
Line 399... Line 399...
399
		}
399
		}
400
 
400
 
401
		void OpenFile(System::String ^open)
401
		void OpenFile(System::String ^open)
402
		{
402
		{
403
				CXspFile *shipFile = new CXspFile;
403
				CXspFile *shipFile = new CXspFile;
404
				int check = CSpkFile::CheckFile(_S(open));
404
				int check = CSpkFile::CheckFile(_WS(open));
405
				bool loaded = false;
405
				bool loaded = false;
406
 
406
 
407
				m_bChanged = false;
407
				m_bChanged = false;
408
 
408
 
409
				if ( check == SPKFILE_SINGLESHIP )
409
				if ( check == SPKFILE_SINGLESHIP )
Line 596... Line 596...
596
					{
596
					{
597
						int donePage = (tcText) ? 3 : 2;
597
						int donePage = (tcText) ? 3 : 2;
598
						int inPage = 0;
598
						int inPage = 0;
599
						while ( !Open.atEnd() )
599
						while ( !Open.atEnd() )
600
						{
600
						{
601
							Utils::String line = Open.readEndOfLine();
601
							Utils::String line = Open.readEndOfLineStr();
602
							if ( line.empty() )
602
							if ( line.empty() )
603
								continue;
603
								continue;
604
							line = line.removeFirstSpace();
604
							line = line.removeFirstSpace();
605
							line = line.remove('\t');
605
							line = line.remove('\t');
606
							if ( !inPage )
606
							if ( !inPage )
Line 671... Line 671...
671
		void LoadGameDirectory()
671
		void LoadGameDirectory()
672
		{
672
		{
673
			CPackages p;
673
			CPackages p;
674
			p.startup(".", ".", ".");
674
			p.startup(".", ".", ".");
675
 
675
 
676
			for ( int i = 1; i < p.GetGameExe()->GetNumGames(); i++ )
676
			for ( int i = 1; i < p.GetGameExe()->numGames(); i++ )
677
			{
677
			{
678
				SGameExe *exe = p.GetGameExe()->GetGame(i);
678
				SGameExe *exe = p.GetGameExe()->game(i);
679
				if ( !m_pDirList->FindData(CyString::Number(i)) )
679
				if ( !m_pDirList->FindData(CyString::Number(i)) )
680
				{
680
				{
681
					if ( MessageBox::Show(this, "You have no directories set for " + _US(exe->sName) + "\n\nWould you like to set it now?", "Game Directory", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == System::Windows::Forms::DialogResult::Yes )
681
					if ( MessageBox::Show(this, "You have no directories set for " + _US(exe->sName) + "\n\nWould you like to set it now?", "Game Directory", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == System::Windows::Forms::DialogResult::Yes )
682
					{
682
					{
683
						FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
683
						FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;