refactor: rename ui_editor to editor for consistency
This commit is contained in:
49
editor/src/Managers/ProjectManager.h
Normal file
49
editor/src/Managers/ProjectManager.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include "Core/AssetItem.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
namespace UI {
|
||||
|
||||
class ProjectManager {
|
||||
public:
|
||||
static ProjectManager& Get();
|
||||
|
||||
std::vector<AssetItemPtr>& GetCurrentItems();
|
||||
int GetSelectedIndex() const { return m_selectedIndex; }
|
||||
void SetSelectedIndex(int index) { m_selectedIndex = index; }
|
||||
|
||||
void NavigateToFolder(const AssetItemPtr& folder);
|
||||
void NavigateBack();
|
||||
void NavigateToIndex(size_t index);
|
||||
bool CanNavigateBack() const { return m_path.size() > 1; }
|
||||
|
||||
std::string GetCurrentPath() const;
|
||||
size_t GetPathDepth() const { return m_path.size(); }
|
||||
std::string GetPathName(size_t index) const;
|
||||
|
||||
void Initialize(const std::string& projectPath);
|
||||
void RefreshCurrentFolder();
|
||||
|
||||
void CreateFolder(const std::string& name);
|
||||
void DeleteItem(int index);
|
||||
bool MoveItem(const std::string& sourceFullPath, const std::string& destFolderFullPath);
|
||||
|
||||
const std::string& GetProjectPath() const { return m_projectPath; }
|
||||
|
||||
private:
|
||||
ProjectManager() = default;
|
||||
|
||||
AssetItemPtr ScanDirectory(const std::wstring& path);
|
||||
AssetItemPtr CreateAssetItem(const std::wstring& path, const std::wstring& nameW, bool isFolder);
|
||||
std::wstring GetCurrentFullPathW() const;
|
||||
|
||||
AssetItemPtr m_rootFolder;
|
||||
std::vector<AssetItemPtr> m_path;
|
||||
int m_selectedIndex = -1;
|
||||
std::string m_projectPath;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user