Fixed editor bugs - Copy/Paste values caused entities to get pasted, filtered asset browser could not expand compilable assets, EditorConfig workingscene does not get saved sometimes #375
|
@ -29,6 +29,8 @@
|
|||
#include "Serialization/Prefab/SHPrefabManager.h"
|
||||
#include "../SHEditorWindowManager.h"
|
||||
#include "../AssetBrowser/SHAssetBrowser.h"
|
||||
#include "Assets/SHAssetManager.h"
|
||||
#include "Assets/Asset Types/SHPrefabAsset.h"
|
||||
|
||||
|
||||
namespace SHADE
|
||||
|
@ -136,6 +138,23 @@ namespace SHADE
|
|||
draggingEntities.clear();
|
||||
ImGui::ClearDragDrop();
|
||||
}
|
||||
//else if(SHDragDrop::currentDragDropTag == SHDragDrop::DRAG_RESOURCE)
|
||||
//{
|
||||
// if (const AssetID* assetPayload = SHDragDrop::AcceptPayload<AssetID>(SHDragDrop::DRAG_RESOURCE)) //If payload is valid
|
||||
// {
|
||||
// auto assetId = *assetPayload;
|
||||
// auto createdEntitiesList = SHSerialization::DeserializeEntitiesFromString(SHAssetManager::GetData<SHPrefabAsset>(assetId)->data);
|
||||
// if (!createdEntitiesList.empty())
|
||||
// {
|
||||
// std::vector<EntityID> eidList;
|
||||
// std::ranges::transform(createdEntitiesList, std::back_inserter(eidList), [](std::pair<EntityID, EntityID> pair) {return pair.second; });
|
||||
// ParentSelectedEntities(eid, eidList);
|
||||
// SetScrollTo(createdEntitiesList.begin()->second);
|
||||
// SHPrefabManager::AddEntity(assetId, createdEntitiesList.begin()->second);
|
||||
// skipFrame = true;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
ImGui::End();
|
||||
|
@ -359,6 +378,20 @@ namespace SHADE
|
|||
draggingEntities.clear();
|
||||
//ImGui::ClearDragDrop();
|
||||
}
|
||||
if (const AssetID* assetPayload = SHDragDrop::AcceptPayload<AssetID>(SHDragDrop::DRAG_RESOURCE)) //If payload is valid
|
||||
{
|
||||
auto assetId = *assetPayload;
|
||||
auto createdEntitiesList = SHSerialization::DeserializeEntitiesFromString(SHAssetManager::GetData<SHPrefabAsset>(assetId)->data);
|
||||
if(!createdEntitiesList.empty())
|
||||
{
|
||||
std::vector<EntityID> eidList;
|
||||
std::ranges::transform(createdEntitiesList, std::back_inserter(eidList), [](std::pair<EntityID, EntityID> pair){return pair.second;} );
|
||||
ParentSelectedEntities(eid, eidList);
|
||||
SetScrollTo(createdEntitiesList.begin()->second);
|
||||
SHPrefabManager::AddEntity(assetId, createdEntitiesList.begin()->second);
|
||||
skipFrame = true;
|
||||
}
|
||||
}
|
||||
SHDragDrop::EndTarget();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue