Fixes
This commit is contained in:
@ -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[])
|
||||
|
||||
Reference in New Issue
Block a user