More content browser stuff

- Seperate AssetHierarchy from EditorContentManager
- Make files selectable and context menu
This commit is contained in:
Simon Lübeß
2023-01-02 20:00:48 +01:00
parent fdf680508d
commit 9d97579857
4 changed files with 398 additions and 107 deletions
@@ -0,0 +1,39 @@
using System.Diagnostics;
namespace System.IO;
extension Path
{
/// Opens the file browser and selects the specified file.
/// @param path The path of the file to select.
public static void OpenFolderAndSelectItem(String path)
{
String fullPath = scope String(256);
Path.GetFullPath(path, fullPath);
#if BF_PLATFORM_WINDOWS
ProcessStartInfo processInfo = scope .();
processInfo.SetFileNameAndArguments(scope $"explorer /select,\"{fullPath}\"");
scope SpawnedProcess().Start(processInfo);
#else
Runtime.NotImplemented();
#endif
}
/// Opens the file browser in the given directory.
/// @param directory The directory to show in the file browser.
public static void OpenFolder(String directory)
{
String fullPath = scope String(256);
Path.GetFullPath(directory, fullPath);
#if BF_PLATFORM_WINDOWS
ProcessStartInfo processInfo = scope .();
processInfo.SetFileNameAndArguments(scope $"explorer \"{fullPath}\"");
scope SpawnedProcess().Start(processInfo);
#else
Runtime.NotImplemented();
#endif
}
}