@@ -385,7 +385,7 @@ void LaunchProject(Project proj)
385
385
386
386
387
387
// we dont have this version installed (or no version info available)
388
- var unityExePath = GetSelectedUnityExePath ( proj . Version ) ;
388
+ var unityExePath = GetUnityExePath ( proj . Version ) ;
389
389
if ( unityExePath == null )
390
390
{
391
391
Console . WriteLine ( "Missing unity version " + proj . Version ) ;
@@ -440,7 +440,7 @@ void LaunchProject(Project proj)
440
440
}
441
441
442
442
443
- string GetSelectedUnityExePath ( string version )
443
+ string GetUnityExePath ( string version )
444
444
{
445
445
return unityInstalledVersions . ContainsKey ( version ) ? unityInstalledVersions [ version ] : null ;
446
446
}
@@ -483,7 +483,86 @@ private void BtnRefreshProjectList_Click(object sender, RoutedEventArgs e)
483
483
gridRecent . ItemsSource = projectsSource ;
484
484
}
485
485
486
+ // run unity only
487
+ private void BtnLaunchUnity_Click ( object sender , RoutedEventArgs e )
488
+ {
489
+ var proj = GetSelectedProject ( ) ;
490
+ var unitypath = GetUnityExePath ( proj ? . Version ) ;
491
+ Tools . LaunchExe ( unitypath ) ;
492
+ }
493
+
494
+ private void BtnUpgradeProject_Click ( object sender , RoutedEventArgs e )
495
+ {
496
+ var proj = GetSelectedProject ( ) ;
497
+ if ( proj == null ) return ;
498
+
499
+ DisplayUpgradeDialog ( proj ) ;
500
+ }
486
501
502
+ void DisplayUpgradeDialog ( Project proj )
503
+ {
504
+ UpgradeWindow modalWindow = new UpgradeWindow ( proj . Version , proj . Path , proj . Arguments ) ;
505
+ modalWindow . Owner = this ;
506
+ modalWindow . ShowDialog ( ) ;
507
+ var results = modalWindow . DialogResult . HasValue && modalWindow . DialogResult . Value ;
508
+
509
+ if ( results == true )
510
+ {
511
+ var upgradeToVersion = UpgradeWindow . upgradeVersion ;
512
+ if ( string . IsNullOrEmpty ( upgradeToVersion ) ) return ;
513
+
514
+ // get selected version to upgrade for
515
+ Console . WriteLine ( "Upgrade to " + upgradeToVersion ) ;
516
+
517
+ // inject new version for this item
518
+ proj . Version = upgradeToVersion ;
519
+ LaunchProject ( proj ) ;
520
+ }
521
+ else
522
+ {
523
+ Console . WriteLine ( "results = " + results ) ;
524
+ }
525
+
526
+
527
+ /*
528
+ // display upgrade dialog (version selector)
529
+ Form2 upgradeDialog = new Form2();
530
+ Form2.currentVersion = currentVersion;
531
+
532
+ // check what user selected
533
+ var results = upgradeDialog.ShowDialog(this);
534
+ switch (results)
535
+ {
536
+ case DialogResult.Ignore: // view release notes page
537
+ Tools.OpenReleaseNotes(currentVersion);
538
+ // display window again for now..
539
+ DisplayUpgradeDialog(currentVersion, projectPath, launchProject, commandLineArguments);
540
+ break;
541
+ case DialogResult.Cancel: // cancelled
542
+ SetStatus("Cancelled project upgrade");
543
+ break;
544
+ case DialogResult.Retry: // download and install missing version
545
+ SetStatus("Download and install missing version " + currentVersion);
546
+ string url = Tools.GetUnityReleaseURL(currentVersion);
547
+ if (string.IsNullOrEmpty(url) == false)
548
+ {
549
+ DownloadInBrowser(url, currentVersion);
550
+ }
551
+ else
552
+ {
553
+ SetStatus("Failed getting Unity Installer URL");
554
+ }
555
+ break;
556
+ case DialogResult.Yes: // upgrade
557
+ SetStatus("Upgrading project to " + Form2.currentVersion);
558
+ if (launchProject == true) LaunchProject(projectPath, Form2.currentVersion);
559
+ break;
560
+ default:
561
+ Console.WriteLine("Unknown DialogResult: " + results);
562
+ break;
563
+ }
564
+ upgradeDialog.Close();*/
565
+ }
487
566
488
567
} // class
489
568
} //namespace
0 commit comments