23 class AssetBrowserPanel {
29 struct AssetBrowserItem {
36 std::filesystem::path filepath;
37 std::filesystem::path filename;
38 AssetType defaultAssetType;
39 std::string defaultAssetName;
41 bool isSubassetListOpen;
42 std::vector<Subasset> subassets;
45 enum class AssetBrowserInspectType {
51 void AddFilePath(
const std::filesystem::directory_entry& file);
54 void SetCurrentPlugin(
const std::string& pluginName);
55 void SetCurrentAssetDirectory(
const std::filesystem::path& path);
56 void SetFilesFromCurrentDirectory();
57 void ProcessFolderClicks(
const std::filesystem::path& path);
58 void ProcessFileClicks(AssetBrowserItem& item);
60 void RenderPathPart(
const std::filesystem::path& path);
62 void RenderContextMenuFileTypeSpecificEntries(
const std::filesystem::path& path);
63 void RenderAssetContextMenu(
bool isFolder,
const std::filesystem::path& path,
size_t index);
64 void RenderCurrentDirectoryContextMenu();
65 void RenderAssetTemplates(
const std::filesystem::path& path);
66 size_t SortFile(
bool isFolder,
size_t indexToSort);
68 void RenderAllPlugins();
72 void RenderAssets(
float height);
73 void RenderSidebar(
float height);
74 void RenderSidebarSubdirectory(
const std::filesystem::directory_entry& entry);
75 void RenderFile(
size_t fileIndex);
77 void AfterCreate(
const std::filesystem::path& path);
78 ImTextureID GetIcon(
const AssetType assetType)
const;
80 AssetBrowserInspectType assetBrowserInspectType;
81 std::filesystem::directory_entry currentDirectory;
86 ImTextureID folderIcon;
87 ImTextureID fileIcons[
static_cast<uint16_t
>(AssetType::Count)];
90 bool isShowingPanel =
true;
92 ImguiEditor* editor =
nullptr;
93 bool isRenamingFolder;
95 std::string pathRenameNewName;
96 std::string searchText;
97 std::string searchTextLower;
98 std::vector<std::filesystem::path> folders;
99 std::vector<AssetBrowserItem> files;
100 std::chrono::time_point<std::chrono::system_clock> lastRefreshedAssetsTime;