/****************************************************************************** * File - asset_browser.h * Author - Joey Pollack * Date - 2021/11/10 (y/m/d) * Mod Date - 2021/11/10 (y/m/d) * Description - Browse and manage project assets ******************************************************************************/ #ifndef ASSET_BROWSER_H_ #define ASSET_BROWSER_H_ #include #include #include #include namespace lunarium { namespace editor { class AssetBrowser : public Panel { public: AssetBrowser(std::filesystem::path dir, Editor* pEditor); void SetAssetDirectory(std::filesystem::path dir); bool DoFrame(); std::filesystem::path GetSelectedDirectory(); private: struct Node { std::filesystem::path Myself; std::vector Children; std::vector Files; }; private: std::filesystem::path mAssetDirectory; std::filesystem::path mSelectedDir; Editor* mpEditor; bool mNewFolder; bool mSyncTree; private: void HandlePopupActions(); void HandleAssetDrop(std::filesystem::path dir); void DoDirTree(std::filesystem::path dir); void DoContentArea(ImVec2 wind_size); void DoContextMenu(); void DoNewFolder(); }; } } #endif // ASSET_BROWSER_H_