42 lines
1.3 KiB
C++
42 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "Panel.h"
|
|
#include "Core/AssetItem.h"
|
|
#include "UI/PopupState.h"
|
|
|
|
namespace XCEngine {
|
|
namespace Editor {
|
|
|
|
class ProjectPanel : public Panel {
|
|
public:
|
|
ProjectPanel();
|
|
void Render() override;
|
|
void Initialize(const std::string& projectPath);
|
|
|
|
private:
|
|
struct AssetItemInteraction {
|
|
bool clicked = false;
|
|
bool contextRequested = false;
|
|
bool openRequested = false;
|
|
std::string droppedSourcePath;
|
|
};
|
|
|
|
void RenderToolbar();
|
|
void RenderFolderTreePane(IProjectManager& manager);
|
|
void RenderFolderTreeNode(IProjectManager& manager, const AssetItemPtr& folder, const std::string& currentFolderPath);
|
|
void RenderBrowserPane(IProjectManager& manager);
|
|
void RenderBrowserHeader(IProjectManager& manager);
|
|
AssetItemInteraction RenderAssetItem(const AssetItemPtr& item, bool isSelected);
|
|
static bool MatchesSearch(const AssetItemPtr& item, const std::string& search);
|
|
static bool IsCurrentTreeBranch(const std::string& currentFolderPath, const std::string& folderPath);
|
|
|
|
char m_searchBuffer[256] = "";
|
|
float m_navigationWidth = UI::ProjectNavigationDefaultWidth();
|
|
UI::TextInputPopupState<256> m_createFolderDialog;
|
|
UI::DeferredPopupState m_emptyContextMenu;
|
|
UI::TargetedPopupState<AssetItemPtr> m_itemContextMenu;
|
|
};
|
|
|
|
}
|
|
}
|