mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-09 20:08:57 +03:00
Merge pull request #41 from antopilo/NK-114-creating-prefab-doesnt-add-prefab
NK-114 - Creating Prefab without extension doesn't add .prefab
This commit is contained in:
@@ -403,8 +403,18 @@ namespace Nuake {
|
||||
{
|
||||
Ref<Prefab> newPrefab = Prefab::CreatePrefabFromEntity(Selection.Entity);
|
||||
std::string savePath = FileDialog::SaveFile("*.prefab");
|
||||
newPrefab->SaveAs(savePath);
|
||||
Selection.Entity.AddComponent<PrefabComponent>().PrefabInstance = newPrefab;
|
||||
if (!String::EndsWith(savePath, ".prefab"))
|
||||
{
|
||||
savePath += ".prefab";
|
||||
}
|
||||
|
||||
if (!savePath.empty())
|
||||
{
|
||||
newPrefab->SaveAs(savePath);
|
||||
Selection.Entity.AddComponent<PrefabComponent>().PrefabInstance = newPrefab;
|
||||
FileSystem::Scan();
|
||||
FileSystemUI::m_CurrentDirectory = FileSystem::RootDirectory;
|
||||
}
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace Nuake
|
||||
path += ".material";
|
||||
}
|
||||
|
||||
if (path != "")
|
||||
if (!path.empty())
|
||||
{
|
||||
Ref<Material> material = CreateRef<Material>();
|
||||
material->IsEmbedded = false;
|
||||
|
||||
Reference in New Issue
Block a user