Always display all gems in Gem Catalog (#2341)

Signed-off-by: AMZN-alexpete <26804013+AMZN-alexpete@users.noreply.github.com>
monroegm-disable-blank-issue-2
Alex Peterson 4 years ago committed by GitHub
parent dae081ba7d
commit 38fd92a15a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -265,6 +265,6 @@ namespace O3DE::ProjectManager
void CreateProjectCtrl::ReinitGemCatalogForSelectedTemplate() void CreateProjectCtrl::ReinitGemCatalogForSelectedTemplate()
{ {
const QString projectTemplatePath = m_newProjectSettingsScreen->GetProjectTemplatePath(); const QString projectTemplatePath = m_newProjectSettingsScreen->GetProjectTemplatePath();
m_gemCatalogScreen->ReinitForProject(projectTemplatePath + "/Template", /*isNewProject=*/true); m_gemCatalogScreen->ReinitForProject(projectTemplatePath + "/Template");
} }
} // namespace O3DE::ProjectManager } // namespace O3DE::ProjectManager

@ -62,10 +62,10 @@ namespace O3DE::ProjectManager
hLayout->addWidget(m_gemInspector); hLayout->addWidget(m_gemInspector);
} }
void GemCatalogScreen::ReinitForProject(const QString& projectPath, bool isNewProject) void GemCatalogScreen::ReinitForProject(const QString& projectPath)
{ {
m_gemModel->clear(); m_gemModel->clear();
FillModel(projectPath, isNewProject); FillModel(projectPath);
if (m_filterWidget) if (m_filterWidget)
{ {
@ -88,18 +88,9 @@ namespace O3DE::ProjectManager
}); });
} }
void GemCatalogScreen::FillModel(const QString& projectPath, bool isNewProject) void GemCatalogScreen::FillModel(const QString& projectPath)
{ {
AZ::Outcome<QVector<GemInfo>, AZStd::string> allGemInfosResult; AZ::Outcome<QVector<GemInfo>, AZStd::string> allGemInfosResult = PythonBindingsInterface::Get()->GetAllGemInfos(projectPath);
if (isNewProject)
{
allGemInfosResult = PythonBindingsInterface::Get()->GetEngineGemInfos();
}
else
{
allGemInfosResult = PythonBindingsInterface::Get()->GetAllGemInfos(projectPath);
}
if (allGemInfosResult.IsSuccess()) if (allGemInfosResult.IsSuccess())
{ {
// Add all available gems to the model. // Add all available gems to the model.

@ -28,13 +28,13 @@ namespace O3DE::ProjectManager
~GemCatalogScreen() = default; ~GemCatalogScreen() = default;
ProjectManagerScreen GetScreenEnum() override; ProjectManagerScreen GetScreenEnum() override;
void ReinitForProject(const QString& projectPath, bool isNewProject); void ReinitForProject(const QString& projectPath);
bool EnableDisableGemsForProject(const QString& projectPath); bool EnableDisableGemsForProject(const QString& projectPath);
GemModel* GetGemModel() const { return m_gemModel; } GemModel* GetGemModel() const { return m_gemModel; }
private: private:
void FillModel(const QString& projectPath, bool isNewProject); void FillModel(const QString& projectPath);
GemListView* m_gemListView = nullptr; GemListView* m_gemListView = nullptr;
GemInspector* m_gemInspector = nullptr; GemInspector* m_gemInspector = nullptr;

@ -94,7 +94,7 @@ namespace O3DE::ProjectManager
Update(); Update();
// Gather the available gems that will be shown in the gem catalog. // Gather the available gems that will be shown in the gem catalog.
m_gemCatalogScreen->ReinitForProject(m_projectInfo.m_path, /*isNewProject=*/false); m_gemCatalogScreen->ReinitForProject(m_projectInfo.m_path);
} }
void UpdateProjectCtrl::HandleGemsButton() void UpdateProjectCtrl::HandleGemsButton()

Loading…
Cancel
Save