Skip to content

Commit c4a3242

Browse files
committed
Disable "Remove project from list" for now (causes sorting issues if registry not in order), Tools: add buttons for browsing CrashDumps, Unity\cache, GiCache
1 parent b84a226 commit c4a3242

File tree

3 files changed

+45
-28
lines changed

3 files changed

+45
-28
lines changed

Diff for: UnityLauncherPro/MainWindow.xaml

+15-6
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,8 @@
585585
<MenuItem x:Name="menuItemKillProcess" Header="Kill Process" Click="MenuItemKillProcess_Click" />
586586
<Separator/>
587587
<MenuItem x:Name="menuStartWebGLServer" Header="Start WebGL server" Click="MenuStartWebGLServer_Click" />
588-
<Separator/>
589-
<MenuItem x:Name="menuRemoveProject" Header="Remove from recent list" Click="MenuRemoveProject_Click" />
588+
<!--<Separator/>
589+
<MenuItem x:Name="menuRemoveProject" Header="Remove from recent list" Click="MenuRemoveProject_Click" />-->
590590
</ContextMenu>
591591
</DataGrid.ContextMenu>
592592

@@ -852,12 +852,12 @@
852852
<RowDefinition Height="50*" />
853853
</Grid.RowDefinitions>
854854
<!-- 1st part -->
855-
<Grid Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Left">
856-
<StackPanel Orientation="Vertical" Margin="10" VerticalAlignment="Top">
855+
<Grid Grid.Row="0" VerticalAlignment="Top">
856+
<StackPanel Orientation="Vertical" Margin="10" VerticalAlignment="Top" HorizontalAlignment="Left">
857857
<!--border to avoid next row moving when button is selected-->
858-
<Border VerticalAlignment="Top" Height="40" HorizontalAlignment="Left" Margin="0,0,0,2">
858+
<Border VerticalAlignment="Top" Height="40" Margin="0,0,0,2" HorizontalAlignment="Left">
859859
<!-- folders -->
860-
<StackPanel Orientation="Horizontal" Margin="0,4,10,4" VerticalAlignment="Top" Width="560">
860+
<StackPanel Orientation="Horizontal" Margin="0,4,10,4" VerticalAlignment="Top">
861861
<Label Content="Folders" Foreground="{DynamicResource ThemeButtonForeground}" />
862862
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenEditorLogsFolder" Margin="0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="BtnOpenEditorLogsFolder_Click" ToolTip="Browse Editor logs folder">
863863
<Label Content="_Editor Logs" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
@@ -868,6 +868,15 @@
868868
<Button Style="{StaticResource CustomButton}" x:Name="btnOpenCrashLogs" Margin="10,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="BtnOpenCrashLogs_Click" ToolTip="Browse Crash logs folder">
869869
<Label Content="_Crash Logs" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
870870
</Button>
871+
<Button Style="{StaticResource CustomButton}" x:Name="btnCrashDumps" Margin="10,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" ToolTip="Browse Crash dumps folder" Click="BtnCrashDumps_Click">
872+
<Label Content="Crash _Dumps" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
873+
</Button>
874+
<Button Style="{StaticResource CustomButton}" x:Name="btnUnityCache" Margin="10,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" ToolTip="Browse Unity Cache folder" Click="BtnUnityCache_Click">
875+
<Label Content="_Unity Cache" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
876+
</Button>
877+
<Button Style="{StaticResource CustomButton}" x:Name="btnGICache" Margin="10,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" ToolTip="Browse Unity GI Cache folder" Click="BtnGICache_Click">
878+
<Label Content="_GI Cache" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
879+
</Button>
871880
<Button Style="{StaticResource CustomButton}" x:Name="btnAssetPackages" Margin="10,0,0,0" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Top" ToolTip="Browse AssetStore downloads folder" Click="BtnAssetPackages_Click">
872881
<Label Content="A_sset packages" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
873882
</Button>

Diff for: UnityLauncherPro/MainWindow.xaml.cs

+18-22
Original file line numberDiff line numberDiff line change
@@ -1139,14 +1139,7 @@ private void BtnOpenEditorLogsFolder_Click(object sender, RoutedEventArgs e)
11391139

