Merge branch 'main' into ly-as-sdk/LYN-2948
# Conflicts: # Code/Tools/ProjectManager/CMakeLists.txt # Code/Tools/ProjectManager/Source/GemCatalog.cpp # Code/Tools/ProjectManager/Source/GemCatalog.h # Code/Tools/ProjectManager/Source/GemCatalog.ui # Code/Tools/ProjectManager/Source/GemCatalog/GemCatalog.h # Code/Tools/ProjectManager/Source/ScreenFactory.cpp # Code/Tools/ProjectManager/project_manager_files.cmake # Code/Tools/ProjectManager/source/Qt/GemCatalog.h
This commit is contained in:
@@ -20,13 +20,18 @@
|
||||
namespace AssetBundler
|
||||
{
|
||||
const char* DateTimeFormat = "hh:mm:ss MMM dd, yyyy";
|
||||
const char* ReadOnlyFileErrorMessage = "File (%s) is Read-Only. Please check your version control and try again.";
|
||||
|
||||
AssetBundlerAbstractFileTableModel::AssetBundlerAbstractFileTableModel(QObject* parent)
|
||||
: QAbstractTableModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void AssetBundlerAbstractFileTableModel::Reload(const char* fileExtension, const QSet<QString>& watchedFolders, const QSet<QString>& watchedFiles, const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap)
|
||||
void AssetBundlerAbstractFileTableModel::Reload(
|
||||
const char* fileExtension,
|
||||
const QSet<QString>& watchedFolders,
|
||||
const QSet<QString>& watchedFiles,
|
||||
const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap)
|
||||
{
|
||||
AZStd::vector<AZStd::string> keysToRemove = m_fileListKeys;
|
||||
|
||||
@@ -49,7 +54,9 @@ namespace AssetBundler
|
||||
|
||||
// If a project name is already specified, then the associated file is a default file
|
||||
LoadFile(absolutePath, projectName, !projectName.empty());
|
||||
keysToRemove.erase(AZStd::remove(keysToRemove.begin(), keysToRemove.end(), AssetBundler::GenerateKeyFromAbsolutePath(absolutePath)), keysToRemove.end());
|
||||
keysToRemove.erase(
|
||||
AZStd::remove(keysToRemove.begin(), keysToRemove.end(), AssetBundler::GenerateKeyFromAbsolutePath(absolutePath)),
|
||||
keysToRemove.end());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +70,9 @@ namespace AssetBundler
|
||||
|
||||
// If a project name is already specified, then the associated file is a default file
|
||||
LoadFile(absolutePath, projectName, !projectName.empty());
|
||||
keysToRemove.erase(AZStd::remove(keysToRemove.begin(), keysToRemove.end(), AssetBundler::GenerateKeyFromAbsolutePath(absolutePath)), keysToRemove.end());
|
||||
keysToRemove.erase(
|
||||
AZStd::remove(keysToRemove.begin(), keysToRemove.end(), AssetBundler::GenerateKeyFromAbsolutePath(absolutePath)),
|
||||
keysToRemove.end());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +83,9 @@ namespace AssetBundler
|
||||
}
|
||||
}
|
||||
|
||||
void AssetBundlerAbstractFileTableModel::ReloadFiles(const AZStd::vector<AZStd::string>& absoluteFilePathList, AZStd::unordered_map<AZStd::string, AZStd::string> pathToProjectNameMap)
|
||||
void AssetBundlerAbstractFileTableModel::ReloadFiles(
|
||||
const AZStd::vector<AZStd::string>& absoluteFilePathList,
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> pathToProjectNameMap)
|
||||
{
|
||||
for (const AZStd::string& absoluteFilePath : absoluteFilePathList)
|
||||
{
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace AssetBundler
|
||||
{
|
||||
|
||||
extern const char* DateTimeFormat;
|
||||
extern const char* ReadOnlyFileErrorMessage;
|
||||
|
||||
//! Provides an abstract model that can be subclassed to create table models used to store information about files found on-disk.
|
||||
class AssetBundlerAbstractFileTableModel
|
||||
@@ -47,9 +48,15 @@ namespace AssetBundler
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Pure virtual functions
|
||||
virtual AZStd::vector<AZStd::string> CreateNewFiles(const AZStd::string& absoluteFilePath, const AzFramework::PlatformFlags& platforms, const QString& project = QString()) = 0;
|
||||
virtual AZStd::vector<AZStd::string> CreateNewFiles(
|
||||
const AZStd::string& absoluteFilePath,
|
||||
const AzFramework::PlatformFlags& platforms,
|
||||
const QString& project = QString()) = 0;
|
||||
virtual bool DeleteFile(const QModelIndex& index) = 0;
|
||||
virtual void LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& projectName = "", bool isDefaultFile = false) = 0;
|
||||
virtual void LoadFile(
|
||||
const AZStd::string& absoluteFilePath,
|
||||
const AZStd::string& projectName = "",
|
||||
bool isDefaultFile = false) = 0;
|
||||
virtual bool WriteToDisk(const AZStd::string& key) = 0;
|
||||
|
||||
//! Returns the absolute path of the file at the given index on success, returns an empty string on failure.
|
||||
@@ -60,9 +67,15 @@ namespace AssetBundler
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! Reload all the data based on the watched folders and files
|
||||
virtual void Reload(const char* fileExtension, const QSet<QString>& watchedFolders, const QSet<QString>& watchedFiles = QSet<QString>(), const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap = AZStd::unordered_map<AZStd::string, AZStd::string>());
|
||||
virtual void Reload(
|
||||
const char* fileExtension,
|
||||
const QSet<QString>& watchedFolders,
|
||||
const QSet<QString>& watchedFiles = QSet<QString>(),
|
||||
const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap = AZStd::unordered_map<AZStd::string, AZStd::string>());
|
||||
|
||||
virtual void ReloadFiles(const AZStd::vector<AZStd::string>& absoluteFilePathList, AZStd::unordered_map<AZStd::string, AZStd::string> pathToProjectNameMap = AZStd::unordered_map<AZStd::string, AZStd::string>());
|
||||
virtual void ReloadFiles(
|
||||
const AZStd::vector<AZStd::string>& absoluteFilePathList,
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> pathToProjectNameMap = AZStd::unordered_map<AZStd::string, AZStd::string>());
|
||||
|
||||
bool Save(const QModelIndex& selectedIndex);
|
||||
|
||||
|
||||
@@ -87,12 +87,15 @@ namespace AssetBundler
|
||||
{
|
||||
if (AZ::IO::FileIOBase::GetInstance()->IsReadOnly(absolutePath))
|
||||
{
|
||||
AZ_Error(AssetBundler::AppWindowName, false, ReadOnlyFileErrorMessage, absolutePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
auto deleteResult = AZ::IO::FileIOBase::GetInstance()->Remove(absolutePath);
|
||||
if (!deleteResult)
|
||||
{
|
||||
AZ_Error(AssetBundler::AppWindowName, false,
|
||||
"Unable to delete (%s). Result code: %u", absolutePath, deleteResult.GetResultCode());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -104,7 +107,10 @@ namespace AssetBundler
|
||||
return true;
|
||||
}
|
||||
|
||||
void AssetListFileTableModel::LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& /*projectName*/, bool /*isDefaultFile*/)
|
||||
void AssetListFileTableModel::LoadFile(
|
||||
const AZStd::string& absoluteFilePath,
|
||||
const AZStd::string& /*projectName*/,
|
||||
bool /*isDefaultFile*/)
|
||||
{
|
||||
AZStd::string fullFileName;
|
||||
AzFramework::StringFunc::Path::GetFullFileName(absoluteFilePath.c_str(), fullFileName);
|
||||
|
||||
@@ -56,7 +56,10 @@ namespace AssetBundler
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// AssetBundlerAbstractFileTableModel overrides
|
||||
AZStd::vector<AZStd::string> CreateNewFiles(const AZStd::string& /*absoluteFilePath*/, const AzFramework::PlatformFlags& /*platforms*/, const QString& /*project*/) override { return {}; }
|
||||
AZStd::vector<AZStd::string> CreateNewFiles(
|
||||
const AZStd::string& /*absoluteFilePath*/,
|
||||
const AzFramework::PlatformFlags& /*platforms*/,
|
||||
const QString& /*project*/) override { return {}; }
|
||||
bool DeleteFile(const QModelIndex& index) override;
|
||||
void LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& projectName = "", bool isDefaultFile = false) override;
|
||||
bool WriteToDisk(const AZStd::string& key) override;
|
||||
|
||||
@@ -23,7 +23,10 @@ namespace AssetBundler
|
||||
: public QAbstractTableModel
|
||||
{
|
||||
public:
|
||||
explicit AssetListTableModel(QObject* parent = nullptr, const AZStd::string& absolutePath = AZStd::string(), const AZStd::string& platform = "");
|
||||
explicit AssetListTableModel(
|
||||
QObject* parent = nullptr,
|
||||
const AZStd::string& absolutePath = AZStd::string(),
|
||||
const AZStd::string& platform = "");
|
||||
virtual ~AssetListTableModel() {}
|
||||
|
||||
AZStd::shared_ptr<AzToolsFramework::AssetSeedManager> GetSeedListManager() { return m_seedListManager; }
|
||||
|
||||
@@ -73,14 +73,15 @@ namespace AssetBundler
|
||||
{
|
||||
if (AZ::IO::FileIOBase::GetInstance()->IsReadOnly(absolutePath))
|
||||
{
|
||||
AZ_Error(AssetBundler::AppWindowName, false, "File (%s) is Read-Only. Please check your version control and try again.", absolutePath);
|
||||
AZ_Error(AssetBundler::AppWindowName, false, ReadOnlyFileErrorMessage, absolutePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
auto deleteResult = AZ::IO::FileIOBase::GetInstance()->Remove(absolutePath);
|
||||
if (!deleteResult)
|
||||
{
|
||||
AZ_Error(AssetBundler::AppWindowName, false, "Unable to delete: %s", absolutePath);
|
||||
AZ_Error(AssetBundler::AppWindowName, false,
|
||||
"Unable to delete (%s). Result code: %u", absolutePath, deleteResult.GetResultCode());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -175,7 +176,10 @@ namespace AssetBundler
|
||||
return Column::ColumnFileCreationTime;
|
||||
}
|
||||
|
||||
void BundleFileListModel::LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& /*projectName*/, bool /*isDefaultFile*/)
|
||||
void BundleFileListModel::LoadFile(
|
||||
const AZStd::string& absoluteFilePath,
|
||||
const AZStd::string& /*projectName*/,
|
||||
bool /*isDefaultFile*/)
|
||||
{
|
||||
AZStd::string key = AssetBundler::GenerateKeyFromAbsolutePath(absoluteFilePath);
|
||||
|
||||
|
||||
@@ -43,7 +43,10 @@ namespace AssetBundler
|
||||
explicit BundleFileListModel();
|
||||
virtual ~BundleFileListModel() {}
|
||||
|
||||
AZStd::vector<AZStd::string> CreateNewFiles(const AZStd::string& /*absoluteFilePath*/, const AzFramework::PlatformFlags& /*platforms*/, const QString& /*project*/) override { return {}; }
|
||||
AZStd::vector<AZStd::string> CreateNewFiles(
|
||||
const AZStd::string& /*absoluteFilePath*/,
|
||||
const AzFramework::PlatformFlags& /*platforms*/,
|
||||
const QString& /*project*/) override { return {}; }
|
||||
bool DeleteFile(const QModelIndex& index) override;
|
||||
void LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& projectName = "", bool isDefaultFile = false) override;
|
||||
bool WriteToDisk(const AZStd::string& /*key*/) override { return true; }
|
||||
|
||||
@@ -67,7 +67,10 @@ namespace AssetBundler
|
||||
{
|
||||
}
|
||||
|
||||
AZStd::vector<AZStd::string> RulesFileTableModel::CreateNewFiles(const AZStd::string& absoluteFilePath, const AzFramework::PlatformFlags& /*platforms*/, const QString& /*project*/)
|
||||
AZStd::vector<AZStd::string> RulesFileTableModel::CreateNewFiles(
|
||||
const AZStd::string& absoluteFilePath,
|
||||
const AzFramework::PlatformFlags& /*platforms*/,
|
||||
const QString& /*project*/)
|
||||
{
|
||||
if (absoluteFilePath.empty())
|
||||
{
|
||||
@@ -116,14 +119,16 @@ namespace AssetBundler
|
||||
// Remove file from disk
|
||||
if (AZ::IO::FileIOBase::GetInstance()->IsReadOnly(rulesFileInfo->m_absolutePath.c_str()))
|
||||
{
|
||||
AZ_Error(AssetBundler::AppWindowName, false, "File (%s) is Read-Only. Please check your version control and try again.", rulesFileInfo->m_absolutePath.c_str());
|
||||
AZ_Error(AssetBundler::AppWindowName, false, ReadOnlyFileErrorMessage, rulesFileInfo->m_absolutePath.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
auto deleteResult = AZ::IO::FileIOBase::GetInstance()->Remove(rulesFileInfo->m_absolutePath.c_str());
|
||||
if (!deleteResult)
|
||||
{
|
||||
AZ_Error(AssetBundler::AppWindowName, false, "Unable to delete: %s", rulesFileInfo->m_absolutePath.c_str());
|
||||
AZ_Error(AssetBundler::AppWindowName, false,
|
||||
"Unable to delete (%s). Result code: %u", rulesFileInfo->m_absolutePath.c_str(),
|
||||
deleteResult.GetResultCode());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -134,7 +139,10 @@ namespace AssetBundler
|
||||
return true;
|
||||
}
|
||||
|
||||
void RulesFileTableModel::LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& /*projectName*/, bool /*isDefaultFile*/)
|
||||
void RulesFileTableModel::LoadFile(
|
||||
const AZStd::string& absoluteFilePath,
|
||||
const AZStd::string& /*projectName*/,
|
||||
bool /*isDefaultFile*/)
|
||||
{
|
||||
// Get the file name without the extension for display purposes
|
||||
AZStd::string fileName(absoluteFilePath);
|
||||
@@ -145,7 +153,8 @@ namespace AssetBundler
|
||||
auto fileInfoIt = m_rulesFileInfoMap.find(key);
|
||||
if (fileInfoIt != m_rulesFileInfoMap.end() && fileInfoIt->second->m_hasUnsavedChanges)
|
||||
{
|
||||
AZ_Warning(AssetBundler::AppWindowName, false, "Rules File %s has unsaved changes and couldn't be reloaded", absoluteFilePath.c_str());
|
||||
AZ_Warning(AssetBundler::AppWindowName, false,
|
||||
"Rules File %s has unsaved changes and couldn't be reloaded", absoluteFilePath.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,10 @@ namespace AssetBundler
|
||||
RulesFileTableModel();
|
||||
virtual ~RulesFileTableModel() {}
|
||||
|
||||
AZStd::vector<AZStd::string> CreateNewFiles(const AZStd::string& absoluteFilePath, const AzFramework::PlatformFlags& platforms = AzFramework::PlatformFlags::Platform_NONE, const QString& project = QString()) override;
|
||||
AZStd::vector<AZStd::string> CreateNewFiles(
|
||||
const AZStd::string& absoluteFilePath,
|
||||
const AzFramework::PlatformFlags& platforms = AzFramework::PlatformFlags::Platform_NONE,
|
||||
const QString& project = QString()) override;
|
||||
|
||||
bool DeleteFile(const QModelIndex& index) override;
|
||||
|
||||
|
||||
@@ -91,12 +91,19 @@ namespace AssetBundler
|
||||
m_seedTabWidget = nullptr;
|
||||
}
|
||||
|
||||
void SeedListFileTableModel::AddDefaultSeedsToInMemoryList(const AZStd::vector<AZStd::string>& defaultSeeds, const char* projectName, const AzFramework::PlatformFlags& platforms)
|
||||
void SeedListFileTableModel::AddDefaultSeedsToInMemoryList(
|
||||
const AZStd::vector<AZStd::string>& defaultSeeds,
|
||||
const char* projectName,
|
||||
const AzFramework::PlatformFlags& platforms)
|
||||
{
|
||||
m_inMemoryDefaultSeedList.reset(new SeedListFileInfo(m_inMemoryDefaultSeedListKey, tr("DefaultSeeds"), QString(projectName), false, true, defaultSeeds, platforms));
|
||||
m_inMemoryDefaultSeedList.reset(
|
||||
new SeedListFileInfo(m_inMemoryDefaultSeedListKey, tr("DefaultSeeds"), QString(projectName), false, true, defaultSeeds, platforms));
|
||||
}
|
||||
|
||||
AZStd::vector<AZStd::string> SeedListFileTableModel::CreateNewFiles(const AZStd::string& absoluteFilePath, const AzFramework::PlatformFlags& /*platforms*/, const QString& project)
|
||||
AZStd::vector<AZStd::string> SeedListFileTableModel::CreateNewFiles(
|
||||
const AZStd::string& absoluteFilePath,
|
||||
const AzFramework::PlatformFlags& /*platforms*/,
|
||||
const QString& project)
|
||||
{
|
||||
if (absoluteFilePath.empty())
|
||||
{
|
||||
@@ -111,7 +118,8 @@ namespace AssetBundler
|
||||
// Create a Seed List File and save it to disk
|
||||
AZStd::string key = AssetBundler::GenerateKeyFromAbsolutePath(absoluteFilePath);
|
||||
|
||||
AZStd::shared_ptr<SeedListFileInfo> newSeedListFile = AZStd::make_shared<SeedListFileInfo>(absoluteFilePath, QString(fileName.c_str()), project, false);
|
||||
AZStd::shared_ptr<SeedListFileInfo> newSeedListFile =
|
||||
AZStd::make_shared<SeedListFileInfo>(absoluteFilePath, QString(fileName.c_str()), project, false);
|
||||
newSeedListFile->m_seedListModel->SetHasUnsavedChanges(true);
|
||||
bool saveResult = newSeedListFile->SaveSeedFile();
|
||||
if (!saveResult)
|
||||
@@ -151,14 +159,15 @@ namespace AssetBundler
|
||||
{
|
||||
if (AZ::IO::FileIOBase::GetInstance()->IsReadOnly(absolutePath))
|
||||
{
|
||||
AZ_Error(AssetBundler::AppWindowName, false, "File (%s) is Read-Only. Please check your version control and try again.", absolutePath);
|
||||
AZ_Error(AssetBundler::AppWindowName, false, ReadOnlyFileErrorMessage, absolutePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
auto deleteResult = AZ::IO::FileIOBase::GetInstance()->Remove(absolutePath);
|
||||
if (!deleteResult)
|
||||
{
|
||||
AZ_Error(AssetBundler::AppWindowName, false, "Unable to delete: %s", absolutePath);
|
||||
AZ_Error(AssetBundler::AppWindowName, false,
|
||||
"Unable to delete (%s). Result code: %u", absolutePath, deleteResult.GetResultCode());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -170,7 +179,11 @@ namespace AssetBundler
|
||||
return true;
|
||||
}
|
||||
|
||||
void SeedListFileTableModel::Reload(const char* fileExtension, const QSet<QString>& watchedFolders, const QSet<QString>& watchedFiles, const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap)
|
||||
void SeedListFileTableModel::Reload(
|
||||
const char* fileExtension,
|
||||
const QSet<QString>& watchedFolders,
|
||||
const QSet<QString>& watchedFiles,
|
||||
const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap)
|
||||
{
|
||||
// Load in the Seed List files from disk
|
||||
AssetBundlerAbstractFileTableModel::Reload(fileExtension, watchedFolders, watchedFiles, pathToProjectNameMap);
|
||||
@@ -191,7 +204,8 @@ namespace AssetBundler
|
||||
auto fileInfoIt = m_seedListFileInfoMap.find(key);
|
||||
if (fileInfoIt != m_seedListFileInfoMap.end() && fileInfoIt->second->HasUnsavedChanges())
|
||||
{
|
||||
AZ_Warning(AssetBundler::AppWindowName, false, "Seed List File %s has unsaved changes and couldn't be reloaded", absoluteFilePath.c_str());
|
||||
AZ_Warning(AssetBundler::AppWindowName, false,
|
||||
"Seed List File %s has unsaved changes and couldn't be reloaded", absoluteFilePath.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -208,7 +222,8 @@ namespace AssetBundler
|
||||
projectNameOnDisplay = outcome.TakeValue();
|
||||
}
|
||||
|
||||
m_seedListFileInfoMap[key].reset(new SeedListFileInfo(absoluteFilePath, QString(fileName.c_str()), QString(projectNameOnDisplay.c_str()), true, isDefaultFile));
|
||||
m_seedListFileInfoMap[key].reset(
|
||||
new SeedListFileInfo(absoluteFilePath, QString(fileName.c_str()), QString(projectNameOnDisplay.c_str()), true, isDefaultFile));
|
||||
AddFileKey(key);
|
||||
}
|
||||
|
||||
@@ -241,7 +256,9 @@ namespace AssetBundler
|
||||
emit dataChanged(firstIndex, lastIndex, { Qt::CheckStateRole });
|
||||
}
|
||||
|
||||
AZStd::vector<AZStd::string> SeedListFileTableModel::GenerateAssetLists(const AZStd::string& absoluteFilePath, const AzFramework::PlatformFlags& platforms)
|
||||
AZStd::vector<AZStd::string> SeedListFileTableModel::GenerateAssetLists(
|
||||
const AZStd::string& absoluteFilePath,
|
||||
const AzFramework::PlatformFlags& platforms)
|
||||
{
|
||||
if (!m_checkedSeedListFiles.size())
|
||||
{
|
||||
@@ -280,7 +297,8 @@ namespace AssetBundler
|
||||
AZStd::vector<AZStd::string> createdFiles;
|
||||
for (const auto& platformIndex : AzFramework::PlatformHelper::GetPlatformIndicesInterpreted(platforms))
|
||||
{
|
||||
AZStd::string platformSpecificCachePath = AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(platformIndex);
|
||||
AZStd::string platformSpecificCachePath =
|
||||
AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(platformIndex);
|
||||
AzFramework::StringFunc::Path::StripFullName(platformSpecificCachePath);
|
||||
|
||||
FilePath platformSpecificPath(absoluteFilePath, AZStd::string(AzFramework::PlatformHelper::GetPlatformName(platformIndex)));
|
||||
@@ -304,7 +322,10 @@ namespace AssetBundler
|
||||
return seedFileInfoOutcome.GetValue()->m_seedListModel;
|
||||
}
|
||||
|
||||
bool SeedListFileTableModel::SetSeedPlatforms(const QModelIndex& seedFileIndex, const QModelIndex& seedIndex, const AzFramework::PlatformFlags& platforms)
|
||||
bool SeedListFileTableModel::SetSeedPlatforms(
|
||||
const QModelIndex& seedFileIndex,
|
||||
const QModelIndex& seedIndex,
|
||||
const AzFramework::PlatformFlags& platforms)
|
||||
{
|
||||
AZStd::string key = GetFileKey(seedFileIndex);
|
||||
if (key.empty())
|
||||
@@ -334,7 +355,10 @@ namespace AssetBundler
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SeedListFileTableModel::AddSeed(const QModelIndex& seedFileIndex, const AZStd::string& seedRelativePath, const AzFramework::PlatformFlags& platforms)
|
||||
bool SeedListFileTableModel::AddSeed(
|
||||
const QModelIndex& seedFileIndex,
|
||||
const AZStd::string& seedRelativePath,
|
||||
const AzFramework::PlatformFlags& platforms)
|
||||
{
|
||||
AZStd::string key = GetFileKey(seedFileIndex);
|
||||
if (key.empty())
|
||||
|
||||
@@ -71,15 +71,28 @@ namespace AssetBundler
|
||||
explicit SeedListFileTableModel(SeedTabWidget* parentSeedTabWidget);
|
||||
virtual ~SeedListFileTableModel();
|
||||
|
||||
void AddDefaultSeedsToInMemoryList(const AZStd::vector<AZStd::string>& defaultSeeds, const char* projectName, const AzFramework::PlatformFlags& platforms);
|
||||
void AddDefaultSeedsToInMemoryList(
|
||||
const AZStd::vector<AZStd::string>& defaultSeeds,
|
||||
const char* projectName,
|
||||
const AzFramework::PlatformFlags& platforms);
|
||||
|
||||
AZStd::vector<AZStd::string> CreateNewFiles(const AZStd::string& absoluteFilePath, const AzFramework::PlatformFlags& platforms, const QString& project) override;
|
||||
AZStd::vector<AZStd::string> CreateNewFiles(
|
||||
const AZStd::string& absoluteFilePath,
|
||||
const AzFramework::PlatformFlags& platforms,
|
||||
const QString& project) override;
|
||||
|
||||
bool DeleteFile(const QModelIndex& index) override;
|
||||
|
||||
void Reload(const char* fileExtension, const QSet<QString>& watchedFolders, const QSet<QString>& watchedFiles = QSet<QString>(), const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap = AZStd::unordered_map<AZStd::string, AZStd::string>()) override;
|
||||
void Reload(
|
||||
const char* fileExtension,
|
||||
const QSet<QString>& watchedFolders,
|
||||
const QSet<QString>& watchedFiles = QSet<QString>(),
|
||||
const AZStd::unordered_map<AZStd::string, AZStd::string>& pathToProjectNameMap = AZStd::unordered_map<AZStd::string, AZStd::string>()) override;
|
||||
|
||||
void LoadFile(const AZStd::string& absoluteFilePath, const AZStd::string& projectName = "", bool isDefaultFile = false) override;
|
||||
void LoadFile(
|
||||
const AZStd::string& absoluteFilePath,
|
||||
const AZStd::string& projectName = "",
|
||||
bool isDefaultFile = false) override;
|
||||
|
||||
void SelectDefaultSeedLists(bool setSelected);
|
||||
|
||||
|
||||
@@ -38,7 +38,11 @@ namespace AssetBundler
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// SeedListTableModel
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
SeedListTableModel::SeedListTableModel(QObject* parent, const AZStd::string& absolutePath, const AZStd::vector<AZStd::string>& defaultSeeds, const AzFramework::PlatformFlags& platforms)
|
||||
SeedListTableModel::SeedListTableModel(
|
||||
QObject* parent,
|
||||
const AZStd::string& absolutePath,
|
||||
const AZStd::vector<AZStd::string>& defaultSeeds,
|
||||
const AzFramework::PlatformFlags& platforms)
|
||||
: QAbstractTableModel(parent)
|
||||
{
|
||||
m_seedListManager.reset(new AzToolsFramework::AssetSeedManager());
|
||||
@@ -66,7 +70,10 @@ namespace AssetBundler
|
||||
QString platformList;
|
||||
for (const auto& seed : m_seedListManager->GetAssetSeedList())
|
||||
{
|
||||
assetInfo = AzToolsFramework::AssetSeedManager::GetAssetInfoById(seed.m_assetId, AzFramework::PlatformHelper::GetPlatformIndicesInterpreted(seed.m_platformFlags)[0], absolutePath);
|
||||
assetInfo = AzToolsFramework::AssetSeedManager::GetAssetInfoById(
|
||||
seed.m_assetId,
|
||||
AzFramework::PlatformHelper::GetPlatformIndicesInterpreted(seed.m_platformFlags)[0],
|
||||
absolutePath);
|
||||
platformList = QString(m_seedListManager->GetReadablePlatformList(seed).c_str());
|
||||
|
||||
m_additionalSeedInfoMap[seed.m_assetId].reset(new AdditionalSeedInfo(assetInfo.m_relativePath.c_str(), platformList));
|
||||
@@ -126,7 +133,8 @@ namespace AssetBundler
|
||||
AZ_Error(AssetBundler::AppWindowName, false, "Unable to find additional Seed info");
|
||||
return false;
|
||||
}
|
||||
additionalSeedInfo->second->m_platformList = QString(AzFramework::PlatformHelper::GetCommaSeparatedPlatformList(platforms).c_str());
|
||||
additionalSeedInfo->second->m_platformList =
|
||||
QString(AzFramework::PlatformHelper::GetCommaSeparatedPlatformList(platforms).c_str());
|
||||
|
||||
SetHasUnsavedChanges(true);
|
||||
|
||||
@@ -140,7 +148,8 @@ namespace AssetBundler
|
||||
|
||||
bool SeedListTableModel::AddSeed(const AZStd::string& seedRelativePath, const AzFramework::PlatformFlags& platforms)
|
||||
{
|
||||
AZStd::pair<AZ::Data::AssetId, AzFramework::PlatformFlags> addSeedsResult = m_seedListManager->AddSeedAssetForValidPlatforms(seedRelativePath, platforms);
|
||||
AZStd::pair<AZ::Data::AssetId, AzFramework::PlatformFlags> addSeedsResult =
|
||||
m_seedListManager->AddSeedAssetForValidPlatforms(seedRelativePath, platforms);
|
||||
|
||||
if (!addSeedsResult.first.IsValid() || addSeedsResult.second == AzFramework::PlatformFlags::Platform_NONE)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,11 @@ namespace AssetBundler
|
||||
: public QAbstractTableModel
|
||||
{
|
||||
public:
|
||||
explicit SeedListTableModel(QObject* parent = nullptr, const AZStd::string& absolutePath = AZStd::string(), const AZStd::vector<AZStd::string>& defaultSeeds = AZStd::vector<AZStd::string>(), const AzFramework::PlatformFlags& platforms = AzFramework::PlatformFlags::Platform_NONE);
|
||||
explicit SeedListTableModel(
|
||||
QObject* parent = nullptr,
|
||||
const AZStd::string& absolutePath = AZStd::string(),
|
||||
const AZStd::vector<AZStd::string>& defaultSeeds = AZStd::vector<AZStd::string>(),
|
||||
const AzFramework::PlatformFlags& platforms = AzFramework::PlatformFlags::Platform_NONE);
|
||||
virtual ~SeedListTableModel() {}
|
||||
|
||||
AZStd::shared_ptr<AzToolsFramework::AssetSeedManager> GetSeedListManager() { return m_seedListManager; }
|
||||
|
||||
@@ -22,7 +22,10 @@ const char QtRelativePathPrefix[] = "../";
|
||||
|
||||
namespace AssetBundler
|
||||
{
|
||||
AddSeedDialog::AddSeedDialog(QWidget* parent, const AzFramework::PlatformFlags& enabledPlatforms, const AZStd::string& platformSpecificCachePath)
|
||||
AddSeedDialog::AddSeedDialog(
|
||||
QWidget* parent,
|
||||
const AzFramework::PlatformFlags& enabledPlatforms,
|
||||
const AZStd::string& platformSpecificCachePath)
|
||||
: QDialog(parent)
|
||||
, m_platformSpecificCachePath(platformSpecificCachePath.c_str())
|
||||
{
|
||||
@@ -35,7 +38,10 @@ namespace AssetBundler
|
||||
|
||||
// Set up Platform selection
|
||||
m_ui->platformSelectionWidget->Init(enabledPlatforms);
|
||||
connect(m_ui->platformSelectionWidget, &PlatformSelectionWidget::PlatformsSelected, this, &AddSeedDialog::OnPlatformSelectionChanged);
|
||||
connect(m_ui->platformSelectionWidget,
|
||||
&PlatformSelectionWidget::PlatformsSelected,
|
||||
this,
|
||||
&AddSeedDialog::OnPlatformSelectionChanged);
|
||||
|
||||
// Set up Cancel and Create New File buttons
|
||||
m_ui->addSeedButton->setEnabled(false);
|
||||
|
||||
@@ -34,7 +34,10 @@ namespace AssetBundler
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AddSeedDialog(QWidget* parent, const AzFramework::PlatformFlags& enabledPlatforms, const AZStd::string& platformSpecificCachePath);
|
||||
explicit AddSeedDialog(
|
||||
QWidget* parent,
|
||||
const AzFramework::PlatformFlags& enabledPlatforms,
|
||||
const AZStd::string& platformSpecificCachePath);
|
||||
virtual ~AddSeedDialog() {}
|
||||
|
||||
AZStd::string GetFileName();
|
||||
|
||||
@@ -73,7 +73,10 @@ namespace AssetBundler
|
||||
SetupContextMenu();
|
||||
Reload();
|
||||
|
||||
connect(GetFileTableView()->header(), &QHeaderView::sortIndicatorChanged, m_fileTableFilterModel.get(), &AssetBundlerFileTableFilterModel::sort);
|
||||
connect(GetFileTableView()->header(),
|
||||
&QHeaderView::sortIndicatorChanged,
|
||||
m_fileTableFilterModel.get(),
|
||||
&AssetBundlerFileTableFilterModel::sort);
|
||||
GetFileTableView()->header()->setSortIndicatorShown(true);
|
||||
// Setting this in descending order will ensure the most recent files are at the top
|
||||
GetFileTableView()->header()->setSortIndicator(GetFileTableModel()->GetTimeStampColumnIndex(), Qt::DescendingOrder);
|
||||
@@ -163,9 +166,11 @@ namespace AssetBundler
|
||||
return;
|
||||
}
|
||||
|
||||
QString messageBoxText = QString(tr("Are you sure you would like to delete %1? \n\nThis will permanently delete the file.")).arg(QString(selectedFileAbsolutePath.c_str()));
|
||||
QString messageBoxText =
|
||||
QString(tr("Are you sure you would like to delete %1? \n\nThis will permanently delete the file.")).arg(QString(selectedFileAbsolutePath.c_str()));
|
||||
|
||||
QMessageBox::StandardButton confirmDeleteFileResult = QMessageBox::question(this, QString(tr("Delete %1")).arg(GetFileTypeDisplayName()), messageBoxText);
|
||||
QMessageBox::StandardButton confirmDeleteFileResult =
|
||||
QMessageBox::question(this, QString(tr("Delete %1")).arg(GetFileTypeDisplayName()), messageBoxText);
|
||||
if (confirmDeleteFileResult != QMessageBox::StandardButton::Yes)
|
||||
{
|
||||
// User canceled out of the confirmation dialog
|
||||
@@ -206,7 +211,8 @@ namespace AssetBundler
|
||||
defaultFolderPath = m_guiApplicationManager->GetBundlesFolder();
|
||||
break;
|
||||
default:
|
||||
AZ_Warning(AssetBundler::AppWindowName, false, "No default folder is defined for AssetBundlingFileType ( %i ).", static_cast<int>(fileType));
|
||||
AZ_Warning(AssetBundler::AppWindowName, false,
|
||||
"No default folder is defined for AssetBundlingFileType ( %i ).", static_cast<int>(fileType));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -224,7 +230,8 @@ namespace AssetBundler
|
||||
|
||||
void AssetBundlerTabWidget::AddScanPathToAssetBundlerSettings(AssetBundlingFileType fileType, const QString& filePath)
|
||||
{
|
||||
AZStd::string assetBundlerSettingsFileAbsolutePath = GetAssetBundlerUserSettingsFile(m_guiApplicationManager->GetCurrentProjectFolder().c_str());
|
||||
AZStd::string assetBundlerSettingsFileAbsolutePath =
|
||||
GetAssetBundlerUserSettingsFile(m_guiApplicationManager->GetCurrentProjectFolder().c_str());
|
||||
QJsonObject assetBundlerSettings = AssetBundler::ReadJson(assetBundlerSettingsFileAbsolutePath);
|
||||
QJsonObject scanPathsSettings = assetBundlerSettings[ScanPathsKey].toObject();
|
||||
QJsonArray scanPaths = scanPathsSettings[AssetBundlingFileTypes[fileType]].toArray();
|
||||
@@ -256,7 +263,8 @@ namespace AssetBundler
|
||||
|
||||
void AssetBundlerTabWidget::RemoveScanPathFromAssetBundlerSettings(AssetBundlingFileType fileType, const QString& filePath)
|
||||
{
|
||||
AZStd::string assetBundlerSettingsFileAbsolutePath = GetAssetBundlerUserSettingsFile(m_guiApplicationManager->GetCurrentProjectFolder().c_str());
|
||||
AZStd::string assetBundlerSettingsFileAbsolutePath =
|
||||
GetAssetBundlerUserSettingsFile(m_guiApplicationManager->GetCurrentProjectFolder().c_str());
|
||||
QJsonObject assetBundlerSettings = AssetBundler::ReadJson(assetBundlerSettingsFileAbsolutePath);
|
||||
QJsonObject scanPathsSettings = assetBundlerSettings[ScanPathsKey].toObject();
|
||||
QJsonArray scanPaths = scanPathsSettings[AssetBundlingFileTypes[fileType]].toArray();
|
||||
@@ -305,7 +313,10 @@ namespace AssetBundler
|
||||
void AssetBundlerTabWidget::SetupContextMenu()
|
||||
{
|
||||
GetFileTableView()->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(GetFileTableView(), &QTreeView::customContextMenuRequested, this, &AssetBundlerTabWidget::OnFileTableContextMenuRequested);
|
||||
connect(GetFileTableView(),
|
||||
&QTreeView::customContextMenuRequested,
|
||||
this,
|
||||
&AssetBundlerTabWidget::OnFileTableContextMenuRequested);
|
||||
}
|
||||
|
||||
void AssetBundlerTabWidget::ReadAssetBundlerSettings(const AZStd::string& filePath, AssetBundlingFileType fileType)
|
||||
|
||||
@@ -78,7 +78,9 @@ namespace AssetBundler
|
||||
|
||||
virtual void ApplyConfig() = 0;
|
||||
|
||||
virtual void FileSelectionChanged(const QItemSelection& /*selected*/ = QItemSelection(), const QItemSelection& /*deselected*/ = QItemSelection()) = 0;
|
||||
virtual void FileSelectionChanged(
|
||||
const QItemSelection& /*selected*/ = QItemSelection(),
|
||||
const QItemSelection& /*deselected*/ = QItemSelection()) = 0;
|
||||
|
||||
static void InitAssetBundlerSettings(const char* currentProjectFolderPath);
|
||||
|
||||
|
||||
@@ -44,14 +44,22 @@ namespace AssetBundler
|
||||
m_ui->mainVerticalLayout->setContentsMargins(10, 10, 10, 10);
|
||||
|
||||
// File view of all Asset List Files
|
||||
m_fileTableFilterModel.reset(new AssetBundlerFileTableFilterModel(this, m_fileTableModel->GetFileNameColumnIndex(), m_fileTableModel->GetTimeStampColumnIndex()));
|
||||
m_fileTableFilterModel.reset(new AssetBundlerFileTableFilterModel(
|
||||
this,
|
||||
m_fileTableModel->GetFileNameColumnIndex(),
|
||||
m_fileTableModel->GetTimeStampColumnIndex()));
|
||||
|
||||
m_fileTableFilterModel->setSourceModel(m_fileTableModel.data());
|
||||
m_ui->assetListsTable->setModel(m_fileTableFilterModel.data());
|
||||
connect(m_ui->fileFilteredSearchWidget, &AzQtComponents::FilteredSearchWidget::TextFilterChanged,
|
||||
m_fileTableFilterModel.data(), static_cast<void (QSortFilterProxyModel::*)(const QString&)>(&AssetBundlerFileTableFilterModel::FilterChanged));
|
||||
connect(m_ui->fileFilteredSearchWidget,
|
||||
&AzQtComponents::FilteredSearchWidget::TextFilterChanged,
|
||||
m_fileTableFilterModel.data(),
|
||||
static_cast<void (QSortFilterProxyModel::*)(const QString&)>(&AssetBundlerFileTableFilterModel::FilterChanged));
|
||||
|
||||
connect(m_ui->assetListsTable->selectionModel(), &QItemSelectionModel::selectionChanged, this, &AssetListTabWidget::FileSelectionChanged);
|
||||
connect(m_ui->assetListsTable->selectionModel(),
|
||||
&QItemSelectionModel::selectionChanged,
|
||||
this,
|
||||
&AssetListTabWidget::FileSelectionChanged);
|
||||
|
||||
m_ui->fileTableHeaderLayout->setContentsMargins(0, 0, 0, 0);
|
||||
m_ui->fileTableVerticalLayout->setContentsMargins(0, 0, 0, 0);
|
||||
@@ -70,8 +78,10 @@ namespace AssetBundler
|
||||
|
||||
m_assetListContentsFilterModel->setSourceModel(m_assetListContentsModel.data());
|
||||
m_ui->assetListContentsTable->setModel(m_assetListContentsFilterModel.data());
|
||||
connect(m_ui->assetListContentsFilteredSearchWidget, &AzQtComponents::FilteredSearchWidget::TextFilterChanged,
|
||||
m_assetListContentsFilterModel.data(), static_cast<void (QSortFilterProxyModel::*)(const QString&)>(&AssetBundlerFileTableFilterModel::FilterChanged));
|
||||
connect(m_ui->assetListContentsFilteredSearchWidget,
|
||||
&AzQtComponents::FilteredSearchWidget::TextFilterChanged,
|
||||
m_assetListContentsFilterModel.data(),
|
||||
static_cast<void (QSortFilterProxyModel::*)(const QString&)>(&AssetBundlerFileTableFilterModel::FilterChanged));
|
||||
|
||||
|
||||
m_ui->fileContentsHeaderLayout->setContentsMargins(0, 0, 0, 0);
|
||||
@@ -121,13 +131,21 @@ namespace AssetBundler
|
||||
|
||||
m_ui->fileTableFrame->setFixedWidth(config.fileTableWidth);
|
||||
|
||||
m_ui->assetListsTable->header()->resizeSection(AssetListFileTableModel::Column::ColumnFileName, config.assetListFileNameColumnWidth);
|
||||
m_ui->assetListsTable->header()->resizeSection(AssetListFileTableModel::Column::ColumnPlatform, config.assetListPlatformColumnWidth);
|
||||
m_ui->assetListsTable->header()->resizeSection(
|
||||
AssetListFileTableModel::Column::ColumnFileName,
|
||||
config.assetListFileNameColumnWidth);
|
||||
m_ui->assetListsTable->header()->resizeSection(
|
||||
AssetListFileTableModel::Column::ColumnPlatform,
|
||||
config.assetListPlatformColumnWidth);
|
||||
|
||||
m_ui->assetListContentsFilteredSearchWidget->setFixedWidth(config.fileTableWidth);
|
||||
|
||||
m_ui->assetListContentsTable->header()->resizeSection(AssetListTableModel::Column::ColumnAssetName, config.productAssetNameColumnWidth);
|
||||
m_ui->assetListContentsTable->header()->resizeSection(AssetListTableModel::Column::ColumnRelativePath, config.productAssetRelativePathColumnWidth);
|
||||
m_ui->assetListContentsTable->header()->resizeSection(
|
||||
AssetListTableModel::Column::ColumnAssetName,
|
||||
config.productAssetNameColumnWidth);
|
||||
m_ui->assetListContentsTable->header()->resizeSection(
|
||||
AssetListTableModel::Column::ColumnRelativePath,
|
||||
config.productAssetRelativePathColumnWidth);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -65,7 +65,9 @@ namespace AssetBundler
|
||||
AssetBundlerAbstractFileTableModel* GetFileTableModel() override;
|
||||
void SetActiveProjectLabel(const QString& labelText) override;
|
||||
void ApplyConfig() override;
|
||||
void FileSelectionChanged(const QItemSelection& /*selected*/ = QItemSelection(), const QItemSelection& /*deselected*/ = QItemSelection()) override;
|
||||
void FileSelectionChanged(
|
||||
const QItemSelection& /*selected*/ = QItemSelection(),
|
||||
const QItemSelection& /*deselected*/ = QItemSelection()) override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private:
|
||||
|
||||
@@ -34,14 +34,22 @@ namespace AssetBundler
|
||||
m_ui->mainVerticalLayout->setContentsMargins(MarginSize, MarginSize, MarginSize, MarginSize);
|
||||
|
||||
m_fileTableModel.reset(new BundleFileListModel);
|
||||
m_fileTableFilterModel.reset(new AssetBundlerFileTableFilterModel(this, m_fileTableModel->GetFileNameColumnIndex(), m_fileTableModel->GetTimeStampColumnIndex()));
|
||||
m_fileTableFilterModel.reset(new AssetBundlerFileTableFilterModel(
|
||||
this,
|
||||
m_fileTableModel->GetFileNameColumnIndex(),
|
||||
m_fileTableModel->GetTimeStampColumnIndex()));
|
||||
|
||||
m_fileTableFilterModel->setSourceModel(m_fileTableModel.data());
|
||||
m_ui->fileTableView->setModel(m_fileTableFilterModel.data());
|
||||
connect(m_ui->fileFilteredSearchWidget, &AzQtComponents::FilteredSearchWidget::TextFilterChanged,
|
||||
m_fileTableFilterModel.data(), static_cast<void (QSortFilterProxyModel::*)(const QString&)>(&AssetBundlerFileTableFilterModel::FilterChanged));
|
||||
connect(m_ui->fileFilteredSearchWidget,
|
||||
&AzQtComponents::FilteredSearchWidget::TextFilterChanged,
|
||||
m_fileTableFilterModel.data(),
|
||||
static_cast<void (QSortFilterProxyModel::*)(const QString&)>(&AssetBundlerFileTableFilterModel::FilterChanged));
|
||||
|
||||
connect(m_ui->fileTableView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &BundleListTabWidget::FileSelectionChanged);
|
||||
connect(m_ui->fileTableView->selectionModel(),
|
||||
&QItemSelectionModel::selectionChanged,
|
||||
this,
|
||||
&BundleListTabWidget::FileSelectionChanged);
|
||||
|
||||
m_ui->fileTableView->setIndentation(0);
|
||||
|
||||
|
||||
@@ -53,7 +53,9 @@ namespace AssetBundler
|
||||
AssetBundlerAbstractFileTableModel* GetFileTableModel() override;
|
||||
void SetActiveProjectLabel(const QString& labelText) override;
|
||||
void ApplyConfig() override;
|
||||
void FileSelectionChanged(const QItemSelection& /*selected*/ = QItemSelection(), const QItemSelection& /*deselected*/ = QItemSelection()) override;
|
||||
void FileSelectionChanged(
|
||||
const QItemSelection& /*selected*/ = QItemSelection(),
|
||||
const QItemSelection& /*deselected*/ = QItemSelection()) override;
|
||||
|
||||
private:
|
||||
void ClearDisplayedBundleValues();
|
||||
|
||||
@@ -42,7 +42,8 @@ namespace AssetBundler
|
||||
|
||||
if (!IsComparisonDataIndexValid())
|
||||
{
|
||||
AZ_Error("AssetBundler", false, "ComparisonData index ( %u ) is out of bounds. ComparisonData cannot be displayed.", m_comparisonDataIndex);
|
||||
AZ_Error("AssetBundler", false,
|
||||
"ComparisonData index ( %u ) is out of bounds. ComparisonData cannot be displayed.", m_comparisonDataIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -64,14 +65,26 @@ namespace AssetBundler
|
||||
connect(m_ui->nameLineEdit, &QLineEdit::textEdited, this, &ComparisonDataWidget::OnNameLineEditChanged);
|
||||
|
||||
m_ui->comparisonTypeComboBox->installEventFilter(mouseWheelEventFilter);
|
||||
connect(m_ui->comparisonTypeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ComparisonDataWidget::OnComparisonTypeComboBoxChanged);
|
||||
connect(m_ui->comparisonTypeComboBox,
|
||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this,
|
||||
&ComparisonDataWidget::OnComparisonTypeComboBoxChanged);
|
||||
|
||||
m_ui->firstInputComboBox->installEventFilter(mouseWheelEventFilter);
|
||||
connect(m_ui->firstInputComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ComparisonDataWidget::OnFirstInputComboBoxChanged);
|
||||
connect(m_ui->firstInputBrowseButton, &QPushButton::pressed, this, &ComparisonDataWidget::OnFirstInputBrowseButtonPressed);
|
||||
connect(m_ui->firstInputComboBox,
|
||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this,
|
||||
&ComparisonDataWidget::OnFirstInputComboBoxChanged);
|
||||
connect(m_ui->firstInputBrowseButton,
|
||||
&QPushButton::pressed,
|
||||
this,
|
||||
&ComparisonDataWidget::OnFirstInputBrowseButtonPressed);
|
||||
|
||||
m_ui->secondInputComboBox->installEventFilter(mouseWheelEventFilter);
|
||||
connect(m_ui->secondInputComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ComparisonDataWidget::OnSecondInputComboBoxChanged);
|
||||
connect(m_ui->secondInputComboBox,
|
||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this,
|
||||
&ComparisonDataWidget::OnSecondInputComboBoxChanged);
|
||||
connect(m_ui->secondInputBrowseButton, &QPushButton::pressed, this, &ComparisonDataWidget::OnSecondInputBrowseButtonPressed);
|
||||
|
||||
connect(m_ui->filePatternLineEdit, &QLineEdit::textEdited, this, &ComparisonDataWidget::OnFilePatternLineEditChanged);
|
||||
@@ -187,7 +200,8 @@ namespace AssetBundler
|
||||
m_ui->filePatternLineEdit->setText(comparisonData.m_filePattern.c_str());
|
||||
}
|
||||
|
||||
void ComparisonDataWidget::InitComparisonTypeComboBox(const AzToolsFramework::AssetFileInfoListComparison::ComparisonData& comparisonData)
|
||||
void ComparisonDataWidget::InitComparisonTypeComboBox(
|
||||
const AzToolsFramework::AssetFileInfoListComparison::ComparisonData& comparisonData)
|
||||
{
|
||||
using namespace AzToolsFramework;
|
||||
|
||||
@@ -225,7 +239,8 @@ namespace AssetBundler
|
||||
initialSelectionIndex = ComparisonTypeIndex::Complement;
|
||||
break;
|
||||
default:
|
||||
AZ_Warning("AssetBundler", false, "ComparisonType ( %u ) is not supported in the Asset Bundler", comparisonData.m_comparisonType);
|
||||
AZ_Warning("AssetBundler", false,
|
||||
"ComparisonType ( %u ) is not supported in the Asset Bundler", comparisonData.m_comparisonType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,10 @@ namespace AssetBundler
|
||||
|
||||
m_ui->platformSelectionWidget->Init(enabledPlatforms);
|
||||
m_ui->platformSelectionWidget->SetSelectedPlatforms(selectedPlatforms, partiallySelectedPlatforms);
|
||||
connect(m_ui->platformSelectionWidget, &PlatformSelectionWidget::PlatformsSelected, this, &EditSeedDialog::OnPlatformSelectionChanged);
|
||||
connect(m_ui->platformSelectionWidget,
|
||||
&PlatformSelectionWidget::PlatformsSelected,
|
||||
this,
|
||||
&EditSeedDialog::OnPlatformSelectionChanged);
|
||||
|
||||
// Set up confirm and cancel buttons
|
||||
connect(m_ui->applyChangesButton, &QPushButton::clicked, this, &QDialog::accept);
|
||||
@@ -49,7 +52,9 @@ namespace AssetBundler
|
||||
return m_ui->platformSelectionWidget->GetPartiallySelectedPlatforms();
|
||||
}
|
||||
|
||||
void EditSeedDialog::OnPlatformSelectionChanged(const AzFramework::PlatformFlags& selectedPlatforms, const AzFramework::PlatformFlags& partiallySelectedPlatforms)
|
||||
void EditSeedDialog::OnPlatformSelectionChanged(
|
||||
const AzFramework::PlatformFlags& selectedPlatforms,
|
||||
const AzFramework::PlatformFlags& partiallySelectedPlatforms)
|
||||
{
|
||||
// Disable the "Apply Changes" button if no platforms are selected
|
||||
bool areAnyPlatformsSelected = selectedPlatforms != AzFramework::PlatformFlags::Platform_NONE ||
|
||||
|
||||
@@ -44,7 +44,9 @@ namespace AssetBundler
|
||||
AzFramework::PlatformFlags GetPartiallySelectedPlatformFlags();
|
||||
|
||||
private:
|
||||
void OnPlatformSelectionChanged(const AzFramework::PlatformFlags& selectedPlatforms, const AzFramework::PlatformFlags& partiallySelectedPlatforms);
|
||||
void OnPlatformSelectionChanged(
|
||||
const AzFramework::PlatformFlags& selectedPlatforms,
|
||||
const AzFramework::PlatformFlags& partiallySelectedPlatforms);
|
||||
|
||||
QSharedPointer<Ui::EditSeedDialog> m_ui;
|
||||
};
|
||||
|
||||
@@ -52,26 +52,41 @@ namespace AssetBundler
|
||||
|
||||
// Bundle Output
|
||||
m_ui->outputBundlePathLineEdit->setReadOnly(true);
|
||||
connect(m_ui->outputBundlePathBrowseButton, &QPushButton::clicked, this, &GenerateBundlesModal::OnOutputBundleLocationBrowseButtonPressed);
|
||||
connect(m_ui->outputBundlePathBrowseButton,
|
||||
&QPushButton::clicked,
|
||||
this,
|
||||
&GenerateBundlesModal::OnOutputBundleLocationBrowseButtonPressed);
|
||||
|
||||
// Bundle Settings files
|
||||
m_ui->bundleSettingsFileLineEdit->setReadOnly(true);
|
||||
m_ui->bundleSettingsFileLineEdit->setText(tr(CustomBundleSettingsText));
|
||||
connect(m_ui->bundleSettingsFileBrowseButton, &QPushButton::clicked, this, &GenerateBundlesModal::OnBundleSettingsBrowseButtonPressed);
|
||||
connect(m_ui->bundleSettingsFileSaveButton, &QPushButton::clicked, this, &GenerateBundlesModal::OnBundleSettingsSaveButtonPressed);
|
||||
connect(m_ui->bundleSettingsFileBrowseButton,
|
||||
&QPushButton::clicked,
|
||||
this,
|
||||
&GenerateBundlesModal::OnBundleSettingsBrowseButtonPressed);
|
||||
connect(m_ui->bundleSettingsFileSaveButton,
|
||||
&QPushButton::clicked,
|
||||
this,
|
||||
&GenerateBundlesModal::OnBundleSettingsSaveButtonPressed);
|
||||
|
||||
// Max Bundle Size
|
||||
m_ui->maxBundleSizeSpinBox->setRange(1, AzToolsFramework::MaxBundleSizeInMB);
|
||||
m_ui->maxBundleSizeSpinBox->setValue(AzToolsFramework::MaxBundleSizeInMB);
|
||||
m_ui->maxBundleSizeSpinBox->setButtonSymbols(QAbstractSpinBox::ButtonSymbols::NoButtons);
|
||||
m_ui->maxBundleSizeSpinBox->setSuffix(" MB");
|
||||
connect(m_ui->maxBundleSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &GenerateBundlesModal::OnMaxBundleSizeChanged);
|
||||
connect(m_ui->maxBundleSizeSpinBox,
|
||||
QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
this,
|
||||
&GenerateBundlesModal::OnMaxBundleSizeChanged);
|
||||
|
||||
// Bundle Version
|
||||
m_ui->bundleVersionSpinBox->setRange(1, AzFramework::AssetBundleManifest::CurrentBundleVersion);
|
||||
m_ui->bundleVersionSpinBox->setValue(AzFramework::AssetBundleManifest::CurrentBundleVersion);
|
||||
m_ui->bundleVersionSpinBox->setButtonSymbols(QAbstractSpinBox::ButtonSymbols::NoButtons);
|
||||
connect(m_ui->bundleVersionSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &GenerateBundlesModal::OnBundleVersionChanged);
|
||||
connect(m_ui->bundleVersionSpinBox,
|
||||
QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
this,
|
||||
&GenerateBundlesModal::OnBundleVersionChanged);
|
||||
|
||||
// Cancel and Generate Bundles buttons
|
||||
m_ui->generateBundlesButton->setEnabled(false);
|
||||
@@ -197,9 +212,11 @@ namespace AssetBundler
|
||||
|
||||
if (AZ::IO::FileIOBase::GetInstance()->Exists(bundleSettingsAbsolutePath.c_str()))
|
||||
{
|
||||
QString messageBoxText = QString(tr("Bundle Settings ( %1 ) already exists on-disk. Saving the current settings will override the existing settings. \n\nDo you wish to continue?")).arg(bundleSettingsAbsolutePath.c_str());
|
||||
QString messageBoxText = QString(tr(
|
||||
"Bundle Settings ( %1 ) already exists on-disk. Saving the current settings will override the existing settings. \n\nDo you wish to continue?")).arg(bundleSettingsAbsolutePath.c_str());
|
||||
|
||||
QMessageBox::StandardButton confirmDeleteFileResult = QMessageBox::question(this, QString(tr("Replace Existing Settings")), messageBoxText);
|
||||
QMessageBox::StandardButton confirmDeleteFileResult =
|
||||
QMessageBox::question(this, QString(tr("Replace Existing Settings")), messageBoxText);
|
||||
if (confirmDeleteFileResult != QMessageBox::StandardButton::Yes)
|
||||
{
|
||||
// User canceled out of the operation
|
||||
@@ -237,9 +254,11 @@ namespace AssetBundler
|
||||
|
||||
if (AZ::IO::FileIOBase::GetInstance()->Exists(m_bundleSettings.m_bundleFilePath.c_str()))
|
||||
{
|
||||
QString messageBoxText = QString(tr("Asset Bundle ( %1 ) already exists on-disk. Generating a new Bundle will override the existing Bundle. \n\nDo you wish to permanently delete the existing Bundle?")).arg(m_bundleSettings.m_bundleFilePath.c_str());
|
||||
QString messageBoxText = QString(tr(
|
||||
"Asset Bundle ( %1 ) already exists on-disk. Generating a new Bundle will override the existing Bundle. \n\nDo you wish to permanently delete the existing Bundle?")).arg(m_bundleSettings.m_bundleFilePath.c_str());
|
||||
|
||||
QMessageBox::StandardButton confirmDeleteFileResult = QMessageBox::question(this, QString(tr("Replace Existing Bundle")), messageBoxText);
|
||||
QMessageBox::StandardButton confirmDeleteFileResult =
|
||||
QMessageBox::question(this, QString(tr("Replace Existing Bundle")), messageBoxText);
|
||||
if (confirmDeleteFileResult != QMessageBox::StandardButton::Yes)
|
||||
{
|
||||
// User canceled out of the operation
|
||||
@@ -259,10 +278,14 @@ namespace AssetBundler
|
||||
|
||||
if (result)
|
||||
{
|
||||
m_assetListTabWidget->AddScanPathToAssetBundlerSettings(AssetBundlingFileType::BundleFileType, m_bundleSettings.m_bundleFilePath);
|
||||
m_assetListTabWidget->AddScanPathToAssetBundlerSettings(
|
||||
AssetBundlingFileType::BundleFileType,
|
||||
m_bundleSettings.m_bundleFilePath);
|
||||
|
||||
// The watched files list was updated after the files were created, so we need to force-reload them
|
||||
m_assetListTabWidget->GetGUIApplicationManager()->UpdateFiles(AssetBundlingFileType::BundleFileType, { m_bundleSettings.m_bundleFilePath });
|
||||
m_assetListTabWidget->GetGUIApplicationManager()->UpdateFiles(
|
||||
AssetBundlingFileType::BundleFileType,
|
||||
{ m_bundleSettings.m_bundleFilePath });
|
||||
}
|
||||
|
||||
AZStd::vector<AZStd::string> generatedFilePaths = { m_bundleSettings.m_bundleFilePath };
|
||||
|
||||
@@ -63,7 +63,10 @@ namespace AssetBundler
|
||||
// Set up Tabs
|
||||
AssetBundlerTabWidget::InitAssetBundlerSettings(m_guiApplicationManager->GetCurrentProjectFolder().c_str());
|
||||
|
||||
m_seedListTab.reset(new SeedTabWidget(this, m_guiApplicationManager, QString(m_guiApplicationManager->GetAssetBundlingFolder().c_str())));
|
||||
m_seedListTab.reset(new SeedTabWidget(
|
||||
this,
|
||||
m_guiApplicationManager,
|
||||
QString(m_guiApplicationManager->GetAssetBundlingFolder().c_str())));
|
||||
m_ui->tabWidget->addTab(m_seedListTab.data(), m_seedListTab->GetTabTitle());
|
||||
|
||||
m_assetListTab.reset(new AssetListTabWidget(this, m_guiApplicationManager));
|
||||
|
||||
@@ -51,7 +51,8 @@ namespace AssetBundler
|
||||
m_newFileDialog.setNameFilter(fileNameFilter);
|
||||
m_newFileDialog.setViewMode(QFileDialog::Detail);
|
||||
m_newFileDialog.setDirectory(m_startingPath);
|
||||
// We are not creating a new file when Qt thinks we are, so we need to block signals or else the file watcher will be triggered too soon
|
||||
// We are not creating a new file when Qt thinks we are, so we need to block signals or else the file watcher will be
|
||||
// triggered too soon
|
||||
m_newFileDialog.blockSignals(true);
|
||||
|
||||
// Set up Platform selection
|
||||
@@ -61,7 +62,10 @@ namespace AssetBundler
|
||||
disabledPatformMessageOverride = tr("This platform is not valid for all input Asset Lists.");
|
||||
}
|
||||
m_ui->platformSelectionWidget->Init(enabledPlatforms, disabledPatformMessageOverride);
|
||||
connect(m_ui->platformSelectionWidget, &PlatformSelectionWidget::PlatformsSelected, this, &NewFileDialog::OnPlatformSelectionChanged);
|
||||
connect(m_ui->platformSelectionWidget,
|
||||
&PlatformSelectionWidget::PlatformsSelected,
|
||||
this,
|
||||
&NewFileDialog::OnPlatformSelectionChanged);
|
||||
|
||||
// Set up Cancel and Create New File buttons
|
||||
m_ui->createFileButton->setEnabled(false);
|
||||
@@ -112,7 +116,8 @@ namespace AssetBundler
|
||||
{
|
||||
// Check to see if any of the selected platform-specific files already exist on-disk
|
||||
QString overwriteExistingFilesList;
|
||||
AZStd::fixed_vector<AZStd::string, AzFramework::NumPlatforms> selectedPlatformNames = AzFramework::PlatformHelper::GetPlatforms(GetPlatformFlags());
|
||||
AZStd::fixed_vector<AZStd::string, AzFramework::NumPlatforms> selectedPlatformNames =
|
||||
AzFramework::PlatformHelper::GetPlatforms(GetPlatformFlags());
|
||||
for (const AZStd::string& platformName : selectedPlatformNames)
|
||||
{
|
||||
FilePath platformSpecificFilePath(GetAbsoluteFilePath(), platformName);
|
||||
@@ -126,9 +131,11 @@ namespace AssetBundler
|
||||
// Ask the user if they are sure they want to overwrite existing files
|
||||
if (!overwriteExistingFilesList.isEmpty())
|
||||
{
|
||||
QString messageBoxText = QString(tr("The following files already exist on-disk. Generating new files will overwrite the existing ones.\n\n%1\n\nDo you wish to permanently delete the existing files?")).arg(overwriteExistingFilesList);
|
||||
QString messageBoxText = QString(tr(
|
||||
"The following files already exist on-disk. Generating new files will overwrite the existing ones.\n\n%1\n\nDo you wish to permanently delete the existing files?")).arg(overwriteExistingFilesList);
|
||||
|
||||
QMessageBox::StandardButton confirmDeleteFileResult = QMessageBox::question(this, QString(tr("Replace Existing Files")), messageBoxText);
|
||||
QMessageBox::StandardButton confirmDeleteFileResult =
|
||||
QMessageBox::question(this, QString(tr("Replace Existing Files")), messageBoxText);
|
||||
if (confirmDeleteFileResult != QMessageBox::StandardButton::Yes)
|
||||
{
|
||||
// User canceled out of the operation
|
||||
@@ -139,7 +146,11 @@ namespace AssetBundler
|
||||
emit QDialog::accept();
|
||||
}
|
||||
|
||||
AZStd::string NewFileDialog::OSNewFileDialog(QWidget* parent, const char* fileExtension, const char* fileTypeDisplayName, const AZStd::string& startingDirectory)
|
||||
AZStd::string NewFileDialog::OSNewFileDialog(
|
||||
QWidget* parent,
|
||||
const char* fileExtension,
|
||||
const char* fileTypeDisplayName,
|
||||
const AZStd::string& startingDirectory)
|
||||
{
|
||||
QFileDialog filePathDialog(parent);
|
||||
filePathDialog.setFileMode(QFileDialog::AnyFile);
|
||||
@@ -160,13 +171,17 @@ namespace AssetBundler
|
||||
AZStd::string absoluteFilePath(filePathDialog.selectedFiles()[0].toUtf8().data());
|
||||
if (!AzFramework::StringFunc::Path::HasExtension(absoluteFilePath.c_str()))
|
||||
{
|
||||
absoluteFilePath = AZStd::string::format("%s%c%s", absoluteFilePath.c_str(), AZ_FILESYSTEM_EXTENSION_SEPARATOR, fileExtension);
|
||||
absoluteFilePath =
|
||||
AZStd::string::format("%s%c%s", absoluteFilePath.c_str(), AZ_FILESYSTEM_EXTENSION_SEPARATOR, fileExtension);
|
||||
}
|
||||
|
||||
return absoluteFilePath;
|
||||
}
|
||||
|
||||
int NewFileDialog::FileGenerationResultMessageBox(QWidget* parent, const AZStd::vector<AZStd::string>& generatedFiles, bool generatedWithErrors)
|
||||
int NewFileDialog::FileGenerationResultMessageBox(
|
||||
QWidget* parent,
|
||||
const AZStd::vector<AZStd::string>& generatedFiles,
|
||||
bool generatedWithErrors)
|
||||
{
|
||||
QMessageBox messageBox(parent);
|
||||
messageBox.setStandardButtons(QMessageBox::Ok);
|
||||
|
||||
@@ -51,9 +51,16 @@ namespace AssetBundler
|
||||
//! A standard OS-specific New File Dialog, but blocks all Qt signals from the dialog and does NOT create a new file.
|
||||
//! Use in place of the static QFileDialog functions to avoid unexpected file watcher updates.
|
||||
//! Returns the absolute path of the file the user either selected or attempted to create, or an empty string if the user canceled out of the dialog.
|
||||
static AZStd::string OSNewFileDialog(QWidget* parent, const char* fileExtension, const char* fileTypeDisplayName, const AZStd::string& startingDirectory);
|
||||
static AZStd::string OSNewFileDialog(
|
||||
QWidget* parent,
|
||||
const char* fileExtension,
|
||||
const char* fileTypeDisplayName,
|
||||
const AZStd::string& startingDirectory);
|
||||
|
||||
static int FileGenerationResultMessageBox(QWidget* parent, const AZStd::vector<AZStd::string>& generatedFiles, bool generatedWithErrors);
|
||||
static int FileGenerationResultMessageBox(
|
||||
QWidget* parent,
|
||||
const AZStd::vector<AZStd::string>& generatedFiles,
|
||||
bool generatedWithErrors);
|
||||
|
||||
private:
|
||||
void OnBrowseButtonPressed();
|
||||
|
||||
@@ -66,7 +66,9 @@ namespace AssetBundler
|
||||
}
|
||||
}
|
||||
|
||||
void PlatformSelectionWidget::SetSelectedPlatforms(const AzFramework::PlatformFlags& selectedPlatforms, const AzFramework::PlatformFlags& partiallySelectedPlatforms)
|
||||
void PlatformSelectionWidget::SetSelectedPlatforms(
|
||||
const AzFramework::PlatformFlags& selectedPlatforms,
|
||||
const AzFramework::PlatformFlags& partiallySelectedPlatforms)
|
||||
{
|
||||
m_selectedPlatforms = AzFramework::PlatformFlags::Platform_NONE;
|
||||
m_partiallySelectedPlatforms = AzFramework::PlatformFlags::Platform_NONE;
|
||||
|
||||
@@ -39,7 +39,9 @@ namespace AssetBundler
|
||||
|
||||
void Init(const AzFramework::PlatformFlags& enabledPlatforms, const QString& disabledPatformMessageOverride = "");
|
||||
|
||||
void SetSelectedPlatforms(const AzFramework::PlatformFlags& selectedPlatforms, const AzFramework::PlatformFlags& partiallySelectedPlatforms);
|
||||
void SetSelectedPlatforms(
|
||||
const AzFramework::PlatformFlags& selectedPlatforms,
|
||||
const AzFramework::PlatformFlags& partiallySelectedPlatforms);
|
||||
|
||||
AzFramework::PlatformFlags GetSelectedPlatforms();
|
||||
AzFramework::PlatformFlags GetPartiallySelectedPlatforms();
|
||||
|
||||
@@ -45,14 +45,22 @@ namespace AssetBundler
|
||||
m_ui->fileTableView->setModel(m_fileTableModel.data());
|
||||
|
||||
// Table View of all Rules files
|
||||
m_fileTableFilterModel.reset(new AssetBundlerFileTableFilterModel(this, m_fileTableModel->GetFileNameColumnIndex(), m_fileTableModel->GetTimeStampColumnIndex()));
|
||||
m_fileTableFilterModel.reset(new AssetBundlerFileTableFilterModel(
|
||||
this,
|
||||
m_fileTableModel->GetFileNameColumnIndex(),
|
||||
m_fileTableModel->GetTimeStampColumnIndex()));
|
||||
|
||||
m_fileTableFilterModel->setSourceModel(m_fileTableModel.data());
|
||||
m_ui->fileTableView->setModel(m_fileTableFilterModel.data());
|
||||
connect(m_ui->fileFilteredSearchWidget, &AzQtComponents::FilteredSearchWidget::TextFilterChanged,
|
||||
m_fileTableFilterModel.data(), static_cast<void (QSortFilterProxyModel::*)(const QString&)>(&AssetBundlerFileTableFilterModel::FilterChanged));
|
||||
connect(m_ui->fileFilteredSearchWidget,
|
||||
&AzQtComponents::FilteredSearchWidget::TextFilterChanged,
|
||||
m_fileTableFilterModel.data(),
|
||||
static_cast<void (QSortFilterProxyModel::*)(const QString&)>(&AssetBundlerFileTableFilterModel::FilterChanged));
|
||||
|
||||
connect(m_ui->fileTableView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &RulesTabWidget::FileSelectionChanged);
|
||||
connect(m_ui->fileTableView->selectionModel(),
|
||||
&QItemSelectionModel::selectionChanged,
|
||||
this,
|
||||
&RulesTabWidget::FileSelectionChanged);
|
||||
|
||||
m_ui->fileTableView->setIndentation(0);
|
||||
|
||||
@@ -76,7 +84,10 @@ namespace AssetBundler
|
||||
|
||||
void RulesTabWidget::Reload()
|
||||
{
|
||||
m_fileTableModel->Reload(AzToolsFramework::AssetFileInfoListComparison::GetComparisonRulesFileExtension(), m_watchedFolders, m_watchedFiles);
|
||||
m_fileTableModel->Reload(
|
||||
AzToolsFramework::AssetFileInfoListComparison::GetComparisonRulesFileExtension(),
|
||||
m_watchedFolders,
|
||||
m_watchedFiles);
|
||||
FileSelectionChanged();
|
||||
}
|
||||
|
||||
@@ -223,7 +234,8 @@ namespace AssetBundler
|
||||
AZStd::vector<AZStd::string> outputFilePaths;
|
||||
bool hasFileGenerationErrors = false;
|
||||
|
||||
AZStd::fixed_vector<AZStd::string, AzFramework::NumPlatforms> selectedPlatformNames = AzFramework::PlatformHelper::GetPlatforms(runRuleDialog.GetPlatformFlags());
|
||||
AZStd::fixed_vector<AZStd::string, AzFramework::NumPlatforms> selectedPlatformNames =
|
||||
AzFramework::PlatformHelper::GetPlatforms(runRuleDialog.GetPlatformFlags());
|
||||
for (const AZStd::string& platformName : selectedPlatformNames)
|
||||
{
|
||||
// We do not want to modify the original Rules file, as we do not save Asset List file paths to disk
|
||||
@@ -238,7 +250,8 @@ namespace AssetBundler
|
||||
{
|
||||
if (comparisonStep.m_cachedFirstInputPath.empty())
|
||||
{
|
||||
AZ_Error("AssetBundler", false, "Unable to run Rule: Comparison Step #%u has no specified first input.", comparisonStepIndex);
|
||||
AZ_Error("AssetBundler", false,
|
||||
"Unable to run Rule: Comparison Step #%u has no specified first input.", comparisonStepIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -251,7 +264,8 @@ namespace AssetBundler
|
||||
{
|
||||
if (comparisonStep.m_cachedSecondInputPath.empty())
|
||||
{
|
||||
AZ_Error("AssetBundler", false, "Unable to run Rule: Comparison Step #%u has no specified second input.", comparisonStepIndex);
|
||||
AZ_Error("AssetBundler", false,
|
||||
"Unable to run Rule: Comparison Step #%u has no specified second input.", comparisonStepIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -313,17 +327,28 @@ namespace AssetBundler
|
||||
}
|
||||
}
|
||||
|
||||
void RulesTabWidget::CreateComparisonDataCard(AZStd::shared_ptr<AzToolsFramework::AssetFileInfoListComparison> comparisonList, size_t comparisonDataIndex)
|
||||
void RulesTabWidget::CreateComparisonDataCard(
|
||||
AZStd::shared_ptr<AzToolsFramework::AssetFileInfoListComparison> comparisonList,
|
||||
size_t comparisonDataIndex)
|
||||
{
|
||||
ComparisonDataCard* comparisonDataCard = new ComparisonDataCard(comparisonList, comparisonDataIndex, m_guiApplicationManager->GetAssetListsFolder());
|
||||
ComparisonDataCard* comparisonDataCard = new ComparisonDataCard(
|
||||
comparisonList,
|
||||
comparisonDataIndex,
|
||||
m_guiApplicationManager->GetAssetListsFolder());
|
||||
comparisonDataCard->setTitle(tr("Step %1").arg(static_cast<int>(comparisonDataIndex) + 1));
|
||||
m_ui->comparisonDataListLayout->addWidget(comparisonDataCard);
|
||||
m_comparisonDataCardList.push_back(comparisonDataCard);
|
||||
|
||||
ComparisonDataWidget* comparisonDataWidget = comparisonDataCard->GetComparisonDataWidget();
|
||||
connect(comparisonDataCard, &ComparisonDataCard::comparisonDataCardContextMenuRequested, this, &RulesTabWidget::OnComparisonDataCardContextMenuRequested);
|
||||
connect(comparisonDataCard,
|
||||
&ComparisonDataCard::comparisonDataCardContextMenuRequested,
|
||||
this,
|
||||
&RulesTabWidget::OnComparisonDataCardContextMenuRequested);
|
||||
connect(comparisonDataWidget, &ComparisonDataWidget::comparisonDataChanged, this, &RulesTabWidget::MarkFileChanged);
|
||||
connect(comparisonDataWidget, &ComparisonDataWidget::comparisonDataTokenNameChanged, this, &RulesTabWidget::OnAnyTokenNameChanged);
|
||||
connect(comparisonDataWidget,
|
||||
&ComparisonDataWidget::comparisonDataTokenNameChanged,
|
||||
this,
|
||||
&RulesTabWidget::OnAnyTokenNameChanged);
|
||||
|
||||
comparisonDataCard->show();
|
||||
}
|
||||
|
||||
@@ -81,7 +81,9 @@ namespace AssetBundler
|
||||
|
||||
void ApplyConfig() override;
|
||||
|
||||
void FileSelectionChanged(const QItemSelection& /*selected*/ = QItemSelection(), const QItemSelection& /*deselected*/ = QItemSelection()) override;
|
||||
void FileSelectionChanged(
|
||||
const QItemSelection& /*selected*/ = QItemSelection(),
|
||||
const QItemSelection& /*deselected*/ = QItemSelection()) override;
|
||||
|
||||
private:
|
||||
void OnNewFileButtonPressed();
|
||||
@@ -94,7 +96,9 @@ namespace AssetBundler
|
||||
|
||||
void PopulateComparisonDataCardList();
|
||||
|
||||
void CreateComparisonDataCard(AZStd::shared_ptr<AzToolsFramework::AssetFileInfoListComparison> comparisonList, size_t comparisonDataIndex);
|
||||
void CreateComparisonDataCard(
|
||||
AZStd::shared_ptr<AzToolsFramework::AssetFileInfoListComparison> comparisonList,
|
||||
size_t comparisonDataIndex);
|
||||
|
||||
void RemoveAllComparisonDataCards();
|
||||
|
||||
|
||||
@@ -56,14 +56,22 @@ namespace AssetBundler
|
||||
AZ::Debug::TraceMessageBus::Handler::BusConnect();
|
||||
|
||||
// File view of all Seed List Files
|
||||
m_fileTableFilterModel.reset(new AssetBundlerFileTableFilterModel(this, m_fileTableModel->GetFileNameColumnIndex(), m_fileTableModel->GetTimeStampColumnIndex()));
|
||||
m_fileTableFilterModel.reset(new AssetBundlerFileTableFilterModel(
|
||||
this,
|
||||
m_fileTableModel->GetFileNameColumnIndex(),
|
||||
m_fileTableModel->GetTimeStampColumnIndex()));
|
||||
|
||||
m_fileTableFilterModel->setSourceModel(m_fileTableModel.data());
|
||||
m_ui->fileTableView->setModel(m_fileTableFilterModel.data());
|
||||
connect(m_ui->fileFilteredSearchWidget, &AzQtComponents::FilteredSearchWidget::TextFilterChanged,
|
||||
m_fileTableFilterModel.data(), static_cast<void (QSortFilterProxyModel::*)(const QString&)>(&AssetBundlerFileTableFilterModel::FilterChanged));
|
||||
connect(m_ui->fileFilteredSearchWidget,
|
||||
&AzQtComponents::FilteredSearchWidget::TextFilterChanged,
|
||||
m_fileTableFilterModel.data(),
|
||||
static_cast<void (QSortFilterProxyModel::*)(const QString&)>(&AssetBundlerFileTableFilterModel::FilterChanged));
|
||||
|
||||
connect(m_ui->fileTableView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &SeedTabWidget::FileSelectionChanged);
|
||||
connect(m_ui->fileTableView->selectionModel(),
|
||||
&QItemSelectionModel::selectionChanged,
|
||||
this,
|
||||
&SeedTabWidget::FileSelectionChanged);
|
||||
|
||||
m_ui->fileTableView->setIndentation(CheckBoxTableIndentationSize);
|
||||
|
||||
@@ -82,11 +90,16 @@ namespace AssetBundler
|
||||
|
||||
m_seedListContentsFilterModel->setSourceModel(m_seedListContentsModel.data());
|
||||
m_ui->seedFileContentsTable->setModel(m_seedListContentsFilterModel.data());
|
||||
connect(m_ui->seedListContentsFilteredSearchWidget, &AzQtComponents::FilteredSearchWidget::TextFilterChanged,
|
||||
m_seedListContentsFilterModel.data(), static_cast<void (QSortFilterProxyModel::*)(const QString&)>(&AssetBundlerFileTableFilterModel::FilterChanged));
|
||||
connect(m_ui->seedListContentsFilteredSearchWidget,
|
||||
&AzQtComponents::FilteredSearchWidget::TextFilterChanged,
|
||||
m_seedListContentsFilterModel.data(),
|
||||
static_cast<void (QSortFilterProxyModel::*)(const QString&)>(&AssetBundlerFileTableFilterModel::FilterChanged));
|
||||
|
||||
m_ui->seedFileContentsTable->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(m_ui->seedFileContentsTable, &QTreeView::customContextMenuRequested, this, &SeedTabWidget::OnSeedListContentsTableContextMenuRequested);
|
||||
connect(m_ui->seedFileContentsTable,
|
||||
&QTreeView::customContextMenuRequested,
|
||||
this,
|
||||
&SeedTabWidget::OnSeedListContentsTableContextMenuRequested);
|
||||
|
||||
m_ui->seedFileContentsTable->setIndentation(0);
|
||||
|
||||
@@ -112,7 +125,11 @@ namespace AssetBundler
|
||||
void SeedTabWidget::Reload()
|
||||
{
|
||||
// Reload all the seed list files
|
||||
m_fileTableModel->Reload(AzToolsFramework::AssetSeedManager::GetSeedFileExtension(), m_watchedFolders, m_watchedFiles, m_filePathToGemNameMap);
|
||||
m_fileTableModel->Reload(
|
||||
AzToolsFramework::AssetSeedManager::GetSeedFileExtension(),
|
||||
m_watchedFolders,
|
||||
m_watchedFiles,
|
||||
m_filePathToGemNameMap);
|
||||
|
||||
// Update the selected row
|
||||
FileSelectionChanged();
|
||||
@@ -138,12 +155,18 @@ namespace AssetBundler
|
||||
m_watchedFolders.insert(m_guiApplicationManager->GetSeedListsFolder().c_str());
|
||||
|
||||
// Get the list of default Seed List files
|
||||
m_filePathToGemNameMap = AssetBundler::GetDefaultSeedListFiles(AZStd::string_view{ AZ::Utils::GetEnginePath() }, m_guiApplicationManager->GetCurrentProjectName(),
|
||||
m_filePathToGemNameMap = AssetBundler::GetDefaultSeedListFiles(
|
||||
AZStd::string_view{ AZ::Utils::GetEnginePath() },
|
||||
m_guiApplicationManager->GetCurrentProjectName(),
|
||||
m_guiApplicationManager->GetGemInfoList(), m_guiApplicationManager->GetEnabledPlatforms());
|
||||
|
||||
// Get the list of default Seeds that are not stored in a Seed List file on-disk
|
||||
AZStd::vector<AZStd::string> defaultSeeds = GetDefaultSeeds(AZ::Utils::GetProjectPath(), m_guiApplicationManager->GetCurrentProjectName());
|
||||
m_fileTableModel->AddDefaultSeedsToInMemoryList(defaultSeeds, m_guiApplicationManager->GetCurrentProjectName().c_str(), m_guiApplicationManager->GetEnabledPlatforms());
|
||||
AZStd::vector<AZStd::string> defaultSeeds =
|
||||
GetDefaultSeeds(AZ::Utils::GetProjectPath(), m_guiApplicationManager->GetCurrentProjectName());
|
||||
m_fileTableModel->AddDefaultSeedsToInMemoryList(
|
||||
defaultSeeds,
|
||||
m_guiApplicationManager->GetCurrentProjectName().c_str(),
|
||||
m_guiApplicationManager->GetEnabledPlatforms());
|
||||
|
||||
// Set the new watched filess for the model
|
||||
m_watchedFiles.clear();
|
||||
@@ -185,7 +208,9 @@ namespace AssetBundler
|
||||
m_ui->fileTableView->header()->resizeSection(SeedListFileTableModel::Column::ColumnCheckBox, config.checkBoxColumnWidth);
|
||||
m_ui->fileTableView->header()->resizeSection(SeedListFileTableModel::Column::ColumnProject, config.projectNameColumnWidth);
|
||||
|
||||
m_ui->seedFileContentsTable->header()->resizeSection(SeedListTableModel::Column::ColumnRelativePath, config.seedListContentsNameColumnWidth);
|
||||
m_ui->seedFileContentsTable->header()->resizeSection(
|
||||
SeedListTableModel::Column::ColumnRelativePath,
|
||||
config.seedListContentsNameColumnWidth);
|
||||
}
|
||||
|
||||
void SeedTabWidget::UncheckSelectDefaultSeedListsCheckBox()
|
||||
@@ -198,15 +223,25 @@ namespace AssetBundler
|
||||
m_ui->generateAssetListsButton->setEnabled(isEnabled);
|
||||
}
|
||||
|
||||
bool SeedTabWidget::OnPreError(const char* /*window*/, const char* /*fileName*/, int /*line*/, const char* /*func*/, const char* /*message*/)
|
||||
bool SeedTabWidget::OnPreError(
|
||||
const char* /*window*/,
|
||||
const char* /*fileName*/,
|
||||
int /*line*/,
|
||||
const char* /*func*/,
|
||||
const char* /*message*/)
|
||||
{
|
||||
m_hasWarnings = true;
|
||||
m_hasWarningsOrErrors = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SeedTabWidget::OnPreWarning(const char* /*window*/, const char* /*fileName*/, int /*line*/, const char* /*func*/, const char* /*message*/)
|
||||
bool SeedTabWidget::OnPreWarning(
|
||||
const char* /*window*/,
|
||||
const char* /*fileName*/,
|
||||
int /*line*/,
|
||||
const char* /*func*/,
|
||||
const char* /*message*/)
|
||||
{
|
||||
m_hasWarnings = true;
|
||||
m_hasWarningsOrErrors = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -275,11 +310,13 @@ namespace AssetBundler
|
||||
return;
|
||||
}
|
||||
|
||||
m_hasWarnings = false;
|
||||
auto createdFiles = m_fileTableModel->GenerateAssetLists(m_generateAssetListsDialog->GetAbsoluteFilePath(), m_generateAssetListsDialog->GetPlatformFlags());
|
||||
m_hasWarningsOrErrors = false;
|
||||
auto createdFiles = m_fileTableModel->GenerateAssetLists(
|
||||
m_generateAssetListsDialog->GetAbsoluteFilePath(),
|
||||
m_generateAssetListsDialog->GetPlatformFlags());
|
||||
|
||||
// Warnings will not prevent the generation of Asset List files, we must track them separately
|
||||
NewFileDialog::FileGenerationResultMessageBox(this, createdFiles, m_hasWarnings);
|
||||
NewFileDialog::FileGenerationResultMessageBox(this, createdFiles, m_hasWarningsOrErrors);
|
||||
|
||||
if (createdFiles.empty())
|
||||
{
|
||||
@@ -306,7 +343,8 @@ namespace AssetBundler
|
||||
}
|
||||
|
||||
// Get the current platforms of the selected Seed so we can display them as already checked
|
||||
QModelIndex currentSeedIndex = m_seedListContentsFilterModel->mapToSource(m_ui->seedFileContentsTable->selectionModel()->currentIndex());
|
||||
QModelIndex currentSeedIndex =
|
||||
m_seedListContentsFilterModel->mapToSource(m_ui->seedFileContentsTable->selectionModel()->currentIndex());
|
||||
auto getPlatformOutcome = m_seedListContentsModel->GetSeedPlatforms(currentSeedIndex);
|
||||
if (!getPlatformOutcome.IsSuccess())
|
||||
{
|
||||
@@ -375,7 +413,8 @@ namespace AssetBundler
|
||||
AzFramework::PlatformFlags checkedPlatforms = m_editSeedDialog->GetPlatformFlags();
|
||||
AzFramework::PlatformFlags partiallyCheckedPlatforms = m_editSeedDialog->GetPartiallySelectedPlatformFlags();
|
||||
// If the platform is partially checked, we want to keep its original status when saving the changes
|
||||
AzFramework::PlatformFlags platformFlags = indexToPlatformFlagsMap[currentSeedIndex] & partiallyCheckedPlatforms | checkedPlatforms;
|
||||
AzFramework::PlatformFlags platformFlags =
|
||||
indexToPlatformFlagsMap[currentSeedIndex] & partiallyCheckedPlatforms | checkedPlatforms;
|
||||
|
||||
m_fileTableModel->SetSeedPlatforms(m_selectedFileTableIndex, currentSeedIndex, platformFlags);
|
||||
}
|
||||
@@ -391,8 +430,10 @@ namespace AssetBundler
|
||||
|
||||
// Get path to the platform-specific cache folder of one of the enabled platforms
|
||||
AzFramework::PlatformFlags enabledPlatforms = m_guiApplicationManager->GetEnabledPlatforms();
|
||||
AZStd::fixed_vector<AzFramework::PlatformId, AzFramework::PlatformId::NumPlatformIds> enabledPlatformIndices = AzFramework::PlatformHelper::GetPlatformIndicesInterpreted(enabledPlatforms);
|
||||
AZStd::string platformSpecificCachePath = AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(enabledPlatformIndices[0]);
|
||||
AZStd::fixed_vector<AzFramework::PlatformId, AzFramework::PlatformId::NumPlatformIds> enabledPlatformIndices =
|
||||
AzFramework::PlatformHelper::GetPlatformIndicesInterpreted(enabledPlatforms);
|
||||
AZStd::string platformSpecificCachePath =
|
||||
AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(enabledPlatformIndices[0]);
|
||||
|
||||
// Create and display the Add Seed Dialog
|
||||
m_addSeedDialog.reset(new AddSeedDialog(this, enabledPlatforms, platformSpecificCachePath));
|
||||
@@ -416,7 +457,8 @@ namespace AssetBundler
|
||||
}
|
||||
|
||||
// Set the data in the model
|
||||
QModelIndex currentSeedIndex = m_seedListContentsFilterModel->mapToSource(m_ui->seedFileContentsTable->selectionModel()->currentIndex());
|
||||
QModelIndex currentSeedIndex =
|
||||
m_seedListContentsFilterModel->mapToSource(m_ui->seedFileContentsTable->selectionModel()->currentIndex());
|
||||
m_fileTableModel->RemoveSeed(m_selectedFileTableIndex, currentSeedIndex);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,9 @@ namespace AssetBundler
|
||||
|
||||
void ApplyConfig() override;
|
||||
|
||||
void FileSelectionChanged(const QItemSelection& /*selected*/ = QItemSelection(), const QItemSelection& /*deselected*/ = QItemSelection()) override;
|
||||
void FileSelectionChanged(
|
||||
const QItemSelection& /*selected*/ = QItemSelection(),
|
||||
const QItemSelection& /*deselected*/ = QItemSelection()) override;
|
||||
|
||||
void UncheckSelectDefaultSeedListsCheckBox();
|
||||
|
||||
@@ -124,6 +126,6 @@ namespace AssetBundler
|
||||
QSharedPointer<EditSeedDialog> m_editSeedDialog;
|
||||
QSharedPointer<AddSeedDialog> m_addSeedDialog;
|
||||
|
||||
bool m_hasWarnings = false;
|
||||
bool m_hasWarningsOrErrors = false;
|
||||
};
|
||||
} // namespace AssetBundler
|
||||
|
||||
@@ -83,7 +83,8 @@ namespace AssetBundler
|
||||
ConfigHelpers::read<int>(settings, QStringLiteral("AssetListFileNameColumnWidth"), config.assetListFileNameColumnWidth);
|
||||
ConfigHelpers::read<int>(settings, QStringLiteral("AssetListPlatformColumnWidth"), config.assetListPlatformColumnWidth);
|
||||
ConfigHelpers::read<int>(settings, QStringLiteral("ProductAssetNameColumnWidth"), config.productAssetNameColumnWidth);
|
||||
ConfigHelpers::read<int>(settings, QStringLiteral("ProductAssetRelativePathColumnWidth"), config.productAssetRelativePathColumnWidth);
|
||||
ConfigHelpers::read<int>(
|
||||
settings, QStringLiteral("ProductAssetRelativePathColumnWidth"), config.productAssetRelativePathColumnWidth);
|
||||
}
|
||||
|
||||
return config;
|
||||
@@ -159,8 +160,7 @@ namespace AssetBundler
|
||||
m_platformCatalogManager = AZStd::make_unique<AzToolsFramework::PlatformAddressedAssetCatalogManager>();
|
||||
|
||||
// Define some application-level settings
|
||||
QApplication::setOrganizationName("Amazon");
|
||||
QApplication::setOrganizationDomain("amazon.com");
|
||||
QApplication::setOrganizationName("O3DE");
|
||||
QApplication::setApplicationName("Asset Bundler");
|
||||
|
||||
QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
|
||||
@@ -194,7 +194,12 @@ namespace AssetBundler
|
||||
engineRoot);
|
||||
AzQtComponents::StyleManager::setStyleSheet(m_mainWindow.data(), QStringLiteral("style:AssetBundler.qss"));
|
||||
|
||||
AzQtComponents::ConfigHelpers::loadConfig<Config, GUIApplicationManager>(&m_fileWatcher, &m_config, QStringLiteral("style:AssetBundlerConfig.ini"), this, std::bind(&GUIApplicationManager::ApplyConfig, this));
|
||||
AzQtComponents::ConfigHelpers::loadConfig<Config, GUIApplicationManager>(
|
||||
&m_fileWatcher,
|
||||
&m_config,
|
||||
QStringLiteral("style:AssetBundlerConfig.ini"),
|
||||
this,
|
||||
std::bind(&GUIApplicationManager::ApplyConfig, this));
|
||||
ApplyConfig();
|
||||
|
||||
qApp->setWindowIcon(QIcon("style:AssetBundler-Icon-256x256@x2.ico"));
|
||||
@@ -238,7 +243,12 @@ namespace AssetBundler
|
||||
m_fileWatcher.removePaths(paths.values());
|
||||
}
|
||||
|
||||
bool GUIApplicationManager::OnPreError(const char* /*window*/, const char* /*fileName*/, int /*line*/, const char* /*func*/, const char* message)
|
||||
bool GUIApplicationManager::OnPreError(
|
||||
const char* /*window*/,
|
||||
const char* /*fileName*/,
|
||||
int /*line*/,
|
||||
const char* /*func*/,
|
||||
const char* message)
|
||||
{
|
||||
// We want to display errors during initialization, then let the MainWindow handle errors during runtime
|
||||
if (m_isInitializing)
|
||||
@@ -258,7 +268,12 @@ namespace AssetBundler
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GUIApplicationManager::OnPreWarning(const char* /*window*/, const char* /*fileName*/, int /*line*/, const char* /*func*/, const char* /*message*/)
|
||||
bool GUIApplicationManager::OnPreWarning(
|
||||
const char* /*window*/,
|
||||
const char* /*fileName*/,
|
||||
int /*line*/,
|
||||
const char* /*func*/,
|
||||
const char* /*message*/)
|
||||
{
|
||||
// Don't handle warnings, let the MainWindow print them
|
||||
return false;
|
||||
|
||||
@@ -155,8 +155,10 @@ namespace AssetBundler
|
||||
if (fileIO->Exists(platformDirectory.c_str()))
|
||||
{
|
||||
bool recurse = true;
|
||||
AZ::Outcome<AZStd::list<AZStd::string>, AZStd::string> result = AzFramework::FileFunc::FindFileList(platformDirectory.String(),
|
||||
AZStd::string::format("*.%s", AzToolsFramework::AssetSeedManager::GetSeedFileExtension()).c_str(), recurse);
|
||||
AZ::Outcome<AZStd::list<AZStd::string>, AZStd::string> result = AzFramework::FileFunc::FindFileList(
|
||||
platformDirectory.String(),
|
||||
AZStd::string::format("*.%s", AzToolsFramework::AssetSeedManager::GetSeedFileExtension()).c_str(),
|
||||
recurse);
|
||||
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
@@ -233,8 +235,11 @@ namespace AssetBundler
|
||||
return platformFlags;
|
||||
}
|
||||
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> GetDefaultSeedListFiles(AZStd::string_view enginePath, AZStd::string_view projectPath,
|
||||
const AZStd::vector<AzFramework::GemInfo>& gemInfoList, AzFramework::PlatformFlags platformFlag)
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> GetDefaultSeedListFiles(
|
||||
AZStd::string_view enginePath,
|
||||
AZStd::string_view projectPath,
|
||||
const AZStd::vector<AzFramework::GemInfo>& gemInfoList,
|
||||
AzFramework::PlatformFlags platformFlag)
|
||||
{
|
||||
AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance();
|
||||
AZ_Assert(fileIO, "AZ::IO::FileIOBase must be ready for use.\n");
|
||||
@@ -299,7 +304,9 @@ namespace AssetBundler
|
||||
return relativeProductPath;
|
||||
}
|
||||
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> GetGemSeedListFilePathToGemNameMap(const AZStd::vector<AzFramework::GemInfo>& gemInfoList, AzFramework::PlatformFlags platformFlags)
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> GetGemSeedListFilePathToGemNameMap(
|
||||
const AZStd::vector<AzFramework::GemInfo>& gemInfoList,
|
||||
AzFramework::PlatformFlags platformFlags)
|
||||
{
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> filePathToGemNameMap;
|
||||
for (const AzFramework::GemInfo& gemInfo : gemInfoList)
|
||||
@@ -325,7 +332,11 @@ namespace AssetBundler
|
||||
return filePathToGemNameMap;
|
||||
}
|
||||
|
||||
bool IsGemSeedFilePathValid(AZStd::string_view engineRoot, AZStd::string seedAbsoluteFilePath, const AZStd::vector<AzFramework::GemInfo>& gemInfoList, AzFramework::PlatformFlags platformFlags)
|
||||
bool IsGemSeedFilePathValid(
|
||||
AZStd::string_view engineRoot,
|
||||
AZStd::string seedAbsoluteFilePath,
|
||||
const AZStd::vector<AzFramework::GemInfo>& gemInfoList,
|
||||
AzFramework::PlatformFlags platformFlags)
|
||||
{
|
||||
AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance();
|
||||
AZ_Assert(fileIO, "AZ::IO::FileIOBase must be ready for use.\n");
|
||||
@@ -369,7 +380,10 @@ namespace AssetBundler
|
||||
return false;
|
||||
}
|
||||
|
||||
AzFramework::PlatformFlags GetEnabledPlatformFlags(AZStd::string_view engineRoot, AZStd::string_view assetRoot, AZStd::string_view projectPath)
|
||||
AzFramework::PlatformFlags GetEnabledPlatformFlags(
|
||||
AZStd::string_view engineRoot,
|
||||
AZStd::string_view assetRoot,
|
||||
AZStd::string_view projectPath)
|
||||
{
|
||||
auto settingsRegistry = AZ::SettingsRegistry::Get();
|
||||
if (settingsRegistry == nullptr)
|
||||
@@ -391,7 +405,8 @@ namespace AssetBundler
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Warning(AssetBundler::AppWindowName, false, "Platform Helper is not aware of the platform (%s).\n ", enabledPlatform.c_str());
|
||||
AZ_Warning(AssetBundler::AppWindowName, false,
|
||||
"Platform Helper is not aware of the platform (%s).\n ", enabledPlatform.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,31 +472,6 @@ namespace AssetBundler
|
||||
AZ::SettingsRegistryMergeUtils::FilePathKey_CacheProjectRootFolder));
|
||||
}
|
||||
|
||||
AZ::Outcome<void, AZStd::string> GetPlatformNamesFromCacheFolder(AZStd::vector<AZStd::string>& platformNames)
|
||||
{
|
||||
AZ::Outcome<AZ::IO::Path, AZStd::string> projectCacheRootFolder = GetProjectCacheFolderPath();
|
||||
if (!projectCacheRootFolder)
|
||||
{
|
||||
return AZ::Failure(projectCacheRootFolder.TakeError());
|
||||
}
|
||||
|
||||
const AZStd::string& projectCacheRootPath = projectCacheRootFolder.GetValue().Native();
|
||||
QDir projectCacheDir(QString::fromUtf8(projectCacheRootPath.c_str(), aznumeric_cast<int>(projectCacheRootPath.size())));
|
||||
auto tempPlatformList = projectCacheDir.entryList(QDir::Filter::Dirs | QDir::Filter::NoDotAndDotDot);
|
||||
|
||||
if (tempPlatformList.empty())
|
||||
{
|
||||
return AZ::Failure(AZStd::string("Cache is empty. Please run the Open 3D Engine Asset Processor to generate a Cache and build assets."));
|
||||
}
|
||||
|
||||
for (const QString& platform : tempPlatformList)
|
||||
{
|
||||
platformNames.push_back(AZStd::string(platform.toUtf8().data()));
|
||||
}
|
||||
|
||||
return AZ::Success();
|
||||
}
|
||||
|
||||
AZ::Outcome<AZ::IO::Path, AZStd::string> GetAssetCatalogFilePath()
|
||||
{
|
||||
AZ::IO::Path assetCatalogFilePath = GetPlatformSpecificCacheFolderPath();
|
||||
@@ -501,7 +491,9 @@ namespace AssetBundler
|
||||
AZ::IO::Path platformSpecificCacheFolderPath;
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
settingsRegistry->Get(platformSpecificCacheFolderPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheProjectRootFolder);
|
||||
settingsRegistry->Get(
|
||||
platformSpecificCacheFolderPath.Native(),
|
||||
AZ::SettingsRegistryMergeUtils::FilePathKey_CacheProjectRootFolder);
|
||||
}
|
||||
return platformSpecificCacheFolderPath;
|
||||
}
|
||||
@@ -701,7 +693,8 @@ namespace AssetBundler
|
||||
m_errors.swap(AZStd::vector<AZStd::string>());
|
||||
}
|
||||
|
||||
AZ::Outcome<AzToolsFramework::AssetFileInfoListComparison::ComparisonType, AZStd::string> ParseComparisonType(const AZStd::string& comparisonType)
|
||||
AZ::Outcome<AzToolsFramework::AssetFileInfoListComparison::ComparisonType, AZStd::string> ParseComparisonType(
|
||||
const AZStd::string& comparisonType)
|
||||
{
|
||||
using namespace AzToolsFramework;
|
||||
|
||||
@@ -729,7 +722,8 @@ namespace AssetBundler
|
||||
}
|
||||
|
||||
// Failure case
|
||||
AZStd::string failureMessage = AZStd::string::format("Invalid Comparison Type ( %s ). Valid types are: ", comparisonType.c_str());
|
||||
AZStd::string failureMessage = AZStd::string::format(
|
||||
"Invalid Comparison Type ( %s ). Valid types are: ", comparisonType.c_str());
|
||||
for (size_t i = 0; i < numTypes - 1; ++i)
|
||||
{
|
||||
failureMessage.append(AZStd::string::format("%s, ", AssetFileInfoListComparison::ComparisonTypeNames[i]));
|
||||
@@ -738,7 +732,8 @@ namespace AssetBundler
|
||||
return AZ::Failure(failureMessage);
|
||||
}
|
||||
|
||||
AZ::Outcome<AzToolsFramework::AssetFileInfoListComparison::FilePatternType, AZStd::string> ParseFilePatternType(const AZStd::string& filePatternType)
|
||||
AZ::Outcome<AzToolsFramework::AssetFileInfoListComparison::FilePatternType, AZStd::string> ParseFilePatternType(
|
||||
const AZStd::string& filePatternType)
|
||||
{
|
||||
using namespace AzToolsFramework;
|
||||
|
||||
@@ -766,7 +761,8 @@ namespace AssetBundler
|
||||
}
|
||||
|
||||
// Failure case
|
||||
AZStd::string failureMessage = AZStd::string::format("Invalid File Pattern Type ( %s ). Valid types are: ", filePatternType.c_str());
|
||||
AZStd::string failureMessage = AZStd::string::format(
|
||||
"Invalid File Pattern Type ( %s ). Valid types are: ", filePatternType.c_str());
|
||||
for (size_t i = 0; i < numTypes - 1; ++i)
|
||||
{
|
||||
failureMessage.append(AZStd::string::format("%s, ", AssetFileInfoListComparison::FilePatternTypeNames[i]));
|
||||
|
||||
@@ -158,17 +158,6 @@ namespace AssetBundler
|
||||
*/
|
||||
AZ::Outcome<AZ::IO::Path, AZStd::string> GetProjectCacheFolderPath();
|
||||
|
||||
/**
|
||||
* Calculates the list of enabled platforms for the input project by reading the folder names inside the project-specific cache folder.
|
||||
* If the Asset Processor has not been run yet, or has not been run since the enabled platform list inside AssetProcessorPlatformConfig.setreg
|
||||
* was changed, the output of this function will be incorrect.
|
||||
*
|
||||
* @param projectCacheFolder The directory of a project-specific cache folder: /ProjectPath/Cache
|
||||
* @param platformNames [out] The list of platforms enabled in the project
|
||||
* @return void on success, error message on failure
|
||||
*/
|
||||
AZ::Outcome<void, AZStd::string> GetPlatformNamesFromCacheFolder(AZStd::vector<AZStd::string>& platformNames);
|
||||
|
||||
/**
|
||||
* Computes the absolute path to the Asset Catalog file for a specified project and platform.
|
||||
* With platform set as "pc" and project as "ProjectName", the path will resemble: C:/ProjectPath/Cache/pc/assetcatalog.xml
|
||||
@@ -204,8 +193,11 @@ namespace AssetBundler
|
||||
AzFramework::PlatformFlags GetPlatformsOnDiskForPlatformSpecificFile(const AZStd::string& platformIndependentAbsolutePath);
|
||||
|
||||
//! Returns a map of <absolute file path, source folder display name> of all default Seed List files for the current game project.
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> GetDefaultSeedListFiles(AZStd::string_view enginePath, AZStd::string_view projectPath,
|
||||
const AZStd::vector<AzFramework::GemInfo>& gemInfoList, AzFramework::PlatformFlags platformFlags);
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> GetDefaultSeedListFiles(
|
||||
AZStd::string_view enginePath,
|
||||
AZStd::string_view projectPath,
|
||||
const AZStd::vector<AzFramework::GemInfo>& gemInfoList,
|
||||
AzFramework::PlatformFlags platformFlags);
|
||||
|
||||
//! Returns a vector of relative paths to Assets that should be included as default Seeds, but are not already in a Seed List file.
|
||||
AZStd::vector<AZStd::string> GetDefaultSeeds(AZStd::string_view projectPath, AZStd::string_view projectName);
|
||||
@@ -217,15 +209,24 @@ namespace AssetBundler
|
||||
AZ::IO::Path GetProjectDependenciesAssetPath(AZStd::string_view projectPath, AZStd::string_view projectName);
|
||||
|
||||
//! Returns the map from gem seed list file path to gem name
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> GetGemSeedListFilePathToGemNameMap(const AZStd::vector<AzFramework::GemInfo>& gemInfoList, AzFramework::PlatformFlags platformFlags);
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> GetGemSeedListFilePathToGemNameMap(
|
||||
const AZStd::vector<AzFramework::GemInfo>& gemInfoList,
|
||||
AzFramework::PlatformFlags platformFlags);
|
||||
|
||||
//! Given an absolute gem seed file path determines whether the file is valid for the current game project.
|
||||
//! This method is for validating gem seed list files only.
|
||||
bool IsGemSeedFilePathValid(AZStd::string_view enginePath, AZStd::string seedAbsoluteFilePath, const AZStd::vector<AzFramework::GemInfo>& gemInfoList, AzFramework::PlatformFlags platformFlags);
|
||||
bool IsGemSeedFilePathValid(
|
||||
AZStd::string_view enginePath,
|
||||
AZStd::string seedAbsoluteFilePath,
|
||||
const AZStd::vector<AzFramework::GemInfo>& gemInfoList,
|
||||
AzFramework::PlatformFlags platformFlags);
|
||||
|
||||
//! Returns platformFlags of all enabled platforms by parsing all the asset processor config files.
|
||||
//! Please note that the game project could be in a different location to the engine therefore we need the assetRoot param.
|
||||
AzFramework::PlatformFlags GetEnabledPlatformFlags(AZStd::string_view enginePath, AZStd::string_view assetRoot, AZStd::string_view projectPath);
|
||||
AzFramework::PlatformFlags GetEnabledPlatformFlags(
|
||||
AZStd::string_view enginePath,
|
||||
AZStd::string_view assetRoot,
|
||||
AZStd::string_view projectPath);
|
||||
|
||||
QJsonObject ReadJson(const AZStd::string& filePath);
|
||||
void SaveJson(const AZStd::string& filePath, const QJsonObject& jsonObject);
|
||||
@@ -239,7 +240,11 @@ namespace AssetBundler
|
||||
{
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(FilePath, AZ::SystemAllocator, 0);
|
||||
explicit FilePath(const AZStd::string& filePath, AZStd::string platformIdentifier = AZStd::string(), bool checkFileCase = false, bool ignoreFileCase = false);
|
||||
explicit FilePath(
|
||||
const AZStd::string& filePath,
|
||||
AZStd::string platformIdentifier = AZStd::string(),
|
||||
bool checkFileCase = false,
|
||||
bool ignoreFileCase = false);
|
||||
explicit FilePath(const AZStd::string& filePath, bool checkFileCase, bool ignoreFileCase);
|
||||
FilePath() = default;
|
||||
const AZStd::string& AbsolutePath() const;
|
||||
@@ -279,8 +284,10 @@ namespace AssetBundler
|
||||
bool m_reportingError = false;
|
||||
};
|
||||
|
||||
AZ::Outcome<AzToolsFramework::AssetFileInfoListComparison::ComparisonType, AZStd::string> ParseComparisonType(const AZStd::string& comparisonType);
|
||||
AZ::Outcome<AzToolsFramework::AssetFileInfoListComparison::FilePatternType, AZStd::string> ParseFilePatternType(const AZStd::string& filePatternType);
|
||||
AZ::Outcome<AzToolsFramework::AssetFileInfoListComparison::ComparisonType, AZStd::string> ParseComparisonType(
|
||||
const AZStd::string& comparisonType);
|
||||
AZ::Outcome<AzToolsFramework::AssetFileInfoListComparison::FilePatternType, AZStd::string> ParseFilePatternType(
|
||||
const AZStd::string& filePatternType);
|
||||
bool LooksLikePath(const AZStd::string& inputString);
|
||||
bool LooksLikeWildcardPattern(const AZStd::string& inputPattern);
|
||||
}
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <GemCatalog.h>
|
||||
|
||||
#include <Source/ui_GemCatalog.h>
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
GemCatalog::GemCatalog(ProjectManagerWindow* window)
|
||||
: ScreenWidget(window)
|
||||
, m_ui(new Ui::GemCatalogClass())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
ConnectSlotsAndSignals();
|
||||
}
|
||||
|
||||
GemCatalog::~GemCatalog()
|
||||
{
|
||||
}
|
||||
|
||||
void GemCatalog::ConnectSlotsAndSignals()
|
||||
{
|
||||
QObject::connect(m_ui->backButton, &QPushButton::pressed, this, &GemCatalog::HandleBackButton);
|
||||
QObject::connect(m_ui->confirmButton, &QPushButton::pressed, this, &GemCatalog::HandleConfirmButton);
|
||||
}
|
||||
|
||||
void GemCatalog::HandleBackButton()
|
||||
{
|
||||
m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::NewProjectSettings);
|
||||
}
|
||||
void GemCatalog::HandleConfirmButton()
|
||||
{
|
||||
m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::ProjectsHome);
|
||||
}
|
||||
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -1,231 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>GemCatalogClass</class>
|
||||
<widget class="QWidget" name="GemCatalogClass">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>806</width>
|
||||
<height>566</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Gem Catalog</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="text">
|
||||
<string>Cart</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton_2">
|
||||
<property name="text">
|
||||
<string>Hamburger Menu</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton">
|
||||
<property name="text">
|
||||
<string>RadioButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_2">
|
||||
<property name="text">
|
||||
<string>RadioButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_3">
|
||||
<property name="text">
|
||||
<string>RadioButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_2">
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_3">
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Atom</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Audio</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Camera</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>PhysX</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="backButton">
|
||||
<property name="text">
|
||||
<string>Back</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="confirmButton">
|
||||
<property name="text">
|
||||
<string>Create Project</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <GemCatalog/GemCatalog.h>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
GemCatalog::GemCatalog(ProjectManagerWindow* window)
|
||||
: ScreenWidget(window)
|
||||
{
|
||||
ConnectSlotsAndSignals();
|
||||
|
||||
m_gemModel = new GemModel(this);
|
||||
|
||||
QVBoxLayout* vLayout = new QVBoxLayout();
|
||||
setLayout(vLayout);
|
||||
|
||||
QHBoxLayout* hLayout = new QHBoxLayout();
|
||||
vLayout->addLayout(hLayout);
|
||||
|
||||
QWidget* filterPlaceholderWidget = new QWidget();
|
||||
filterPlaceholderWidget->setFixedWidth(250);
|
||||
hLayout->addWidget(filterPlaceholderWidget);
|
||||
|
||||
m_gemListView = new GemListView(m_gemModel, this);
|
||||
hLayout->addWidget(m_gemListView);
|
||||
|
||||
QWidget* inspectorPlaceholderWidget = new QWidget();
|
||||
inspectorPlaceholderWidget->setFixedWidth(250);
|
||||
hLayout->addWidget(inspectorPlaceholderWidget);
|
||||
|
||||
// Temporary back and next buttons until they are centralized and shared.
|
||||
QDialogButtonBox* backNextButtons = new QDialogButtonBox();
|
||||
vLayout->addWidget(backNextButtons);
|
||||
|
||||
QPushButton* tempBackButton = backNextButtons->addButton("Back", QDialogButtonBox::RejectRole);
|
||||
QPushButton* tempNextButton = backNextButtons->addButton("Next", QDialogButtonBox::AcceptRole);
|
||||
connect(tempBackButton, &QPushButton::pressed, this, &GemCatalog::HandleBackButton);
|
||||
connect(tempNextButton, &QPushButton::pressed, this, &GemCatalog::HandleConfirmButton);
|
||||
|
||||
// Start: Temporary gem test data
|
||||
{
|
||||
m_gemModel->AddGem(GemInfo("EMotion FX",
|
||||
"O3DE Foundation",
|
||||
"EMFX is a real-time character animation system. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||
(GemInfo::Android | GemInfo::iOS | GemInfo::Windows | GemInfo::Linux),
|
||||
true));
|
||||
|
||||
m_gemModel->AddGem(O3DE::ProjectManager::GemInfo("Atom",
|
||||
"O3DE Foundation",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||
GemInfo::Android | GemInfo::Windows | GemInfo::Linux,
|
||||
true));
|
||||
|
||||
m_gemModel->AddGem(O3DE::ProjectManager::GemInfo("PhysX",
|
||||
"O3DE Foundation",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||
GemInfo::Android | GemInfo::Linux,
|
||||
false));
|
||||
|
||||
m_gemModel->AddGem(O3DE::ProjectManager::GemInfo("Certificate Manager",
|
||||
"O3DE Foundation",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||
GemInfo::Windows,
|
||||
false));
|
||||
|
||||
m_gemModel->AddGem(O3DE::ProjectManager::GemInfo("Cloud Gem Framework",
|
||||
"O3DE Foundation",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||
GemInfo::iOS | GemInfo::Linux,
|
||||
false));
|
||||
|
||||
m_gemModel->AddGem(O3DE::ProjectManager::GemInfo("Achievements",
|
||||
"O3DE Foundation",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||
GemInfo::Android | GemInfo::Windows | GemInfo::Linux,
|
||||
false));
|
||||
}
|
||||
// End: Temporary gem test data
|
||||
}
|
||||
|
||||
void GemCatalog::HandleBackButton()
|
||||
{
|
||||
m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::NewProjectSettings);
|
||||
}
|
||||
void GemCatalog::HandleConfirmButton()
|
||||
{
|
||||
m_projectManagerWindow->ChangeToScreen(ProjectManagerScreen::ProjectsHome);
|
||||
}
|
||||
} // namespace O3DE::ProjectManager
|
||||
+5
-12
@@ -13,32 +13,25 @@
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <ScreenWidget.h>
|
||||
#include <GemCatalog/GemListView.h>
|
||||
#include <GemCatalog/GemModel.h>
|
||||
#endif
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class GemCatalogClass;
|
||||
}
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
class GemCatalog
|
||||
: public ScreenWidget
|
||||
{
|
||||
|
||||
public:
|
||||
explicit GemCatalog(ProjectManagerWindow* window);
|
||||
~GemCatalog();
|
||||
|
||||
protected:
|
||||
void ConnectSlotsAndSignals() override;
|
||||
~GemCatalog() = default;
|
||||
|
||||
protected slots:
|
||||
void HandleBackButton();
|
||||
void HandleConfirmButton();
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::GemCatalogClass> m_ui;
|
||||
GemListView* m_gemListView = nullptr;
|
||||
GemModel* m_gemModel = nullptr;
|
||||
};
|
||||
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "GemInfo.h"
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
GemInfo::GemInfo(const QString& name, const QString& creator, const QString& summary, Platforms platforms, bool isAdded)
|
||||
: m_name(name)
|
||||
, m_creator(creator)
|
||||
, m_summary(summary)
|
||||
, m_platforms(platforms)
|
||||
, m_isAdded(isAdded)
|
||||
{
|
||||
}
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <AzCore/Math/Uuid.h>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QVector>
|
||||
#endif
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
class GemInfo
|
||||
{
|
||||
public:
|
||||
enum Platform
|
||||
{
|
||||
Android = 0x0,
|
||||
iOS = 0x1,
|
||||
Linux = 0x2,
|
||||
macOS = 0x3,
|
||||
Windows = 0x4
|
||||
};
|
||||
Q_DECLARE_FLAGS(Platforms, Platform)
|
||||
|
||||
GemInfo(const QString& name, const QString& creator, const QString& summary, Platforms platforms, bool isAdded);
|
||||
|
||||
QString m_name;
|
||||
QString m_displayName;
|
||||
AZ::Uuid m_uuid;
|
||||
QString m_creator;
|
||||
bool m_isAdded = false; //! Is the gem currently added and enabled in the project?
|
||||
QString m_summary;
|
||||
Platforms m_platforms;
|
||||
QStringList m_features;
|
||||
QString m_version;
|
||||
QString m_lastUpdatedDate;
|
||||
QString m_documentationUrl;
|
||||
QVector<AZ::Uuid> m_dependingGemUuids;
|
||||
QVector<AZ::Uuid> m_conflictingGemUuids;
|
||||
};
|
||||
} // namespace O3DE::ProjectManager
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(O3DE::ProjectManager::GemInfo::Platforms)
|
||||
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "GemItemDelegate.h"
|
||||
#include "GemModel.h"
|
||||
#include <QEvent>
|
||||
#include <QPainter>
|
||||
#include <QMouseEvent>
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
GemItemDelegate::GemItemDelegate(GemModel* gemModel, QObject* parent)
|
||||
: QStyledItemDelegate(parent)
|
||||
, m_gemModel(gemModel)
|
||||
{
|
||||
}
|
||||
|
||||
void GemItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& modelIndex) const
|
||||
{
|
||||
if (!modelIndex.isValid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QStyleOptionViewItem options(option);
|
||||
initStyleOption(&options, modelIndex);
|
||||
|
||||
painter->setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
QRect fullRect, itemRect, contentRect;
|
||||
CalcRects(options, modelIndex, fullRect, itemRect, contentRect);
|
||||
|
||||
QFont standardFont(options.font);
|
||||
standardFont.setPixelSize(s_fontSize);
|
||||
|
||||
painter->save();
|
||||
painter->setClipping(true);
|
||||
painter->setClipRect(fullRect);
|
||||
painter->setFont(options.font);
|
||||
|
||||
// Draw background
|
||||
painter->fillRect(fullRect, m_backgroundColor);
|
||||
|
||||
// Draw item background
|
||||
const QColor itemBackgroundColor = options.state & QStyle::State_MouseOver ? m_itemBackgroundColor.lighter(120) : m_itemBackgroundColor;
|
||||
painter->fillRect(itemRect, itemBackgroundColor);
|
||||
|
||||
// Draw border
|
||||
if (options.state & QStyle::State_Selected)
|
||||
{
|
||||
painter->save();
|
||||
QPen borderPen(m_borderColor);
|
||||
borderPen.setWidth(s_borderWidth);
|
||||
painter->setPen(borderPen);
|
||||
painter->drawRect(itemRect);
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
// Gem name
|
||||
const QString gemName = m_gemModel->GetName(modelIndex);
|
||||
QFont gemNameFont(options.font);
|
||||
gemNameFont.setPixelSize(s_gemNameFontSize);
|
||||
gemNameFont.setBold(true);
|
||||
QRect gemNameRect = GetTextRect(gemNameFont, gemName, s_gemNameFontSize);
|
||||
gemNameRect.moveTo(contentRect.left(), contentRect.top());
|
||||
|
||||
painter->setFont(gemNameFont);
|
||||
painter->setPen(m_textColor);
|
||||
painter->drawText(gemNameRect, Qt::TextSingleLine, gemName);
|
||||
|
||||
// Gem creator
|
||||
const QString gemCreator = m_gemModel->GetCreator(modelIndex);
|
||||
QRect gemCreatorRect = GetTextRect(standardFont, gemCreator, s_fontSize);
|
||||
gemCreatorRect.moveTo(contentRect.left(), contentRect.top() + gemNameRect.height());
|
||||
|
||||
painter->setFont(standardFont);
|
||||
painter->setPen(m_linkColor);
|
||||
painter->drawText(gemCreatorRect, Qt::TextSingleLine, gemCreator);
|
||||
|
||||
// Gem summary
|
||||
const QSize summarySize = QSize(contentRect.width() - s_summaryStartX - s_itemMargins.right() * 4, contentRect.height());
|
||||
const QRect summaryRect = QRect(/*topLeft=*/QPoint(contentRect.left() + s_summaryStartX, contentRect.top()), summarySize);
|
||||
|
||||
painter->setFont(standardFont);
|
||||
painter->setPen(m_textColor);
|
||||
|
||||
const QString summary = m_gemModel->GetSummary(modelIndex);
|
||||
painter->drawText(summaryRect, Qt::AlignLeft | Qt::TextWordWrap, summary);
|
||||
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
QSize GemItemDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& modelIndex) const
|
||||
{
|
||||
QStyleOptionViewItem options(option);
|
||||
initStyleOption(&options, modelIndex);
|
||||
|
||||
int marginsHorizontal = s_itemMargins.left() + s_itemMargins.right() + s_contentMargins.left() + s_contentMargins.right();
|
||||
return QSize(marginsHorizontal + s_summaryStartX, s_height);
|
||||
}
|
||||
|
||||
bool GemItemDelegate::editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& modelIndex)
|
||||
{
|
||||
if (!modelIndex.isValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return QStyledItemDelegate::editorEvent(event, model, option, modelIndex);
|
||||
}
|
||||
|
||||
void GemItemDelegate::CalcRects(const QStyleOptionViewItem& option, const QModelIndex& modelIndex, QRect& outFullRect, QRect& outItemRect, QRect& outContentRect) const
|
||||
{
|
||||
const bool isFirst = modelIndex.row() == 0;
|
||||
|
||||
outFullRect = QRect(option.rect);
|
||||
outItemRect = QRect(outFullRect.adjusted(s_itemMargins.left(), isFirst ? s_itemMargins.top() * 2 : s_itemMargins.top(), -s_itemMargins.right(), -s_itemMargins.bottom()));
|
||||
outContentRect = QRect(outItemRect.adjusted(s_contentMargins.left(), s_contentMargins.top(), -s_contentMargins.right(), -s_contentMargins.bottom()));
|
||||
}
|
||||
|
||||
QRect GemItemDelegate::GetTextRect(QFont& font, const QString& text, qreal fontSize) const
|
||||
{
|
||||
font.setPixelSize(fontSize);
|
||||
return QFontMetrics(font).boundingRect(text);
|
||||
}
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <QStyledItemDelegate>
|
||||
#include "GemInfo.h"
|
||||
#include "GemModel.h"
|
||||
#endif
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QEvent)
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
class GemItemDelegate
|
||||
: public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT // AUTOMOC
|
||||
|
||||
public:
|
||||
explicit GemItemDelegate(GemModel* gemModel, QObject* parent = nullptr);
|
||||
~GemItemDelegate() = default;
|
||||
|
||||
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& modelIndex) const override;
|
||||
bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& modelIndex) override;
|
||||
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& modelIndex) const override;
|
||||
|
||||
private:
|
||||
void CalcRects(const QStyleOptionViewItem& option, const QModelIndex& modelIndex, QRect& outFullRect, QRect& outItemRect, QRect& outContentRect) const;
|
||||
QRect GetTextRect(QFont& font, const QString& text, qreal fontSize) const;
|
||||
|
||||
GemModel* m_gemModel = nullptr;
|
||||
|
||||
// Colors
|
||||
const QColor m_textColor = QColor("#FFFFFF");
|
||||
const QColor m_linkColor = QColor("#94D2FF");
|
||||
const QColor m_backgroundColor = QColor("#333333"); // Outside of the actual gem item
|
||||
const QColor m_itemBackgroundColor = QColor("#404040"); // Background color of the gem item
|
||||
const QColor m_borderColor = QColor("#1E70EB");
|
||||
|
||||
// Item
|
||||
inline constexpr static int s_height = 140; // Gem item total height
|
||||
inline constexpr static qreal s_gemNameFontSize = 16.0;
|
||||
inline constexpr static qreal s_fontSize = 15.0;
|
||||
inline constexpr static int s_summaryStartX = 200;
|
||||
|
||||
// Margin and borders
|
||||
inline constexpr static QMargins s_itemMargins = QMargins(/*left=*/20, /*top=*/10, /*right=*/20, /*bottom=*/10); // Item border distances
|
||||
inline constexpr static QMargins s_contentMargins = QMargins(/*left=*/15, /*top=*/12, /*right=*/12, /*bottom=*/12); // Distances of the elements within an item to the item borders
|
||||
inline constexpr static int s_borderWidth = 4;
|
||||
};
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "GemListView.h"
|
||||
#include "GemItemDelegate.h"
|
||||
#include <QStandardItemModel>
|
||||
#include <QDateTime>
|
||||
#include <QPalette>
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
GemListView::GemListView(GemModel* model, QWidget *parent) :
|
||||
QListView(parent)
|
||||
{
|
||||
setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
|
||||
QPalette palette;
|
||||
palette.setColor(QPalette::Window, QColor("#333333"));
|
||||
setPalette(palette);
|
||||
|
||||
setModel(model);
|
||||
setSelectionModel(model->GetSelectionModel());
|
||||
setItemDelegate(new GemItemDelegate(model, this));
|
||||
}
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include "GemInfo.h"
|
||||
#include "GemModel.h"
|
||||
#include <QListView>
|
||||
#endif
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
class GemListView
|
||||
: public QListView
|
||||
{
|
||||
Q_OBJECT // AUTOMOC
|
||||
public:
|
||||
explicit GemListView(GemModel* model, QWidget *parent = nullptr);
|
||||
~GemListView() = default;
|
||||
};
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "GemModel.h"
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
GemModel::GemModel(QObject* parent)
|
||||
: QStandardItemModel(parent)
|
||||
{
|
||||
m_selectionModel = new QItemSelectionModel(this, parent);
|
||||
}
|
||||
|
||||
QItemSelectionModel* GemModel::GetSelectionModel() const
|
||||
{
|
||||
return m_selectionModel;
|
||||
}
|
||||
|
||||
void GemModel::AddGem(const GemInfo& gemInfo)
|
||||
{
|
||||
QStandardItem* item = new QStandardItem();
|
||||
|
||||
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
|
||||
|
||||
item->setData(gemInfo.m_name, RoleName);
|
||||
item->setData(gemInfo.m_creator, RoleCreator);
|
||||
item->setData(static_cast<int>(gemInfo.m_platforms), RolePlatforms);
|
||||
item->setData(gemInfo.m_summary, RoleSummary);
|
||||
item->setData(gemInfo.m_isAdded, RoleIsAdded);
|
||||
|
||||
appendRow(item);
|
||||
}
|
||||
|
||||
void GemModel::Clear()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
QString GemModel::GetName(const QModelIndex& modelIndex) const
|
||||
{
|
||||
return modelIndex.data(RoleName).toString();
|
||||
}
|
||||
|
||||
QString GemModel::GetCreator(const QModelIndex& modelIndex) const
|
||||
{
|
||||
return modelIndex.data(RoleCreator).toString();
|
||||
}
|
||||
|
||||
int GemModel::GetPlatforms(const QModelIndex& modelIndex) const
|
||||
{
|
||||
return static_cast<GemInfo::Platforms>(modelIndex.data(RolePlatforms).toInt());
|
||||
}
|
||||
|
||||
QString GemModel::GetSummary(const QModelIndex& modelIndex) const
|
||||
{
|
||||
return modelIndex.data(RoleSummary).toString();
|
||||
}
|
||||
|
||||
bool GemModel::IsAdded(const QModelIndex& modelIndex) const
|
||||
{
|
||||
return modelIndex.data(RoleIsAdded).toBool();
|
||||
}
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include "GemInfo.h"
|
||||
#include <QStandardItemModel>
|
||||
#include <QItemSelectionModel>
|
||||
#endif
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
class GemModel
|
||||
: public QStandardItemModel
|
||||
{
|
||||
Q_OBJECT // AUTOMOC
|
||||
|
||||
public:
|
||||
explicit GemModel(QObject* parent = nullptr);
|
||||
QItemSelectionModel* GetSelectionModel() const;
|
||||
|
||||
void AddGem(const GemInfo& gemInfo);
|
||||
void Clear();
|
||||
|
||||
QString GetName(const QModelIndex& modelIndex) const;
|
||||
QString GetCreator(const QModelIndex& modelIndex) const;
|
||||
int GetPlatforms(const QModelIndex& modelIndex) const;
|
||||
QString GetSummary(const QModelIndex& modelIndex) const;
|
||||
bool IsAdded(const QModelIndex& modelIndex) const;
|
||||
|
||||
private:
|
||||
enum UserRole
|
||||
{
|
||||
RoleName = Qt::UserRole,
|
||||
RoleCreator,
|
||||
RolePlatforms,
|
||||
RoleSummary,
|
||||
RoleIsAdded
|
||||
};
|
||||
|
||||
QItemSelectionModel* m_selectionModel = nullptr;
|
||||
};
|
||||
} // namespace O3DE::ProjectManager
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include <FirstTimeUse.h>
|
||||
#include <NewProjectSettings.h>
|
||||
#include <GemCatalog.h>
|
||||
#include <GemCatalog/GemCatalog.h>
|
||||
#include <ProjectsHome.h>
|
||||
#include <ProjectSettings.h>
|
||||
#include <EngineSettings.h>
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace O3DE::ProjectManager
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void ConnectSlotsAndSignals() = 0;
|
||||
virtual void ConnectSlotsAndSignals() {}
|
||||
|
||||
ProjectManagerWindow* m_projectManagerWindow;
|
||||
};
|
||||
|
||||
@@ -25,9 +25,6 @@ set(FILES
|
||||
Source/NewProjectSettings.h
|
||||
Source/NewProjectSettings.cpp
|
||||
Source/NewProjectSettings.ui
|
||||
Source/GemCatalog.h
|
||||
Source/GemCatalog.cpp
|
||||
Source/GemCatalog.ui
|
||||
Source/ProjectsHome.h
|
||||
Source/ProjectsHome.cpp
|
||||
Source/ProjectsHome.ui
|
||||
@@ -37,4 +34,14 @@ set(FILES
|
||||
Source/EngineSettings.h
|
||||
Source/EngineSettings.cpp
|
||||
Source/EngineSettings.ui
|
||||
Source/GemCatalog/GemCatalog.h
|
||||
Source/GemCatalog/GemCatalog.cpp
|
||||
Source/GemCatalog/GemInfo.h
|
||||
Source/GemCatalog/GemInfo.cpp
|
||||
Source/GemCatalog/GemItemDelegate.h
|
||||
Source/GemCatalog/GemItemDelegate.cpp
|
||||
Source/GemCatalog/GemListView.h
|
||||
Source/GemCatalog/GemListView.cpp
|
||||
Source/GemCatalog/GemModel.h
|
||||
Source/GemCatalog/GemModel.cpp
|
||||
)
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace AZ
|
||||
SerializeContext* serializeContext = azrtti_cast<SerializeContext*>(context);
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->Class<AssImpAnimationImporter, SceneCore::LoadingComponent>()->Version(2); // [LYN-2281] Skinned mesh loading fixes
|
||||
serializeContext->Class<AssImpAnimationImporter, SceneCore::LoadingComponent>()->Version(3); // [LYN-3349] Rolling back rotation change
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user