| 1 | cycrow | 1 | #pragma once
 | 
        
           |  |  | 2 |   | 
        
           | 85 | cycrow | 3 | #include "../X3Data.h"
 | 
        
           | 1 | cycrow | 4 |   | 
        
           |  |  | 5 | #include "ViewData.h"
 | 
        
           |  |  | 6 | #include "EZ_LCD.h"
 | 
        
           | 85 | cycrow | 7 | #include "../LCDDisplay.h"
 | 
        
           | 1 | cycrow | 8 |   | 
        
           |  |  | 9 | #define LOGFILE		902
 | 
        
           | 115 | cycrow | 10 | #define VERSION		"1.32"
 | 
        
           |  |  | 11 | #define DATE		"08/08/2015"
 | 
        
           | 1 | cycrow | 12 |   | 
        
           | 15 | cycrow | 13 | #include "../../Direct3D-Hook/src/Hook/Direct3D-Hook.h"
 | 
        
           | 1 | cycrow | 14 |   | 
        
           |  |  | 15 | using namespace System;
 | 
        
           |  |  | 16 |   | 
        
           |  |  | 17 | namespace GameLauncher {
 | 
        
           |  |  | 18 |   | 
        
           |  |  | 19 | 	using namespace System;
 | 
        
           |  |  | 20 | 	using namespace System::ComponentModel;
 | 
        
           |  |  | 21 | 	using namespace System::Collections;
 | 
        
           |  |  | 22 | 	using namespace System::Windows::Forms;
 | 
        
           |  |  | 23 | 	using namespace System::Data;
 | 
        
           |  |  | 24 | 	using namespace System::Drawing;
 | 
        
           |  |  | 25 |   | 
        
           |  |  | 26 | 	using namespace Microsoft::Win32;
 | 
        
           |  |  | 27 | 	/// <summary>
 | 
        
           |  |  | 28 | 	/// Summary for Form1
 | 
        
           |  |  | 29 | 	///
 | 
        
           |  |  | 30 | 	/// WARNING: If you change the name of this class, you will need to change the
 | 
        
           |  |  | 31 | 	///          'Resource File Name' property for the managed resource compiler tool
 | 
        
           |  |  | 32 | 	///          associated with all .resx files this class depends on.  Otherwise,
 | 
        
           |  |  | 33 | 	///          the designers will not be able to interact properly with localized
 | 
        
           |  |  | 34 | 	///          resources associated with this form.
 | 
        
           |  |  | 35 | 	/// </summary>
 | 
        
           |  |  | 36 | 	public ref class Form1 : public System::Windows::Forms::Form
 | 
        
           |  |  | 37 | 	{
 | 
        
           |  |  | 38 | 	public:
 | 
        
           | 85 | cycrow | 39 | 		Form1(System::String ^runGame, System::String ^arguments, System::String ^runManager);
 | 
        
           | 1 | cycrow | 40 |   | 
        
           |  |  | 41 | 		void SetGameLogDisplay()
 | 
        
           |  |  | 42 | 		{
 | 
        
           | 298 | cycrow | 43 | 			Utils::WString display = L"Game Log: ";
 | 
        
           |  |  | 44 | 			display += Utils::WString::PadNumber(m_iGameLog, 5);
 | 
        
           |  |  | 45 | 			System::String ^Str = gcnew System::String(display);
 | 
        
           | 1 | cycrow | 46 | 			this->gameLogToolStripMenuItem->Text = Str;
 | 
        
           |  |  | 47 | 		}
 | 
        
           |  |  | 48 |   | 
        
           |  |  | 49 | 		bool Resume() 
 | 
        
           |  |  | 50 | 		{ 
 | 
        
           |  |  | 51 | 			if ( m_bResume )
 | 
        
           |  |  | 52 | 				return true;
 | 
        
           |  |  | 53 | 			return m_bAutoResume;
 | 
        
           |  |  | 54 | 		}
 | 
        
           |  |  | 55 |   | 
        
           |  |  | 56 | 		void AddGame(String ^dir, String ^name, String ^language)
 | 
        
           |  |  | 57 | 		{
 | 
        
           |  |  | 58 | 			if ( language )
 | 
        
           |  |  | 59 | 				name = name + " (" + language + ")";
 | 
        
           |  |  | 60 |   | 
        
           | 298 | cycrow | 61 | 			dir = dir->Replace(L'/', L'\\');
 | 
        
           | 1 | cycrow | 62 | 			String ^exe = dir->Substring(dir->LastIndexOf('\\') + 1);
 | 
        
           |  |  | 63 | 			String ^baseDir = dir->Substring(0, dir->LastIndexOf('\\'));
 | 
        
           |  |  | 64 | 			ToolStripMenuItem ^foundItem;
 | 
        
           |  |  | 65 | 			for ( int i = 0; i < this->ContextGames->DropDownItems->Count; i++ )
 | 
        
           |  |  | 66 | 			{
 | 
        
           |  |  | 67 | 				if ( !String::Compare(this->ContextGames->DropDownItems[i]->Text, name) )
 | 
        
           |  |  | 68 | 				{
 | 
        
           |  |  | 69 | 					foundItem = cli::safe_cast<ToolStripMenuItem ^>(this->ContextGames->DropDownItems[i]);
 | 
        
           |  |  | 70 | 					break;
 | 
        
           |  |  | 71 | 				}
 | 
        
           |  |  | 72 | 			}
 | 
        
           |  |  | 73 |   | 
        
           |  |  | 74 |   | 
        
           |  |  | 75 | 			if ( foundItem )
 | 
        
           |  |  | 76 | 			{
 | 
        
           |  |  | 77 | 				if ( foundItem->Tag )
 | 
        
           |  |  | 78 | 				{
 | 
        
           |  |  | 79 | 					String ^foundDir = cli::safe_cast<String ^>(foundItem->Tag);
 | 
        
           |  |  | 80 | 					int imagePos = this->imageList1->Images->IndexOfKey(exe);
 | 
        
           |  |  | 81 | 					ToolStripMenuItem ^item = gcnew ToolStripMenuItem(foundDir->Substring(0, foundDir->LastIndexOf('\\')), (imagePos == -1) ? nullptr : this->imageList1->Images[imagePos], gcnew EventHandler(this, &Form1::LaunchGameEvent));
 | 
        
           |  |  | 82 | 					item->Tag = foundItem->Tag;
 | 
        
           |  |  | 83 | 					foundItem->DropDownItems->Add(item);
 | 
        
           |  |  | 84 | 					foundItem->Tag = nullptr;
 | 
        
           |  |  | 85 | 				}
 | 
        
           |  |  | 86 | 				int imagePos = this->imageList1->Images->IndexOfKey(exe);
 | 
        
           |  |  | 87 | 				ToolStripMenuItem ^item = gcnew ToolStripMenuItem(baseDir, (imagePos == -1) ? nullptr : this->imageList1->Images[imagePos], gcnew EventHandler(this, &Form1::LaunchGameEvent));
 | 
        
           |  |  | 88 | 				item->Tag = dir;
 | 
        
           |  |  | 89 | 				foundItem->DropDownItems->Add(item);
 | 
        
           |  |  | 90 | 			}
 | 
        
           |  |  | 91 | 			else
 | 
        
           |  |  | 92 | 			{
 | 
        
           |  |  | 93 | 				int imagePos = this->imageList1->Images->IndexOfKey(exe);
 | 
        
           |  |  | 94 | 				ToolStripMenuItem ^item = gcnew ToolStripMenuItem(name, (imagePos == -1) ? nullptr : this->imageList1->Images[imagePos], gcnew EventHandler(this, &Form1::LaunchGameEvent));
 | 
        
           |  |  | 95 | 				item->Tag = dir;
 | 
        
           |  |  | 96 | 				this->ContextGames->DropDownItems->Add(item);
 | 
        
           |  |  | 97 | 			}
 | 
        
           |  |  | 98 | 		}
 | 
        
           |  |  | 99 |   | 
        
           |  |  | 100 | 		void SetLogDirForGame(System::String ^gameExe)
 | 
        
           |  |  | 101 | 		{
 | 
        
           |  |  | 102 | 			gameExe = System::IO::FileInfo(gameExe).Name;
 | 
        
           |  |  | 103 |   | 
        
           |  |  | 104 | 			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
 | 
        
           |  |  | 105 | 			if ( IO::File::Exists(mydoc + "\\Egosoft\\pluginmanager.dat") )
 | 
        
           |  |  | 106 | 			{
 | 
        
           |  |  | 107 | 				try {
 | 
        
           |  |  | 108 | 					cli::array<String ^> ^lines = IO::File::ReadAllLines(mydoc + "\\Egosoft\\pluginmanager.dat");
 | 
        
           |  |  | 109 | 					if ( lines && lines->Length )
 | 
        
           |  |  | 110 | 					{
 | 
        
           |  |  | 111 | 						for ( int i = 0; i < lines->Length; i++ )
 | 
        
           |  |  | 112 | 						{
 | 
        
           |  |  | 113 | 							int pos = lines[i]->IndexOf(":");
 | 
        
           |  |  | 114 | 							if ( pos == -1 )
 | 
        
           |  |  | 115 | 								continue;
 | 
        
           |  |  | 116 | 							if ( String::Compare(lines[i]->Substring(0, pos), "GameLog") )
 | 
        
           |  |  | 117 | 								continue;
 | 
        
           |  |  | 118 | 							String ^dir = lines[i]->Substring(pos + 1);
 | 
        
           |  |  | 119 | 							cli::array<String ^> ^parts = dir->Split('|');
 | 
        
           |  |  | 120 | 							if ( parts )
 | 
        
           |  |  | 121 | 							{
 | 
        
           |  |  | 122 | 								// no language
 | 
        
           |  |  | 123 | 								String ^name;
 | 
        
           |  |  | 124 | 								if ( parts->Length >= 2 )
 | 
        
           |  |  | 125 | 								{
 | 
        
           |  |  | 126 | 									name = System::IO::FileInfo(parts[1]).Name;
 | 
        
           |  |  | 127 | 									if ( name == gameExe )
 | 
        
           |  |  | 128 | 									{
 | 
        
           |  |  | 129 | 										m_sLogDir = parts[0];
 | 
        
           |  |  | 130 | 										break;
 | 
        
           |  |  | 131 | 									}
 | 
        
           |  |  | 132 | 								}
 | 
        
           |  |  | 133 | 								else
 | 
        
           |  |  | 134 | 									continue;
 | 
        
           |  |  | 135 | 							}
 | 
        
           |  |  | 136 | 						}
 | 
        
           |  |  | 137 | 					}
 | 
        
           |  |  | 138 | 				}
 | 
        
           |  |  | 139 | 				catch (IO::IOException ^) { }
 | 
        
           |  |  | 140 | 				catch (System::Exception ^) {}
 | 
        
           |  |  | 141 | 			}
 | 
        
           |  |  | 142 | 		}
 | 
        
           |  |  | 143 |   | 
        
           |  |  | 144 | 		String ^GetGameName(String ^exe)
 | 
        
           |  |  | 145 | 		{
 | 
        
           |  |  | 146 | 			// read the plugin manager file
 | 
        
           |  |  | 147 | 			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
 | 
        
           |  |  | 148 | 			if ( IO::File::Exists(mydoc + "\\Egosoft\\pluginmanager.dat") )
 | 
        
           |  |  | 149 | 			{
 | 
        
           |  |  | 150 | 				try {
 | 
        
           |  |  | 151 | 					cli::array<String ^> ^lines = IO::File::ReadAllLines(mydoc + "\\Egosoft\\pluginmanager.dat");
 | 
        
           |  |  | 152 | 					if ( lines && lines->Length )
 | 
        
           |  |  | 153 | 					{
 | 
        
           |  |  | 154 | 						for ( int i = 0; i < lines->Length; i++ )
 | 
        
           |  |  | 155 | 						{
 | 
        
           |  |  | 156 | 							int pos = lines[i]->IndexOf(":");
 | 
        
           |  |  | 157 | 							if ( pos == -1 )
 | 
        
           |  |  | 158 | 								continue;
 | 
        
           |  |  | 159 | 							if ( String::Compare(lines[i]->Substring(0, pos), "DirExe") )
 | 
        
           |  |  | 160 | 								continue;
 | 
        
           |  |  | 161 | 							String ^dir = lines[i]->Substring(pos + 1);
 | 
        
           |  |  | 162 | 							cli::array<String ^> ^parts = dir->Split('|');
 | 
        
           |  |  | 163 | 							if ( parts )
 | 
        
           |  |  | 164 | 							{
 | 
        
           |  |  | 165 | 								// no language
 | 
        
           |  |  | 166 | 								String ^language;
 | 
        
           |  |  | 167 | 								String ^dir;
 | 
        
           |  |  | 168 | 								String ^name;
 | 
        
           |  |  | 169 | 								if ( parts->Length == 2 )
 | 
        
           |  |  | 170 | 								{
 | 
        
           |  |  | 171 | 									dir = parts[1];
 | 
        
           |  |  | 172 | 									name = parts[0];
 | 
        
           |  |  | 173 | 								}
 | 
        
           |  |  | 174 | 								else if ( parts->Length > 2 )
 | 
        
           |  |  | 175 | 								{
 | 
        
           |  |  | 176 | 									language = parts[0];
 | 
        
           |  |  | 177 | 									name = parts[1];
 | 
        
           |  |  | 178 | 									dir = parts[2];
 | 
        
           |  |  | 179 | 								}
 | 
        
           |  |  | 180 | 								else
 | 
        
           |  |  | 181 | 									continue;
 | 
        
           |  |  | 182 |   | 
        
           |  |  | 183 | 								if ( String::Compare(IO::FileInfo(dir).FullName, IO::FileInfo(exe).FullName, true) == 0 )
 | 
        
           |  |  | 184 | 								{
 | 
        
           |  |  | 185 | 									if ( language ) return name + " (" + language + ")";
 | 
        
           |  |  | 186 | 									return name;
 | 
        
           |  |  | 187 | 								}
 | 
        
           |  |  | 188 | 							}
 | 
        
           |  |  | 189 | 						}
 | 
        
           |  |  | 190 | 					}
 | 
        
           |  |  | 191 | 				}
 | 
        
           |  |  | 192 | 				catch (IO::IOException ^) { }
 | 
        
           |  |  | 193 | 				catch (System::Exception ^) {}
 | 
        
           |  |  | 194 | 			}
 | 
        
           |  |  | 195 |   | 
        
           |  |  | 196 | 			return "";
 | 
        
           |  |  | 197 | 		}
 | 
        
           |  |  | 198 |   | 
        
           |  |  | 199 | 		void AddGames()
 | 
        
           |  |  | 200 | 		{
 | 
        
           |  |  | 201 | 			// read the plugin manager file
 | 
        
           |  |  | 202 | 			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
 | 
        
           |  |  | 203 | 			if ( IO::File::Exists(mydoc + "\\Egosoft\\pluginmanager.dat") )
 | 
        
           |  |  | 204 | 			{
 | 
        
           |  |  | 205 | 				try {
 | 
        
           |  |  | 206 | 					cli::array<String ^> ^lines = IO::File::ReadAllLines(mydoc + "\\Egosoft\\pluginmanager.dat");
 | 
        
           |  |  | 207 | 					if ( lines && lines->Length )
 | 
        
           |  |  | 208 | 					{
 | 
        
           |  |  | 209 | 						for ( int i = 0; i < lines->Length; i++ )
 | 
        
           |  |  | 210 | 						{
 | 
        
           |  |  | 211 | 							int pos = lines[i]->IndexOf(":");
 | 
        
           |  |  | 212 | 							if ( pos == -1 )
 | 
        
           |  |  | 213 | 								continue;
 | 
        
           |  |  | 214 | 							if ( String::Compare(lines[i]->Substring(0, pos), "DirExe") )
 | 
        
           |  |  | 215 | 								continue;
 | 
        
           |  |  | 216 | 							String ^dir = lines[i]->Substring(pos + 1);
 | 
        
           |  |  | 217 | 							cli::array<String ^> ^parts = dir->Split('|');
 | 
        
           |  |  | 218 | 							if ( parts )
 | 
        
           |  |  | 219 | 							{
 | 
        
           |  |  | 220 | 								// no language
 | 
        
           |  |  | 221 | 								String ^language;
 | 
        
           |  |  | 222 | 								String ^dir;
 | 
        
           |  |  | 223 | 								String ^name;
 | 
        
           |  |  | 224 | 								if ( parts->Length == 2 )
 | 
        
           |  |  | 225 | 								{
 | 
        
           |  |  | 226 | 									dir = parts[1];
 | 
        
           |  |  | 227 | 									name = parts[0];
 | 
        
           |  |  | 228 | 								}
 | 
        
           |  |  | 229 | 								else if ( parts->Length > 2 )
 | 
        
           |  |  | 230 | 								{
 | 
        
           |  |  | 231 | 									language = parts[0];
 | 
        
           |  |  | 232 | 									name = parts[1];
 | 
        
           |  |  | 233 | 									dir = parts[2];
 | 
        
           |  |  | 234 | 								}
 | 
        
           |  |  | 235 | 								else
 | 
        
           |  |  | 236 | 									continue;
 | 
        
           |  |  | 237 |   | 
        
           |  |  | 238 | 								this->AddGame(dir, name, language);
 | 
        
           |  |  | 239 | 							}
 | 
        
           |  |  | 240 | 						}
 | 
        
           |  |  | 241 | 					}
 | 
        
           |  |  | 242 | 				}
 | 
        
           |  |  | 243 | 				catch (IO::IOException ^) { }
 | 
        
           |  |  | 244 | 				catch (System::Exception ^) {}
 | 
        
           |  |  | 245 | 			}
 | 
        
           |  |  | 246 | 		}
 | 
        
           |  |  | 247 |   | 
        
           | 105 | cycrow | 248 | 	protected:
 | 
        
           |  |  | 249 | 		void _launchManager(bool bAdvanced);
 | 
        
           |  |  | 250 |   | 
        
           |  |  | 251 |   | 
        
           | 1 | cycrow | 252 | 	private: System::Windows::Forms::ToolStripMenuItem^  resumeManagerToolStripMenuItem;
 | 
        
           |  |  | 253 | 	public: 
 | 
        
           |  |  | 254 | 	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator1;
 | 
        
           |  |  | 255 |   | 
        
           |  |  | 256 | 	protected:
 | 
        
           |  |  | 257 | private: System::Windows::Forms::ToolStripMenuItem^  ContextGames;
 | 
        
           |  |  | 258 | protected: 
 | 
        
           |  |  | 259 | private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator2;
 | 
        
           |  |  | 260 | private: System::Windows::Forms::ToolStripMenuItem^  settingsToolStripMenuItem;
 | 
        
           |  |  | 261 | private: System::Windows::Forms::ToolStripMenuItem^  ContextResume;
 | 
        
           |  |  | 262 | private: System::Windows::Forms::ToolStripMenuItem^  ContextAutoClose;
 | 
        
           |  |  | 263 | private: System::Windows::Forms::Timer^  timer1;
 | 
        
           |  |  | 264 | private: System::Windows::Forms::ImageList^  imageList1;
 | 
        
           |  |  | 265 | private: System::Windows::Forms::Timer^  timerGameData;
 | 
        
           |  |  | 266 |   | 
        
           |  |  | 267 | 		bool	m_bResume;
 | 
        
           |  |  | 268 | 		bool	m_bClose;
 | 
        
           |  |  | 269 | 		bool	m_bAutoResume;
 | 
        
           |  |  | 270 | 		bool	m_bCheckProcess;
 | 
        
           |  |  | 271 | 		bool	m_bAutoClose;
 | 
        
           |  |  | 272 | 		bool	m_bGameClosed;
 | 
        
           |  |  | 273 | 		bool	m_bUpdateLCD;
 | 
        
           |  |  | 274 | 		bool	m_bCustomGui;
 | 
        
           |  |  | 275 | 		bool	m_bGuiHooked;
 | 
        
           |  |  | 276 | private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator3;
 | 
        
           |  |  | 277 | private: System::Windows::Forms::ToolStripMenuItem^  gameLogToolStripMenuItem;
 | 
        
           |  |  | 278 | private: System::Windows::Forms::ToolStripMenuItem^  gameDataToolStripMenuItem;
 | 
        
           |  |  | 279 | private: System::Windows::Forms::ToolStripMenuItem^  updateLCDToolStripMenuItem;
 | 
        
           |  |  | 280 | private: System::Windows::Forms::ToolStripMenuItem^  aboutToolStripMenuItem;
 | 
        
           |  |  | 281 | private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator4;
 | 
        
           |  |  | 282 | private: System::Windows::Forms::Label^  label1;
 | 
        
           |  |  | 283 | private: System::Windows::Forms::Label^  label2;
 | 
        
           |  |  | 284 | private: System::Windows::Forms::Label^  label3;
 | 
        
           |  |  | 285 | private: System::Windows::Forms::LinkLabel^  linkLabel1;
 | 
        
           |  |  | 286 | private: System::Windows::Forms::Timer^  timerCheckGame;
 | 
        
           |  |  | 287 | private: System::Windows::Forms::ToolStripMenuItem^  gUIOverlayToolStripMenuItem;
 | 
        
           | 105 | cycrow | 288 | private: System::Windows::Forms::ToolStripMenuItem^  launchManagerAdvancedToolStripMenuItem;
 | 
        
           | 1 | cycrow | 289 | 		 bool	m_bNoLCD;
 | 
        
           |  |  | 290 |   | 
        
           |  |  | 291 | 		void ParseNewData(bool updated)
 | 
        
           |  |  | 292 | 		{
 | 
        
           |  |  | 293 | 			if ( m_bUpdateLCD && m_pLCD )
 | 
        
           |  |  | 294 | 			{
 | 
        
           |  |  | 295 | 				m_pLCD->UpdateDisplay(updated);
 | 
        
           |  |  | 296 | 			}
 | 
        
           |  |  | 297 | 		}
 | 
        
           |  |  | 298 |   | 
        
           | 85 | cycrow | 299 | 		void StartGame(String ^originalGame, String ^args, String ^name)
 | 
        
           | 1 | cycrow | 300 | 		{
 | 
        
           | 85 | cycrow | 301 | 			System::String ^game = originalGame;
 | 
        
           | 1 | cycrow | 302 | 			if ( !game )
 | 
        
           |  |  | 303 | 				return;
 | 
        
           | 85 | cycrow | 304 |   | 
        
           |  |  | 305 | 			String ^noSteamExe = System::IO::FileInfo(game).DirectoryName + "\\" + System::IO::Path::GetFileNameWithoutExtension(game) + "_n.exe";
 | 
        
           |  |  | 306 | 			if ( System::IO::File::Exists(noSteamExe) ) {
 | 
        
           |  |  | 307 | 				game = noSteamExe;
 | 
        
           |  |  | 308 | 			}
 | 
        
           |  |  | 309 |   | 
        
           | 1 | cycrow | 310 | 			System::Diagnostics::ProcessStartInfo ^info = gcnew System::Diagnostics::ProcessStartInfo(game);
 | 
        
           |  |  | 311 | 			info->WorkingDirectory = System::IO::FileInfo(game).DirectoryName;
 | 
        
           | 85 | cycrow | 312 |   | 
        
           | 1 | cycrow | 313 | 			m_bRunSteam = game->Contains("steamapps");
 | 
        
           |  |  | 314 | 			m_sGameRunExe = System::IO::FileInfo(game).Name;
 | 
        
           |  |  | 315 | 			m_sGameName = name;
 | 
        
           |  |  | 316 | 			m_bWaitingSteam = m_bRunSteam;
 | 
        
           | 85 | cycrow | 317 |   | 
        
           | 1 | cycrow | 318 | 			info->Arguments = args;
 | 
        
           |  |  | 319 | 			info->UseShellExecute = false;
 | 
        
           |  |  | 320 | 			info->WindowStyle = System::Diagnostics::ProcessWindowStyle::Normal;
 | 
        
           |  |  | 321 | 			System::Diagnostics::Process ^process = gcnew System::Diagnostics::Process;
 | 
        
           |  |  | 322 | 			process->StartInfo = info;
 | 
        
           |  |  | 323 | 			process->StartInfo->CreateNoWindow = true;
 | 
        
           |  |  | 324 | 			process->EnableRaisingEvents = true;
 | 
        
           |  |  | 325 | 			process->Exited += gcnew EventHandler(this, &Form1::ProgramClosedEvent);
 | 
        
           |  |  | 326 |   | 
        
           |  |  | 327 | 			// setup game to read log files
 | 
        
           | 85 | cycrow | 328 | 			SetLogDirForGame(originalGame);
 | 
        
           | 1 | cycrow | 329 | 			m_pGameData->Reset();
 | 
        
           | 242 | cycrow | 330 | 			m_pGameData->setGameName(_WS(name));
 | 
        
           |  |  | 331 | 			m_pGameData->setGameDirectory(_WS(System::IO::FileInfo(game).DirectoryName));
 | 
        
           | 1 | cycrow | 332 | 			m_bGameClosed = false;
 | 
        
           |  |  | 333 |   | 
        
           |  |  | 334 | 			m_bGuiHooked = false;
 | 
        
           |  |  | 335 | 			if ( m_bCustomGui )
 | 
        
           |  |  | 336 | 			{
 | 
        
           |  |  | 337 | 				if ( IO::File::Exists(info->WorkingDirectory + "\\X-Gui.dll") || IO::File::Exists(IO::FileInfo(System::Windows::Forms::Application::ExecutablePath).DirectoryName + "\\X-Gui.dll") )
 | 
        
           |  |  | 338 | 				{
 | 
        
           |  |  | 339 | 					RegistryKey ^searchKey = Registry::CurrentUser->CreateSubKey("Software\\Egosoft\\XUniverseGame-Hook");
 | 
        
           |  |  | 340 | 					if ( searchKey )
 | 
        
           |  |  | 341 | 					{
 | 
        
           |  |  | 342 | 						searchKey->SetValue("", System::IO::FileInfo(game).Name);
 | 
        
           |  |  | 343 | 						searchKey->SetValue("LogDir", m_sLogDir);
 | 
        
           |  |  | 344 | 						searchKey->SetValue("GameDir", System::IO::FileInfo(game).DirectoryName);
 | 
        
           |  |  | 345 | 						InstallHook();
 | 
        
           |  |  | 346 | 						m_bGuiHooked = true;
 | 
        
           |  |  | 347 | 					}
 | 
        
           |  |  | 348 | 				}
 | 
        
           |  |  | 349 | 			}
 | 
        
           |  |  | 350 |   | 
        
           |  |  | 351 | 			// start the game
 | 
        
           |  |  | 352 | 			process->Start();
 | 
        
           |  |  | 353 | 			this->ContextGames->Visible = false;
 | 
        
           |  |  | 354 | 			this->gameDataToolStripMenuItem->Visible = true;
 | 
        
           |  |  | 355 |   | 
        
           |  |  | 356 | 			// check for LCD
 | 
        
           |  |  | 357 | 		    CEzLcd* pEzlcd = new CEzLcd();
 | 
        
           |  |  | 358 | 		    // Have it initialize itself
 | 
        
           |  |  | 359 | 			if ( pEzlcd->InitYourself(_T("X-Universe LCD Display"), false, false) == S_OK )
 | 
        
           |  |  | 360 | 			{
 | 
        
           |  |  | 361 | 				if ( m_pLCD ) delete m_pLCD;
 | 
        
           |  |  | 362 | 				m_pLCD = new CLCDDisplay(pEzlcd, m_pGameData);
 | 
        
           |  |  | 363 | 			}
 | 
        
           |  |  | 364 | 			else
 | 
        
           |  |  | 365 | 			{
 | 
        
           |  |  | 366 | 				this->updateLCDToolStripMenuItem->Visible = false;
 | 
        
           |  |  | 367 | 				delete pEzlcd;
 | 
        
           |  |  | 368 | 			}
 | 
        
           |  |  | 369 |   | 
        
           |  |  | 370 | 			timerGameData->Start();
 | 
        
           |  |  | 371 | 		}
 | 
        
           |  |  | 372 |   | 
        
           |  |  | 373 | 		void EndGame()
 | 
        
           |  |  | 374 | 		{
 | 
        
           |  |  | 375 | 			timerGameData->Stop();
 | 
        
           |  |  | 376 | 			this->gameDataToolStripMenuItem->Visible = false;
 | 
        
           |  |  | 377 | 			this->ContextGames->Visible = true;
 | 
        
           |  |  | 378 |   | 
        
           |  |  | 379 | 			if ( m_pLCD ) delete m_pLCD;
 | 
        
           |  |  | 380 | 			m_pLCD = NULL;
 | 
        
           |  |  | 381 |   | 
        
           | 298 | cycrow | 382 | 			Utils::WString logfile = _WS(m_sLogDir);
 | 
        
           |  |  | 383 | 			logfile += L"/log";
 | 
        
           |  |  | 384 | 			logfile += Utils::WString((long)m_iGameLog).padNumber(5);
 | 
        
           |  |  | 385 | 			logfile += L".txt";
 | 
        
           |  |  | 386 | 			String ^sLog = _US(logfile);
 | 
        
           | 1 | cycrow | 387 | 			System::IO::File::Delete(sLog);
 | 
        
           |  |  | 388 |   | 
        
           |  |  | 389 | 			// unhook the gui
 | 
        
           |  |  | 390 | 			if ( m_bGuiHooked )
 | 
        
           |  |  | 391 | 			{
 | 
        
           |  |  | 392 | 				RemoveHook();
 | 
        
           |  |  | 393 | 				m_bGuiHooked = false;
 | 
        
           |  |  | 394 | 			}
 | 
        
           |  |  | 395 |   | 
        
           |  |  | 396 | 			if ( m_bAutoClose )
 | 
        
           |  |  | 397 | 			{
 | 
        
           |  |  | 398 | 				m_bClosing = true;
 | 
        
           |  |  | 399 | 				this->Close();
 | 
        
           |  |  | 400 | 			}
 | 
        
           |  |  | 401 | 		}
 | 
        
           |  |  | 402 |   | 
        
           |  |  | 403 | 		void LaunchManager(bool advanced)
 | 
        
           |  |  | 404 | 		{
 | 
        
           |  |  | 405 | 			 if ( !m_sManager || !m_sManager->Length )
 | 
        
           |  |  | 406 | 				 MessageBox::Show(this, "Unable to run the Plugin Manager, cant find exe", "Unable to Run", MessageBoxButtons::OK, MessageBoxIcon::Error);
 | 
        
           |  |  | 407 | 			 else
 | 
        
           |  |  | 408 | 			 {
 | 
        
           |  |  | 409 | 				System::Diagnostics::ProcessStartInfo ^info = gcnew System::Diagnostics::ProcessStartInfo(m_sManager);
 | 
        
           |  |  | 410 | 				info->WorkingDirectory = System::IO::FileInfo(m_sManager).DirectoryName;
 | 
        
           |  |  | 411 | 				info->UseShellExecute = false;
 | 
        
           |  |  | 412 | 				info->WindowStyle = System::Diagnostics::ProcessWindowStyle::Normal;
 | 
        
           |  |  | 413 | 				info->Arguments = "\"--fromlauncher\"";
 | 
        
           |  |  | 414 | 				if ( advanced )
 | 
        
           |  |  | 415 | 					info->Arguments += " \"--advanced\"";
 | 
        
           |  |  | 416 | 				System::Diagnostics::Process ^process = System::Diagnostics::Process::Start(info);
 | 
        
           |  |  | 417 | 			 }
 | 
        
           |  |  | 418 | 		}
 | 
        
           |  |  | 419 |   | 
        
           |  |  | 420 | 		/// <summary>
 | 
        
           |  |  | 421 | 		/// Clean up any resources being used.
 | 
        
           |  |  | 422 | 		/// </summary>
 | 
        
           |  |  | 423 | 		~Form1()
 | 
        
           |  |  | 424 | 		{
 | 
        
           |  |  | 425 | 			if (components)
 | 
        
           |  |  | 426 | 			{
 | 
        
           |  |  | 427 | 				delete components;
 | 
        
           |  |  | 428 | 			}
 | 
        
           |  |  | 429 | 			delete m_pGameData;
 | 
        
           |  |  | 430 | 			if ( m_pLCD ) delete m_pLCD;
 | 
        
           |  |  | 431 |   | 
        
           |  |  | 432 | 			if ( m_bGuiHooked )
 | 
        
           |  |  | 433 | 			{
 | 
        
           |  |  | 434 | 				RemoveHook();
 | 
        
           |  |  | 435 | 				m_bGuiHooked = false;
 | 
        
           |  |  | 436 | 			}
 | 
        
           |  |  | 437 |   | 
        
           |  |  | 438 | 		}
 | 
        
           |  |  | 439 | 	private: System::Windows::Forms::NotifyIcon^  notifyIcon1;
 | 
        
           |  |  | 440 | 	protected: 
 | 
        
           |  |  | 441 | 		bool	m_bWaitingSteam;
 | 
        
           |  |  | 442 | 		bool	m_bRunSteam;
 | 
        
           |  |  | 443 | 		int		m_iGameLog;
 | 
        
           |  |  | 444 | 		String ^m_sGameRunExe;
 | 
        
           |  |  | 445 | 		System::String ^m_sGameName;
 | 
        
           |  |  | 446 | 		System::String ^m_sGame;
 | 
        
           |  |  | 447 | 		System::String ^m_sManager;
 | 
        
           |  |  | 448 | 		System::String ^m_sArgs;
 | 
        
           |  |  | 449 | 		System::String ^m_sLogDir;
 | 
        
           |  |  | 450 | 		CLCDDisplay *m_pLCD;
 | 
        
           |  |  | 451 | 		CX3Data *m_pGameData;
 | 
        
           |  |  | 452 | 		bool	m_bClosing;
 | 
        
           |  |  | 453 | 	private: System::Windows::Forms::ContextMenuStrip^  contextMenuStrip1;
 | 
        
           |  |  | 454 | 	protected: 
 | 
        
           |  |  | 455 | 	private: System::Windows::Forms::ToolStripMenuItem^  closeToolStripMenuItem;
 | 
        
           |  |  | 456 | 	private: System::ComponentModel::IContainer^  components;
 | 
        
           |  |  | 457 |   | 
        
           |  |  | 458 | 	private:
 | 
        
           |  |  | 459 | 		/// <summary>
 | 
        
           |  |  | 460 | 		/// Required designer variable.
 | 
        
           |  |  | 461 | 		/// </summary>
 | 
        
           |  |  | 462 |   | 
        
           |  |  | 463 |   | 
        
           |  |  | 464 | #pragma region Windows Form Designer generated code
 | 
        
           |  |  | 465 | 		/// <summary>
 | 
        
           |  |  | 466 | 		/// Required method for Designer support - do not modify
 | 
        
           |  |  | 467 | 		/// the contents of this method with the code editor.
 | 
        
           |  |  | 468 | 		/// </summary>
 | 
        
           |  |  | 469 | 		void InitializeComponent(void)
 | 
        
           |  |  | 470 | 		{
 | 
        
           |  |  | 471 | 			this->components = (gcnew System::ComponentModel::Container());
 | 
        
           |  |  | 472 | 			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
 | 
        
           |  |  | 473 | 			this->notifyIcon1 = (gcnew System::Windows::Forms::NotifyIcon(this->components));
 | 
        
           |  |  | 474 | 			this->contextMenuStrip1 = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
 | 
        
           |  |  | 475 | 			this->aboutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
 | 
        
           |  |  | 476 | 			this->toolStripSeparator4 = (gcnew System::Windows::Forms::ToolStripSeparator());
 | 
        
           |  |  | 477 | 			this->settingsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
 | 
        
           |  |  | 478 | 			this->ContextResume = (gcnew System::Windows::Forms::ToolStripMenuItem());
 | 
        
           |  |  | 479 | 			this->ContextAutoClose = (gcnew System::Windows::Forms::ToolStripMenuItem());
 | 
        
           |  |  | 480 | 			this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
 | 
        
           |  |  | 481 | 			this->gameLogToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
 | 
        
           |  |  | 482 | 			this->updateLCDToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
 | 
        
           | 105 | cycrow | 483 | 			this->gUIOverlayToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
 | 
        
           | 1 | cycrow | 484 | 			this->resumeManagerToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
 | 
        
           |  |  | 485 | 			this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());
 | 
        
           |  |  | 486 | 			this->ContextGames = (gcnew System::Windows::Forms::ToolStripMenuItem());
 | 
        
           |  |  | 487 | 			this->gameDataToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
 | 
        
           |  |  | 488 | 			this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
 | 
        
           |  |  | 489 | 			this->closeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
 | 
        
           |  |  | 490 | 			this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
 | 
        
           |  |  | 491 | 			this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
 | 
        
           |  |  | 492 | 			this->timerGameData = (gcnew System::Windows::Forms::Timer(this->components));
 | 
        
           |  |  | 493 | 			this->label1 = (gcnew System::Windows::Forms::Label());
 | 
        
           |  |  | 494 | 			this->label2 = (gcnew System::Windows::Forms::Label());
 | 
        
           |  |  | 495 | 			this->label3 = (gcnew System::Windows::Forms::Label());
 | 
        
           |  |  | 496 | 			this->linkLabel1 = (gcnew System::Windows::Forms::LinkLabel());
 | 
        
           |  |  | 497 | 			this->timerCheckGame = (gcnew System::Windows::Forms::Timer(this->components));
 | 
        
           | 105 | cycrow | 498 | 			this->launchManagerAdvancedToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
 | 
        
           | 1 | cycrow | 499 | 			this->contextMenuStrip1->SuspendLayout();
 | 
        
           |  |  | 500 | 			this->SuspendLayout();
 | 
        
           |  |  | 501 | 			// 
 | 
        
           |  |  | 502 | 			// notifyIcon1
 | 
        
           |  |  | 503 | 			// 
 | 
        
           |  |  | 504 | 			this->notifyIcon1->ContextMenuStrip = this->contextMenuStrip1;
 | 
        
           |  |  | 505 | 			this->notifyIcon1->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"notifyIcon1.Icon")));
 | 
        
           |  |  | 506 | 			this->notifyIcon1->Text = L"X-Universe Game Launcher";
 | 
        
           |  |  | 507 | 			this->notifyIcon1->Visible = true;
 | 
        
           |  |  | 508 | 			this->notifyIcon1->DoubleClick += gcnew System::EventHandler(this, &Form1::notifyIcon1_DoubleClick);
 | 
        
           |  |  | 509 | 			// 
 | 
        
           |  |  | 510 | 			// contextMenuStrip1
 | 
        
           |  |  | 511 | 			// 
 | 
        
           | 105 | cycrow | 512 | 			this->contextMenuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(10) {this->aboutToolStripMenuItem, 
 | 
        
           |  |  | 513 | 				this->toolStripSeparator4, this->settingsToolStripMenuItem, this->resumeManagerToolStripMenuItem, this->launchManagerAdvancedToolStripMenuItem, 
 | 
        
           |  |  | 514 | 				this->toolStripSeparator1, this->ContextGames, this->gameDataToolStripMenuItem, this->toolStripSeparator2, this->closeToolStripMenuItem});
 | 
        
           | 1 | cycrow | 515 | 			this->contextMenuStrip1->Name = L"contextMenuStrip1";
 | 
        
           | 105 | cycrow | 516 | 			this->contextMenuStrip1->Size = System::Drawing::Size(228, 198);
 | 
        
           | 1 | cycrow | 517 | 			// 
 | 
        
           |  |  | 518 | 			// aboutToolStripMenuItem
 | 
        
           |  |  | 519 | 			// 
 | 
        
           |  |  | 520 | 			this->aboutToolStripMenuItem->Name = L"aboutToolStripMenuItem";
 | 
        
           | 105 | cycrow | 521 | 			this->aboutToolStripMenuItem->Size = System::Drawing::Size(227, 22);
 | 
        
           | 1 | cycrow | 522 | 			this->aboutToolStripMenuItem->Text = L"About";
 | 
        
           |  |  | 523 | 			this->aboutToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::aboutToolStripMenuItem_Click);
 | 
        
           |  |  | 524 | 			// 
 | 
        
           |  |  | 525 | 			// toolStripSeparator4
 | 
        
           |  |  | 526 | 			// 
 | 
        
           |  |  | 527 | 			this->toolStripSeparator4->Name = L"toolStripSeparator4";
 | 
        
           | 105 | cycrow | 528 | 			this->toolStripSeparator4->Size = System::Drawing::Size(224, 6);
 | 
        
           | 1 | cycrow | 529 | 			// 
 | 
        
           |  |  | 530 | 			// settingsToolStripMenuItem
 | 
        
           |  |  | 531 | 			// 
 | 
        
           |  |  | 532 | 			this->settingsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(6) {this->ContextResume, 
 | 
        
           |  |  | 533 | 				this->ContextAutoClose, this->toolStripSeparator3, this->gameLogToolStripMenuItem, this->updateLCDToolStripMenuItem, this->gUIOverlayToolStripMenuItem});
 | 
        
           |  |  | 534 | 			this->settingsToolStripMenuItem->Name = L"settingsToolStripMenuItem";
 | 
        
           | 105 | cycrow | 535 | 			this->settingsToolStripMenuItem->Size = System::Drawing::Size(227, 22);
 | 
        
           | 1 | cycrow | 536 | 			this->settingsToolStripMenuItem->Text = L"Settings";
 | 
        
           |  |  | 537 | 			// 
 | 
        
           |  |  | 538 | 			// ContextResume
 | 
        
           |  |  | 539 | 			// 
 | 
        
           |  |  | 540 | 			this->ContextResume->Checked = true;
 | 
        
           |  |  | 541 | 			this->ContextResume->CheckOnClick = true;
 | 
        
           |  |  | 542 | 			this->ContextResume->CheckState = System::Windows::Forms::CheckState::Checked;
 | 
        
           |  |  | 543 | 			this->ContextResume->Name = L"ContextResume";
 | 
        
           | 105 | cycrow | 544 | 			this->ContextResume->Size = System::Drawing::Size(145, 22);
 | 
        
           | 1 | cycrow | 545 | 			this->ContextResume->Text = L"Auto Resume";
 | 
        
           |  |  | 546 | 			this->ContextResume->CheckedChanged += gcnew System::EventHandler(this, &Form1::ContextResume_CheckedChanged);
 | 
        
           |  |  | 547 | 			// 
 | 
        
           |  |  | 548 | 			// ContextAutoClose
 | 
        
           |  |  | 549 | 			// 
 | 
        
           |  |  | 550 | 			this->ContextAutoClose->Checked = true;
 | 
        
           |  |  | 551 | 			this->ContextAutoClose->CheckOnClick = true;
 | 
        
           |  |  | 552 | 			this->ContextAutoClose->CheckState = System::Windows::Forms::CheckState::Checked;
 | 
        
           |  |  | 553 | 			this->ContextAutoClose->Name = L"ContextAutoClose";
 | 
        
           | 105 | cycrow | 554 | 			this->ContextAutoClose->Size = System::Drawing::Size(145, 22);
 | 
        
           | 1 | cycrow | 555 | 			this->ContextAutoClose->Text = L"Auto Close";
 | 
        
           |  |  | 556 | 			this->ContextAutoClose->Click += gcnew System::EventHandler(this, &Form1::ContextAutoClose_Click);
 | 
        
           |  |  | 557 | 			// 
 | 
        
           |  |  | 558 | 			// toolStripSeparator3
 | 
        
           |  |  | 559 | 			// 
 | 
        
           |  |  | 560 | 			this->toolStripSeparator3->Name = L"toolStripSeparator3";
 | 
        
           | 105 | cycrow | 561 | 			this->toolStripSeparator3->Size = System::Drawing::Size(142, 6);
 | 
        
           | 1 | cycrow | 562 | 			// 
 | 
        
           |  |  | 563 | 			// gameLogToolStripMenuItem
 | 
        
           |  |  | 564 | 			// 
 | 
        
           |  |  | 565 | 			this->gameLogToolStripMenuItem->Name = L"gameLogToolStripMenuItem";
 | 
        
           | 105 | cycrow | 566 | 			this->gameLogToolStripMenuItem->Size = System::Drawing::Size(145, 22);
 | 
        
           | 1 | cycrow | 567 | 			this->gameLogToolStripMenuItem->Text = L"Game Log";
 | 
        
           |  |  | 568 | 			this->gameLogToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::gameLogToolStripMenuItem_Click);
 | 
        
           |  |  | 569 | 			// 
 | 
        
           |  |  | 570 | 			// updateLCDToolStripMenuItem
 | 
        
           |  |  | 571 | 			// 
 | 
        
           |  |  | 572 | 			this->updateLCDToolStripMenuItem->Checked = true;
 | 
        
           |  |  | 573 | 			this->updateLCDToolStripMenuItem->CheckOnClick = true;
 | 
        
           |  |  | 574 | 			this->updateLCDToolStripMenuItem->CheckState = System::Windows::Forms::CheckState::Checked;
 | 
        
           |  |  | 575 | 			this->updateLCDToolStripMenuItem->Name = L"updateLCDToolStripMenuItem";
 | 
        
           | 105 | cycrow | 576 | 			this->updateLCDToolStripMenuItem->Size = System::Drawing::Size(145, 22);
 | 
        
           | 1 | cycrow | 577 | 			this->updateLCDToolStripMenuItem->Text = L"Update LCD";
 | 
        
           |  |  | 578 | 			this->updateLCDToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::updateLCDToolStripMenuItem_Click);
 | 
        
           |  |  | 579 | 			// 
 | 
        
           | 105 | cycrow | 580 | 			// gUIOverlayToolStripMenuItem
 | 
        
           |  |  | 581 | 			// 
 | 
        
           |  |  | 582 | 			this->gUIOverlayToolStripMenuItem->Checked = true;
 | 
        
           |  |  | 583 | 			this->gUIOverlayToolStripMenuItem->CheckOnClick = true;
 | 
        
           |  |  | 584 | 			this->gUIOverlayToolStripMenuItem->CheckState = System::Windows::Forms::CheckState::Checked;
 | 
        
           |  |  | 585 | 			this->gUIOverlayToolStripMenuItem->Name = L"gUIOverlayToolStripMenuItem";
 | 
        
           |  |  | 586 | 			this->gUIOverlayToolStripMenuItem->Size = System::Drawing::Size(145, 22);
 | 
        
           |  |  | 587 | 			this->gUIOverlayToolStripMenuItem->Text = L"GUI Overlay";
 | 
        
           |  |  | 588 | 			this->gUIOverlayToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::gUIOverlayToolStripMenuItem_Click);
 | 
        
           |  |  | 589 | 			// 
 | 
        
           | 1 | cycrow | 590 | 			// resumeManagerToolStripMenuItem
 | 
        
           |  |  | 591 | 			// 
 | 
        
           |  |  | 592 | 			this->resumeManagerToolStripMenuItem->Name = L"resumeManagerToolStripMenuItem";
 | 
        
           | 105 | cycrow | 593 | 			this->resumeManagerToolStripMenuItem->Size = System::Drawing::Size(227, 22);
 | 
        
           |  |  | 594 | 			this->resumeManagerToolStripMenuItem->Text = L"Launch Manager (Lite)";
 | 
        
           | 1 | cycrow | 595 | 			this->resumeManagerToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::resumeManagerToolStripMenuItem_Click);
 | 
        
           |  |  | 596 | 			// 
 | 
        
           |  |  | 597 | 			// toolStripSeparator1
 | 
        
           |  |  | 598 | 			// 
 | 
        
           |  |  | 599 | 			this->toolStripSeparator1->Name = L"toolStripSeparator1";
 | 
        
           | 105 | cycrow | 600 | 			this->toolStripSeparator1->Size = System::Drawing::Size(224, 6);
 | 
        
           | 1 | cycrow | 601 | 			// 
 | 
        
           |  |  | 602 | 			// ContextGames
 | 
        
           |  |  | 603 | 			// 
 | 
        
           |  |  | 604 | 			this->ContextGames->Name = L"ContextGames";
 | 
        
           | 105 | cycrow | 605 | 			this->ContextGames->Size = System::Drawing::Size(227, 22);
 | 
        
           | 1 | cycrow | 606 | 			this->ContextGames->Text = L"Launch Game";
 | 
        
           |  |  | 607 | 			// 
 | 
        
           |  |  | 608 | 			// gameDataToolStripMenuItem
 | 
        
           |  |  | 609 | 			// 
 | 
        
           |  |  | 610 | 			this->gameDataToolStripMenuItem->Name = L"gameDataToolStripMenuItem";
 | 
        
           | 105 | cycrow | 611 | 			this->gameDataToolStripMenuItem->Size = System::Drawing::Size(227, 22);
 | 
        
           | 1 | cycrow | 612 | 			this->gameDataToolStripMenuItem->Text = L"View Game Data";
 | 
        
           |  |  | 613 | 			this->gameDataToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::gameDataToolStripMenuItem_Click);
 | 
        
           |  |  | 614 | 			// 
 | 
        
           |  |  | 615 | 			// toolStripSeparator2
 | 
        
           |  |  | 616 | 			// 
 | 
        
           |  |  | 617 | 			this->toolStripSeparator2->Name = L"toolStripSeparator2";
 | 
        
           | 105 | cycrow | 618 | 			this->toolStripSeparator2->Size = System::Drawing::Size(224, 6);
 | 
        
           | 1 | cycrow | 619 | 			// 
 | 
        
           |  |  | 620 | 			// closeToolStripMenuItem
 | 
        
           |  |  | 621 | 			// 
 | 
        
           |  |  | 622 | 			this->closeToolStripMenuItem->Name = L"closeToolStripMenuItem";
 | 
        
           | 105 | cycrow | 623 | 			this->closeToolStripMenuItem->Size = System::Drawing::Size(227, 22);
 | 
        
           | 1 | cycrow | 624 | 			this->closeToolStripMenuItem->Text = L"Close";
 | 
        
           |  |  | 625 | 			this->closeToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::closeToolStripMenuItem_Click);
 | 
        
           |  |  | 626 | 			// 
 | 
        
           |  |  | 627 | 			// timer1
 | 
        
           |  |  | 628 | 			// 
 | 
        
           |  |  | 629 | 			this->timer1->Enabled = true;
 | 
        
           |  |  | 630 | 			this->timer1->Interval = 1000;
 | 
        
           |  |  | 631 | 			this->timer1->Tick += gcnew System::EventHandler(this, &Form1::timer1_Tick);
 | 
        
           |  |  | 632 | 			// 
 | 
        
           |  |  | 633 | 			// imageList1
 | 
        
           |  |  | 634 | 			// 
 | 
        
           |  |  | 635 | 			this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imageList1.ImageStream")));
 | 
        
           |  |  | 636 | 			this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
 | 
        
           |  |  | 637 | 			this->imageList1->Images->SetKeyName(0, L"x3.exe");
 | 
        
           |  |  | 638 | 			this->imageList1->Images->SetKeyName(1, L"x3tc.exe");
 | 
        
           |  |  | 639 | 			this->imageList1->Images->SetKeyName(2, L"x2.exe");
 | 
        
           |  |  | 640 | 			// 
 | 
        
           |  |  | 641 | 			// timerGameData
 | 
        
           |  |  | 642 | 			// 
 | 
        
           |  |  | 643 | 			this->timerGameData->Tick += gcnew System::EventHandler(this, &Form1::timerGameData_Tick);
 | 
        
           |  |  | 644 | 			// 
 | 
        
           |  |  | 645 | 			// label1
 | 
        
           |  |  | 646 | 			// 
 | 
        
           |  |  | 647 | 			this->label1->Dock = System::Windows::Forms::DockStyle::Top;
 | 
        
           |  |  | 648 | 			this->label1->Font = (gcnew System::Drawing::Font(L"Segoe Print", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
 | 
        
           |  |  | 649 | 				static_cast<System::Byte>(0)));
 | 
        
           |  |  | 650 | 			this->label1->Location = System::Drawing::Point(0, 0);
 | 
        
           |  |  | 651 | 			this->label1->Name = L"label1";
 | 
        
           |  |  | 652 | 			this->label1->Size = System::Drawing::Size(328, 49);
 | 
        
           |  |  | 653 | 			this->label1->TabIndex = 1;
 | 
        
           |  |  | 654 | 			this->label1->Text = L"X-Universe Game Launcher";
 | 
        
           |  |  | 655 | 			this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
 | 
        
           |  |  | 656 | 			// 
 | 
        
           |  |  | 657 | 			// label2
 | 
        
           |  |  | 658 | 			// 
 | 
        
           |  |  | 659 | 			this->label2->Dock = System::Windows::Forms::DockStyle::Top;
 | 
        
           |  |  | 660 | 			this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Italic, System::Drawing::GraphicsUnit::Point, 
 | 
        
           |  |  | 661 | 				static_cast<System::Byte>(0)));
 | 
        
           |  |  | 662 | 			this->label2->Location = System::Drawing::Point(0, 49);
 | 
        
           |  |  | 663 | 			this->label2->Name = L"label2";
 | 
        
           |  |  | 664 | 			this->label2->Size = System::Drawing::Size(328, 30);
 | 
        
           |  |  | 665 | 			this->label2->TabIndex = 2;
 | 
        
           |  |  | 666 | 			this->label2->Text = L"By Cycrow";
 | 
        
           |  |  | 667 | 			this->label2->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
 | 
        
           |  |  | 668 | 			// 
 | 
        
           |  |  | 669 | 			// label3
 | 
        
           |  |  | 670 | 			// 
 | 
        
           |  |  | 671 | 			this->label3->Dock = System::Windows::Forms::DockStyle::Top;
 | 
        
           |  |  | 672 | 			this->label3->Location = System::Drawing::Point(0, 79);
 | 
        
           |  |  | 673 | 			this->label3->Name = L"label3";
 | 
        
           |  |  | 674 | 			this->label3->Size = System::Drawing::Size(328, 30);
 | 
        
           |  |  | 675 | 			this->label3->TabIndex = 3;
 | 
        
           |  |  | 676 | 			this->label3->Text = L"Version: 1.00";
 | 
        
           |  |  | 677 | 			this->label3->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
 | 
        
           |  |  | 678 | 			// 
 | 
        
           |  |  | 679 | 			// linkLabel1
 | 
        
           |  |  | 680 | 			// 
 | 
        
           |  |  | 681 | 			this->linkLabel1->Dock = System::Windows::Forms::DockStyle::Bottom;
 | 
        
           |  |  | 682 | 			this->linkLabel1->Location = System::Drawing::Point(0, 109);
 | 
        
           |  |  | 683 | 			this->linkLabel1->Name = L"linkLabel1";
 | 
        
           |  |  | 684 | 			this->linkLabel1->Size = System::Drawing::Size(328, 34);
 | 
        
           |  |  | 685 | 			this->linkLabel1->TabIndex = 4;
 | 
        
           |  |  | 686 | 			this->linkLabel1->TabStop = true;
 | 
        
           |  |  | 687 | 			this->linkLabel1->Text = L"http://cycrow.thexuniverse.us";
 | 
        
           |  |  | 688 | 			this->linkLabel1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
 | 
        
           |  |  | 689 | 			this->linkLabel1->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, &Form1::linkLabel1_LinkClicked);
 | 
        
           |  |  | 690 | 			// 
 | 
        
           |  |  | 691 | 			// timerCheckGame
 | 
        
           |  |  | 692 | 			// 
 | 
        
           |  |  | 693 | 			this->timerCheckGame->Enabled = true;
 | 
        
           |  |  | 694 | 			this->timerCheckGame->Interval = 1000;
 | 
        
           |  |  | 695 | 			this->timerCheckGame->Tick += gcnew System::EventHandler(this, &Form1::timerCheckGame_Tick);
 | 
        
           |  |  | 696 | 			// 
 | 
        
           | 105 | cycrow | 697 | 			// launchManagerAdvancedToolStripMenuItem
 | 
        
           | 1 | cycrow | 698 | 			// 
 | 
        
           | 105 | cycrow | 699 | 			this->launchManagerAdvancedToolStripMenuItem->Name = L"launchManagerAdvancedToolStripMenuItem";
 | 
        
           |  |  | 700 | 			this->launchManagerAdvancedToolStripMenuItem->Size = System::Drawing::Size(227, 22);
 | 
        
           |  |  | 701 | 			this->launchManagerAdvancedToolStripMenuItem->Text = L"Launch Manager (Advanced)";
 | 
        
           |  |  | 702 | 			this->launchManagerAdvancedToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::launchManagerAdvancedToolStripMenuItem_Click);
 | 
        
           | 1 | cycrow | 703 | 			// 
 | 
        
           |  |  | 704 | 			// Form1
 | 
        
           |  |  | 705 | 			// 
 | 
        
           |  |  | 706 | 			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
 | 
        
           |  |  | 707 | 			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
 | 
        
           |  |  | 708 | 			this->ClientSize = System::Drawing::Size(328, 143);
 | 
        
           |  |  | 709 | 			this->Controls->Add(this->linkLabel1);
 | 
        
           |  |  | 710 | 			this->Controls->Add(this->label3);
 | 
        
           |  |  | 711 | 			this->Controls->Add(this->label2);
 | 
        
           |  |  | 712 | 			this->Controls->Add(this->label1);
 | 
        
           |  |  | 713 | 			this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
 | 
        
           |  |  | 714 | 			this->MaximizeBox = false;
 | 
        
           |  |  | 715 | 			this->MinimizeBox = false;
 | 
        
           |  |  | 716 | 			this->Name = L"Form1";
 | 
        
           |  |  | 717 | 			this->Opacity = 0;
 | 
        
           |  |  | 718 | 			this->ShowInTaskbar = false;
 | 
        
           |  |  | 719 | 			this->SizeGripStyle = System::Windows::Forms::SizeGripStyle::Hide;
 | 
        
           |  |  | 720 | 			this->Text = L"Game Launcher";
 | 
        
           |  |  | 721 | 			this->WindowState = System::Windows::Forms::FormWindowState::Minimized;
 | 
        
           |  |  | 722 | 			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
 | 
        
           |  |  | 723 | 			this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Form1::Form1_FormClosing);
 | 
        
           |  |  | 724 | 			this->contextMenuStrip1->ResumeLayout(false);
 | 
        
           |  |  | 725 | 			this->ResumeLayout(false);
 | 
        
           |  |  | 726 |   | 
        
           |  |  | 727 | 		}
 | 
        
           |  |  | 728 | #pragma endregion
 | 
        
           |  |  | 729 | 	private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 730 | 				 this->StartGame(m_sGame, m_sArgs, GetGameName(m_sGame));
 | 
        
           |  |  | 731 | 			 }
 | 
        
           |  |  | 732 | 			 void ProgramClosedEvent(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 733 | 				 System::Diagnostics::Process ^process = cli::safe_cast<Diagnostics::Process ^>(sender);
 | 
        
           |  |  | 734 | 				 process->WaitForExit();
 | 
        
           |  |  | 735 |   | 
        
           |  |  | 736 | 				 m_bGameClosed = true;
 | 
        
           |  |  | 737 | 				 if ( m_bRunSteam )
 | 
        
           |  |  | 738 | 				 {
 | 
        
           |  |  | 739 | 					 m_bCheckProcess = true;
 | 
        
           |  |  | 740 | 					 m_bWaitingSteam = true;
 | 
        
           |  |  | 741 | 					 m_bGameClosed = false;
 | 
        
           |  |  | 742 | 				 }
 | 
        
           |  |  | 743 | 				 else if ( m_bAutoClose )
 | 
        
           |  |  | 744 | 				 {
 | 
        
           |  |  | 745 | 					 m_bClose = true;
 | 
        
           |  |  | 746 | 					 m_bWaitingSteam = false;
 | 
        
           |  |  | 747 | 				 }
 | 
        
           |  |  | 748 | 			 }
 | 
        
           |  |  | 749 | 	private: System::Void closeToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 750 | 				 m_bClosing = true;
 | 
        
           |  |  | 751 | 				 this->Close();
 | 
        
           |  |  | 752 | 			 }
 | 
        
           |  |  | 753 | private: System::Void ContextResume_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 754 | 			m_bAutoResume = this->ContextResume->Checked;
 | 
        
           |  |  | 755 | 			RegistryKey ^searchKey = Registry::CurrentUser->CreateSubKey("Software\\Egosoft\\PluginManagerSettings");
 | 
        
           |  |  | 756 | 			if ( searchKey )
 | 
        
           |  |  | 757 | 				searchKey->SetValue("DontAutoResume", (m_bAutoResume) ? 0 : 1);
 | 
        
           |  |  | 758 | 		 }
 | 
        
           |  |  | 759 | private: System::Void resumeManagerToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           | 105 | cycrow | 760 | 			 _launchManager(false);
 | 
        
           | 1 | cycrow | 761 | 		 }
 | 
        
           |  |  | 762 | private: System::Void notifyIcon1_DoubleClick(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 763 | 			 m_bResume = true;
 | 
        
           |  |  | 764 | 			 if ( m_bAutoClose )
 | 
        
           |  |  | 765 | 				this->Close();
 | 
        
           |  |  | 766 | 		 }
 | 
        
           |  |  | 767 | private: System::Void LaunchGameEvent(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 768 | 			 ToolStripMenuItem ^item = cli::safe_cast<ToolStripMenuItem ^>(sender);
 | 
        
           |  |  | 769 | 			 if ( item )
 | 
        
           |  |  | 770 | 				 this->StartGame(cli::safe_cast<String ^>(item->Tag), "-noabout", item->Text);
 | 
        
           |  |  | 771 | 		 }
 | 
        
           |  |  | 772 | private: System::Void ContextAutoClose_Click(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 773 | 			m_bAutoClose = this->ContextAutoClose->Checked;
 | 
        
           |  |  | 774 | 			RegistryKey ^searchKey = Registry::CurrentUser->CreateSubKey("Software\\Egosoft\\PluginManagerSettings");
 | 
        
           |  |  | 775 | 			if ( searchKey )
 | 
        
           |  |  | 776 | 				searchKey->SetValue("DontAutoClose", (m_bAutoClose) ? 0 : 1);
 | 
        
           |  |  | 777 | 		 }
 | 
        
           |  |  | 778 | private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 779 | 			 if ( m_bClose )
 | 
        
           |  |  | 780 | 				 this->Close();
 | 
        
           |  |  | 781 | 			 else if ( m_bCheckProcess )
 | 
        
           |  |  | 782 | 			 {
 | 
        
           |  |  | 783 | 				 // check for the steam game
 | 
        
           |  |  | 784 | 				 if ( m_sGameRunExe )
 | 
        
           |  |  | 785 | 				 {
 | 
        
           |  |  | 786 | 					 String ^name = m_sGameRunExe->Substring(0, m_sGameRunExe->IndexOf('.'));
 | 
        
           |  |  | 787 | 					 cli::array<Diagnostics::Process ^> ^processes = Diagnostics::Process::GetProcessesByName(name);
 | 
        
           |  |  | 788 | 					 if ( !processes || !processes->Length )
 | 
        
           |  |  | 789 | 					 {
 | 
        
           |  |  | 790 | 						 if ( !m_bWaitingSteam )
 | 
        
           |  |  | 791 | 						 {
 | 
        
           |  |  | 792 | 							 m_bCheckProcess = false;
 | 
        
           |  |  | 793 | 							 this->EndGame();
 | 
        
           |  |  | 794 | 						 }
 | 
        
           |  |  | 795 | 					 }
 | 
        
           |  |  | 796 | 					 // if steam, waiting for process to start before resuming
 | 
        
           |  |  | 797 | 					 else if ( m_bWaitingSteam )
 | 
        
           |  |  | 798 | 						 m_bWaitingSteam = false;
 | 
        
           |  |  | 799 | 				 }
 | 
        
           |  |  | 800 | 			 }
 | 
        
           |  |  | 801 | 		 }
 | 
        
           |  |  | 802 |   | 
        
           |  |  | 803 | private: System::Void timerGameData_Tick(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 804 |   | 
        
           |  |  | 805 | 			 if ( m_bGameClosed )
 | 
        
           |  |  | 806 | 			 {
 | 
        
           |  |  | 807 | 				 this->EndGame();
 | 
        
           |  |  | 808 | 				 return;
 | 
        
           |  |  | 809 | 			 }
 | 
        
           |  |  | 810 |   | 
        
           | 242 | cycrow | 811 | 			 if ( m_pGameData->readFile(_WS(m_sLogDir), Utils::WString::PadNumber((long)m_iGameLog, 5)) )
 | 
        
           | 1 | cycrow | 812 | 				 ParseNewData(true);
 | 
        
           |  |  | 813 | 			 else
 | 
        
           |  |  | 814 | 				 ParseNewData(false);
 | 
        
           |  |  | 815 | 		 }
 | 
        
           |  |  | 816 | private: System::Void gameLogToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 817 | 			 InputBox ^input = gcnew InputBox("Enter the log file number to extract game data from", Convert::ToString(m_iGameLog));
 | 
        
           |  |  | 818 | 			 if ( input->ShowDialog(this) == Windows::Forms::DialogResult::OK )
 | 
        
           |  |  | 819 | 			 {
 | 
        
           |  |  | 820 | 				 int log = System::Convert::ToInt32(input->GetInput());
 | 
        
           |  |  | 821 | 				 if ( log <= 0 )
 | 
        
           |  |  | 822 | 				 {
 | 
        
           |  |  | 823 | 				 }
 | 
        
           |  |  | 824 | 				 else
 | 
        
           |  |  | 825 | 				 {
 | 
        
           |  |  | 826 | 					m_iGameLog = log;
 | 
        
           |  |  | 827 | 					RegistryKey ^searchKey = Registry::CurrentUser->CreateSubKey("Software\\Egosoft\\PluginManagerSettings");
 | 
        
           |  |  | 828 | 					if ( searchKey )
 | 
        
           |  |  | 829 | 						searchKey->SetValue("GameDataLog", m_iGameLog);
 | 
        
           |  |  | 830 | 					SetGameLogDisplay();
 | 
        
           |  |  | 831 | 				 }
 | 
        
           |  |  | 832 | 			 }
 | 
        
           |  |  | 833 | 		 }
 | 
        
           |  |  | 834 | private: System::Void gameDataToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 835 | 			 ViewData ^data = gcnew ViewData(m_pGameData, m_sGameName);
 | 
        
           |  |  | 836 | 			 data->ShowDialog(this);
 | 
        
           |  |  | 837 | 		 }
 | 
        
           |  |  | 838 | private: System::Void updateLCDToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 839 | 			m_bUpdateLCD = this->updateLCDToolStripMenuItem->Checked;
 | 
        
           |  |  | 840 | 			RegistryKey ^searchKey = Registry::CurrentUser->CreateSubKey("Software\\Egosoft\\PluginManagerSettings");
 | 
        
           |  |  | 841 | 			if ( searchKey )
 | 
        
           |  |  | 842 | 				searchKey->SetValue("DontUpdateLCD", (m_bUpdateLCD) ? 0 : 1);
 | 
        
           |  |  | 843 | 		 }
 | 
        
           |  |  | 844 | private: System::Void aboutToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 845 | 			 this->WindowState = Windows::Forms::FormWindowState::Normal;
 | 
        
           |  |  | 846 | 			 this->Opacity = 1.0;
 | 
        
           |  |  | 847 | 		 }
 | 
        
           |  |  | 848 | private: System::Void Form1_FormClosing(System::Object^  sender, System::Windows::Forms::FormClosingEventArgs^  e) {
 | 
        
           |  |  | 849 | 			 if ( !m_bClosing )
 | 
        
           |  |  | 850 | 			 {
 | 
        
           |  |  | 851 | 				 this->WindowState = Windows::Forms::FormWindowState::Minimized;
 | 
        
           |  |  | 852 | 				 this->Opacity = 0.0;
 | 
        
           |  |  | 853 | 				 e->Cancel = true;
 | 
        
           |  |  | 854 | 				 return;
 | 
        
           |  |  | 855 | 			 }
 | 
        
           |  |  | 856 | 		 }
 | 
        
           |  |  | 857 | private: System::Void linkLabel1_LinkClicked(System::Object^  sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^  e) {
 | 
        
           |  |  | 858 | 			 Diagnostics::Process::Start(linkLabel1->Text);
 | 
        
           |  |  | 859 | 		 }
 | 
        
           |  |  | 860 | private: System::Void timerCheckGame_Tick(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 861 | 		System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
 | 
        
           |  |  | 862 | 		if ( System::IO::File::Exists(mydoc + "\\Egosoft\\launchgame.dat") )
 | 
        
           |  |  | 863 | 		{
 | 
        
           |  |  | 864 | 			System::String ^lines = System::IO::File::ReadAllText(mydoc + "\\Egosoft\\launchgame.dat");
 | 
        
           |  |  | 865 | 			System::IO::File::Delete(mydoc + "\\Egosoft\\launchgame.dat");
 | 
        
           |  |  | 866 | 			if ( lines )
 | 
        
           |  |  | 867 | 			{
 | 
        
           |  |  | 868 | 				System::String ^gameFile;
 | 
        
           |  |  | 869 | 				System::String ^gameArgs;
 | 
        
           |  |  | 870 |   | 
        
           | 298 | cycrow | 871 | 				Utils::WString strLines = _WS(lines);
 | 
        
           |  |  | 872 | 				std::vector<Utils::WString> lines;
 | 
        
           |  |  | 873 | 				strLines.tokenise(L"\n", lines);
 | 
        
           |  |  | 874 | 				for (auto it = lines.begin(); it != lines.end(); ++it)
 | 
        
           | 1 | cycrow | 875 | 				{
 | 
        
           | 298 | cycrow | 876 | 					Utils::WString l = *it;
 | 
        
           |  |  | 877 | 					l.removeChar('\r');
 | 
        
           | 1 | cycrow | 878 |   | 
        
           | 298 | cycrow | 879 | 					Utils::WString first = l.token(L":", 1);
 | 
        
           |  |  | 880 | 					Utils::WString rest = l.tokens(L":", 2);
 | 
        
           |  |  | 881 | 					rest.removeFirstSpace();
 | 
        
           | 1 | cycrow | 882 |   | 
        
           | 298 | cycrow | 883 | 					if (first.Compare(L"File"))
 | 
        
           |  |  | 884 | 						gameFile = _US(rest);
 | 
        
           |  |  | 885 | 					else if (first.Compare(L"Args") )
 | 
        
           |  |  | 886 | 						gameArgs = _US(rest);				
 | 
        
           | 1 | cycrow | 887 | 				}
 | 
        
           |  |  | 888 |   | 
        
           |  |  | 889 | 				if ( gameFile && gameFile->Length )
 | 
        
           |  |  | 890 | 					this->StartGame(gameFile, gameArgs, GetGameName(gameFile));
 | 
        
           |  |  | 891 | 			}
 | 
        
           |  |  | 892 | 		}
 | 
        
           |  |  | 893 | 		 }
 | 
        
           |  |  | 894 | private: System::Void gUIOverlayToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 895 | 			m_bCustomGui = this->gUIOverlayToolStripMenuItem->Checked;
 | 
        
           |  |  | 896 | 			RegistryKey ^searchKey = Registry::CurrentUser->CreateSubKey("Software\\Egosoft\\PluginManagerSettings");
 | 
        
           |  |  | 897 | 			if ( searchKey )
 | 
        
           |  |  | 898 | 				searchKey->SetValue("DontDoGUI", (m_bCustomGui) ? 0 : 1);
 | 
        
           |  |  | 899 | 		 }
 | 
        
           | 105 | cycrow | 900 | private: System::Void launchManagerAdvancedToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
 | 
        
           |  |  | 901 | 			 _launchManager(true);
 | 
        
           |  |  | 902 | 		 }
 | 
        
           | 1 | cycrow | 903 | };
 | 
        
           |  |  | 904 | }
 | 
        
           |  |  | 905 |   |