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 void AddFilePath(
const std::filesystem::directory_entry& file);
47 void SetCurrentAssetDirectory(
const std::filesystem::path& path);
48 void SetFilesFromCurrentDirectory();
49 void ProcessFolderClicks(
const std::filesystem::path& path);
50 void ProcessFileClicks(AssetBrowserItem& item);
52 void RenderPathPart(
const std::filesystem::path& path);
54 void RenderContextMenuFileTypeSpecificEntries(
const std::filesystem::path& path);
55 void RenderAssetContextMenu(
bool isFolder,
const std::filesystem::path& path,
size_t index);
56 void RenderCurrentDirectoryContextMenu();
57 void RenderAssetTemplates(
const std::filesystem::path& path);
58 size_t SortFile(
bool isFolder,
size_t indexToSort);
62 void RenderAssets(
float height);
63 void RenderSidebar(
float height);
64 void RenderSidebarSubdirectory(
const std::filesystem::directory_entry& entry);
65 void RenderFile(
size_t fileIndex);
67 void AfterCreate(
const std::filesystem::path& path);
68 ImTextureID GetIcon(
const AssetType assetType)
const;
70 std::filesystem::directory_entry currentDirectory;
75 ImTextureID folderIcon;
76 ImTextureID fileIcons[
static_cast<uint16_t
>(AssetType::Count)];
79 bool isShowingPanel =
true;
82 bool isRenamingFolder;
84 std::string pathRenameNewName;
85 std::string searchText;
86 std::string searchTextLower;
87 std::vector<std::filesystem::path> folders;
88 std::vector<AssetBrowserItem> files;
89 std::chrono::time_point<std::chrono::system_clock> lastRefreshedAssetsTime;