Module |
|
Header |
/Engine/Source/Editor/PluginWarden/Public/IPluginWardenModule.h |
Include |
#include "IPluginWardenModule.h" |
void CheckEntitlementForPlugin
(
const FText & PluginFriendlyName,
const FString & PluginItemId,
const FString & PluginOfferId,
const EEntitlementCacheLevelRequest CacheLevel,
const FText & UnauthorizedMessageOverride,
EUnauthorizedErrorHandling UnauthorizedErrorHandling,
TFunction< void()> AuthorizedCallback
)
Ask the Unreal Engine Launcher if the user has authorization to use the given plug-in. The authorized callback will only be called if the user is authorized to use the plug-in.
WARNING ### WARNING ### WARNING ### WARNING ### WARNING
Do not gate the user in inline custom plug-in UI, like inside a customization in the details panel. Only use this to gate the user from opening a dialog or some other big explicit action that opens up into UI that is exclusively the domain of your plug-in. An example of a good place to use this would be inside of OpenAssetEditor(), in your derived version of FAssetTypeActions_Base for the custom assets your plug-in handles.
WARNING ### WARNING ### WARNING ### WARNING ### WARNING
IPluginWardenModule::Get().CheckEntitlementForPlugin(LOCTEXT("AwesomePluginName", "My Awesome Plugin"), TEXT("PLUGIN_MARKETPLACE_GUID"), [&] () { // Code Here Will Run If Authorized });
Parameter |
Description |
---|---|
PluginFriendlyName |
The localized friendly name of the plug-in. |
PluginItemId |
The unique identifier of the item plug-in on the marketplace. |
PluginOfferId |
The unique identifier of the offer for the plug-in on the marketplace. |
CacheLevel |
Where to check for the entitlements. Defaults to memory. |
UnauthorizedMessageOverride |
The error message to display for unauthorized plugins, overriding the default message if not empty. |
UnauthorizedErrorHandling |
How to handle the unauthorized error. |
AuthorizedCallback |
This function will be called after the user has been given entitlement. |