本文整理汇总了C++中IDesktopPlatform::OpenLauncher方法的典型用法代码示例。如果您正苦于以下问题:C++ IDesktopPlatform::OpenLauncher方法的具体用法?C++ IDesktopPlatform::OpenLauncher怎么用?C++ IDesktopPlatform::OpenLauncher使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDesktopPlatform
的用法示例。
在下文中一共展示了IDesktopPlatform::OpenLauncher方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowStorePageForPlugin
void SAuthorizingPlugin::ShowStorePageForPlugin()
{
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
if ( DesktopPlatform != nullptr )
{
FOpenLauncherOptions StorePageOpen(FString(TEXT("/ue/marketplace/content/")) + PluginOfferId);
DesktopPlatform->OpenLauncher(StorePageOpen);
}
}
示例2: SubmitAndRestart
FReply FCrashReportClient::SubmitAndRestart()
{
Submit();
// Check for processes that were started from the Launcher using -EpicPortal on the command line
bool bRunFromLauncher = FParse::Param(*FPrimaryCrashProperties::Get()->RestartCommandLine, TEXT("EPICPORTAL"));
const FString CrashedAppPath = ErrorReport.FindCrashedAppPath();
bool bLauncherRestarted = false;
if (bRunFromLauncher)
{
// We'll restart Launcher-run processes by having the installed Launcher handle it
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
if (DesktopPlatform != nullptr)
{
// Split the path so we can format it as a URI
TArray<FString> PathArray;
CrashedAppPath.Replace(TEXT("//"), TEXT("/")).ParseIntoArray(PathArray, TEXT("/"), false); // WER saves this out on Windows with double slashes as the separator for some reason.
FString CrashedAppPathUri;
// Exclude the last item (the filename). The Launcher currently expects an installed application folder.
for (int32 ItemIndex = 0; ItemIndex < PathArray.Num() - 1; ItemIndex++)
{
FString& PathItem = PathArray[ItemIndex];
CrashedAppPathUri += FPlatformHttp::UrlEncode(PathItem);
CrashedAppPathUri += TEXT("/");
}
CrashedAppPathUri.RemoveAt(CrashedAppPathUri.Len() - 1);
// Re-run the application via the Launcher
FOpenLauncherOptions OpenOptions(FString::Printf(TEXT("apps/%s"), *CrashedAppPathUri));
OpenOptions.bSilent = true;
if (DesktopPlatform->OpenLauncher(OpenOptions))
{
bLauncherRestarted = true;
}
}
}
if (!bLauncherRestarted)
{
// Launcher didn't restart the process so start it ourselves
const FString CommandLineArguments = FPrimaryCrashProperties::Get()->RestartCommandLine;
FPlatformProcess::CreateProc(*CrashedAppPath, *CommandLineArguments, true, false, false, NULL, 0, NULL, NULL);
}
return FReply::Handled();
}
示例3: RunLauncher
virtual bool RunLauncher(ELauncherAction Action) const override
{
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
if (DesktopPlatform != nullptr)
{
// Construct a url to tell the launcher of this app and what we want to do with it
FOpenLauncherOptions LauncherOptions;
LauncherOptions.LauncherRelativeUrl = TEXT("apps");
LauncherOptions.LauncherRelativeUrl /= GetEncodedExePath();
switch (Action)
{
case ELauncherAction::AppLaunch:
LauncherOptions.LauncherRelativeUrl += TEXT("?action=launch");
break;
case ELauncherAction::AppUpdateCheck:
LauncherOptions.LauncherRelativeUrl += TEXT("?action=updatecheck");
break;
};
return DesktopPlatform->OpenLauncher(LauncherOptions);
}
return false;
}
示例4: RefreshStatus
EActiveTimerReturnType SAuthorizingPlugin::RefreshStatus(double InCurrentTime, float InDeltaTime)
{
// Engine tick isn't running when the modal window is open, so we need to tick any core tickers
// to as that's what the RPC system uses to update the current state of RPC calls.
FTaskGraphInterface::Get().ProcessThreadUntilIdle(ENamedThreads::GameThread);
FTicker::GetCoreTicker().Tick(InDeltaTime);
switch ( CurrentState )
{
case EPluginAuthorizationState::Initializing:
{
WaitingTime = 0;
if ( PortalWindowService->IsAvailable() && PortalUserService->IsAvailable() )
{
CurrentState = EPluginAuthorizationState::AuthorizePlugin;
}
else
{
CurrentState = EPluginAuthorizationState::StartLauncher;
}
break;
}
case EPluginAuthorizationState::StartLauncher:
{
WaitingTime = 0;
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
if ( DesktopPlatform != nullptr )
{
if ( !FPlatformProcess::IsApplicationRunning(TEXT("EpicGamesLauncher")) &&
!FPlatformProcess::IsApplicationRunning(TEXT("EpicGamesLauncher-Mac-Shipping")) )
{
FOpenLauncherOptions SilentOpen;
if ( DesktopPlatform->OpenLauncher(SilentOpen) )
{
CurrentState = EPluginAuthorizationState::StartLauncher_Waiting;
}
else
{
CurrentState = EPluginAuthorizationState::LauncherStartFailed;
}
}
else
{
// If the process is found to be running already, move into the next state.
CurrentState = EPluginAuthorizationState::StartLauncher_Waiting;
}
}
else
{
CurrentState = EPluginAuthorizationState::LauncherStartFailed;
}
break;
}
case EPluginAuthorizationState::StartLauncher_Waiting:
{
if ( PortalWindowService->IsAvailable() && PortalUserService->IsAvailable() )
{
CurrentState = EPluginAuthorizationState::AuthorizePlugin;
}
else
{
WaitingTime += InDeltaTime;
}
break;
}
case EPluginAuthorizationState::AuthorizePlugin:
{
WaitingTime = 0;
EntitlementResult = PortalUserService->IsEntitledToItem(PluginItemId, EEntitlementCacheLevelRequest::Memory);
CurrentState = EPluginAuthorizationState::AuthorizePlugin_Waiting;
break;
}
case EPluginAuthorizationState::AuthorizePlugin_Waiting:
{
WaitingTime += InDeltaTime;
check(EntitlementResult.GetFuture().IsValid());
if ( EntitlementResult.GetFuture().IsReady() )
{
FPortalUserIsEntitledToItemResult Entitlement = EntitlementResult.GetFuture().Get();
if ( Entitlement.IsEntitled )
{
CurrentState = EPluginAuthorizationState::Authorized;
}
else
{
CurrentState = EPluginAuthorizationState::IsUserSignedIn;
}
}
break;
}
case EPluginAuthorizationState::IsUserSignedIn:
{
WaitingTime = 0;
UserDetailsResult = PortalUserService->GetUserDetails();
CurrentState = EPluginAuthorizationState::IsUserSignedIn_Waiting;
break;
}
//.........这里部分代码省略.........