Voltray Engine Docs
Loading...
Searching...
No Matches
ContextMenu.h
Go to the documentation of this file.
1#pragma once
2#include "../Core/AssetItem.h"
3#include "../Core/AssetManager.h"
4#include <functional>
5
11namespace Editor
12{
13 namespace Assets
14 {
20 {
34
36 std::string stringParam; // For folder name, script name, etc.
37 AssetItem targetItem; // The item the action was performed on
38 };
39
45 {
46 public:
53 static ContextMenuResult ShowEmptySpaceMenu(const std::filesystem::path &currentPath, bool isGlobal);
54
61 static ContextMenuResult ShowAssetMenu(const AssetItem &item, bool isGlobal);
62
69 static bool ShowScriptCreationDialog(std::string &scriptName, std::string &scriptType);
70
77 static bool ShowRenameDialog(const std::string &currentName, std::string &newName);
78
84 static bool ShowFolderCreationDialog(std::string &folderName);
85
92 static bool ShowDeleteConfirmation(const std::string &itemName, bool isDirectory);
93
94 private:
95 static bool s_showScriptDialog;
96 static bool s_showRenameDialog;
97 static bool s_showFolderDialog;
98 static bool s_showDeleteDialog;
99
100 static std::string s_tempScriptName;
101 static std::string s_tempScriptType;
102 static std::string s_tempNewName;
103 static std::string s_tempFolderName;
104 static std::string s_tempDeleteItemName;
105 static bool s_tempIsDirectory;
106 };
107 }
108}
A panel component responsible for managing and displaying asset resources.
Manages context menus for the asset browser.
Definition ContextMenu.h:45
static bool ShowScriptCreationDialog(std::string &scriptName, std::string &scriptType)
Show script creation submenu.
Definition ContextMenu.cpp:131
static ContextMenuResult ShowEmptySpaceMenu(const std::filesystem::path &currentPath, bool isGlobal)
Show context menu for empty space in the browser.
Definition ContextMenu.cpp:21
static ContextMenuResult ShowAssetMenu(const AssetItem &item, bool isGlobal)
Show context menu for a specific asset item.
Definition ContextMenu.cpp:78
static bool ShowFolderCreationDialog(std::string &folderName)
Show folder creation dialog.
Definition ContextMenu.cpp:239
static bool ShowRenameDialog(const std::string &currentName, std::string &newName)
Show rename dialog.
Definition ContextMenu.cpp:186
static bool ShowDeleteConfirmation(const std::string &itemName, bool isDirectory)
Show delete confirmation dialog.
Definition ContextMenu.cpp:292
Definition AssetsPanel.cpp:7
Represents a single asset item in the file browser.
Definition AssetItem.h:30
Result of a context menu action.
Definition ContextMenu.h:20
std::string stringParam
Definition ContextMenu.h:36
AssetItem targetItem
Definition ContextMenu.h:37
Type
Definition ContextMenu.h:22
@ ShowInExplorer
Definition ContextMenu.h:31
@ CreateFolder
Definition ContextMenu.h:24
@ Delete
Definition ContextMenu.h:27
@ Copy
Definition ContextMenu.h:28
@ Cut
Definition ContextMenu.h:29
@ CreateScript
Definition ContextMenu.h:25
@ None
Definition ContextMenu.h:23
@ Rename
Definition ContextMenu.h:26
@ Paste
Definition ContextMenu.h:30
@ Refresh
Definition ContextMenu.h:32
Type type
Definition ContextMenu.h:35