Skip to content

Commit c6b6d30

Browse files
committed
editors tab: add copy editor path context menu
1 parent ad94d38 commit c6b6d30

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

UnityLauncherPro/MainWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@
639639
<DataGrid.ContextMenu>
640640
<ContextMenu>
641641
<MenuItem x:Name="menuItemCopyVersionInstalled" Header="Copy Unity Version" Click="MenuItemCopyVersion_Click" />
642+
<MenuItem x:Name="menuItemCopyEditorPath" Header="Copy Editor Path" Click="MenuItemCopyPath_Click" />
642643
<MenuItem x:Name="menuItemShowUnityInExplorer" Header="Show in Explorer" Click="MenuItemShowProjectInExplorer_Click" />
643644
<MenuItem x:Name="menuItemSetPreferredUnityVersion" Header="Set as Preferred Version" Click="MenuItemSetPreferredUnityVersion_Click"/>
644645
</ContextMenu>

UnityLauncherPro/MainWindow.xaml.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,9 +1332,17 @@ private void MenuItemCopyPath_Click(object sender, RoutedEventArgs e)
13321332
if (tabControl.SelectedIndex == 0)
13331333
{
13341334
var proj = GetSelectedProject();
1335-
// fix slashes so that it works in save dialogs
1335+
// fix slashes so that it works in save dialogs
13361336
copy = proj?.Path.Replace('/', '\\');
13371337
}
1338+
else if (tabControl.SelectedIndex == 1)
1339+
{
1340+
var proj = GetSelectedUnity();
1341+
// fix slashes so that it works in save dialogs, and remove editor part
1342+
copy = proj?.Path.Replace('/', '\\').Replace("\\Editor", "");
1343+
// remove exe
1344+
copy = Path.GetDirectoryName(copy);
1345+
}
13381346
if (copy != null) Clipboard.SetText(copy);
13391347
}
13401348

0 commit comments

Comments
 (0)