Skip to content
This repository was archived by the owner on May 19, 2021. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bd0f709

Browse files
committedFeb 16, 2018
don't check backup file if running unity only (fixes #35), check unity install date (fixes #34), fix unity tab tooltip text
1 parent 469e14c commit bd0f709

File tree

3 files changed

+88
-67
lines changed

3 files changed

+88
-67
lines changed
 

‎UnityLauncher/Form1.Designer.cs

Lines changed: 63 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎UnityLauncher/Form1.cs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,10 @@ bool ScanUnityInstallations()
262262
if (unityList.ContainsKey(unityVersion) == false)
263263
{
264264
unityList.Add(unityVersion, unityExe);
265-
gridUnityList.Rows.Add(unityVersion, unityExe);
265+
var dataFolder = Path.Combine(directories[i], "Editor", "Data");
266+
DateTime? installDate = GetLastModifiedTime(dataFolder);
267+
gridUnityList.Rows.Add(unityVersion, unityExe, installDate);
266268
}
267-
//Console.WriteLine(unityVersion);
268269
} // have unity.exe
269270
} // have uninstaller.exe
270271
} // got folders
@@ -401,7 +402,7 @@ void UpdateRecentProjectsList()
401402

402403
DateTime? GetLastModifiedTime(string path)
403404
{
404-
if (File.Exists(path) == true)
405+
if (File.Exists(path) == true || Directory.Exists(path) == true)
405406
{
406407
DateTime modification = File.GetLastWriteTime(path);
407408
//return modification.ToShortDateString();
@@ -425,11 +426,14 @@ void LaunchProject(string projectPath, string version, bool openProject = true)
425426
Directory.CreateDirectory(assetsFolder);
426427
}
427428

428-
// check for crashed backup scene first
429-
var cancelLaunch = CheckCrashBackupScene(projectPath);
430-
if (cancelLaunch == true)
429+
// when opening project, check for crashed backup scene first
430+
if (openProject == true)
431431
{
432-
return;
432+
var cancelLaunch = CheckCrashBackupScene(projectPath);
433+
if (cancelLaunch == true)
434+
{
435+
return;
436+
}
433437
}
434438

435439
if (HaveExactVersionInstalled(version) == true)
@@ -1272,7 +1276,6 @@ private void gridRecent_CellEndEdit(object sender, DataGridViewCellEventArgs e)
12721276
string path = GetSelectedRowData("_path");
12731277
if (string.IsNullOrEmpty(path)) return;
12741278

1275-
12761279
string arguments = GetSelectedRowData("_launchArguments");
12771280

12781281
// check folder first
@@ -1295,7 +1298,10 @@ private void gridRecent_CellEndEdit(object sender, DataGridViewCellEventArgs e)
12951298
{
12961299
SetStatus("File error: " + exception.Message);
12971300
}
1298-
// TODO: keep current row selected
1301+
1302+
// select the same row again (dont move to next), doesnt work here
1303+
// var previousRow = gridRecent.CurrentCell.RowIndex;
1304+
// gridRecent.Rows[previousRow].Selected = true;
12991305
}
13001306

13011307
// returns currently selected rows path string

‎UnityLauncher/Form1.resx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,7 @@
162162
<metadata name="_unityPath.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
163163
<value>True</value>
164164
</metadata>
165-
<metadata name="_unityVersion.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
166-
<value>True</value>
167-
</metadata>
168-
<metadata name="_unityPath.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
165+
<metadata name="_unityInstallDate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
169166
<value>True</value>
170167
</metadata>
171168
<metadata name="_Date.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -1078,6 +1075,15 @@
10781075
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
10791076
<value>374, 17</value>
10801077
</metadata>
1078+
<metadata name="_unityVersion.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
1079+
<value>True</value>
1080+
</metadata>
1081+
<metadata name="_unityPath.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
1082+
<value>True</value>
1083+
</metadata>
1084+
<metadata name="_unityInstallDate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
1085+
<value>True</value>
1086+
</metadata>
10811087
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
10821088
<value>25</value>
10831089
</metadata>

0 commit comments

Comments
 (0)
This repository has been archived.