Browse Source

Feature: Double-click on BSL and plain text files will now open them in OS-specified editor

BearishSun 6 years ago
parent
commit
ca1567e4e5
2 changed files with 8 additions and 1 deletions
  1. 7 0
      Source/EditorManaged/Windows/Library/LibraryGUIEntry.cs
  2. 1 1
      Source/bsf

+ 7 - 0
Source/EditorManaged/Windows/Library/LibraryGUIEntry.cs

@@ -1,5 +1,7 @@
 //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+
+using System.Diagnostics;
 using System.IO;
 using bs;
 
@@ -436,6 +438,11 @@ namespace bs.Editor
 
                         delayedOpenCodeEditorFrame = Time.FrameIdx + 1;
                     }
+                    else if(meta.ResType == ResourceType.PlainText || meta.ResType == ResourceType.Shader || meta.ResType == ResourceType.ShaderInclude)
+                    {
+                        string absPath = Path.Combine(ProjectLibrary.ResourceFolder, fileEntry.Path);
+                        Process.Start(absPath);
+                    }
                 }
             }
         }

+ 1 - 1
Source/bsf

@@ -1 +1 @@
-Subproject commit 6358af6aeaab80aa63525d6f96fccc7a9ad6a6bc
+Subproject commit df8fcff41eb24422c7065d8ffebd0d9c53287d92