mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-06 05:01:53 +00:00
Delete hotkey, delte files in background, Alt Up to go back a folder, basic multi select files
This commit is contained in:
@@ -66,6 +66,30 @@ class AssetHierarchy
|
||||
Log.EngineLogger.Trace($"Created root node");
|
||||
}
|
||||
|
||||
public void DeletePathsBackground(Span<StringView> paths)
|
||||
{
|
||||
DeleteBackgroundTask deleteTask = new .(paths);
|
||||
deleteTask.DeleteWhenEnded = true;
|
||||
|
||||
for (StringView path in paths)
|
||||
{
|
||||
Result<TreeNode<AssetNode>> nodeResult = GetNodeFromPath(path);
|
||||
|
||||
if (nodeResult case .Ok(TreeNode<AssetNode> assetNode))
|
||||
{
|
||||
StringView assetDescriptorPath = assetNode->AssetFile?.AssetConfigPath ?? "";
|
||||
|
||||
// If it exists, also try to delete the .ass file
|
||||
if (File.Exists(assetDescriptorPath))
|
||||
{
|
||||
deleteTask.AddPath(assetDescriptorPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EditorApp.Instance.BackgroundTaskManager.StartBackgroundTask(deleteTask);
|
||||
}
|
||||
|
||||
/// Deletes the file that belongs to the given assetNode
|
||||
public void DeleteFile(AssetNode assetNode)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user