diff --git a/PS2ModLauncher/LauncherForm.Designer.cs b/PS2ModLauncher/LauncherForm.Designer.cs index a233601..0e6ec9a 100644 --- a/PS2ModLauncher/LauncherForm.Designer.cs +++ b/PS2ModLauncher/LauncherForm.Designer.cs @@ -30,13 +30,10 @@ { this.components = new System.ComponentModel.Container(); this.findPTRDirDialogue = new System.Windows.Forms.FolderBrowserDialog(); - this.savePackDialogue = new System.Windows.Forms.SaveFileDialog(); - this.selectFileForPack = new System.Windows.Forms.OpenFileDialog(); - this.directorySearcher1 = new System.DirectoryServices.DirectorySearcher(); - this.tabPage1 = new System.Windows.Forms.TabPage(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.launchProgress = new System.Windows.Forms.ProgressBar(); this.planetsideVersion = new System.Windows.Forms.Label(); + this.launchArgs = new System.Windows.Forms.TextBox(); + this.launchProgress = new System.Windows.Forms.ProgressBar(); this.skipLauncher = new System.Windows.Forms.CheckBox(); this.passwordLabel = new System.Windows.Forms.Label(); this.usernameLabel = new System.Windows.Forms.Label(); @@ -44,72 +41,47 @@ this.username = new System.Windows.Forms.TextBox(); this.loggingCheckBox = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); - this.launchArgs = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.launchGame = new System.Windows.Forms.Button(); this.selectDirectory = new System.Windows.Forms.Button(); this.planetside2PathTextField = new System.Windows.Forms.TextBox(); this.launchMessage = new System.Windows.Forms.Label(); this.ps_consoleOutput = new System.Windows.Forms.TextBox(); - this.tabControl1 = new System.Windows.Forms.TabControl(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.tabPage1.SuspendLayout(); + this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); - this.tabControl1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); + this.toolStripContainer1.ContentPanel.SuspendLayout(); + this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); + this.toolStripContainer1.SuspendLayout(); this.SuspendLayout(); // // findPTRDirDialogue // this.findPTRDirDialogue.HelpRequest += new System.EventHandler(this.folderBrowserDialog1_HelpRequest); // - // savePackDialogue - // - this.savePackDialogue.FileName = "Assets_256"; - this.savePackDialogue.Filter = "Pack Files (*.pack)|*.pack"; - // - // selectFileForPack - // - this.selectFileForPack.FileName = "openFileDialog1"; - this.selectFileForPack.Multiselect = true; - // - // directorySearcher1 - // - this.directorySearcher1.ClientTimeout = System.TimeSpan.Parse("-00:00:01"); - this.directorySearcher1.ServerPageTimeLimit = System.TimeSpan.Parse("-00:00:01"); - this.directorySearcher1.ServerTimeLimit = System.TimeSpan.Parse("-00:00:01"); - // - // tabPage1 - // - this.tabPage1.Controls.Add(this.splitContainer1); - this.tabPage1.Location = new System.Drawing.Point(4, 22); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(627, 285); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "Launcher"; - this.tabPage1.UseVisualStyleBackColor = true; - // // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; this.splitContainer1.IsSplitterFixed = true; - this.splitContainer1.Location = new System.Drawing.Point(3, 3); + this.splitContainer1.Location = new System.Drawing.Point(0, 0); this.splitContainer1.Name = "splitContainer1"; this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitContainer1.Panel1 // - this.splitContainer1.Panel1.Controls.Add(this.launchProgress); + this.splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.ControlLightLight; this.splitContainer1.Panel1.Controls.Add(this.planetsideVersion); + this.splitContainer1.Panel1.Controls.Add(this.launchArgs); + this.splitContainer1.Panel1.Controls.Add(this.launchProgress); this.splitContainer1.Panel1.Controls.Add(this.skipLauncher); this.splitContainer1.Panel1.Controls.Add(this.passwordLabel); this.splitContainer1.Panel1.Controls.Add(this.usernameLabel); @@ -117,7 +89,6 @@ this.splitContainer1.Panel1.Controls.Add(this.username); this.splitContainer1.Panel1.Controls.Add(this.loggingCheckBox); this.splitContainer1.Panel1.Controls.Add(this.label10); - this.splitContainer1.Panel1.Controls.Add(this.launchArgs); this.splitContainer1.Panel1.Controls.Add(this.label2); this.splitContainer1.Panel1.Controls.Add(this.launchGame); this.splitContainer1.Panel1.Controls.Add(this.selectDirectory); @@ -128,36 +99,44 @@ // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add(this.ps_consoleOutput); - this.splitContainer1.Size = new System.Drawing.Size(621, 279); + this.splitContainer1.Size = new System.Drawing.Size(584, 486); this.splitContainer1.SplitterDistance = this.splitContainer1.Panel1MinSize; this.splitContainer1.TabIndex = 0; // + // planetsideVersion + // + this.planetsideVersion.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.planetsideVersion.Location = new System.Drawing.Point(419, 50); + this.planetsideVersion.Name = "planetsideVersion"; + this.planetsideVersion.Size = new System.Drawing.Size(132, 21); + this.planetsideVersion.TabIndex = 24; + // + // launchArgs + // + this.launchArgs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.launchArgs.Location = new System.Drawing.Point(329, 96); + this.launchArgs.Name = "launchArgs"; + this.launchArgs.Size = new System.Drawing.Size(222, 20); + this.launchArgs.TabIndex = 6; + // // launchProgress // this.launchProgress.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); - this.launchProgress.Location = new System.Drawing.Point(9, 102); + this.launchProgress.Location = new System.Drawing.Point(9, 96); this.launchProgress.Name = "launchProgress"; - this.launchProgress.Size = new System.Drawing.Size(291, 18); + this.launchProgress.Size = new System.Drawing.Size(246, 20); this.launchProgress.TabIndex = 16; this.launchProgress.Tag = ""; this.launchProgress.UseWaitCursor = true; this.launchProgress.Visible = false; // - // planetsideVersion - // - this.planetsideVersion.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.planetsideVersion.Location = new System.Drawing.Point(477, 54); - this.planetsideVersion.Name = "planetsideVersion"; - this.planetsideVersion.Size = new System.Drawing.Size(132, 21); - this.planetsideVersion.TabIndex = 24; - // // skipLauncher // this.skipLauncher.AutoSize = true; - this.skipLauncher.Location = new System.Drawing.Point(205, 9); + this.skipLauncher.Location = new System.Drawing.Point(205, 13); this.skipLauncher.Name = "skipLauncher"; this.skipLauncher.Size = new System.Drawing.Size(95, 17); - this.skipLauncher.TabIndex = 23; + this.skipLauncher.TabIndex = 3; this.skipLauncher.Text = "Skip Launcher"; this.skipLauncher.UseVisualStyleBackColor = true; this.skipLauncher.CheckedChanged += new System.EventHandler(this.loginFormChanged); @@ -186,7 +165,7 @@ this.password.Location = new System.Drawing.Point(67, 41); this.password.Name = "password"; this.password.Size = new System.Drawing.Size(123, 20); - this.password.TabIndex = 19; + this.password.TabIndex = 1; this.password.UseSystemPasswordChar = true; this.password.TextChanged += new System.EventHandler(this.loginFormChanged); // @@ -195,13 +174,13 @@ this.username.Location = new System.Drawing.Point(67, 11); this.username.Name = "username"; this.username.Size = new System.Drawing.Size(123, 20); - this.username.TabIndex = 18; + this.username.TabIndex = 0; this.username.TextChanged += new System.EventHandler(this.loginFormChanged); // // loggingCheckBox // this.loggingCheckBox.AutoSize = true; - this.loggingCheckBox.Location = new System.Drawing.Point(205, 32); + this.loggingCheckBox.Location = new System.Drawing.Point(205, 36); this.loggingCheckBox.Name = "loggingCheckBox"; this.loggingCheckBox.Size = new System.Drawing.Size(64, 17); this.loggingCheckBox.TabIndex = 15; @@ -214,25 +193,17 @@ // this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(384, 86); + this.label10.Location = new System.Drawing.Point(326, 77); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(158, 13); this.label10.TabIndex = 14; this.label10.Text = "Additional command line options"; // - // launchArgs - // - this.launchArgs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.launchArgs.Location = new System.Drawing.Point(387, 102); - this.launchArgs.Name = "launchArgs"; - this.launchArgs.Size = new System.Drawing.Size(222, 20); - this.launchArgs.TabIndex = 13; - // // label2 // this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(384, 7); + this.label2.Location = new System.Drawing.Point(326, 3); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(90, 13); this.label2.TabIndex = 7; @@ -246,7 +217,7 @@ this.launchGame.Location = new System.Drawing.Point(67, 67); this.launchGame.Name = "launchGame"; this.launchGame.Size = new System.Drawing.Size(123, 23); - this.launchGame.TabIndex = 6; + this.launchGame.TabIndex = 2; this.launchGame.Text = "Launch"; this.launchGame.UseVisualStyleBackColor = false; this.launchGame.Click += new System.EventHandler(this.button2_Click); @@ -254,10 +225,10 @@ // selectDirectory // this.selectDirectory.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.selectDirectory.Location = new System.Drawing.Point(387, 49); + this.selectDirectory.Location = new System.Drawing.Point(329, 45); this.selectDirectory.Name = "selectDirectory"; this.selectDirectory.Size = new System.Drawing.Size(75, 23); - this.selectDirectory.TabIndex = 2; + this.selectDirectory.TabIndex = 5; this.selectDirectory.Text = "Choose"; this.selectDirectory.UseVisualStyleBackColor = true; this.selectDirectory.Click += new System.EventHandler(this.button1_Click); @@ -265,11 +236,11 @@ // planetside2PathTextField // this.planetside2PathTextField.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.planetside2PathTextField.Location = new System.Drawing.Point(387, 23); + this.planetside2PathTextField.Location = new System.Drawing.Point(329, 19); this.planetside2PathTextField.Name = "planetside2PathTextField"; this.planetside2PathTextField.ReadOnly = true; this.planetside2PathTextField.Size = new System.Drawing.Size(222, 20); - this.planetside2PathTextField.TabIndex = 1; + this.planetside2PathTextField.TabIndex = 4; this.planetside2PathTextField.Text = "Path to PlanetSide folder"; this.planetside2PathTextField.Click += new System.EventHandler(this.button1_Click); // @@ -293,18 +264,9 @@ this.ps_consoleOutput.Name = "ps_consoleOutput"; this.ps_consoleOutput.ReadOnly = true; this.ps_consoleOutput.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.ps_consoleOutput.Size = new System.Drawing.Size(621, 150); + this.ps_consoleOutput.Size = new System.Drawing.Size(584, 357); this.ps_consoleOutput.TabIndex = 1; - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl1.Location = new System.Drawing.Point(0, 0); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(635, 311); - this.tabControl1.TabIndex = 1; + this.ps_consoleOutput.WordWrap = false; // // contextMenuStrip1 // @@ -321,11 +283,12 @@ // // menuStrip1 // + this.menuStrip1.Dock = System.Windows.Forms.DockStyle.None; this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.aboutToolStripMenuItem1}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(635, 24); + this.menuStrip1.Size = new System.Drawing.Size(584, 24); this.menuStrip1.TabIndex = 2; this.menuStrip1.Text = "menuStrip1"; // @@ -336,41 +299,60 @@ this.aboutToolStripMenuItem1.Text = "About"; this.aboutToolStripMenuItem1.Click += new System.EventHandler(this.aboutToolStripMenuItem1_Click); // + // toolStripContainer1 + // + // + // toolStripContainer1.ContentPanel + // + this.toolStripContainer1.ContentPanel.Controls.Add(this.splitContainer1); + this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(584, 486); + this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.toolStripContainer1.LeftToolStripPanelVisible = false; + this.toolStripContainer1.Location = new System.Drawing.Point(0, 0); + this.toolStripContainer1.Name = "toolStripContainer1"; + this.toolStripContainer1.RightToolStripPanelVisible = false; + this.toolStripContainer1.Size = new System.Drawing.Size(584, 510); + this.toolStripContainer1.TabIndex = 3; + this.toolStripContainer1.Text = "toolStripContainer1"; + // + // toolStripContainer1.TopToolStripPanel + // + this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.menuStrip1); + // // LauncherForm // this.AcceptButton = this.launchGame; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(635, 311); - this.Controls.Add(this.menuStrip1); - this.Controls.Add(this.tabControl1); + this.ClientSize = new System.Drawing.Size(584, 510); + this.Controls.Add(this.toolStripContainer1); this.MainMenuStrip = this.menuStrip1; this.MinimumSize = new System.Drawing.Size(600, 350); this.Name = "LauncherForm"; this.Text = "Planetside 1 Launcher"; this.Load += new System.EventHandler(this.Form1_Load); - this.tabPage1.ResumeLayout(false); + this.ResizeBegin += new System.EventHandler(this.LauncherForm_ResizeBegin); + this.ResizeEnd += new System.EventHandler(this.LauncherForm_ResizeEnd); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel1.PerformLayout(); this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.Panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); - this.tabControl1.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); + this.toolStripContainer1.ContentPanel.ResumeLayout(false); + this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false); + this.toolStripContainer1.TopToolStripPanel.PerformLayout(); + this.toolStripContainer1.ResumeLayout(false); + this.toolStripContainer1.PerformLayout(); this.ResumeLayout(false); - this.PerformLayout(); } #endregion private System.Windows.Forms.FolderBrowserDialog findPTRDirDialogue; - private System.Windows.Forms.SaveFileDialog savePackDialogue; - private System.Windows.Forms.OpenFileDialog selectFileForPack; - private System.DirectoryServices.DirectorySearcher directorySearcher1; - private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.CheckBox loggingCheckBox; private System.Windows.Forms.Label label10; @@ -379,7 +361,6 @@ private System.Windows.Forms.Button launchGame; private System.Windows.Forms.Button selectDirectory; private System.Windows.Forms.TextBox planetside2PathTextField; - private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.Label usernameLabel; private System.Windows.Forms.TextBox password; @@ -393,6 +374,7 @@ private System.Windows.Forms.Label launchMessage; private System.Windows.Forms.CheckBox skipLauncher; private System.Windows.Forms.Label planetsideVersion; + private System.Windows.Forms.ToolStripContainer toolStripContainer1; } } diff --git a/PS2ModLauncher/LauncherForm.cs b/PS2ModLauncher/LauncherForm.cs index 4f493a1..c3dc037 100644 --- a/PS2ModLauncher/LauncherForm.cs +++ b/PS2ModLauncher/LauncherForm.cs @@ -8,6 +8,7 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Net; +using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -252,6 +253,7 @@ namespace PSLauncher { // magic string to login to planetside from the actual game startPlanetSide(planetsidePath, Path.GetDirectoryName(planetsidePath), "/K:StagingTest " + launchArgs.Text); + setProgress(100); } else { @@ -729,6 +731,19 @@ namespace PSLauncher password.Enabled = true; } } + + private void LauncherForm_ResizeBegin(object sender, EventArgs e) + { + splitContainer1.Panel2.SuspendLayout(); + } + + private void LauncherForm_ResizeEnd(object sender, EventArgs e) + { + Win32.SuspendPainting(splitContainer1.Panel2.Handle); + splitContainer1.Panel2.ResumeLayout(); + Win32.ResumePainting(splitContainer1.Panel2.Handle); + this.Refresh(); + } } public static class QueryExtensions @@ -741,4 +756,22 @@ namespace PSLauncher return string.Join("&", segments); } } + public static class Win32 + { + + public const int WM_SETREDRAW = 0x0b; + + [DllImport("user32.dll")] + public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); + + public static void SuspendPainting(IntPtr hWnd) + { + SendMessage(hWnd, WM_SETREDRAW, (IntPtr)0, IntPtr.Zero); + } + + public static void ResumePainting(IntPtr hWnd) + { + SendMessage(hWnd, WM_SETREDRAW, (IntPtr)1, IntPtr.Zero); + } + } } diff --git a/PS2ModLauncher/LauncherForm.resx b/PS2ModLauncher/LauncherForm.resx index 22295a8..1ab0a44 100644 --- a/PS2ModLauncher/LauncherForm.resx +++ b/PS2ModLauncher/LauncherForm.resx @@ -120,22 +120,13 @@ 17, 17 - - 186, 17 - - - 335, 17 - - - 479, 17 - - 633, 17 + 224, 17 - 788, 17 + 396, 9 - 27 + 132 \ No newline at end of file