11401140
private void BtnOpenPlayerLogs_Click(object sender, RoutedEventArgs e)
11411141
{
1142-
var logfolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "/../LocalLow");
1143-
if (Directory.Exists(logfolder) == true)
1144-
{
1145-
if (Tools.LaunchExplorer(logfolder) == false)
1146-
{
1147-
Console.WriteLine("Error> Directory not found: " + logfolder);
1148-
}
1149-
}
1142+
Tools.OpenAppdataSpecialFolder("../LocalLow");
11501143
}
11511144

11521145
private void BtnOpenADBLogCat_Click(object sender, RoutedEventArgs e)
@@ -1514,12 +1507,7 @@ private void ChkAllowSingleInstanceOnly_CheckedChanged(object sender, RoutedEven
15141507

15151508
private void BtnAssetPackages_Click(object sender, RoutedEventArgs e)
15161509
{
1517-
var folder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Unity", "Asset Store-5.x");
1518-
if (Directory.Exists(folder) == false) return;
1519-
if (Tools.LaunchExplorer(folder) == false)
1520-
{
1521-
Console.WriteLine("Cannot open folder.." + folder);
1522-
}
1510+
Tools.OpenAppdataSpecialFolder("../Roaming/Unity/Asset Store-5.x");
15231511
}
15241512

15251513
// sets selected unity version as preferred main unity version (to be preselected in case of unknown version projects, when creating new empty project, etc)
@@ -1739,14 +1727,7 @@ private void GridRecent_BeginningEdit(object sender, DataGridBeginningEditEventA
17391727

17401728
private void BtnOpenCrashLogs_Click(object sender, RoutedEventArgs e)
17411729
{
1742-
var logfolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Temp", "Unity", "Editor", "Crashes");
1743-
if (Directory.Exists(logfolder) == true)
1744-
{
1745-
if (Tools.LaunchExplorer(logfolder) == false)
1746-
{
1747-
Console.WriteLine("Cannot open folder.." + logfolder);
1748-
}
1749-
}
1730+
Tools.OpenAppdataSpecialFolder("Temp/Unity/Editor/Crashes/");
17501731
}
17511732

17521733
// reorder grid item by index
@@ -2410,6 +2391,21 @@ private void ChkSearchProjectPath_Checked(object sender, RoutedEventArgs e)
24102391
Properties.Settings.Default.Save();
24112392
}
24122393

2394+
private void BtnCrashDumps_Click(object sender, RoutedEventArgs e)
2395+
{
2396+
Tools.OpenAppdataSpecialFolder("CrashDumps");
2397+
}
2398+
2399+
private void BtnGICache_Click(object sender, RoutedEventArgs e)
2400+
{
2401+
Tools.OpenAppdataSpecialFolder("../LocalLow/Unity/Caches/GiCache");
2402+
}
2403+
2404+
private void BtnUnityCache_Click(object sender, RoutedEventArgs e)
2405+
{
2406+
Tools.OpenAppdataSpecialFolder("Unity/cache");
2407+
}
2408+
24132409
//private void BtnBrowseTemplateUnityPackagesFolder_Click(object sender, RoutedEventArgs e)
24142410
//{
24152411
// var folder = Tools.BrowseForOutputFolder("Select unitypackage Templates folder");

Diff for: UnityLauncherPro/Tools.cs

+12
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,18 @@ public static void DownloadAdditionalModules(string UnityExePath, string unityVe
12901290
OpenURL(moduleURL);
12911291
}
12921292

1293+
public static void OpenAppdataSpecialFolder(string subfolder)
1294+
{
1295+
var logfolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), subfolder);
1296+
if (Directory.Exists(logfolder) == true)
1297+
{
1298+
if (Tools.LaunchExplorer(logfolder) == false)
1299+
{
1300+
Console.WriteLine("Cannot open folder.." + logfolder);
1301+
}
1302+
}
1303+
}
1304+
12931305
} // class
12941306
} // namespace
12951307

0 commit comments

Comments
 (0)