This commit is contained in:
Isuru Samarathunga
2025-11-14 09:43:09 +05:30
parent 9ff39d7245
commit a2b80ef600
32 changed files with 928 additions and 295 deletions

View File

@ -26,6 +26,7 @@
#include <UI/UI.hpp>
#include <UI/View/Asset.hpp>
#include <UI/View/FilePreview.hpp>
#include <LogoIcon.hpp>
@ -41,15 +42,46 @@ namespace ia::iae
ImDrawData *g_imDrawData{};
IVec2 g_windowExtent{800, 600};
Map<String, String> g_assetNameMap;
SIZE_T g_uniqueNameCounter{0};
String generate_unique_asset_name()
{
return BuildString("Asset_", g_uniqueNameCounter++);
}
VOID Editor::LoadProject(IN CONST String &directory)
{
m_activeProject = Project::Load(directory);
}
VOID Editor::OpenAsset(IN Path path)
VOID Editor::OpenFile(IN Path path)
{
const auto assetName = AssetManager::GetAssetName(path.string().c_str());
if (assetName.size())
{
UI::GetAssetView()->Open(assetName);
UI::OpenAssetView();
}
else
{
UI::GetFilePreviewView()->Open(path);
UI::OpenFilePreviewView();
}
}
VOID Editor::MarkAsAsset(IN Path path)
{
const auto assetName = generate_unique_asset_name();
AssetManager::AssignAssetName(AssetManager::LoadTexture(path.string().c_str()), assetName);
UI::CloseFilePreviewView();
UI::GetAssetView()->Open(assetName);
UI::OpenAssetView();
}
VOID Editor::RemoveFromAssets(IN CONST String &assetName)
{
UI::GetAssetView()->Open(path);
UI::FocusAssetView();
}
INT32 Editor::Run(IN INT32 argc, IN PCCHAR argv[])