本文整理汇总了C++中TSharedPtr::ApplicationLicenseValid方法的典型用法代码示例。如果您正苦于以下问题:C++ TSharedPtr::ApplicationLicenseValid方法的具体用法?C++ TSharedPtr::ApplicationLicenseValid怎么用?C++ TSharedPtr::ApplicationLicenseValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSharedPtr
的用法示例。
在下文中一共展示了TSharedPtr::ApplicationLicenseValid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnKeyDown
virtual FReply OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override
{
const FKey Key = InKeyEvent.GetKey();
if (Key == EKeys::Enter)
{
MenuOwner->HandleLoginUIClosed(TSharedPtr<const FUniqueNetId>(), 0);
}
else if (!MenuOwner->GetControlsLocked() && Key == EKeys::Gamepad_FaceButton_Bottom)
{
bool bSkipToMainMenu = true;
{
const auto OnlineSub = IOnlineSubsystem::Get();
if (OnlineSub)
{
const auto IdentityInterface = OnlineSub->GetIdentityInterface();
if (IdentityInterface.IsValid())
{
TSharedPtr<GenericApplication> GenericApplication = FSlateApplication::Get().GetPlatformApplication();
const bool bIsLicensed = GenericApplication->ApplicationLicenseValid();
const auto LoginStatus = IdentityInterface->GetLoginStatus(InKeyEvent.GetUserIndex());
if (LoginStatus == ELoginStatus::NotLoggedIn || !bIsLicensed)
{
// Show the account picker.
const auto ExternalUI = OnlineSub->GetExternalUIInterface();
if (ExternalUI.IsValid())
{
ExternalUI->ShowLoginUI(InKeyEvent.GetUserIndex(), false, IOnlineExternalUI::FOnLoginUIClosedDelegate::CreateSP(MenuOwner, &FShooterWelcomeMenu::HandleLoginUIClosed));
bSkipToMainMenu = false;
}
}
}
}
}
if (bSkipToMainMenu)
{
const auto OnlineSub = IOnlineSubsystem::Get();
if (OnlineSub)
{
const auto IdentityInterface = OnlineSub->GetIdentityInterface();
if (IdentityInterface.IsValid())
{
TSharedPtr<const FUniqueNetId> UserId = IdentityInterface->GetUniquePlayerId(InKeyEvent.GetUserIndex());
// If we couldn't show the external login UI for any reason, or if the user is
// already logged in, just advance to the main menu immediately.
MenuOwner->HandleLoginUIClosed(UserId, InKeyEvent.GetUserIndex());
}
}
}
return FReply::Handled();
}
return FReply::Unhandled();
}
示例2: HandleAppLicenseUpdate
void UAmethystGameInstance::HandleAppLicenseUpdate()
{
TSharedPtr<GenericApplication> GenericApplication = FSlateApplication::Get().GetPlatformApplication();
bIsLicensed = GenericApplication->ApplicationLicenseValid();
}