Skip to content

Commit 118a7dd

Browse files
committed
add Open Crash Logs button to Tools
1 parent 8146e38 commit 118a7dd

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

UnityLauncherPro/MainWindow.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,9 @@
597597
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenPlayerLogs" Margin="10,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="BtnOpenPlayerLogs_Click" ToolTip="Open Player logs folder in Explorer">
598598
<Label Content="_Player Logs" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
599599
</Button>
600+
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenCrashLogs" Margin="10,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="BtnOpenCrashLogs_Click" ToolTip="Open Player logs folder in Explorer">
601+
<Label Content="_Crash Logs" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
602+
</Button>
600603
<Button Style="{StaticResource CustomButton}" x:Name="btnAssetPackages" Margin="10,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" ToolTip="Open assetstore downloads folder in Explorer" Click="BtnAssetPackages_Click">
601604
<Label Content="A_sset packages" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
602605
</Button>

UnityLauncherPro/MainWindow.xaml.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,18 @@ private void GridRecent_BeginningEdit(object sender, DataGridBeginningEditEventA
13591359
{
13601360
isDirtyCell = true;
13611361
}
1362+
1363+
private void BtnOpenCrashLogs_Click(object sender, RoutedEventArgs e)
1364+
{
1365+
var logfolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Temp", "Unity", "Editor", "Crashes");
1366+
if (Directory.Exists(logfolder) == true)
1367+
{
1368+
if (Tools.LaunchExplorer(logfolder) == false)
1369+
{
1370+
Console.WriteLine("Cannot open folder.." + logfolder);
1371+
}
1372+
}
1373+
}
13621374
} // class
13631375
} //namespace
13641376

0 commit comments

Comments
 (0)