1586c00fc8
* When there are multiple project templates present, we re-gather the gems when changing the selected the project template. * In case the user enabled or disabled any gem and they select a new project template, we show a warning dialog where users can either cancel the operation or proceed to the new project template. The warning dialog will only appear in case the enabled gems actually differ from the currently used template's default. * New helper function to select the used project template. * Storing the currently used project template index and only update the template details and emitting the changed event in case the user has actually chosen another template. This avoids emitting signals in case the user clicks on the already selected template. Signed-off-by: Benjamin Jillich <jillich@amazon.com>
73 lines
2.1 KiB
C++
73 lines
2.1 KiB
C++
/*
|
|
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
*
|
|
*/
|
|
#pragma once
|
|
|
|
#if !defined(Q_MOC_RUN)
|
|
#include <ScreenWidget.h>
|
|
#include <ProjectInfo.h>
|
|
#endif
|
|
|
|
// due to current limitations, customizing template Gems is disabled
|
|
#define TEMPLATE_GEM_CONFIGURATION_ENABLED
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QStackedWidget)
|
|
QT_FORWARD_DECLARE_CLASS(QPushButton)
|
|
QT_FORWARD_DECLARE_CLASS(QLabel)
|
|
|
|
namespace O3DE::ProjectManager
|
|
{
|
|
QT_FORWARD_DECLARE_CLASS(ScreenHeader)
|
|
QT_FORWARD_DECLARE_CLASS(NewProjectSettingsScreen)
|
|
QT_FORWARD_DECLARE_CLASS(GemCatalogScreen)
|
|
|
|
class CreateProjectCtrl
|
|
: public ScreenWidget
|
|
{
|
|
public:
|
|
explicit CreateProjectCtrl(QWidget* parent = nullptr);
|
|
~CreateProjectCtrl() = default;
|
|
ProjectManagerScreen GetScreenEnum() override;
|
|
void NotifyCurrentScreen() override;
|
|
|
|
protected slots:
|
|
void HandleBackButton();
|
|
void HandlePrimaryButton();
|
|
|
|
#ifdef TEMPLATE_GEM_CONFIGURATION_ENABLED
|
|
void OnChangeScreenRequest(ProjectManagerScreen screen);
|
|
void HandleSecondaryButton();
|
|
void ReinitGemCatalogForSelectedTemplate();
|
|
#endif // TEMPLATE_GEM_CONFIGURATION_ENABLED
|
|
|
|
private:
|
|
#ifdef TEMPLATE_GEM_CONFIGURATION_ENABLED
|
|
void Update();
|
|
void NextScreen();
|
|
void PreviousScreen();
|
|
#endif // TEMPLATE_GEM_CONFIGURATION_ENABLED
|
|
|
|
bool CurrentScreenIsValid();
|
|
void CreateProject();
|
|
|
|
QStackedWidget* m_stack = nullptr;
|
|
ScreenHeader* m_header = nullptr;
|
|
|
|
QPushButton* m_primaryButton = nullptr;
|
|
|
|
#ifdef TEMPLATE_GEM_CONFIGURATION_ENABLED
|
|
QPushButton* m_secondaryButton = nullptr;
|
|
#endif // TEMPLATE_GEM_CONFIGURATION_ENABLED
|
|
|
|
QString m_projectTemplatePath;
|
|
ProjectInfo m_projectInfo;
|
|
|
|
NewProjectSettingsScreen* m_newProjectSettingsScreen = nullptr;
|
|
GemCatalogScreen* m_gemCatalogScreen = nullptr;
|
|
};
|
|
|
|
} // namespace O3DE::ProjectManager
|