Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit65025c8

Browse files
committed
fix array out of index, if removed last recent project item from list, display error message if try to launch from explorer (without any unity editors)#212
1 parentf5f31c0 commit65025c8

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

‎UnityLauncherPro/Tools.cs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,13 @@ public static Process LaunchProject(Project proj, DataGrid dataGridRef = null, b
274274
varunityExePath=GetUnityExePath(proj.Version);
275275
if(unityExePath==null)
276276
{
277+
// if no editors installed, show message
278+
if(MainWindow.unityInstallationsSource.Count==0)
279+
{
280+
MessageBox.Show($"No Unity versions installed. Please run{MainWindow.appName} first to setup root folders.",MainWindow.appName,MessageBoxButton.OK,MessageBoxImage.Warning);
281+
returnnull;
282+
}
283+
277284
DisplayUpgradeDialog(proj,null,useInitScript);
278285
returnnull;
279286
}
@@ -1665,6 +1672,9 @@ public static void SetFocusToGrid(DataGrid targetGrid, int index = -1)
16651672
DataGridRowrow=(DataGridRow)targetGrid.ItemContainerGenerator.ContainerFromIndex(index);
16661673
if(row==null)
16671674
{
1675+
// clamp to max items
1676+
if(index>=targetGrid.Items.Count)index=targetGrid.Items.Count-1;
1677+
16681678
targetGrid.ScrollIntoView(targetGrid.Items[index]);
16691679
// Defer the focus once row is generated
16701680
targetGrid.Dispatcher.InvokeAsync(()=>

‎UnityLauncherPro/UpgradeWindow.xaml.cs‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ public UpgradeWindow(string currentVersion, string projectPath, string commandLi
2626

2727
gridAvailableVersions.SelectedItem=null;
2828

29-
// we have current version info in project
30-
// enable release and dl buttons
31-
btnOpenReleasePage.IsEnabled=true;
32-
btnDownload.IsEnabled=true;
33-
3429
// if dont have exact version, show red outline
3530
if(currentVersion==null||MainWindow.unityInstalledVersions.ContainsKey(currentVersion)==false)
3631
{
@@ -40,6 +35,10 @@ public UpgradeWindow(string currentVersion, string projectPath, string commandLi
4035

4136
if(currentVersion!=null)
4237
{
38+
// we know the version, enable buttons
39+
btnOpenReleasePage.IsEnabled=true;
40+
btnDownload.IsEnabled=true;
41+
4342
// remove china c1 from version
4443
if(currentVersion.Contains("c"))currentVersion=currentVersion.Replace("c1","");
4544
// find nearest version
@@ -150,6 +149,13 @@ private void GridAvailableVersions_PreviewMouseDoubleClick(object sender, MouseB
150149
voidUpgrade()
151150
{
152151
vark=(UnityInstallation)gridAvailableVersions.SelectedItem;
152+
153+
if(k==null)
154+
{
155+
DialogResult=false;
156+
return;
157+
}
158+
153159
upgradeVersion=k.Version;
154160
DialogResult=true;
155161
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp