diff --git a/docs/tasks/core.todo b/docs/tasks/core.todo index 6546dfe..3a4742b 100644 --- a/docs/tasks/core.todo +++ b/docs/tasks/core.todo @@ -7,6 +7,7 @@ Build System: ✔ Modify .sh scripts to recognize the noeditor flag @done (1/25/2022, 3:59:23 PM) Core: + ☐ Figure out how to represent Unique Entities and entity instances - and how this will work with UUIDs @critical ☐ Implement generic serializeation system ☐ JSON serializeable base class ☐ JSON implementions should be stubbed out in non-editor builds diff --git a/src/run_modes/editor/contents/content_manager.cpp b/src/run_modes/editor/contents/content_manager.cpp index 942cabf..093c6c3 100644 --- a/src/run_modes/editor/contents/content_manager.cpp +++ b/src/run_modes/editor/contents/content_manager.cpp @@ -271,6 +271,7 @@ namespace lunarium { namespace editor mAssets[asset->mID] = asset; id = asset->mID; + Save().LogIfFailed(Editor::LogCat, "Asset was created"); return OpRes::OK(); } @@ -331,7 +332,12 @@ namespace lunarium { namespace editor void ContentManager::MoveAsset(EditorAsset* asset, std::filesystem::path to) { std::filesystem::path from = mpProject->GetAssetDirectory() / asset->GetFileLocation(); - std::filesystem::rename(from, to); + + // Not all assets will have files associated with them + if (std::filesystem::exists(from)) + { + std::filesystem::rename(from, to); + } std::filesystem::path r = mpProject->MakeRelativeToAssets(to); asset->mLocation = r; diff --git a/src/run_modes/editor/panels/asset_browser.cpp b/src/run_modes/editor/panels/asset_browser.cpp index 8070ef3..758da6b 100644 --- a/src/run_modes/editor/panels/asset_browser.cpp +++ b/src/run_modes/editor/panels/asset_browser.cpp @@ -108,7 +108,7 @@ namespace editor mSelectedDir = dir; ImGui::SetNextItemOpen(false); } - HandleAssetDrop(mSelectedDir); + HandleAssetDrop(dir); } for(auto const& dir_entry: std::filesystem::directory_iterator{dir}) diff --git a/src/run_modes/editor/panels/world_tree.cpp b/src/run_modes/editor/panels/world_tree.cpp index 32c0040..9249fe3 100644 --- a/src/run_modes/editor/panels/world_tree.cpp +++ b/src/run_modes/editor/panels/world_tree.cpp @@ -69,11 +69,12 @@ namespace lunarium void WorldTree::DoFrame() { Entity *pSelection = nullptr; - if (mpWorld) + if (!mpWorld) { - ImGui::SetNextItemOpen(true); + ImGui::Text("No World Loaded"); + return; } - + if (ImGui::TreeNode("World Root") && mpWorld) { // List all world entities