Remove deprecated prefab support from UI Editor (#1754)
* Remove old prefab support from UI Editor Signed-off-by: abrmich <abrmich@amazon.com> * Delete deprecated prefab files that are no longer supported in UI Editor Signed-off-by: abrmich <abrmich@amazon.com>
This commit is contained in:
@@ -128,7 +128,6 @@ EditorWindow::EditorWindow(QWidget* parent, Qt::WindowFlags flags)
|
||||
, m_previewActionLogDockWidget(nullptr)
|
||||
, m_previewAnimationListDockWidget(nullptr)
|
||||
, m_editorMode(UiEditorMode::Edit)
|
||||
, m_prefabFiles()
|
||||
, m_actionsEnabledWithSelection()
|
||||
, m_pasteAsSiblingAction(nullptr)
|
||||
, m_pasteAsChildAction(nullptr)
|
||||
@@ -160,8 +159,6 @@ EditorWindow::EditorWindow(QWidget* parent, Qt::WindowFlags flags)
|
||||
connect(m_hierarchy, &HierarchyWidget::SetUserSelection, this, &EditorWindow::UpdateActionsEnabledState);
|
||||
m_clipboardConnection = connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &EditorWindow::UpdateActionsEnabledState);
|
||||
|
||||
UpdatePrefabFiles();
|
||||
|
||||
// Create the cursor to be used when picking an element in the hierarchy or viewport during object pick mode.
|
||||
// Uses the default hot spot which is the center of the image
|
||||
m_entityPickerCursor = QCursor(QPixmap(UICANVASEDITOR_ENTITY_PICKER_CURSOR));
|
||||
@@ -1551,46 +1548,6 @@ AssetTreeEntry* EditorWindow::GetSliceLibraryTree()
|
||||
return m_sliceLibraryTree;
|
||||
}
|
||||
|
||||
void EditorWindow::UpdatePrefabFiles()
|
||||
{
|
||||
m_prefabFiles.clear();
|
||||
|
||||
// IMPORTANT: ScanDirectory() is VERY slow. It can easily take as much
|
||||
// as a whole second to execute. That's why we want to cache its result
|
||||
// up front and ONLY access the cached data.
|
||||
GetIEditor()->GetFileUtil()->ScanDirectory("", "*." UICANVASEDITOR_PREFAB_EXTENSION, m_prefabFiles);
|
||||
SortPrefabsList();
|
||||
}
|
||||
|
||||
IFileUtil::FileArray& EditorWindow::GetPrefabFiles()
|
||||
{
|
||||
return m_prefabFiles;
|
||||
}
|
||||
|
||||
void EditorWindow::AddPrefabFile(const QString& prefabFilename)
|
||||
{
|
||||
IFileUtil::FileDesc fd;
|
||||
fd.filename = prefabFilename;
|
||||
m_prefabFiles.push_back(fd);
|
||||
SortPrefabsList();
|
||||
}
|
||||
|
||||
void EditorWindow::SortPrefabsList()
|
||||
{
|
||||
AZStd::sort<IFileUtil::FileArray::iterator>(m_prefabFiles.begin(), m_prefabFiles.end(),
|
||||
[](const IFileUtil::FileDesc& fd1, const IFileUtil::FileDesc& fd2)
|
||||
{
|
||||
// Some of the files in the list are in different directories, so we
|
||||
// explicitly sort by filename only.
|
||||
AZStd::string fd1Filename;
|
||||
AzFramework::StringFunc::Path::GetFileName(fd1.filename.toUtf8().data(), fd1Filename);
|
||||
|
||||
AZStd::string fd2Filename;
|
||||
AzFramework::StringFunc::Path::GetFileName(fd2.filename.toUtf8().data(), fd2Filename);
|
||||
return fd1Filename < fd2Filename;
|
||||
});
|
||||
}
|
||||
|
||||
void EditorWindow::ToggleEditorMode()
|
||||
{
|
||||
m_editorMode = (m_editorMode == UiEditorMode::Edit) ? UiEditorMode::Preview : UiEditorMode::Edit;
|
||||
|
||||
Reference in New Issue
Block a user