|
|
|
@ -271,6 +271,7 @@ namespace lunarium { namespace editor
|
|
|
|
mAssets[asset->mID] = asset;
|
|
|
|
mAssets[asset->mID] = asset;
|
|
|
|
id = asset->mID;
|
|
|
|
id = asset->mID;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Save().LogIfFailed(Editor::LogCat, "Asset was created");
|
|
|
|
return OpRes::OK();
|
|
|
|
return OpRes::OK();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -331,7 +332,12 @@ namespace lunarium { namespace editor
|
|
|
|
void ContentManager::MoveAsset(EditorAsset* asset, std::filesystem::path to)
|
|
|
|
void ContentManager::MoveAsset(EditorAsset* asset, std::filesystem::path to)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::filesystem::path from = mpProject->GetAssetDirectory() / asset->GetFileLocation();
|
|
|
|
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);
|
|
|
|
std::filesystem::path r = mpProject->MakeRelativeToAssets(to);
|
|
|
|
asset->mLocation = r;
|
|
|
|
asset->mLocation = r;
|
|
|
|
|
|
|
|
|
|
|
|
|