From 1fb1b7bf2522e6d2eae266e816439c8feeaa23a4 Mon Sep 17 00:00:00 2001 From: Peter Witt Date: Fri, 15 Dec 2017 19:51:40 +0100 Subject: [PATCH 1/4] You can now double click to launch a project --- UnityLauncher/Form1.Designer.cs | 1 + UnityLauncher/Form1.cs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/UnityLauncher/Form1.Designer.cs b/UnityLauncher/Form1.Designer.cs index 3c7b24c..f44f4a9 100644 --- a/UnityLauncher/Form1.Designer.cs +++ b/UnityLauncher/Form1.Designer.cs @@ -192,6 +192,7 @@ private void InitializeComponent() this.gridRecent.TabIndex = 0; this.gridRecent.KeyDown += new System.Windows.Forms.KeyEventHandler(this.gridRecent_KeyDown); // + this.gridRecent.CellMouseDoubleClick += GridRecent_CellMouseDoubleClick; // _project // this._project.HeaderText = "Project"; diff --git a/UnityLauncher/Form1.cs b/UnityLauncher/Form1.cs index 20f88fa..b1cc099 100644 --- a/UnityLauncher/Form1.cs +++ b/UnityLauncher/Form1.cs @@ -734,6 +734,15 @@ private void gridRecent_KeyDown(object sender, KeyEventArgs e) } } + //Checks if you are doubleclicking the current cell + private void GridRecent_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) + { + if(e.RowIndex == gridRecent.CurrentCell.RowIndex) + { + LaunchSelectedProject(); + } + } + // set basefolder of all unity installations private void btn_setinstallfolder_Click(object sender, EventArgs e) { From 96aef6d6222e8cb15118e5435c7afcf0dfc4ede9 Mon Sep 17 00:00:00 2001 From: Peter Witt Date: Fri, 15 Dec 2017 20:28:56 +0100 Subject: [PATCH 2/4] Added option to close after launching a project --- UnityLauncher/App.config | 3 +++ UnityLauncher/Form1.Designer.cs | 22 +++++++++++++++---- UnityLauncher/Form1.cs | 12 ++++++++++ UnityLauncher/Properties/Settings.Designer.cs | 12 ++++++++++ UnityLauncher/Properties/Settings.settings | 3 +++ 5 files changed, 48 insertions(+), 4 deletions(-) diff --git a/UnityLauncher/App.config b/UnityLauncher/App.config index ee64511..cf12cb6 100644 --- a/UnityLauncher/App.config +++ b/UnityLauncher/App.config @@ -30,6 +30,9 @@ True + + False + \ No newline at end of file diff --git a/UnityLauncher/Form1.Designer.cs b/UnityLauncher/Form1.Designer.cs index f44f4a9..0cc6f71 100644 --- a/UnityLauncher/Form1.Designer.cs +++ b/UnityLauncher/Form1.Designer.cs @@ -57,6 +57,7 @@ private void InitializeComponent() this.label3 = new System.Windows.Forms.Label(); this.lstPackageFolders = new System.Windows.Forms.ListBox(); this.tabPage3 = new System.Windows.Forms.TabPage(); + this.ChkQuitAfterOpen = new System.Windows.Forms.CheckBox(); this.btnOpenLogFolder = new System.Windows.Forms.Button(); this.chkQuitAfterCommandline = new System.Windows.Forms.CheckBox(); this.btnAddRegister = new System.Windows.Forms.Button(); @@ -390,6 +391,7 @@ private void InitializeComponent() // // tabPage3 // + this.tabPage3.Controls.Add(this.ChkQuitAfterOpen); this.tabPage3.Controls.Add(this.btnOpenLogFolder); this.tabPage3.Controls.Add(this.chkQuitAfterCommandline); this.tabPage3.Controls.Add(this.btnAddRegister); @@ -410,6 +412,17 @@ private void InitializeComponent() this.tabPage3.Text = "Settings"; this.tabPage3.UseVisualStyleBackColor = true; // + // ChkQuitAfterOpen + // + this.ChkQuitAfterOpen.AutoSize = true; + this.ChkQuitAfterOpen.Location = new System.Drawing.Point(20, 409); + this.ChkQuitAfterOpen.Name = "ChkQuitAfterOpen"; + this.ChkQuitAfterOpen.Size = new System.Drawing.Size(172, 17); + this.ChkQuitAfterOpen.TabIndex = 33; + this.ChkQuitAfterOpen.Text = "Close after launching a project"; + this.ChkQuitAfterOpen.UseVisualStyleBackColor = true; + this.ChkQuitAfterOpen.CheckedChanged += new System.EventHandler(this.ChkQuitAfterOpen_CheckedChanged); + // // btnOpenLogFolder // this.btnOpenLogFolder.Location = new System.Drawing.Point(435, 380); @@ -423,7 +436,7 @@ private void InitializeComponent() // chkQuitAfterCommandline // this.chkQuitAfterCommandline.AutoSize = true; - this.chkQuitAfterCommandline.Location = new System.Drawing.Point(20, 409); + this.chkQuitAfterCommandline.Location = new System.Drawing.Point(20, 432); this.chkQuitAfterCommandline.Name = "chkQuitAfterCommandline"; this.chkQuitAfterCommandline.Size = new System.Drawing.Size(189, 17); this.chkQuitAfterCommandline.TabIndex = 31; @@ -433,7 +446,7 @@ private void InitializeComponent() // // btnAddRegister // - this.btnAddRegister.Location = new System.Drawing.Point(139, 442); + this.btnAddRegister.Location = new System.Drawing.Point(139, 465); this.btnAddRegister.Name = "btnAddRegister"; this.btnAddRegister.Size = new System.Drawing.Size(64, 23); this.btnAddRegister.TabIndex = 30; @@ -443,7 +456,7 @@ private void InitializeComponent() // // btnRemoveRegister // - this.btnRemoveRegister.Location = new System.Drawing.Point(209, 442); + this.btnRemoveRegister.Location = new System.Drawing.Point(209, 465); this.btnRemoveRegister.Name = "btnRemoveRegister"; this.btnRemoveRegister.Size = new System.Drawing.Size(64, 23); this.btnRemoveRegister.TabIndex = 29; @@ -454,7 +467,7 @@ private void InitializeComponent() // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(19, 447); + this.label4.Location = new System.Drawing.Point(19, 470); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(117, 13); this.label4.TabIndex = 28; @@ -654,6 +667,7 @@ private void InitializeComponent() private System.Windows.Forms.DataGridViewTextBoxColumn _dateModified; private System.Windows.Forms.Button btnOpenLogFolder; private System.Windows.Forms.TextBox tbSearchBar; + private System.Windows.Forms.CheckBox ChkQuitAfterOpen; } } diff --git a/UnityLauncher/Form1.cs b/UnityLauncher/Form1.cs index b1cc099..3e0a50f 100644 --- a/UnityLauncher/Form1.cs +++ b/UnityLauncher/Form1.cs @@ -95,6 +95,7 @@ void LoadSettings() // update settings window chkMinimizeToTaskbar.Checked = Properties.Settings.Default.minimizeToTaskbar; chkQuitAfterCommandline.Checked = Properties.Settings.Default.closeAfterExplorer; + ChkQuitAfterOpen.Checked = Properties.Settings.Default.closeAfterProject; // update installations folder listbox lstRootFolders.Items.AddRange(Properties.Settings.Default.rootFolders.Cast().ToArray()); @@ -328,6 +329,11 @@ void LaunchProject(string projectPath, string version, bool openProject = true) myProcess.StartInfo.Arguments = pars; } myProcess.Start(); + + if (Properties.Settings.Default.closeAfterProject) + { + Environment.Exit(0); + } } catch (Exception ex) { @@ -821,6 +827,12 @@ private void btnAddRegister_Click(object sender, EventArgs e) AddContextMenuRegistry(); } + private void ChkQuitAfterOpen_CheckedChanged(object sender, EventArgs e) + { + Properties.Settings.Default.closeAfterProject = ChkQuitAfterOpen.Checked; + Properties.Settings.Default.Save(); + } + private void chkQuitAfterCommandline_CheckedChanged(object sender, EventArgs e) { Properties.Settings.Default.closeAfterExplorer = chkQuitAfterCommandline.Checked; diff --git a/UnityLauncher/Properties/Settings.Designer.cs b/UnityLauncher/Properties/Settings.Designer.cs index 73bd910..ecf2236 100644 --- a/UnityLauncher/Properties/Settings.Designer.cs +++ b/UnityLauncher/Properties/Settings.Designer.cs @@ -73,5 +73,17 @@ public bool closeAfterExplorer { this["closeAfterExplorer"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool closeAfterProject { + get { + return ((bool)(this["closeAfterProject"])); + } + set { + this["closeAfterProject"] = value; + } + } } } diff --git a/UnityLauncher/Properties/Settings.settings b/UnityLauncher/Properties/Settings.settings index 9719d60..9c749ba 100644 --- a/UnityLauncher/Properties/Settings.settings +++ b/UnityLauncher/Properties/Settings.settings @@ -18,5 +18,8 @@ True + + False + \ No newline at end of file From 2a731c708c96932f8aabc163026150d55e4a0add Mon Sep 17 00:00:00 2001 From: Peter Witt Date: Fri, 15 Dec 2017 20:37:50 +0100 Subject: [PATCH 3/4] Changed default value of close after launch --- UnityLauncher/App.config | 2 +- UnityLauncher/Properties/Settings.Designer.cs | 2 +- UnityLauncher/Properties/Settings.settings | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/UnityLauncher/App.config b/UnityLauncher/App.config index cf12cb6..276d37d 100644 --- a/UnityLauncher/App.config +++ b/UnityLauncher/App.config @@ -31,7 +31,7 @@ True - False + True diff --git a/UnityLauncher/Properties/Settings.Designer.cs b/UnityLauncher/Properties/Settings.Designer.cs index ecf2236..78dd54b 100644 --- a/UnityLauncher/Properties/Settings.Designer.cs +++ b/UnityLauncher/Properties/Settings.Designer.cs @@ -76,7 +76,7 @@ public bool closeAfterExplorer { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] + [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool closeAfterProject { get { return ((bool)(this["closeAfterProject"])); diff --git a/UnityLauncher/Properties/Settings.settings b/UnityLauncher/Properties/Settings.settings index 9c749ba..c70e9e9 100644 --- a/UnityLauncher/Properties/Settings.settings +++ b/UnityLauncher/Properties/Settings.settings @@ -19,7 +19,7 @@ True - False + True \ No newline at end of file From f431ab906d5a235c55830590857afc1eb3e80856 Mon Sep 17 00:00:00 2001 From: Peter Witt Date: Fri, 15 Dec 2017 20:45:17 +0100 Subject: [PATCH 4/4] Changed so double click only works with left click --- UnityLauncher/Form1.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnityLauncher/Form1.cs b/UnityLauncher/Form1.cs index 3e0a50f..c0430ff 100644 --- a/UnityLauncher/Form1.cs +++ b/UnityLauncher/Form1.cs @@ -743,7 +743,7 @@ private void gridRecent_KeyDown(object sender, KeyEventArgs e) //Checks if you are doubleclicking the current cell private void GridRecent_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { - if(e.RowIndex == gridRecent.CurrentCell.RowIndex) + if(e.Button == MouseButtons.Left && e.RowIndex == gridRecent.CurrentCell.RowIndex) { LaunchSelectedProject(); }