Add GameLift to the AWS menu (#4716)
* Add GameLift to the AWS menu Signed-off-by: Junbo Liang <junbo@amazon.com>
This commit is contained in:
@@ -51,4 +51,21 @@ namespace AWSCore
|
||||
"https://o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/advanced-topics/";
|
||||
static constexpr const char AWSMetricsSettingsUrl[] =
|
||||
"https://o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/";
|
||||
|
||||
static constexpr const char AWSGameLiftGemOverviewUrl[] =
|
||||
"https://o3de.org/docs/user-guide/gems/reference/aws/aws-gamelift/";
|
||||
static constexpr const char AWSGameLiftGemSetupUrl[] =
|
||||
"https://o3de.org/docs/user-guide/gems/reference/aws/aws-gamelift/gem-setup/";
|
||||
static constexpr const char AWSGameLiftScriptingUrl[] =
|
||||
"https://o3de.org/docs/user-guide/gems/reference/aws/aws-gamelift/scripting/";
|
||||
static constexpr const char AWSGameLiftAPIReferenceUrl[] =
|
||||
"https://o3de.org/docs/user-guide/gems/reference/aws/aws-gamelift/cpp-api/";
|
||||
static constexpr const char AWSGameLiftAdvancedTopicsUrl[] =
|
||||
"https://o3de.org/docs/user-guide/gems/reference/aws/aws-gamelift/advanced-topics/";
|
||||
static constexpr const char AWSGameLiftLocalTestingUrl[] =
|
||||
"https://o3de.org/docs/user-guide/gems/reference/aws/aws-gamelift/local-testing/";
|
||||
static constexpr const char AWSGameLiftBuildPackagingUrl[] =
|
||||
"https://o3de.org/docs/user-guide/gems/reference/aws/aws-gamelift/build-packaging-for-windows/";
|
||||
static constexpr const char AWSGameLiftResourceManagementUrl[] =
|
||||
"https://o3de.org/docs/user-guide/gems/reference/aws/aws-gamelift/resource-management/";
|
||||
} // namespace AWSCore
|
||||
|
||||
@@ -38,4 +38,14 @@ namespace AWSCore
|
||||
static constexpr const char AWSMetricsAPIReferenceActionText[] = "API reference";
|
||||
static constexpr const char AWSMetricsAdvancedTopicsActionText[] = "Advanced topics";
|
||||
static constexpr const char AWSMetricsSettingsActionText[] = "Metrics settings";
|
||||
|
||||
static constexpr const char AWSGameLiftActionText[] = "GameLift Gem";
|
||||
static constexpr const char AWSGameLiftGemOverviewActionText[] = "Gem overview";
|
||||
static constexpr const char AWSGameLiftGemSetupActionText[] = "Setup";
|
||||
static constexpr const char AWSMGameLiftScriptingActionText[] = "Scripting reference";
|
||||
static constexpr const char AWSGameLiftAPIReferenceActionText[] = "API reference";
|
||||
static constexpr const char AWSGameLiftAdvancedTopicsActionText[] = "Advanced topics";
|
||||
static constexpr const char AWSGameLiftLocalTestingActionText[] = "Local testing";
|
||||
static constexpr const char AWSGameLiftBuildPackagingActionText[] = "Build packaging (Windows)";
|
||||
static constexpr const char AWSGameLiftResourceManagementActionText[] = "Resource Management";
|
||||
} // namespace AWSCore
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace AWSCore
|
||||
// AWSCoreEditorRequestBus interface implementation
|
||||
void SetAWSClientAuthEnabled() override;
|
||||
void SetAWSMetricsEnabled() override;
|
||||
void SetAWSGameLiftEnabled() override;
|
||||
|
||||
QMenu* SetAWSFeatureSubMenu(const AZStd::string& menuText);
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace AWSCore
|
||||
public:
|
||||
virtual void SetAWSClientAuthEnabled() = 0;
|
||||
virtual void SetAWSMetricsEnabled() = 0;
|
||||
virtual void SetAWSGameLiftEnabled() = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// EBusTraits overrides
|
||||
|
||||
@@ -156,6 +156,11 @@ namespace AWSCore
|
||||
metrics->setIcon(QIcon(QString(":/Notifications/download.svg")));
|
||||
metrics->setDisabled(true);
|
||||
this->addAction(metrics);
|
||||
|
||||
QAction* gamelift = new QAction(QObject::tr(AWSGameLiftActionText));
|
||||
gamelift->setIcon(QIcon(QString(":/Notifications/download.svg")));
|
||||
gamelift->setDisabled(true);
|
||||
this->addAction(gamelift);
|
||||
}
|
||||
|
||||
void AWSCoreEditorMenu::SetAWSClientAuthEnabled()
|
||||
@@ -181,6 +186,23 @@ namespace AWSCore
|
||||
AddSpaceForIcon(subMenu);
|
||||
}
|
||||
|
||||
void AWSCoreEditorMenu::SetAWSGameLiftEnabled()
|
||||
{
|
||||
// TODO: instead of creating submenu in core editor, aws feature gem should return submenu component directly
|
||||
QMenu* subMenu = SetAWSFeatureSubMenu(AWSGameLiftActionText);
|
||||
|
||||
subMenu->addAction(AddExternalLinkAction(AWSGameLiftGemOverviewActionText, AWSGameLiftGemOverviewUrl, ":/Notifications/link.svg"));
|
||||
subMenu->addAction(AddExternalLinkAction(AWSGameLiftGemSetupActionText, AWSGameLiftGemSetupUrl, ":/Notifications/link.svg"));
|
||||
subMenu->addAction(AddExternalLinkAction(AWSMGameLiftScriptingActionText, AWSGameLiftScriptingUrl, ":/Notifications/link.svg"));
|
||||
subMenu->addAction(AddExternalLinkAction(AWSGameLiftAPIReferenceActionText, AWSGameLiftAPIReferenceUrl, ":/Notifications/link.svg"));
|
||||
subMenu->addAction(AddExternalLinkAction(AWSGameLiftAdvancedTopicsActionText, AWSGameLiftAdvancedTopicsUrl, ":/Notifications/link.svg"));
|
||||
subMenu->addAction(AddExternalLinkAction(AWSGameLiftLocalTestingActionText, AWSGameLiftLocalTestingUrl, ":/Notifications/link.svg"));
|
||||
subMenu->addAction(AddExternalLinkAction(AWSGameLiftBuildPackagingActionText, AWSGameLiftBuildPackagingUrl, ":/Notifications/link.svg"));
|
||||
subMenu->addAction(AddExternalLinkAction(AWSGameLiftResourceManagementActionText, AWSGameLiftResourceManagementUrl, ":/Notifications/link.svg"));
|
||||
|
||||
AddSpaceForIcon(subMenu);
|
||||
}
|
||||
|
||||
void AWSCoreEditorMenu::SetAWSMetricsEnabled()
|
||||
{
|
||||
// TODO: instead of creating submenu in core editor, aws feature gem should return submenu component directly
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
|
||||
using namespace AWSCore;
|
||||
|
||||
static constexpr const int ExpectedActionNumOnWindowsPlatform = 8;
|
||||
static constexpr const int ExpectedActionNumOnOtherPlatform = 6;
|
||||
static constexpr const int ExpectedActionNumOnWindowsPlatform = 9;
|
||||
static constexpr const int ExpectedActionNumOnOtherPlatform = 7;
|
||||
|
||||
class AWSCoreEditorMenuTest
|
||||
: public AWSCoreFixture
|
||||
@@ -60,6 +60,7 @@ TEST_F(AWSCoreEditorMenuTest, AWSCoreEditorMenu_BroadcastFeatureGemsAreEnabled_C
|
||||
|
||||
AWSCoreEditorRequestBus::Broadcast(&AWSCoreEditorRequests::SetAWSClientAuthEnabled);
|
||||
AWSCoreEditorRequestBus::Broadcast(&AWSCoreEditorRequests::SetAWSMetricsEnabled);
|
||||
AWSCoreEditorRequestBus::Broadcast(&AWSCoreEditorRequests::SetAWSGameLiftEnabled);
|
||||
|
||||
QList<QAction*> actualActions = testMenu.actions();
|
||||
for (QList<QAction*>::iterator itr = actualActions.begin(); itr != actualActions.end(); itr++)
|
||||
@@ -73,5 +74,10 @@ TEST_F(AWSCoreEditorMenuTest, AWSCoreEditorMenu_BroadcastFeatureGemsAreEnabled_C
|
||||
{
|
||||
EXPECT_TRUE((*itr)->isEnabled());
|
||||
}
|
||||
|
||||
if (QString::compare((*itr)->text(), AWSGameLiftActionText) == 0)
|
||||
{
|
||||
EXPECT_TRUE((*itr)->isEnabled());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <AzFramework/Session/SessionConfig.h>
|
||||
|
||||
#include <AWSGameLiftClientLocalTicketTracker.h>
|
||||
#include <AWSCoreBus.h>
|
||||
#include <AWSGameLiftClientManager.h>
|
||||
#include <AWSGameLiftClientSystemComponent.h>
|
||||
#include <Request/AWSGameLiftAcceptMatchRequest.h>
|
||||
@@ -105,6 +106,8 @@ namespace AWSGameLift
|
||||
m_gameliftClient.reset();
|
||||
m_gameliftManager->ActivateManager();
|
||||
m_gameliftTicketTracker->ActivateTracker();
|
||||
|
||||
AWSCore::AWSCoreEditorRequestBus::Broadcast(&AWSCore::AWSCoreEditorRequests::SetAWSGameLiftEnabled);
|
||||
}
|
||||
|
||||
void AWSGameLiftClientSystemComponent::Deactivate()
|
||||
|
||||
Reference in New Issue
Block a user