std::pair SDeployScenarioSection::HandleDeployButtonState()

in GameLiftPlugin/Source/GameLiftPlugin/Private/SMenu/EC2/SDeployScenarioSection.cpp [156:187]


std::pair<bool, FText> SDeployScenarioSection::HandleDeployButtonState()
{
	if (AsSDeploymentFieldsRef(DeploymentFields)->GetBuildName().IsEmptyOrWhitespace())
	{
		return { false, Menu::DeployManagedEC2::kDeploymentDisabledBuildNameEmptyTooltip };
	}

	if (AsSDeploymentFieldsRef(DeploymentFields)->GetBuildName().ToString().Len() > Menu::DeployManagedEC2::kMaxGameNameLength)
	{
		return { false, Menu::DeployManagedEC2::kDeploymentDisabledBuildNameTooLongTooltip };
	}

	if (AsSDeploymentFieldsRef(DeploymentFields)->GetBuildFilePath().IsEmptyOrWhitespace() || AsSDeploymentFieldsRef(DeploymentFields)->GetBuildFolderPath().IsEmptyOrWhitespace())
	{
		return { false, Menu::DeployManagedEC2::kDeploymentDisabledServerBuildPathNotSetTooltip };
	}

	bool IsDeploymentInProgress = AsSDeploymentStatusRef(DeploymentStatus)->GetCurrentState() == EDeploymentMessageState::InProgressMessage;
	if (IsDeploymentInProgress)
	{
		return { false, Menu::DeployManagedEC2::kDeploymentDisabledAlreadyActiveTooltip };
	}

	auto* Settings = GetMutableDefault<UGameLiftSettings>();
	bool IsBootstrapped = EBootstrapMessageStateFromInt(Settings->BootstrapStatus) == EBootstrapMessageState::ActiveMessage;
	if (!IsBootstrapped)
	{
		return { false, Menu::DeployCommon::kDeploymentDisabledNeedBootstrapTooltip };
	}

	return { true, Menu::DeployCommon::kDeploymentEnabledTooltip };
}