You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lunarium_OLD/src/run_modes/editor/panels/asset_browser.h

60 lines
1.4 KiB
C

/******************************************************************************
* 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 <gui/panel.h>
#include <editor/editor.h>
#include <filesystem>
#include <vector>
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<Node*> Children;
std::vector<std::filesystem::path> 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_