diff --git a/Config/Defaultmodio.ini b/Config/Defaultmodio.ini index f185736..d13f503 100644 --- a/Config/Defaultmodio.ini +++ b/Config/Defaultmodio.ini @@ -3,4 +3,7 @@ +PropertyRedirects=(OldName="/Script/ModioUI5.ModioCommonUISettings.FeaturedAdditionalParams",NewName="/Script/ModioUI5.ModioCommonUISettings.FeaturedParams") +PackageRedirects=(OldName="/Script/ModioUI5", NewName="/Script/ModioUI") +FunctionRedirects=(OldName="/Script/ModioUICore.ModioUISubsystem.ExecuteOnModBrowserClosedDelegate",NewName="/Script/ModioUICore.ModioUISubsystem.ExecuteOnModBrowserCloseRequestedDelegate") -+PropertyRedirects=(OldName="ModioUISubsystem.ShowModBrowserUIForPlayer.BrowserClosedDelegate",NewName="OnModBrowserCloseRequestedDelegate") \ No newline at end of file ++PropertyRedirects=(OldName="ModioUISubsystem.ShowModBrowserUIForPlayer.BrowserClosedDelegate",NewName="OnModBrowserCloseRequestedDelegate") ++ClassRedirects=(OldName="/Script/Modio.ModioMapPreview",NewName="/Script/Modio.ModioModChangeMap") ++ClassRedirects=(OldName="/Script/Modio.ModioOptionalMapPreview",NewName="/Script/Modio.ModioOptionalModChangeMap") + diff --git a/Content/Data/ST_ModioStaticLocData.uasset b/Content/Data/ST_ModioStaticLocData.uasset new file mode 100644 index 0000000..b51f032 Binary files /dev/null and b/Content/Data/ST_ModioStaticLocData.uasset differ diff --git a/Content/ST_ModioStaticLocData.uasset b/Content/ST_ModioStaticLocData.uasset new file mode 100644 index 0000000..5913a5a Binary files /dev/null and b/Content/ST_ModioStaticLocData.uasset differ diff --git a/Doc/documentation.html b/Doc/documentation.html index 4934642..538e41e 100644 --- a/Doc/documentation.html +++ b/Doc/documentation.html @@ -838,6 +838,19 @@

mod.io Unreal Engine Plugin Documentation

  • Installing Temporary Mods
  • + + +
  • Plugin quick-start: Monetization +
  • Enums @@ -1706,6 +1732,7 @@

    mod.io Unreal Engine Plugin Documentation

  • EModioLogLevel
  • EModioLanguage
  • EModioModChangeType
  • +
  • EFileSizeUnit
  • EModioErrorCondition
  • EModioSortFieldType
  • EModioSortDirection
  • @@ -1715,10 +1742,6 @@

    mod.io Unreal Engine Plugin Documentation

  • EModioModProgressState
  • EModioRating
  • EModioReportType
  • -
  • EFileSizeUnit
  • -
  • EModioCommonDialogButtonType
  • -
  • EModioCommonSearchViewType
  • -
  • EModioCommonRichTextStyleTextImageOrder
  • EModioUIAsyncOperationWidgetState
  • EModioUIMediaDownloadEventType
  • EModioUIModInfoEventType
  • @@ -1726,6 +1749,9 @@

    mod.io Unreal Engine Plugin Documentation

  • EModioQueuedFilterType
  • EModioInstalledFilterType
  • EModioManualSortType
  • +
  • EModioCommonDialogButtonType
  • +
  • EModioCommonSearchViewType
  • +
  • EModioCommonRichTextStyleTextImageOrder
  • @@ -2107,7 +2133,7 @@

    Plugin quick-start: Ini
    -

    When you are ready to initialize the plugin for the current user, you’ll need to call InitializeAsync, passing in an instance of FModioInitializeOptions, and a delegate so you know when the plugin is initialized correctly. Here, you can specify your Game ID, API Key, Environment, and Portal. You can get the default portal for the current platform using Get Default Portal for Current Platform function.

    +

    When you are ready to initialize the plugin for the current user, you’ll need to call InitializeAsync, passing in an instance of FModioInitializeOptions, and a delegate so you know when the plugin is initialized correctly. Here, you can specify your Game ID, API Key, Environment, and Portal. You can get the default portal for the current platform using Get Default Portal for Current Platform function.

    @@ -2358,7 +2384,7 @@

    SSO/External authentication

    Nintendo Switch

  • -

    PlayStation™ Network

    +

    PlayStation™Network

  • Steam

    @@ -2367,12 +2393,15 @@

    SSO/External authentication

    Xbox Live

  • +

    Oculus

    +
  • +
  • OpenID

  • -

    Please note that the ability to authenticate players using OpenID is feature for advanced partners only. If you are interested in becoming an advanced partner, please contact developers@mod.io

    +

    Please note that the ability to authenticate players using OpenID is a premium feature. If you are interested in mod.io premium features, please contact developers@mod.io.

    To use SSO with mod.io, a user must have accepted the mod.io Terms of Use in order to create an account.

    @@ -3317,6 +3346,212 @@

    Installing Temporary Mods

    + + +
    +

    Plugin quick-start: Monetization

    +
    +
    +

    The Mod.io Unreal Engine Plugin supports a range of Monetization features, allowing you to sell a per-game virtual currency to your players that they can use to purchase mods, with a share of the revenue split between creators and your studio. Visit here for an overview of the mod.io monetization system.

    +
    +
    +

    Every platform requires specific setup for monetization features to work, with regards to the virtual currency configuration and API calls, however the following documentation is generically applicable, with only small differences per-platform that are documented within the platform-specific monetization documentation.

    +
    +
    +

    Initialization

    +
    +

    The mod.io monetization features are enabled as part of the onboarding process on your game profile. Once that is setup, there is nothing further you need to do for initialization in the Plugin.

    +
    +
    +

    Ensure that you have set the appropriate Portal when initializing the SDK for the portal you are using for purchasing - for instance, on Steam, you must initialize with Modio::Portal::Steam in order to redeem entitlements for Steam.

    +
    +
    +
    +

    Getting the user’s wallet

    +
    +

    On startup, you can make a call to UModioSubsystem::GetUserWalletBalanceAsync to get the balance of the current user’s wallet. If no wallet exists for the user, one will be created for them automatically. This call returns the users wallet balance for the current game. The only time you need to make this call is on startup.

    +
    +
    +

    We recommend that you cache the value of this result in your game code rather than making consistent calls to UModioSubsystem::GetUserWalletBalanceAsync and update your local state from the return values of other calls that affect wallet balance.

    +
    +
    +Blueprint Example +
    +
    +
    +get user wallet +
    +
    +
    +
    +
    +C++ Example +
    +
    +
    +
    void UModioManager::GetUserWallet()
    +{
    +	if (GEngine->GetEngineSubsystem<UModioSubsystem>())
    +	{
    +		GEngine->GetEngineSubsystem<UModioSubsystem>()->GetUserWalletBalanceAsync(FOnGetUserWalletBalanceDelegate::CreateUObject(this, &UModioManager::OnGetUserWalletCallback));
    +	}
    +}
    +
    +void UModioManager::OnGetUserWalletCallback(FModioErrorCode ErrorCode, FModioOptionalUInt64 WalletBalance)
    +{
    +	if (ErrorCode == false)
    +	{
    +		// Wallet Balance Successfully Retrieved
    +	}
    +}
    +
    +
    +
    +
    +
    +
    +

    Querying & Purchasing Mods

    +
    +

    As part UModioSubsystem::ListAllModsAsync, you can include an additional filter for whether you list paid mods. By default, only free mods are shown, but you can set RevenueType on the [ModioFilterParams](#ModioFilterParams) object passed to UModioSubsystem::ListAllModsAsync to include free and paid content, or just paid content. All mods returned will have a Price property, indicating the virtual currency price that must be paid in order to purchase.

    +
    +
    +

    Currently filtering for Paid/Unpaid content is not exposed to Blueprint.

    +
    +
    +

    Purchasing Mods

    +
    +

    You can call UModioSubsystem::PurchaseModAsync to purchase a given mod. PurchaseModAsync takes two parameters = the ModID of the mod to purchase, and the ExpectedPrice, which is the price displayed to the user from UModioSubsystem::ListAllModsAsync. You must include this parameter for safety, so the user is not charged more or less than the price displayed to them in case the price of the mod has changed between the call to ListAllModsAsync and purchase time.

    +
    +
    +

    Once a mod is purchased, it is automatically subscribed to for the user.

    +
    +
    +

    You should validate that the user has enough virtual currency to make the purchase by comparing it to the balance you received from UModioSubsystem::GetUserWalletBalanceAsync. Note this is purely for user experience (ie for graying out the purchase button in the UI, or upselling the user a virtual currenct pack), and UModioSubsystem::PurchaseModAsync will return an error if the user does not have enough in their wallet.

    +
    +
    +

    The updated wallet balance after the purchase amount is subtracted is returned in the callback of UModioSubsystem::PurchaseModAsync.

    +
    +
    +Blueprint Example +
    +
    +
    +purchase mod +
    +
    +
    +
    +
    +C++ Example +
    +
    +
    +
    void UModioManager::PurchaseMod(FModioModID ModId, FModioUnsigned64 ExpectedPrice)
    +{
    +	if (GEngine->GetEngineSubsystem<UModioSubsystem>())
    +	{
    +		GEngine->GetEngineSubsystem<UModioSubsystem>()->PurchaseModAsync(ModId, ExpectedPrice, FOnPurchaseModDelegate::CreateUObject(this, &UModioManager::OnPurchaseModCallback));
    +	}
    +}
    +
    +void UModioManager::OnPurchaseModCallback(FModioErrorCode ErrorCode, FModioOptionalTransactionRecord Transaction)
    +{
    +	if (ErrorCode == false)
    +	{
    +		// Mod Purchase Successful
    +	}
    +}
    +
    +
    +
    +
    +
    +
    +
    +

    Showing user purchases

    +
    +

    Even though all purchased mods are automatically subscribed, the user can still unsubscribe from them and uninstall them; however, they still remain owned and purchased by the user. They must re-subscribe to the mod in order to have it installed. This is facilitated by UModioSubsystem::FetchUserPurchasesAsync, which will fetch a list of a users purchased mods. After a successful call, you can then display them with UModioSubsystem::QueryUserPurchasedMods, allowing re-subscription if necessary.

    +
    +
    +Blueprint Example +
    +
    +
    +show user purchases +
    +
    +
    +
    +
    +C++ Example +
    +
    +
    +
    void UModioManager::FetchUserPurchases()
    +{
    +	if (GEngine->GetEngineSubsystem<UModioSubsystem>())
    +	{
    +		GEngine->GetEngineSubsystem<UModioSubsystem>()->FetchUserPurchasesAsync(FOnFetchUserPurchasesDelegate::CreateUObject(this, &UModioManager::OnFetchUserPurchasesCallback));
    +	}
    +}
    +
    +void UModioManager::OnFetchUserPurchasesCallback(FModioErrorCode ErrorCode)
    +{
    +	if (ErrorCode == false)
    +	{
    +		// Purchases Successfully Fetched
    +		if (GEngine->GetEngineSubsystem<UModioSubsystem>())
    +		{
    +			// We can now access the list of purchased mods directly
    +			TMap<FModioModID, FModioModInfo> PurchasedMods = GEngine->GetEngineSubsystem<UModioSubsystem>()->QueryUserPurchasedMods();
    +		}
    +	}
    +}
    +
    +
    +
    +
    +
    +
    +

    Getting a User Delegation Token

    +
    +

    User Delegation Tokens can be used by a backend server for S2S (Server to Server) transactions/functionality. You can get one for the current user by calling UModioSubsystem::GetUserDelegationTokenAsync, the callback for which contains the Token as a FString.

    +
    +
    +Blueprint Example +
    +
    +
    +get user delegation token +
    +
    +
    +
    +
    +C++ Example +
    +
    +
    +
    void UModioManager::GetUserDelegationToken()
    +{
    +	if (GEngine->GetEngineSubsystem<UModioSubsystem>())
    +	{
    +		GEngine->GetEngineSubsystem<UModioSubsystem>()->GetUserDelegationTokenAsync(FOnGetUserDelegationTokenDelegateFast::CreateUObject(this, &UModioManager::OnGetUserDelegationTokenCallback));
    +	}
    +}
    +
    +void UModioManager::OnGetUserDelegationTokenCallback(FModioErrorCode ErrorCode, FString UserDelegationToken)
    +{
    +	if (ErrorCode == false)
    +	{
    +		// Successfully got User Delegation Token
    +	}
    +}
    +
    +
    +
    +
    +

    How to Set Up Common UI for Project to Use Mod.io UE5 UI

    @@ -10824,7 +11059,7 @@
    Parameters

    Locale

    - +

    Language to set

    @@ -11788,19 +12023,19 @@
    Error Values

    -

    GetUserDerivedTokenAsync

    +

    GetUserDelegationTokenAsync

    -nd img K2 GetUserDerivedTokenAsync +nd img K2 GetUserDelegationTokenAsync
    -
    void K2_GetUserDerivedTokenAsync(FOnGetUserDerivedTokenDelegate Callback)
    +
    void K2_GetUserDelegationTokenAsync(FOnGetUserDelegationTokenDelegate Callback)
    -

    Get a User Derived Token that can be used for S2S service calls

    +

    Get a User Delegation Token that can be used for S2S service calls

    Requirements
    @@ -12475,6 +12710,44 @@
    Parameters

    +

    GetLanguage

    +
    +
    +nd img K2 GetLanguage +
    +
    +
    +
    +
    EModioLanguage K2_GetLanguage()
    +
    +
    +
    +

    Get the currently applied language

    +
    +
    Parameters
    + ++++ + + + + + + + + + + +

    Target

    Modio Subsystem Object Reference

    Return Value

    Current language

    +
    Returns
    +
    +

    Current language

    +
    +
    +
    +

    GetGameInfoAsync

    @@ -12500,7 +12773,7 @@
    Requirements
    -
    Parameters
    +
    Parameters
    @@ -12563,7 +12836,7 @@

    ForceUninstallModAsync

    Forcibly uninstalls a mod from the system. This can be used when the host application requires additional space for other mods. The current user must not be subscribed to the mod to force uninstall. To remove a mod the current user is subscribed to, first use UnsubscribeFromModAsync. If the mod does not uninstall (due to a different user on the same system remaining subscribed), ForceUninstallModAsync can be called next.

    -
    Parameters
    +
    Parameters
    @@ -12640,7 +12913,7 @@
    Requirements
    -
    Parameters
    +
    Parameters
    @@ -12674,7 +12947,7 @@

    FetchExternalUpdatesAsync

    Synchronises the local list of the current user’s subscribed mods with the server. Any mods that have been externally subscribed will be automatically marked for installation, and mods that have been externally removed from the user’s subscriptions may be uninstalled if no other local users have a current subscription.

    -
    Parameters
    +
    Parameters
    @@ -12708,7 +12981,7 @@

    EnableModManagement

    Enables the automatic management of installed mods on the system based on the user’s subscriptions.

    -
    Parameters
    +
    Parameters
    @@ -12760,7 +13033,7 @@
    Requirements
    -
    Parameters
    +
    Parameters
    @@ -12777,7 +13050,7 @@
    Parameters
    -
    Returns
    +
    Returns

    Error code indicating the status of the TempModSet. Will be empty if it was successful

    @@ -12833,7 +13106,7 @@
    Requirements
    -
    Parameters
    +
    Parameters
    @@ -12898,7 +13171,7 @@
    Requirements
    -
    Parameters
    +
    Parameters
    @@ -12975,7 +13248,7 @@
    Requirements
    -
    Parameters
    +
    Parameters
    @@ -13048,7 +13321,7 @@
    Requirements
    -
    Parameters
    +
    Parameters
    @@ -13129,7 +13402,7 @@
    Requirements
    -
    Parameters
    +
    Parameters
    @@ -13150,7 +13423,7 @@
    Parameters
    -
    Returns
    +
    Returns

    Error code indicating the status of the TempModSet. Will be empty if it was successful

    @@ -13206,7 +13479,7 @@

    Is Mod Management Busy

    Checks if the automatic management process is currently installing or removing mods

    -
    Parameters
    +
    Parameters
    @@ -13223,7 +13496,7 @@
    Parameters
    -
    Returns
    +
    Returns

    True if automatic management is currently performing an operation

    @@ -13252,7 +13525,7 @@
    Requirements
    -
    Parameters
    +
    Parameters
    @@ -13269,7 +13542,7 @@
    Parameters
    -
    Returns
    +
    Returns

    Collection of FModioValidationError objects, or empty collection if there were no validation failures

    @@ -13290,7 +13563,7 @@

    Disable Mod Management

    Disables automatic installation or uninstallation of mods based on the user’s subscriptions. Allows currently processing installation to complete; will cancel any pending operations when called.

    -
    Parameters
    +
    Parameters
    @@ -13321,7 +13594,7 @@

    Get Tag Categories for UI

    TArray<UModioTagInfoUI*> GetTagCategoriesForUI()
    -
    Parameters
    +
    Parameters
    @@ -13338,7 +13611,7 @@
    Parameters
    -
    Returns
    +
    Returns

    Array with its corresponding info tags

    @@ -13409,7 +13682,7 @@

    Set Operation State Delegate

    Call this to pass in a delegate that will receive operation state change notifications

    -
    Parameters
    +
    Parameters
    @@ -13443,7 +13716,7 @@

    Request Operation Retry

    Call this to request that the underlying widget retry the async operation

    -
    Parameters
    +
    Parameters
    @@ -13491,7 +13764,7 @@

    Set Retry Requested Delegate

    Call this to pass in a delegate that will receive operation state change notifications

    -
    Parameters
    +
    Parameters
    @@ -13582,7 +13855,7 @@

    Configure

    void Configure(FModioNotificationParams Params)
    -
    Parameters
    +
    Parameters
    @@ -13634,7 +13907,7 @@

    Display Notification Params

    Function to display an error code notification widget

    -
    Parameters
    +
    Parameters
    @@ -13682,7 +13955,7 @@

    Display Notification

    Function to display an arbitrary notification widget that the caller has already configured

    -
    Parameters
    +
    Parameters
    @@ -13927,7 +14200,7 @@

    Prioritize Transfer for Mod

    void PrioritizeTransferForMod(FModioModID ModToPrioritize)
    -
    Parameters
    +
    Parameters
    @@ -14924,6 +15197,11 @@

    Variables

    + + + + + @@ -15082,7 +15360,7 @@

    ModioOptionalUserList


    -

    ModioOptionalMapPreview

    +

    ModioOptionalModChangeMap


    @@ -15206,7 +15484,7 @@

    ModioEditModParams


    -

    ModioImageWrapper

    +

    ModioPresetFilterParams

    Variables

    Size of the file in bytes.

    int64

    FilesizeUncompressed

    Total size of all files in the mod after installation.

    FString

    Filename

    Filename including extension.

    @@ -15216,6 +15494,50 @@

    Variables

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    FText

    PresetName

    TArray<FString>

    Tags

    TArray<FString>

    ExcludedTags

    EModioSortDirection

    Direction

    EModioSortFieldType

    SortField

    int64

    Count

    +
    +
    +
    +

    ModioImageWrapper

    +

    Variables

    + +++++ + + @@ -15226,7 +15548,7 @@

    Variables

    ModioInitializeOptions

    -

    Variables

    +

    Variables

    FString

    ImagePath

    @@ -15269,6 +15591,25 @@

    Variables


    +

    ModioModChangeMap

    +

    Variables

    +
    +++++ + + + + + + + +

    TMap<FModioModID,EModioModChangeType>

    Changes

    +
    +
    +

    ModioModCollectionEntry


    @@ -15290,7 +15631,7 @@

    ModioModDependency

    -

    Variables

    +

    Variables

    @@ -15308,6 +15649,41 @@

    Variables

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    ModName

    FDateTime

    DateAdded

    FDateTime

    DateUpdated

    uint8

    DependencyDepth

    FModioLogo

    Logo

    FModioFileMetadata

    FileInfo

    EModioModServerSideStatus

    Status

    EModioObjectVisibilityFlags

    Visibility


    @@ -15326,7 +15702,7 @@

    ModioModDependencyList

    -

    Variables

    +

    Variables

    @@ -15344,17 +15720,23 @@

    Variables

    + + + + + + + + + +

    InternalList

    int64

    TotalFilesize

    int64

    TotalFilesizeUncompressed


    -

    ModioMapPreview

    -
    -
    -

    ModioModProgressInfo

    -

    Variables

    +

    Variables

    @@ -15381,7 +15763,7 @@

    ModioReportParams

    -

    Variables

    +

    Variables

    @@ -15410,7 +15792,7 @@

    Variables

    ModioTerms

    -

    Variables

    +

    Variables

    @@ -15448,13 +15830,18 @@

    Variables

    + + + + +

    ManageLink

    Link to the mod.io Manage User Account page

    FString

    TermsText

    The plaintext version of the mod.io terms of use


    ModioTransactionRecord

    -

    Variables

    +

    Variables

    @@ -15487,7 +15874,7 @@

    ModioOptionalUser

    ModioUserList

    -

    Variables

    +

    Variables

    @@ -15514,7 +15901,7 @@

    ModioValidationError

    Wrapper struct containing information about a field validation error

    -

    Variables

    +

    Variables

    @@ -15537,8 +15924,8 @@

    Variables


    -

    ModioCommonTabDescriptor

    -

    Variables

    +

    ModioCreateModFileMemoryParams

    +

    Variables

    @@ -15547,23 +15934,37 @@

    Variables

    - - + + + +

    FName

    TabId

    TArray<uint8>

    ModMemory

    +
    +
    +
    +

    ModioNotificationParams

    +

    Variables

    + +++++ + - - + + - - + + - - + + @@ -15571,28 +15972,8 @@

    Variables


    -

    ModioCommonAuthParamsSettings

    -
    -
    -
    -

    ModioCommonEmailAuthCodeParamsSettings

    -
    -
    -
    -

    ModioCommonEmailAuthLoadingParamsSettings

    -
    -
    -
    -

    ModioCommonEmailAuthParamsSettings

    -
    -
    -
    -

    ModioCommonTermsOfUseParamsSettings

    -
    -
    -
    -

    ModioCommonCodeInputTextBoxInputStyle

    -

    Variables

    +

    ModioModCategoryParams

    +

    Variables

    FText

    TabText

    FModioErrorCode

    ErrorCode

    TSubclassOf<UModioCommonTabButtonBase>

    TabButtonType

    UObject*

    NotificationContextObject

    TSubclassOf<UModioCommonTabButtonStyle>

    TabButtonStyle

    float

    Duration

    @@ -15601,57 +15982,180 @@

    Variables

    - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + +

    FSlateBrush

    CharacterBorderBrushBase

    FText

    CategoryName

    FSlateBrush

    CharacterBorderBrushFocused

    TArray<FString>

    Tags

    FMargin

    CharacterBorderPadding

    TArray<FString>

    ExcludedTags

    FSlateBrush

    FakeCaretBrush

    EModioSortDirection

    Direction

    TEnumAsByte<EHorizontalAlignment>

    FakeCaretHorizontalAlignment

    EModioSortFieldType

    SortField

    TEnumAsByte<EVerticalAlignment>

    FakeCaretVerticalAlignment

    int64

    Count

    FMargin

    CharacterPadding

    FString

    SearchKeywords

    FMargin

    CharacterSpacing

    EModioInstalledFilterType

    InstalledField

    float

    MinimumCharacterWidth

    EModioQueuedFilterType

    QueuedField

    FText

    HintText

    EModioEnabledFilterType

    EnabledFilter

    FSlateFontInfo

    EModioManualSortType

    ManualSortField

    +
    +
    +
    +

    ModioCommonTabDescriptor

    +

    Variables

    + +++++ + + + + + + + + + + + + + + + + + + + + + + +

    FName

    TabId

    FText

    TabText

    TSubclassOf<UModioCommonTabButtonBase>

    TabButtonType

    TSubclassOf<UModioCommonTabButtonStyle>

    TabButtonStyle

    +
    +
    +
    +

    ModioCommonAuthParamsSettings

    +
    +
    +
    +

    ModioCommonEmailAuthCodeParamsSettings

    +
    +
    +
    +

    ModioCommonEmailAuthLoadingParamsSettings

    +
    +
    +
    +

    ModioCommonEmailAuthParamsSettings

    +
    +
    +
    +

    ModioCommonTermsOfUseParamsSettings

    +
    +
    +
    +

    ModioCommonCodeInputTextBoxInputStyle

    +

    Variables

    + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -15740,123 +16244,7 @@

    ModioCommonSearchParamsSettings

    ModioCommonUserProfileWidgetParamsSettings

    -
    -
    -
    -

    ModioNotificationParams

    -

    Variables

    -

    FSlateBrush

    CharacterBorderBrushBase

    FSlateBrush

    CharacterBorderBrushFocused

    FMargin

    CharacterBorderPadding

    FSlateBrush

    FakeCaretBrush

    TEnumAsByte<EHorizontalAlignment>

    FakeCaretHorizontalAlignment

    TEnumAsByte<EVerticalAlignment>

    FakeCaretVerticalAlignment

    FMargin

    CharacterPadding

    FMargin

    CharacterSpacing

    float

    MinimumCharacterWidth

    FText

    HintText

    FSlateFontInfo

    Font

    ----- - - - - - - - - - - - - - - - - - -

    FModioErrorCode

    ErrorCode

    UObject*

    NotificationContextObject

    float

    Duration

    -
    -
    -
    -

    ModioModCategoryParams

    -

    Variables

    - ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    FText

    CategoryName

    TArray<FString>

    Tags

    TArray<FString>

    ExcludedTags

    EModioSortDirection

    Direction

    EModioSortFieldType

    SortField

    int64

    Count

    FString

    SearchKeywords

    EModioInstalledFilterType

    InstalledField

    EModioQueuedFilterType

    QueuedField

    EModioEnabledFilterType

    EnabledFilter

    EModioManualSortType

    ManualSortField

    -
    -
    -
    -

    ModioCreateModFileMemoryParams

    -

    Variables

    - ----- - - - - - - - -

    TArray<uint8>

    ModMemory

    +
    @@ -15879,7 +16267,7 @@

    Set Session Identifier

    Changes the session identifier for the provided set of initialization options

    -

    Parameters

    +

    Parameters

    @@ -15900,7 +16288,7 @@

    Parameters

    -

    Returns

    +

    Returns

    New Initialization Options object with the session identifier set to the desired value

    @@ -15921,7 +16309,7 @@

    Set Portal

    Changes the portal for the provided set of initialization options

    -

    Parameters

    +

    Parameters

    @@ -15942,7 +16330,7 @@

    Parameters

    -

    Returns

    +

    Returns

    New Initialization Options object with the portal set to the desired value

    @@ -15963,7 +16351,7 @@

    ModioModID != ModioModID

    Compares two ModioModIDs, returning true if not equal

    -

    Parameters

    +

    Parameters

    @@ -16001,7 +16389,7 @@

    Make Initialize Options

    Make initialization options, should only be used in conjunction with InitializeAsync

    -

    Parameters

    +

    Parameters

    @@ -16047,7 +16435,7 @@

    Make Game Id

    Create a game id from a integer, should only be used in conjunction with InitializeAsync

    -

    Parameters

    +

    Parameters

    @@ -16081,7 +16469,7 @@

    Make Entitlement Params

    Create entitlement parameters

    -

    Parameters

    +

    Parameters

    @@ -16115,7 +16503,7 @@

    Make Auth Params

    Creates an AuthenticationParams object

    -

    Parameters

    +

    Parameters

    @@ -16140,7 +16528,7 @@

    Parameters

    -

    Returns

    +

    Returns

    The constructed FModioAuthenticationParams object for use with AuthenticateUserExternalAsync

    @@ -16161,7 +16549,7 @@

    Make Api Key

    Create a ApiKey id from a string, should only be used in conjunction with InitializeAsync

    -

    Parameters

    +

    Parameters

    @@ -16195,7 +16583,7 @@

    Get Raw Value from Mod ID

    Retrieves the raw underlying value from a FModioModID. FModioModIDs are intended as opaque types, so use with care.

    -

    Parameters

    +

    Parameters

    @@ -16212,7 +16600,7 @@

    Parameters

    -

    Returns

    +

    Returns

    The underlying value

    @@ -16233,7 +16621,7 @@

    ModioModID == ModioModID

    Compares two ModioModIDs, returning true if equal

    -

    Parameters

    +

    Parameters

    @@ -16335,78 +16723,271 @@

    Set Mark as Active Release

    -
    void SetMarkAsActiveRelease(FModioCreateModFileParams In, bool bMarkAsActiveRelease)
    +
    void SetMarkAsActiveRelease(FModioCreateModFileParams In, bool bMarkAsActiveRelease)
    +
    +
    +
    + +
    +

    Set Initial Visibility DEPRECATED

    +
    +
    +nd img SetInitialVisibility DEPRECATED +
    +
    +
    +
    +
    void SetInitialVisibility_DEPRECATED(FModioCreateModParams In, bool InitialVisibility)
    +
    +
    +
    +
    +
    +

    Set Initial Visibility

    +
    +
    +nd img SetInitialVisibility +
    +
    +
    +
    +
    void SetInitialVisibility(FModioCreateModParams In, EModioObjectVisibilityFlags InitialVisibility)
    +
    +
    +
    +
    +
    +

    Set Homepage URL

    +
    +
    +nd img SetHomepageURL +
    +
    +
    +
    +
    void SetHomepageURL(FModioCreateModParams In, FString HomepageURL)
    +
    +
    +
    +
    +
    +

    Set Description

    +
    +
    +nd img SetDescription +
    +
    +
    +
    +
    void SetDescription(FModioCreateModParams In, FString Description)
    +
    +
    +
    +
    +
    +

    Set Changelog String

    +
    +
    +nd img SetChangelogString +
    +
    +
    +
    +
    void SetChangelogString(FModioCreateModFileParams In, FString Changelog)

    -

    Set Initial Visibility DEPRECATED

    +

    Get Localized Text for Enum by Name

    -nd img SetInitialVisibility DEPRECATED +nd img GetLocalizedTextForEnumByName
    -
    void SetInitialVisibility_DEPRECATED(FModioCreateModParams In, bool InitialVisibility)
    +
    FText GetLocalizedTextForEnumByName(FName EnumName)
    +
    +
    +
    +

    Returns the string table FText for a given enum value’s FName - Only works with enums registered via /// ModioUI::RegisterEnumAsLocalizable //

    +

    Parameters

    +
    ++++ + + + + + + + + + + +

    Enum Name

    The Name from a given enum value

    Return Value

    localized Text for the specified enum value, or dummy FText if not found

    +

    Returns

    +
    +

    localized Text for the specified enum value, or dummy FText if not found


    -

    Set Initial Visibility

    +

    FileSizeToText (Unsigned64)

    -nd img SetInitialVisibility +nd img FileSizeUnsigned64 ToText
    -
    void SetInitialVisibility(FModioCreateModParams In, EModioObjectVisibilityFlags InitialVisibility)
    +
    FText FileSizeUnsigned64_ToText(FModioUnsigned64 FileSize, int32 MinDecimals, int32 MaxDecimals, TEnumAsByte<EFileSizeUnit> Unit, bool bIncludeUnitName)
    +

    Parameters

    + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +

    File Size

    Filesize in bytes

    Min Decimals

    Max Decimals

    Maximum amount of decimals to display of the filesize

    Unit

    If Largest, then it tries to display the size in the largest unit that will have a integral part > 0, else it displays the filesize in the specified unit

    Include Unit Name

    Return Value

    A text formatted from your specifications

    +

    Returns

    +
    +

    A text formatted from your specifications

    +

    -

    Set Homepage URL

    +

    Get Localized Text from Default Table by Key

    -nd img SetHomepageURL +nd img GetLocalizedTextFromDefaultTableByKey
    -
    void SetHomepageURL(FModioCreateModParams In, FString HomepageURL)
    +
    FText GetLocalizedTextFromDefaultTableByKey(FString StringKey)
    +
    +

    Returns the string table FText for a given string key //

    +
    +

    Parameters

    + ++++ + + + + + + + + + + +

    String Key

    The key to look up in the table

    Return Value

    localized Text for the specified key, or StringKey if not found

    +

    Returns

    +
    +

    localized Text for the specified key, or StringKey if not found

    +

    -

    Set Description

    +

    Reconstruct Error

    -nd img SetDescription +nd img ReconstructError
    -
    void SetDescription(FModioCreateModParams In, FString Description)
    +
    FModioErrorCode ReconstructError(int32 Value, int32 Category)
    +

    Parameters

    + ++++ + + + + + + + + + + + + + + +

    Value

    The numeric value of the code

    Category

    The category ID (populated by native code)

    Return Value


    -

    Set Changelog String

    +

    IsError

    -nd img SetChangelogString +nd img IsErrorAsExec
    -
    void SetChangelogString(FModioCreateModFileParams In, FString Changelog)
    +
    bool IsErrorAsExec(FModioErrorCode Error)
    +
    +

    Parameters

    + ++++ + + + + + + +

    Error

    +

    Returns

    +
    +

    true if the error code is a error


    @@ -16422,7 +17003,7 @@

    Get Value

    int32 GetValue(FModioErrorCode Error)
    -

    Parameters

    +

    Parameters

    @@ -16439,7 +17020,7 @@

    Parameters

    -

    Returns

    +

    Returns

    0 if there is no error

    @@ -16457,7 +17038,7 @@

    Get Message

    FString GetMessage(FModioErrorCode Error)
    -

    Parameters

    +

    Parameters

    @@ -16474,7 +17055,7 @@

    Parameters

    -

    Returns

    +

    Returns


    @@ -16492,7 +17073,7 @@

    Error Code Matches

    Checks if the passed-in ErrorCode matches the specified error condition

    -

    Parameters

    +

    Parameters

    @@ -16513,7 +17094,7 @@

    Parameters

    -

    Returns

    +

    Returns

    true if the code matches the condition

    @@ -16534,7 +17115,7 @@

    List User Subscription Async

    Runs a filter over the user’s subscription list

    -

    Parameters

    +

    Parameters

    @@ -16596,6 +17177,20 @@

    Get Avatar Thumbnail Size


    +

    To Filter Params

    +
    +
    +nd img ToFilterParams +
    +
    +
    +
    +
    FModioFilterParams ToFilterParams(FModioPresetFilterParams Preset)
    +
    +
    +
    +
    +

    Load Async

    @@ -16649,7 +17244,7 @@

    Get Logo Size

    FVector2D GetLogoSize(UTexture* Logo, EModioLogoSize LogoSize)
    -

    Parameters

    +

    Parameters

    @@ -16670,7 +17265,7 @@

    Parameters

    -

    Returns

    +

    Returns

    Dimensions of the logo if displayed in a 1:1 pixel ratio

    @@ -16688,7 +17283,7 @@

    Get Gallery Size

    FVector2D GetGallerySize(UTexture* GalleryImage, EModioGallerySize GallerySize)
    -

    Parameters

    +

    Parameters

    @@ -16709,7 +17304,7 @@

    Parameters

    -

    Returns

    +

    Returns

    Dimensions of the gallery image if displayed in a 1:1 pixel ratio

    @@ -16727,7 +17322,7 @@

    Get Avatar Size

    FVector2D GetAvatarSize(UTexture* Avatar, EModioAvatarSize AvatarSize)
    -

    Parameters

    +

    Parameters

    @@ -16748,7 +17343,7 @@

    Parameters

    -

    Returns

    +

    Returns

    Dimensions of the avatar if displayed in a 1:1 pixel ratio

    @@ -16766,7 +17361,7 @@

    Get Path

    FString GetPath(FModioModCollectionEntry Entry)
    -

    Parameters

    +

    Parameters

    @@ -16783,7 +17378,7 @@

    Parameters

    -

    Returns

    +

    Returns

    Path to the mod’s installation folder on disk NOTE: If the mod is not yet installed this path may not yet exist. Check Get Mod State before trying to load files in this location

    @@ -16801,7 +17396,7 @@

    Get Mod State

    EModioModState GetModState(FModioModCollectionEntry Entry)
    -

    Parameters

    +

    Parameters

    @@ -16818,7 +17413,7 @@

    Parameters

    -

    Returns

    +

    Returns

    EModioModState enum representing current state of the mod

    @@ -16836,7 +17431,7 @@

    Get Mod Profile

    FModioModInfo GetModProfile(FModioModCollectionEntry Entry)
    -

    Parameters

    +

    Parameters

    @@ -16853,7 +17448,7 @@

    Parameters

    -

    Returns

    +

    Returns

    FModioModInfo containing mod profile data

    @@ -16871,7 +17466,7 @@

    Get ID

    FModioModID GetID(FModioModCollectionEntry Entry)
    -

    Parameters

    +

    Parameters

    @@ -16888,7 +17483,7 @@

    Parameters

    -

    Returns

    +

    Returns

    Mod ID

    @@ -16898,18 +17493,94 @@

    Returns

    Get Total Progress

    -nd img GetTotalProgress +nd img GetTotalProgress +
    +
    +
    +
    +
    FModioUnsigned64 GetTotalProgress(FModioModProgressInfo Info, EModioModProgressState State)
    +
    +
    +
    +

    Retrieves the total amount of progress required for the specified state.

    +
    +

    Parameters

    + ++++ + + + + + + + + + + + + + + +

    Info

    the progress struct to query

    State

    which state to query total progress for

    Return Value

    Modio::FileSize for total progress in bytes

    +

    Returns

    +
    +

    Modio::FileSize for total progress in bytes

    +
    +
    + +
    +

    Get Current State

    +
    +
    +nd img GetCurrentState +
    +
    +
    +
    +
    EModioModProgressState GetCurrentState(FModioModProgressInfo Info)
    +
    +
    +
    +

    Returns a EModioModProgressState indicating which state the mod operation is in

    +
    +

    Parameters

    + ++++ + + + + + + + + + + +

    Info

    the progress struct to query

    Return Value

    +
    +
    +
    +

    Get Current Progress

    +
    +
    +nd img GetCurrentProgress
    -
    FModioUnsigned64 GetTotalProgress(FModioModProgressInfo Info, EModioModProgressState State)
    +
    FModioUnsigned64 GetCurrentProgress(FModioModProgressInfo Info, EModioModProgressState State)
    -

    Retrieves the total amount of progress required for the specified state.

    +

    Retrieves the progress value for the specified state. CurrentProgress == TotalProgress for states which have completed, for example if a mod is currently Extracting, then passing in Downloading would give you a value equal to the total download size because the download has completed

    -

    Parameters

    +

    Parameters

    @@ -16922,36 +17593,33 @@

    Parameters

    - + - +

    State

    which state to query total progress for

    which state to query progress information for

    Return Value

    Modio::FileSize for total progress in bytes

    FModioUnsigned64 containing current progress in bytes

    -

    Returns

    +

    Returns

    -

    Modio::FileSize for total progress in bytes

    +

    FModioUnsigned64 containing current progress in bytes


    -

    Get Current State

    +

    Get Tags

    -nd img GetCurrentState +nd img GetTags
    -
    EModioModProgressState GetCurrentState(FModioModProgressInfo Info)
    -
    +
    TArray<FModioModTagInfo> GetTags(FModioModTagOptions ModTags)
    -
    -

    Returns a EModioModProgressState indicating which state the mod operation is in

    -

    Parameters

    +

    Parameters

    @@ -16959,8 +17627,8 @@

    Parameters

    - - + + @@ -16968,24 +17636,22 @@

    Parameters

    Info

    the progress struct to query

    Mod Tags

    Return Value

    +

    Returns


    -

    Get Current Progress

    +

    Get Paged Result

    -nd img GetCurrentProgress +nd img GetPagedResult
    -
    FModioUnsigned64 GetCurrentProgress(FModioModProgressInfo Info, EModioModProgressState State)
    +
    FModioPagedResult GetPagedResult(FModioModTagOptions ModTags)
    -
    -

    Retrieves the progress value for the specified state. CurrentProgress == TotalProgress for states which have completed, for example if a mod is currently Extracting, then passing in Downloading would give you a value equal to the total download size because the download has completed

    -
    -

    Parameters

    +

    Parameters

    @@ -16993,23 +17659,16 @@

    Parameters

    - - - - - - + + - +

    Info

    the progress struct to query

    State

    which state to query progress information for

    Mod Tags

    Return Value

    FModioUnsigned64 containing current progress in bytes

    -

    Returns

    -
    -

    FModioUnsigned64 containing current progress in bytes

    -
    +

    Returns


    @@ -17027,7 +17686,7 @@

    Get Default Portal for Current Platf

    Get the default portal for the platform the game is running on.

    -

    Parameters

    +

    Parameters

    @@ -17040,7 +17699,7 @@

    Parameters

    -

    Returns

    +

    Returns

    EModioPortal of the portal to use

    @@ -17061,7 +17720,7 @@

    Get Default Auth Provider for

    Get the default Authentication Provider for the current platform the game is running on

    -

    Parameters

    +

    Parameters

    @@ -17074,7 +17733,7 @@

    Parameters

    -

    Returns

    +

    Returns

    EModioAuthenticationProvider to use for authentication calls

    @@ -17095,7 +17754,7 @@

    Get Current Platform

    Gets the current platform that the game is running on

    -

    Parameters

    +

    Parameters

    @@ -17108,7 +17767,7 @@

    Parameters

    -

    Returns

    +

    Returns


    @@ -17126,7 +17785,7 @@

    Round Number String

    Sets the correct decimals depending on the file size or speed

    -

    Parameters

    +

    Parameters

    @@ -17160,7 +17819,7 @@

    Get Percent (integer64/integer64)

    Dividend/Divisor and return the floating point result with no checks *

    -

    Parameters

    +

    Parameters

    @@ -17195,7 +17854,7 @@

    Is Valid Security Code Format

    bool IsValidSecurityCodeFormat(FString String)
    -

    Parameters

    +

    Parameters

    @@ -17212,7 +17871,7 @@

    Parameters

    -

    Returns

    +

    Returns

    true if the security code has a valid format

    @@ -17230,7 +17889,7 @@

    Is Valid Email Address Format

    bool IsValidEmailAddressFormat(FString String)
    -

    Parameters

    +

    Parameters

    @@ -17247,7 +17906,7 @@

    Parameters

    -

    Returns

    +

    Returns

    true if the email address has a valid format

    @@ -17268,7 +17927,7 @@

    Get Time Span as String

    Gets the time span between present and specified past date FString

    -

    Parameters

    +

    Parameters

    @@ -17302,7 +17961,7 @@

    Get Shortened Number as String

    Shortens the specified large number

    -

    Parameters

    +

    Parameters

    @@ -17333,7 +17992,7 @@

    Get Project Initialize Options
    FModioInitializeOptions GetProjectInitializeOptionsForSessionId(FString SessionId)
    -

    Parameters

    +

    Parameters

    @@ -17395,6 +18054,82 @@

    Get Project Api Key


    +

    Get Language Code String

    +
    +
    +nd img GetLanguageCodeString +
    +
    +
    +
    +
    FString GetLanguageCodeString(EModioLanguage Language)
    +
    +
    +
    +

    Get language code string. This can be used for localization purposes

    +
    +

    Parameters

    +
    ++++ + + + + + + + + + + +

    Language

    The language code to convert to string

    Return Value

    The language code as a string (e.g. "en", "fr", "de")

    +

    Returns

    +
    +

    The language code as a string (e.g. "en", "fr", "de")

    +
    +
    + +
    +

    Get Language Code from String

    +
    +
    +nd img GetLanguageCodeFromString +
    +
    +
    +
    +
    EModioLanguage GetLanguageCodeFromString(FString LanguageCode)
    +
    +
    +
    +

    Get language code enum from string in ISO 639-1 format. This can be used for localization purposes

    +
    +

    Parameters

    + ++++ + + + + + + + + + + +

    Language Code

    The language code as a string (e.g. "en", "fr", "de")

    Return Value

    The language code as an enum

    +

    Returns

    +
    +

    The language code as an enum

    +
    +
    +
    +

    Get Desired File Size Unit

    @@ -17406,7 +18141,7 @@

    Get Desired File Size Unit

    TEnumAsByte<EFileSizeUnit> GetDesiredFileSizeUnit(int64 FileSize)
    -

    Parameters

    +

    Parameters

    @@ -17423,7 +18158,7 @@

    Parameters

    -

    Returns

    +

    Returns

    the desired file size unit

    @@ -17444,7 +18179,7 @@

    Get Default Session Id Windows

    Get Session Id for Windows for initialization of the SDK return empty string if you are not on Windows

    -

    Parameters

    +

    Parameters

    @@ -17472,7 +18207,7 @@

    ToString (Filesize)

    FText Filesize_ToString(int64 FileSize, int32 MinDecimals, int32 MaxDecimals, TEnumAsByte<EFileSizeUnit> Unit, bool bIncludeUnitName)
    -

    Parameters

    +

    Parameters

    @@ -17505,7 +18240,7 @@

    Parameters

    -

    Returns

    +

    Returns

    A text formatted from your specifications

    @@ -17526,7 +18261,7 @@

    GetDefaultModInstallationDirector

    Returns the default mod installation directory for this game and platform, ignoring overrides and without requiring the SDK to be initialized.

    -

    Parameters

    +

    Parameters

    @@ -17543,7 +18278,7 @@

    Parameters

    -

    Returns

    +

    Returns

    The default mod installation directory for the specified game on the current platform

    @@ -17620,6 +18355,20 @@

    ModioUnsigned64 < ModioUnsigned64


    +

    ModioUnsigned64 > 0

    +
    +
    +nd img GreaterThanZero +
    +
    +
    +
    +
    bool GreaterThanZero(FModioUnsigned64 In)
    +
    +
    +
    +
    +

    ModioUnsigned64 > ModioUnsigned64

    @@ -17718,53 +18467,21 @@

    ModioUnsigned64 + ModioUnsigned64


    -

    Create Uninstall Dialog Info

    +

    SubmitNewModFromMemoryAsync

    -nd img CreateUninstallDialogInfo +nd img K2 SubmitNewModFromMemoryAsync
    -
    UModioCommonDialogInfo* CreateUninstallDialogInfo(FModioModInfo ModInfo)
    +
    void K2_SubmitNewModFromMemoryAsync(FModioModCreationHandle Handle, FModioCreateModParams Params, TArray<uint8> PngData, FOnSubmitNewModDelegate Callback)
    -

    Parameters

    - ---- - - - - - - - - - - -

    Mod Info

    Return Value

    The created dialog

    -

    Returns

    -

    The created dialog

    -
    -
    -
    -
    -

    Create Manual Dialog Info

    -
    -
    -nd img CreateManualDialogInfo -
    -
    -
    -
    -
    UModioCommonDialogInfo* CreateManualDialogInfo(FText TitleText, FText DialogText)
    -
    +

    Submit a new mod, with its logo data coming from an in-memory buffer rather than a file.

    -

    Parameters

    +

    Parameters

    @@ -17772,77 +18489,52 @@

    Parameters

    - - - - - - - - - - + + - -

    Title Text

    The title text of the dialog

    Dialog Text

    The description text of the dialog

    Return Value

    The created dialog

    Handle

    Mod creation handle

    -

    Returns

    -
    -

    The created dialog

    -
    -
    -
    -
    -

    Create Error Dialog Info

    -
    -
    -nd img CreateErrorDialogInfo -
    -
    -
    -
    -
    UModioCommonDialogInfo* CreateErrorDialogInfo(FModioErrorCode ErrorCode, FText TitleText)
    -
    -
    -

    Parameters

    - ---- - - - + + - - + + - - + +

    Error Code

    The error code to display in the dialog

    Params

    Parameters to use when creating the mod

    Title Text

    The title text of the dialog

    Png Data

    In-memory buffer, representative of a PNG file to be used for upload

    Return Value

    The created dialog

    Callback

    Callback once operation has completed

    -

    Returns

    -
    -

    The created dialog

    -

    -

    Create Confirm Uninstall Dialog Info

    +

    SubmitNewModFileForModFromMemory

    -nd img CreateConfirmUninstallDialogInfo +nd img K2 SubmitNewModFileForModFromMemory
    -
    UModioCommonDialogInfo* CreateConfirmUninstallDialogInfo(FModioModInfo ModInfo)
    +
    void K2_SubmitNewModFileForModFromMemory(UModioSubsystem* Target, FModioModID Mod, FModioCreateModFileMemoryParams Params)
    -

    Parameters

    +
    +

    Queues the upload of a new mod file release for the specified mod, using the submitted parameters. This upload method accepts a a block of memory TArray<uint8> rather than a file path. The upload’s progress can be tracked in the same way as downloads; when completed, a Mod Management Event will be triggered with the result code for the upload.

    +
    +

    Requirements

    +
    +
      +
    • +

      initialized-sdk

      +
    • +
    • +

      authenticated-user

      +
    • +
    +
    +

    Parameters

    @@ -17850,34 +18542,48 @@

    Parameters

    - - + + - - + + + + + +

    Mod Info

    The mod info to display in the dialog

    Target

    Modio Subsystem Object Reference

    Return Value

    The created dialog

    Mod

    The ID of the mod you are submitting a file for

    Params

    Information about the mod file being created, including the memory that wiull be uploaded as a mod

    -

    Returns

    -
    -

    The created dialog

    -

    -

    Create from Params

    +

    LoadModFileToMemory

    -nd img CreateFromParams +nd img K2 LoadModFileToMemory
    -
    UWidget* CreateFromParams(TSubclassOf<UWidget>  NotificationClass, FModioNotificationParams Params, UWidget* Outer)
    +
    bool K2_LoadModFileToMemory(UModioSubsystem* Target, FModioModID ModId, TArray<uint8> ModData)
    -

    Parameters

    +
    +

    Loads an installed mod file into memory.

    +
    +

    Requirements

    +
    +
      +
    • +

      initialized-sdk

      +
    • +
    • +

      authenticated-user

      +
    • +
    +
    +

    Parameters

    @@ -17885,27 +18591,23 @@

    Parameters

    - - + + - - + + - - + + - +

    Notification Class

    The widget subclass the new instance will be part of

    Target

    Modio Subsystem Object Reference

    Params

    The parameters the new instance should store

    Mod Id

    Outer

    The reference widget the new instance should be linked to

    Mod Data

    A byte array of the mod that has been loaded

    Return Value

    An instance of a Widget subclass that is a notification

    True if the mod file is successfully loaded; false if it cannot be loaded

    -

    Returns

    -
    -

    An instance of a Widget subclass that is a notification

    -

    @@ -17920,7 +18622,7 @@

    Set Text Arg

    FModioNotificationParams SetTextArg(FModioNotificationParams NotificationParams, FString Name, FText Text)
    -

    Parameters

    +

    Parameters

    @@ -17945,7 +18647,7 @@

    Parameters

    -

    Returns

    +

    Returns

    Updated ModioNotificationParams instance

    @@ -17963,7 +18665,7 @@

    Set String Arg

    FModioNotificationParams SetStringArg(FModioNotificationParams NotificationParams, FString Name, FString Value)
    -

    Parameters

    +

    Parameters

    @@ -17988,7 +18690,7 @@

    Parameters

    -

    Returns

    +

    Returns

    Updated ModioNotificationParams instance

    @@ -18006,7 +18708,7 @@

    Set Integer Arg

    FModioNotificationParams SetIntegerArg(FModioNotificationParams NotificationParams, FString Name, int32 Value)
    -

    Parameters

    +

    Parameters

    @@ -18031,7 +18733,7 @@

    Parameters

    -

    Returns

    +

    Returns

    Updated ModioNotificationParams instance

    @@ -18049,7 +18751,7 @@

    Set Float Arg

    FModioNotificationParams SetFloatArg(FModioNotificationParams NotificationParams, FString Name, float Value)
    -

    Parameters

    +

    Parameters

    @@ -18074,7 +18776,7 @@

    Parameters

    -

    Returns

    +

    Returns

    Updated ModioNotificationParams instance

    @@ -18092,7 +18794,7 @@

    Create Unsubscription Notification

    FModioNotificationParams CreateUnsubscriptionNotification(FModioErrorCode StatusCode, TScriptInterface<IModioModInfoUIDetails> ModInfo) -

    Parameters

    +

    Parameters

    @@ -18113,7 +18815,7 @@

    Parameters

    -

    Returns

    +

    Returns

    FModioNotificationParams instance

    @@ -18131,7 +18833,7 @@

    Create Uninstall Notification

    FModioNotificationParams CreateUninstallNotification(FModioErrorCode StatusCode, TScriptInterface<IModioModInfoUIDetails> ModInfo)
    -

    Parameters

    +

    Parameters

    @@ -18152,7 +18854,7 @@

    Parameters

    -

    Returns

    +

    Returns

    FModioNotificationParams instance

    @@ -18170,7 +18872,7 @@

    Create Subscription Notification

    FModioNotificationParams CreateSubscriptionNotification(FModioErrorCode StatusCode, TScriptInterface<IModioModInfoUIDetails> ModInfo)
    -

    Parameters

    +

    Parameters

    @@ -18191,7 +18893,7 @@

    Parameters

    -

    Returns

    +

    Returns

    FModioNotificationParams instance

    @@ -18209,7 +18911,7 @@

    Create Rating Notification

    FModioNotificationParams CreateRatingNotification(FModioErrorCode StatusCode, TScriptInterface<IModioModInfoUIDetails> ModInfo)
    -

    Parameters

    +

    Parameters

    @@ -18230,7 +18932,7 @@

    Parameters

    -

    Returns

    +

    Returns

    FModioNotificationParams instance

    @@ -18248,7 +18950,7 @@

    Create Prioritize Transfer f
    FModioNotificationParams CreatePrioritizeTransferForModNotification(FModioErrorCode StatusCode, TScriptInterface<IModioModInfoUIDetails> ModInfo)
    -

    Parameters

    +

    Parameters

    @@ -18269,7 +18971,7 @@

    Parameters

    -

    Returns

    +

    Returns

    FModioNotificationParams instance

    @@ -18287,7 +18989,7 @@

    Create Notification Params

    FModioNotificationParams CreateNotificationParams(FModioErrorCode StatusCode, FText TitleText, FText SuccessText, FText ErrorText)
    -

    Parameters

    +

    Parameters

    @@ -18316,7 +19018,7 @@

    Parameters

    -

    Returns

    +

    Returns

    FModioNotificationParams instance

    @@ -18334,7 +19036,7 @@

    Create Installation Notification

    FModioNotificationParams CreateInstallationNotification(FModioErrorCode StatusCode, TScriptInterface<IModioModInfoUIDetails> ModInfo)
    -

    Parameters

    +

    Parameters

    @@ -18355,7 +19057,7 @@

    Parameters

    -

    Returns

    +

    Returns

    FModioNotificationParams instance

    @@ -18373,7 +19075,7 @@

    Add Format Text

    FModioNotificationParams AddFormatText(FModioNotificationParams NotificationParams, FName Name, FText Text)
    -

    Parameters

    +

    Parameters

    @@ -18398,28 +19100,25 @@

    Parameters

    -

    Returns

    +

    Returns

    Updated ModioNotificationParams instance


    -

    SubmitNewModFromMemoryAsync

    +

    Create Uninstall Dialog Info

    -nd img K2 SubmitNewModFromMemoryAsync +nd img CreateUninstallDialogInfo
    -
    void K2_SubmitNewModFromMemoryAsync(FModioModCreationHandle Handle, FModioCreateModParams Params, TArray<uint8> PngData, FOnSubmitNewModDelegate Callback)
    -
    +
    UModioCommonDialogInfo* CreateUninstallDialogInfo(FModioModInfo ModInfo)
    -
    -

    Submit a new mod, with its logo data coming from an in-memory buffer rather than a file.

    -

    Parameters

    +

    Parameters

    @@ -18427,52 +19126,73 @@

    Parameters

    - - + + - - + + + + +

    Handle

    Mod creation handle

    Mod Info

    Params

    Parameters to use when creating the mod

    Return Value

    The created dialog

    +

    Returns

    +
    +

    The created dialog

    +
    +
    +
    +
    +

    Create Manual Dialog Info

    +
    +
    +nd img CreateManualDialogInfo +
    +
    +
    +
    +
    UModioCommonDialogInfo* CreateManualDialogInfo(FText TitleText, FText DialogText)
    +
    +
    +

    Parameters

    + ++++ + + + + - - + + - - + +

    Title Text

    The title text of the dialog

    Png Data

    In-memory buffer, representative of a PNG file to be used for upload

    Dialog Text

    The description text of the dialog

    Callback

    Callback once operation has completed

    Return Value

    The created dialog

    +

    Returns

    +
    +

    The created dialog

    +

    -

    SubmitNewModFileForModFromMemory

    +

    Create Error Dialog Info

    -nd img K2 SubmitNewModFileForModFromMemory +nd img CreateErrorDialogInfo
    -
    void K2_SubmitNewModFileForModFromMemory(UModioSubsystem* Target, FModioModID Mod, FModioCreateModFileMemoryParams Params)
    -
    -
    -
    -

    Queues the upload of a new mod file release for the specified mod, using the submitted parameters. This upload method accepts a a block of memory TArray<uint8> rather than a file path. The upload’s progress can be tracked in the same way as downloads; when completed, a Mod Management Event will be triggered with the result code for the upload.

    +
    UModioCommonDialogInfo* CreateErrorDialogInfo(FModioErrorCode ErrorCode, FText TitleText)
    -

    Requirements

    -
    -
    -

    Parameters

    +

    Parameters

    @@ -18480,48 +19200,73 @@

    Parameters

    - - + + - - + + - - + +

    Target

    Modio Subsystem Object Reference

    Error Code

    The error code to display in the dialog

    Mod

    The ID of the mod you are submitting a file for

    Title Text

    The title text of the dialog

    Params

    Information about the mod file being created, including the memory that wiull be uploaded as a mod

    Return Value

    The created dialog

    +

    Returns

    +
    +

    The created dialog

    +

    -

    LoadModFileToMemory

    +

    Create Confirm Uninstall Dialog Info

    -nd img K2 LoadModFileToMemory +nd img CreateConfirmUninstallDialogInfo
    -
    bool K2_LoadModFileToMemory(UModioSubsystem* Target, FModioModID ModId, TArray<uint8> ModData)
    +
    UModioCommonDialogInfo* CreateConfirmUninstallDialogInfo(FModioModInfo ModInfo)
    +

    Parameters

    + ++++ + + + + + + + + + + +

    Mod Info

    The mod info to display in the dialog

    Return Value

    The created dialog

    +

    Returns

    -

    Loads an installed mod file into memory.

    +

    The created dialog

    +
    +
    +
    +
    +

    Create from Params

    +
    +
    +nd img CreateFromParams +
    +
    +
    +
    +
    UWidget* CreateFromParams(TSubclassOf<UWidget>  NotificationClass, FModioNotificationParams Params, UWidget* Outer)
    -

    Requirements

    -
    -
      -
    • -

      initialized-sdk

      -
    • -
    • -

      authenticated-user

      -
    • -
    -

    Parameters

    +

    Parameters

    @@ -18529,23 +19274,27 @@

    Parameters

    - - + + - - + + - - + + - +

    Target

    Modio Subsystem Object Reference

    Notification Class

    The widget subclass the new instance will be part of

    Mod Id

    Params

    The parameters the new instance should store

    Mod Data

    A byte array of the mod that has been loaded

    Outer

    The reference widget the new instance should be linked to

    Return Value

    True if the mod file is successfully loaded; false if it cannot be loaded

    An instance of a Widget subclass that is a notification

    +

    Returns

    +
    +

    An instance of a Widget subclass that is a notification

    +
    @@ -19153,6 +19902,10 @@

    Values

    Detailed low-level debugging output. Not intended for general use *

    +

    Detailed

    +

    Detailed but not low-level. Generally useful for some mid-level information for debugging.

    + +

    Info

    Informational output containing status messages *

    @@ -19267,7 +20020,7 @@

    Values


    -

    EModioErrorCondition

    +

    EFileSizeUnit

    Values

    @@ -19276,6 +20029,39 @@

    Values

    + + + + + + + + + + + + + + + + + + + + +

    Largest

    Will take the largest one that becomes a number larger than 1 (i.e, 1300mb becomes 1.3gb) *

    B

    A single byte *

    KB

    Kilo bytes *

    MB

    Mega bytes *

    GB

    Giga bytes *

    +
    +
    +
    +

    EModioErrorCondition

    +

    Values

    + ++++ + + @@ -19408,7 +20194,7 @@

    EModioSortFieldTy

    Enum indicating which field should be used to sort the results

    -

    Values

    +

    Values

    NoError

    @@ -19443,6 +20229,10 @@

    Values

    + + + +

    DownloadsTotal

    use date mod was last updated

    Alphabetical

    use downloads total


    @@ -19452,7 +20242,7 @@

    EModioSortDirecti

    Enum indicating which direction sorting should be applied

    -

    Values

    +

    Values

    @@ -19476,7 +20266,7 @@

    EModioRev

    Enum indicating filtering options based off revenue type

    -

    Values

    +

    Values

    @@ -19501,7 +20291,7 @@

    Values

    EModioImageState

    -

    Values

    +

    Values

    @@ -19533,7 +20323,7 @@

    EModioModState

    Enum representing the current state of a mod

    -

    Values

    +

    Values

    @@ -19570,7 +20360,7 @@

    Values

    EModioModProgressState

    -

    Values

    +

    Values

    @@ -19603,7 +20393,7 @@

    Values

    EModioRating

    -

    Values

    +

    Values

    @@ -19628,7 +20418,7 @@

    Values

    EModioReportType

    -

    Values

    +

    Values

    @@ -19672,40 +20462,7 @@

    Values


    -

    EFileSizeUnit

    -

    Values

    -
    ---- - - - - - - - - - - - - - - - - - - - - - - -

    Largest

    Will take the largest one that becomes a number larger than 1 (i.e, 1300mb becomes 1.3gb) *

    B

    A single byte *

    KB

    Kilo bytes *

    MB

    Mega bytes *

    GB

    Giga bytes *

    -
    -
    -
    -

    EModioCommonDialogButtonType

    +

    EModioUIAsyncOperationWidgetState

    Values

    @@ -19714,31 +20471,23 @@

    Values

    - - - - - - - - - - + + - - + + - - + +

    Back

    Cancel

    Confirm

    Success

    Operation succeeded *

    Ok

    Error

    Operation failed *

    ModDetails

    InProgress

    Operation still working *


    -

    EModioCommonSearchViewType

    +

    EModioUIMediaDownloadEventType

    Values

    @@ -19747,19 +20496,23 @@

    Values

    - - + + - - + + + + + +

    SearchResults

    ModGalleryImages

    Downloading gallery images *

    Collection

    ModCreatorAvatarImage

    Downloading an avatar *

    ModLogo

    Downloading a logo *


    -

    EModioCommonRichTextStyleTextImageOrder

    +

    EModioUIModInfoEventType

    Values

    @@ -19768,19 +20521,19 @@

    Values

    - - + + - - + +

    ImageFirst

    ListAllMods

    Event to list all mods *

    TextFirst

    GetModInfo

    Event to retrieve the mod information *


    -

    EModioUIAsyncOperationWidgetState

    +

    EModioEnabledFilterType

    Values

    @@ -19789,23 +20542,23 @@

    Values

    - - + + - - + + - - + +

    Success

    Operation succeeded *

    None

    Error

    Operation failed *

    Enabled

    InProgress

    Operation still working *

    Disabled


    -

    EModioUIMediaDownloadEventType

    +

    EModioQueuedFilterType

    Values

    @@ -19814,23 +20567,23 @@

    Values

    - - + + - - + + - - + +

    ModGalleryImages

    Downloading gallery images *

    None

    ModCreatorAvatarImage

    Downloading an avatar *

    Queued

    ModLogo

    Downloading a logo *

    NotQueued


    -

    EModioUIModInfoEventType

    +

    EModioInstalledFilterType

    Values

    @@ -19839,19 +20592,23 @@

    Values

    - - + + - - + + + + + +

    ListAllMods

    Event to list all mods *

    None

    GetModInfo

    Event to retrieve the mod information *

    CurrentUser

    AnotherUser


    -

    EModioEnabledFilterType

    +

    EModioManualSortType

    Values

    @@ -19860,15 +20617,19 @@

    Values

    - + - + - + + + + + @@ -19876,7 +20637,7 @@

    Values


    -

    EModioQueuedFilterType

    +

    EModioCommonDialogButtonType

    Values

    None

    AToZ

    Enabled

    ZToA

    Disabled

    SizeOnDisk

    RecentlyUpdated

    @@ -19885,15 +20646,23 @@

    Values

    - + - + - + + + + + + + + + @@ -19901,7 +20670,7 @@

    Values


    -

    EModioInstalledFilterType

    +

    EModioCommonSearchViewType

    Values

    None

    Back

    Queued

    Cancel

    NotQueued

    Confirm

    Ok

    ModDetails

    @@ -19910,15 +20679,11 @@

    Values

    - - - - - + - + @@ -19926,7 +20691,7 @@

    Values


    -

    EModioManualSortType

    +

    EModioCommonRichTextStyleTextImageOrder

    Values

    None

    CurrentUser

    SearchResults

    AnotherUser

    Collection

    @@ -19935,19 +20700,11 @@

    Values

    - - - - - - - - - + - + @@ -19958,7 +20715,7 @@

    Values

    diff --git a/Doc/getting-started.adoc b/Doc/getting-started.adoc index f50902d..89b8c1d 100644 --- a/Doc/getting-started.adoc +++ b/Doc/getting-started.adoc @@ -180,7 +180,7 @@ For best performance it should be called at least once per frame, so it should e image::img/run_pending_handlers.png[] -When you are ready to initialize the plugin for the current user, you'll need to call <>, passing in an instance of `FModioInitializeOptions`, and a delegate so you know when the plugin is initialized correctly. Here, you can specify your Game ID, API Key, Environment, and https://docs.mod.io/#targeting-a-portal[Portal]. You can get the default portal for the current platform using <> function. +When you are ready to initialize the plugin for the current user, you'll need to call <>, passing in an instance of `FModioInitializeOptions`, and a delegate so you know when the plugin is initialized correctly. Here, you can specify your Game ID, API Key, Environment, and https://docs.mod.io/restapiref/#targeting-a-portal[Portal]. You can get the default portal for the current platform using <> function. image::img/initasync_customoptions.png[] @@ -368,19 +368,20 @@ Once this completes successfully, the user is authenticated and you can then man mod.io features single sign on authentication from a number of external providers. This currently includes: - * Apple - * Discord - * Epic Games Store - * GoG - * Google - * itch.io - * Nintendo Switch - * PlayStation(TM) Network - * Steam - * Xbox Live - * OpenID - -Please note that the ability to authenticate players using OpenID is feature for advanced partners only. If you are interested in becoming an advanced partner, please contact developers@mod.io + * Apple + * Discord + * Epic Games Store + * GoG + * Google + * itch.io + * Nintendo Switch + * PlayStation™Network + * Steam + * Xbox Live + * Oculus + * OpenID + +Please note that the ability to authenticate players using OpenID is a premium feature. If you are interested in mod.io premium features, please contact developers@mod.io. To use SSO with mod.io, a user must have accepted the mod.io Terms of Use in order to create an account. @@ -1145,4 +1146,181 @@ This call will start a TempModSet and install Mods with IDs 8, 4 and 5. Note | If you add an already subscribed mod to TempModSet, it will not download be downloaded as the player will already have that content. If you try to unsubscribe from it while it's in TempModSet, the SDK it will wait for it to be removed from TempModSet before processing the unsubscribe. +== Plugin quick-start: Monetization + +The Mod.io Unreal Engine Plugin supports a range of Monetization features, allowing you to sell a per-game virtual currency to your players that they can use to purchase mods, with a share of the revenue split between creators and your studio. Visit https://docs.mod.io/monetization[here] for an overview of the mod.io monetization system. + +Every platform requires specific setup for monetization features to work, with regards to the virtual currency configuration and API calls, however the following documentation is generically applicable, with only small differences per-platform that are documented within the platform-specific monetization documentation. + +=== Initialization + +The mod.io monetization features are enabled as part of the onboarding process on your game profile. Once that is setup, there is nothing further you need to do for initialization in the Plugin. + +Ensure that you have set the appropriate Portal when initializing the SDK for the portal you are using for purchasing - for instance, on Steam, you must initialize with Modio::Portal::Steam in order to redeem entitlements for Steam. + +=== Getting the user's wallet + +On startup, you can make a call to `UModioSubsystem::GetUserWalletBalanceAsync` to get the balance of the current user's wallet. If no wallet exists for the user, one will be created for them automatically. This call returns the users wallet balance for the current game. The only time you need to make this call is on startup. + +We recommend that you cache the value of this result in your game code rather than making consistent calls to `UModioSubsystem::GetUserWalletBalanceAsync` and update your local state from the return values of other calls that affect wallet balance. + +.Blueprint Example +[%collapsible] +==== + +image::img/get_user_wallet.png[] + +==== + +.C++ Example +[%collapsible] +==== + +[source,cpp] +---- +void UModioManager::GetUserWallet() +{ + if (GEngine->GetEngineSubsystem()) + { + GEngine->GetEngineSubsystem()->GetUserWalletBalanceAsync(FOnGetUserWalletBalanceDelegate::CreateUObject(this, &UModioManager::OnGetUserWalletCallback)); + } +} + +void UModioManager::OnGetUserWalletCallback(FModioErrorCode ErrorCode, FModioOptionalUInt64 WalletBalance) +{ + if (ErrorCode == false) + { + // Wallet Balance Successfully Retrieved + } +} +---- + +==== + +=== Querying & Purchasing Mods + +As part `UModioSubsystem::ListAllModsAsync`, you can include an additional filter for whether you list paid mods. By default, only free mods are shown, but you can set `RevenueType` on the [ModioFilterParams](#ModioFilterParams) object passed to `UModioSubsystem::ListAllModsAsync` to include free and paid content, or just paid content. All mods returned will have a `Price` property, indicating the virtual currency price that must be paid in order to purchase. + +Currently filtering for Paid/Unpaid content is not exposed to Blueprint. + +==== Purchasing Mods + +You can call `UModioSubsystem::PurchaseModAsync` to purchase a given mod. PurchaseModAsync takes two parameters = the ModID of the mod to purchase, and the ExpectedPrice, which is the price displayed to the user from `UModioSubsystem::ListAllModsAsync`. You must include this parameter for safety, so the user is not charged more or less than the price displayed to them in case the price of the mod has changed between the call to ListAllModsAsync and purchase time. + +Once a mod is purchased, it is automatically subscribed to for the user. + +You should validate that the user has enough virtual currency to make the purchase by comparing it to the balance you received from `UModioSubsystem::GetUserWalletBalanceAsync`. Note this is purely for user experience (ie for graying out the purchase button in the UI, or upselling the user a virtual currenct pack), and `UModioSubsystem::PurchaseModAsync` will return an error if the user does not have enough in their wallet. + +The updated wallet balance after the purchase amount is subtracted is returned in the callback of `UModioSubsystem::PurchaseModAsync`. + +.Blueprint Example +[%collapsible] +==== + +image::img/purchase_mod.png[] + +==== + +.C++ Example +[%collapsible] +==== + +[source,cpp] +---- +void UModioManager::PurchaseMod(FModioModID ModId, FModioUnsigned64 ExpectedPrice) +{ + if (GEngine->GetEngineSubsystem()) + { + GEngine->GetEngineSubsystem()->PurchaseModAsync(ModId, ExpectedPrice, FOnPurchaseModDelegate::CreateUObject(this, &UModioManager::OnPurchaseModCallback)); + } +} + +void UModioManager::OnPurchaseModCallback(FModioErrorCode ErrorCode, FModioOptionalTransactionRecord Transaction) +{ + if (ErrorCode == false) + { + // Mod Purchase Successful + } +} +---- + +==== + +=== Showing user purchases + +Even though all purchased mods are automatically subscribed, the user can still unsubscribe from them and uninstall them; however, they still remain owned and purchased by the user. They must re-subscribe to the mod in order to have it installed. This is facilitated by `UModioSubsystem::FetchUserPurchasesAsync`, which will fetch a list of a users purchased mods. After a successful call, you can then display them with `UModioSubsystem::QueryUserPurchasedMods`, allowing re-subscription if necessary. + +.Blueprint Example +[%collapsible] +==== + +image::img/show_user_purchases.png[] + +==== + +.C++ Example +[%collapsible] +==== + +[source,cpp] +---- +void UModioManager::FetchUserPurchases() +{ + if (GEngine->GetEngineSubsystem()) + { + GEngine->GetEngineSubsystem()->FetchUserPurchasesAsync(FOnFetchUserPurchasesDelegate::CreateUObject(this, &UModioManager::OnFetchUserPurchasesCallback)); + } +} +void UModioManager::OnFetchUserPurchasesCallback(FModioErrorCode ErrorCode) +{ + if (ErrorCode == false) + { + // Purchases Successfully Fetched + if (GEngine->GetEngineSubsystem()) + { + // We can now access the list of purchased mods directly + TMap PurchasedMods = GEngine->GetEngineSubsystem()->QueryUserPurchasedMods(); + } + } +} +---- + +==== + +=== Getting a User Delegation Token + +User Delegation Tokens can be used by a backend server for S2S (Server to Server) transactions/functionality. You can get one for the current user by calling `UModioSubsystem::GetUserDelegationTokenAsync`, the callback for which contains the Token as a `FString`. + +.Blueprint Example +[%collapsible] +==== + +image::img/get_user_delegation_token.png[] + +==== + +.C++ Example +[%collapsible] +==== + +[source,cpp] +---- +void UModioManager::GetUserDelegationToken() +{ + if (GEngine->GetEngineSubsystem()) + { + GEngine->GetEngineSubsystem()->GetUserDelegationTokenAsync(FOnGetUserDelegationTokenDelegateFast::CreateUObject(this, &UModioManager::OnGetUserDelegationTokenCallback)); + } +} + +void UModioManager::OnGetUserDelegationTokenCallback(FModioErrorCode ErrorCode, FString UserDelegationToken) +{ + if (ErrorCode == false) + { + // Successfully got User Delegation Token + } +} +---- + +==== diff --git a/Doc/img/get_user_delegation_token.png b/Doc/img/get_user_delegation_token.png new file mode 100644 index 0000000..a09d7a4 Binary files /dev/null and b/Doc/img/get_user_delegation_token.png differ diff --git a/Doc/img/get_user_wallet.png b/Doc/img/get_user_wallet.png new file mode 100644 index 0000000..0910aae Binary files /dev/null and b/Doc/img/get_user_wallet.png differ diff --git a/Doc/img/nd_img_CreateNotificationParams.png b/Doc/img/nd_img_CreateNotificationParams.png index 110a210..d4d3c84 100644 Binary files a/Doc/img/nd_img_CreateNotificationParams.png and b/Doc/img/nd_img_CreateNotificationParams.png differ diff --git a/Doc/img/nd_img_FileSizeUnsigned64_ToText.png b/Doc/img/nd_img_FileSizeUnsigned64_ToText.png new file mode 100644 index 0000000..59252a7 Binary files /dev/null and b/Doc/img/nd_img_FileSizeUnsigned64_ToText.png differ diff --git a/Doc/img/nd_img_GetLanguageCodeFromString.png b/Doc/img/nd_img_GetLanguageCodeFromString.png new file mode 100644 index 0000000..48b8fa2 Binary files /dev/null and b/Doc/img/nd_img_GetLanguageCodeFromString.png differ diff --git a/Doc/img/nd_img_GetLanguageCodeString.png b/Doc/img/nd_img_GetLanguageCodeString.png new file mode 100644 index 0000000..704fdf5 Binary files /dev/null and b/Doc/img/nd_img_GetLanguageCodeString.png differ diff --git a/Doc/img/nd_img_GetLocalizedTextForEnumByName.png b/Doc/img/nd_img_GetLocalizedTextForEnumByName.png new file mode 100644 index 0000000..f90e6af Binary files /dev/null and b/Doc/img/nd_img_GetLocalizedTextForEnumByName.png differ diff --git a/Doc/img/nd_img_GetLocalizedTextFromDefaultTableByKey.png b/Doc/img/nd_img_GetLocalizedTextFromDefaultTableByKey.png new file mode 100644 index 0000000..faeefe7 Binary files /dev/null and b/Doc/img/nd_img_GetLocalizedTextFromDefaultTableByKey.png differ diff --git a/Doc/img/nd_img_GetLogoSize.png b/Doc/img/nd_img_GetLogoSize.png index 9055ae2..c4ec1e4 100644 Binary files a/Doc/img/nd_img_GetLogoSize.png and b/Doc/img/nd_img_GetLogoSize.png differ diff --git a/Doc/img/nd_img_GetPagedResult.png b/Doc/img/nd_img_GetPagedResult.png new file mode 100644 index 0000000..7670570 Binary files /dev/null and b/Doc/img/nd_img_GetPagedResult.png differ diff --git a/Doc/img/nd_img_GetTags.png b/Doc/img/nd_img_GetTags.png new file mode 100644 index 0000000..ebd40a4 Binary files /dev/null and b/Doc/img/nd_img_GetTags.png differ diff --git a/Doc/img/nd_img_GreaterThanZero.png b/Doc/img/nd_img_GreaterThanZero.png new file mode 100644 index 0000000..e2897f1 Binary files /dev/null and b/Doc/img/nd_img_GreaterThanZero.png differ diff --git a/Doc/img/nd_img_IsErrorAsExec.png b/Doc/img/nd_img_IsErrorAsExec.png new file mode 100644 index 0000000..e9560a5 Binary files /dev/null and b/Doc/img/nd_img_IsErrorAsExec.png differ diff --git a/Doc/img/nd_img_K2_EnableModManagement.png b/Doc/img/nd_img_K2_EnableModManagement.png index 745c1df..527579a 100644 Binary files a/Doc/img/nd_img_K2_EnableModManagement.png and b/Doc/img/nd_img_K2_EnableModManagement.png differ diff --git a/Doc/img/nd_img_K2_ForceUninstallModAsync.png b/Doc/img/nd_img_K2_ForceUninstallModAsync.png index 79820e8..47f87ca 100644 Binary files a/Doc/img/nd_img_K2_ForceUninstallModAsync.png and b/Doc/img/nd_img_K2_ForceUninstallModAsync.png differ diff --git a/Doc/img/nd_img_K2_GetGameInfoAsync.png b/Doc/img/nd_img_K2_GetGameInfoAsync.png index a8c54df..092f1dd 100644 Binary files a/Doc/img/nd_img_K2_GetGameInfoAsync.png and b/Doc/img/nd_img_K2_GetGameInfoAsync.png differ diff --git a/Doc/img/nd_img_K2_GetLanguage.png b/Doc/img/nd_img_K2_GetLanguage.png new file mode 100644 index 0000000..48c802c Binary files /dev/null and b/Doc/img/nd_img_K2_GetLanguage.png differ diff --git a/Doc/img/nd_img_K2_GetUserDelegationTokenAsync.png b/Doc/img/nd_img_K2_GetUserDelegationTokenAsync.png new file mode 100644 index 0000000..31e004d Binary files /dev/null and b/Doc/img/nd_img_K2_GetUserDelegationTokenAsync.png differ diff --git a/Doc/img/nd_img_K2_GetUserDerivedTokenAsync.png b/Doc/img/nd_img_K2_GetUserDerivedTokenAsync.png deleted file mode 100644 index ed29d82..0000000 Binary files a/Doc/img/nd_img_K2_GetUserDerivedTokenAsync.png and /dev/null differ diff --git a/Doc/img/nd_img_K2_ListUserGamesAsync.png b/Doc/img/nd_img_K2_ListUserGamesAsync.png index aefdff4..04d8b0f 100644 Binary files a/Doc/img/nd_img_K2_ListUserGamesAsync.png and b/Doc/img/nd_img_K2_ListUserGamesAsync.png differ diff --git a/Doc/img/nd_img_K2_MuteUserAsync.png b/Doc/img/nd_img_K2_MuteUserAsync.png index 5db2e7e..ad8750c 100644 Binary files a/Doc/img/nd_img_K2_MuteUserAsync.png and b/Doc/img/nd_img_K2_MuteUserAsync.png differ diff --git a/Doc/img/nd_img_K2_RemoveFromTempModSet.png b/Doc/img/nd_img_K2_RemoveFromTempModSet.png index 37ed49d..2307414 100644 Binary files a/Doc/img/nd_img_K2_RemoveFromTempModSet.png and b/Doc/img/nd_img_K2_RemoveFromTempModSet.png differ diff --git a/Doc/img/nd_img_K2_ReportContentAsync.png b/Doc/img/nd_img_K2_ReportContentAsync.png index 0e2abd9..c6c37f3 100644 Binary files a/Doc/img/nd_img_K2_ReportContentAsync.png and b/Doc/img/nd_img_K2_ReportContentAsync.png differ diff --git a/Doc/img/nd_img_K2_SubmitModChangesFromMemoryAsync.png b/Doc/img/nd_img_K2_SubmitModChangesFromMemoryAsync.png index 57aea0c..44f9476 100644 Binary files a/Doc/img/nd_img_K2_SubmitModChangesFromMemoryAsync.png and b/Doc/img/nd_img_K2_SubmitModChangesFromMemoryAsync.png differ diff --git a/Doc/img/nd_img_MakeEntitlementParams.png b/Doc/img/nd_img_MakeEntitlementParams.png index debacfe..a6eb89a 100644 Binary files a/Doc/img/nd_img_MakeEntitlementParams.png and b/Doc/img/nd_img_MakeEntitlementParams.png differ diff --git a/Doc/img/nd_img_MakeFromComponents.png b/Doc/img/nd_img_MakeFromComponents.png index 63644a7..ff2fa1e 100644 Binary files a/Doc/img/nd_img_MakeFromComponents.png and b/Doc/img/nd_img_MakeFromComponents.png differ diff --git a/Doc/img/nd_img_MakeInitializeOptions.png b/Doc/img/nd_img_MakeInitializeOptions.png index 9c9d324..8b67bc5 100644 Binary files a/Doc/img/nd_img_MakeInitializeOptions.png and b/Doc/img/nd_img_MakeInitializeOptions.png differ diff --git a/Doc/img/nd_img_ReconstructError.png b/Doc/img/nd_img_ReconstructError.png new file mode 100644 index 0000000..0034992 Binary files /dev/null and b/Doc/img/nd_img_ReconstructError.png differ diff --git a/Doc/img/nd_img_RefreshListByFilter.png b/Doc/img/nd_img_RefreshListByFilter.png index 13e8380..27df280 100644 Binary files a/Doc/img/nd_img_RefreshListByFilter.png and b/Doc/img/nd_img_RefreshListByFilter.png differ diff --git a/Doc/img/nd_img_RegisterDynamicTab.png b/Doc/img/nd_img_RegisterDynamicTab.png index dcd5c2d..52f8f3a 100644 Binary files a/Doc/img/nd_img_RegisterDynamicTab.png and b/Doc/img/nd_img_RegisterDynamicTab.png differ diff --git a/Doc/img/nd_img_RoundNumberString.png b/Doc/img/nd_img_RoundNumberString.png index 1ec8f43..01e04eb 100644 Binary files a/Doc/img/nd_img_RoundNumberString.png and b/Doc/img/nd_img_RoundNumberString.png differ diff --git a/Doc/img/nd_img_SetFloatArg.png b/Doc/img/nd_img_SetFloatArg.png index 885ca4c..54f530d 100644 Binary files a/Doc/img/nd_img_SetFloatArg.png and b/Doc/img/nd_img_SetFloatArg.png differ diff --git a/Doc/img/nd_img_SetIntegerArg.png b/Doc/img/nd_img_SetIntegerArg.png index 0ecbf38..e083751 100644 Binary files a/Doc/img/nd_img_SetIntegerArg.png and b/Doc/img/nd_img_SetIntegerArg.png differ diff --git a/Doc/img/nd_img_SetPortal.png b/Doc/img/nd_img_SetPortal.png index 068ed9f..f6889f4 100644 Binary files a/Doc/img/nd_img_SetPortal.png and b/Doc/img/nd_img_SetPortal.png differ diff --git a/Doc/img/nd_img_SetRetryRequestedDelegate.png b/Doc/img/nd_img_SetRetryRequestedDelegate.png index 513315f..2d6c6aa 100644 Binary files a/Doc/img/nd_img_SetRetryRequestedDelegate.png and b/Doc/img/nd_img_SetRetryRequestedDelegate.png differ diff --git a/Doc/img/nd_img_SetSessionIdentifier.png b/Doc/img/nd_img_SetSessionIdentifier.png index 3d40090..33c389a 100644 Binary files a/Doc/img/nd_img_SetSessionIdentifier.png and b/Doc/img/nd_img_SetSessionIdentifier.png differ diff --git a/Doc/img/nd_img_SetStringArg.png b/Doc/img/nd_img_SetStringArg.png index c57f269..ab470d2 100644 Binary files a/Doc/img/nd_img_SetStringArg.png and b/Doc/img/nd_img_SetStringArg.png differ diff --git a/Doc/img/nd_img_SetTextArg.png b/Doc/img/nd_img_SetTextArg.png index a4a0f83..5a59187 100644 Binary files a/Doc/img/nd_img_SetTextArg.png and b/Doc/img/nd_img_SetTextArg.png differ diff --git a/Doc/img/nd_img_SetTrackingModID.png b/Doc/img/nd_img_SetTrackingModID.png index 6a4795b..368145e 100644 Binary files a/Doc/img/nd_img_SetTrackingModID.png and b/Doc/img/nd_img_SetTrackingModID.png differ diff --git a/Doc/img/nd_img_ShowSearchResults.png b/Doc/img/nd_img_ShowSearchResults.png index c10f2c6..c00bb67 100644 Binary files a/Doc/img/nd_img_ShowSearchResults.png and b/Doc/img/nd_img_ShowSearchResults.png differ diff --git a/Doc/img/nd_img_ToFilterParams.png b/Doc/img/nd_img_ToFilterParams.png new file mode 100644 index 0000000..917f2a1 Binary files /dev/null and b/Doc/img/nd_img_ToFilterParams.png differ diff --git a/Doc/img/purchase_mod.png b/Doc/img/purchase_mod.png new file mode 100644 index 0000000..8f87a02 Binary files /dev/null and b/Doc/img/purchase_mod.png differ diff --git a/Doc/img/show_user_purchases.png b/Doc/img/show_user_purchases.png new file mode 100644 index 0000000..30f5a2c Binary files /dev/null and b/Doc/img/show_user_purchases.png differ diff --git a/README.adoc b/README.adoc index 8ba9284..cca66c6 100644 --- a/README.adoc +++ b/README.adoc @@ -5,7 +5,7 @@ image:https://img.shields.io/badge/license-MIT-brightgreen.svg[alt="License", link="https://github.com/modio/modio-sdk/blob/master/LICENSE"] image:https://img.shields.io/discord/389039439487434752.svg?label=Discord&logo=discord&color=7289DA&labelColor=2C2F33[alt="Discord", link="https://discord.mod.io"] -image:https://img.shields.io/badge/docs-master-green.svg[alt="Master Docs", link="https://go.mod.io/ue-docs"] +image:https://img.shields.io/badge/docs-master-green.svg[alt="Master Docs", link="https://docs.mod.io/unreal/"] image:https://img.shields.io/badge/Unreal-4.26%2B-dea309[alt="Unreal Engine", link="https://www.unrealengine.com"] Welcome to the mod.io Unreal Engine plugin repository. It allows game developers to host and automatically install user-created mods in their Unreal Engine games. It provides a UI for mod discovery, installation and collection management, and a C++ and Blueprint interface around the mod.io SDK, which connects to the https://docs.mod.io[mod.io REST API]. @@ -99,13 +99,13 @@ Before release, you will be able to setup a "hidden" Live environment that will == Further reading -To begin using the Plugin, either from Blueprint or from C++, please read our https://go.mod.io/ue-docs[Getting Started Guide] for a detailed explanation of initialization and usage. +To begin using the Plugin, either from Blueprint or from C++, please read our https://docs.mod.io/unreal/[Getting Started Guide] for a detailed explanation of initialization and usage. -* https://go.mod.io/ue-docs#_plugin_quick_start_initialization_and_teardown[SDK initialization and event loop] -* https://go.mod.io/ue-docs#_plugin_quick_start_user_authentication[Authentication] -* https://go.mod.io/ue-docs#_plugin_quick_start_browsing_available_mods[Mod Browsing] -* https://go.mod.io/ue-docs#_plugin_quick_start_mod_subscriptions_and_management[Mod Subscription Management] -* link:Doc/mod-creation-tool-documentation.adoc[Content Creation & Upload Tool] +* https://docs.mod.io/unreal/getting-started/#plugin-quick-start-initialization-and-teardown[SDK initialization and event loop] +* https://docs.mod.io/unreal/getting-started/#plugin-quick-start-user-authentication[Authentication] +* https://docs.mod.io/unreal/getting-started/#plugin-quick-start-browsing-available-mods[Mod Browsing] +* https://docs.mod.io/unreal/getting-started/#plugin-quick-start-mod-subscriptions-and-management[Mod Subscription Management] +* https://docs.mod.io/unreal/mod-creation-tool/[Content Creation & Upload Tool] === User Interface diff --git a/Source/Modio/Modio.Build.cs b/Source/Modio/Modio.Build.cs index 0b568dd..40f9bae 100644 --- a/Source/Modio/Modio.Build.cs +++ b/Source/Modio/Modio.Build.cs @@ -278,7 +278,7 @@ private void ApplyTestConfig(string GeneratedHeaderPath, string GeneratedSourceP foreach(ModioTestConfigFile.FileToCopy TestFile in TestConfig.TestFiles) { Directory.CreateDirectory(Path.Combine(GeneratedHeaderPath, Path.GetDirectoryName(TestFile.DestPath))); - File.Copy(Path.Combine(ModuleDirectory, "../ThirdParty/NativeSDK", TestFile.SourcePath), Path.Combine(GeneratedHeaderPath, TestFile.DestPath)); + File.Copy(Path.Combine(ModuleDirectory, "../ThirdParty/NativeSDK", TestFile.SourcePath), Path.Combine(GeneratedHeaderPath, TestFile.DestPath), true); } } } diff --git a/Source/Modio/Private/Internal/Convert/FileMetadata.h b/Source/Modio/Private/Internal/Convert/FileMetadata.h index 69b0427..a2d8bbd 100644 --- a/Source/Modio/Private/Internal/Convert/FileMetadata.h +++ b/Source/Modio/Private/Internal/Convert/FileMetadata.h @@ -59,6 +59,7 @@ FORCEINLINE FModioFileMetadata ToUnreal(const Modio::FileMetadata& FileMetadata) Out.CurrentVirusScanStatus = ToUnreal(FileMetadata.CurrentVirusScanStatus); Out.CurrentVirusStatus = ToUnreal(FileMetadata.CurrentVirusStatus); Out.Filesize = ToUnreal(FileMetadata.Filesize); + Out.FilesizeUncompressed = ToUnreal(FileMetadata.FilesizeUncompressed); Out.Filename = ToUnreal(FileMetadata.Filename); Out.Version = ToUnreal(FileMetadata.Version); Out.Changelog = ToUnreal(FileMetadata.Changelog); diff --git a/Source/Modio/Private/Internal/Convert/FilterParams.h b/Source/Modio/Private/Internal/Convert/FilterParams.h index ff823aa..cd1539f 100644 --- a/Source/Modio/Private/Internal/Convert/FilterParams.h +++ b/Source/Modio/Private/Internal/Convert/FilterParams.h @@ -61,6 +61,8 @@ FORCEINLINE Modio::FilterParams::SortFieldType ToModio(EModioSortFieldType Envir return Modio::FilterParams::SortFieldType::DateUpdated; case EModioSortFieldType::DownloadsTotal: return Modio::FilterParams::SortFieldType::DownloadsTotal; + case EModioSortFieldType::Alphabetical: + return Modio::FilterParams::SortFieldType::Alphabetical; } return Modio::FilterParams::SortFieldType::ID; diff --git a/Source/Modio/Private/Internal/Convert/ModDependency.h b/Source/Modio/Private/Internal/Convert/ModDependency.h index 6d0c7bf..a474a71 100644 --- a/Source/Modio/Private/Internal/Convert/ModDependency.h +++ b/Source/Modio/Private/Internal/Convert/ModDependency.h @@ -17,5 +17,15 @@ FORCEINLINE FModioModDependency ToUnreal(const Modio::ModDependency& In) FModioModDependency Out; Out.ModID = ToUnreal(In.ModID); Out.ModName = ToUnreal(In.ModName); + Out.DateAdded = ToUnrealDateTime(In.DateAdded); + Out.DateUpdated = ToUnrealDateTime(In.DateUpdated); + Out.DependencyDepth = In.DependencyDepth; + Modio::Detail::Logo Logo; + if (In.FileInfo.has_value()) + { + Out.FileInfo = ToUnreal(In.FileInfo.value()); + } + Out.Status = (EModioModServerSideStatus) In.Status; + Out.Visibility = (EModioObjectVisibilityFlags) In.Visibility; return Out; } \ No newline at end of file diff --git a/Source/Modio/Private/Internal/ModioConvert.cpp b/Source/Modio/Private/Internal/ModioConvert.cpp index cabfb76..cc8018f 100644 --- a/Source/Modio/Private/Internal/ModioConvert.cpp +++ b/Source/Modio/Private/Internal/ModioConvert.cpp @@ -95,6 +95,11 @@ FText ToUnrealText(const std::string& String) return FText::FromString(UTF8_TO_TCHAR(String.c_str())); } +FString ToUnrealString(EModioLanguage Language) +{ + return FString(ToUnreal(Modio::Detail::ToString(ToModio(Language)))); +} + Modio::ApiKey ToModio(const FModioApiKey& In) { return Modio::ApiKey(TCHAR_TO_UTF8(*In.ToString())); @@ -140,6 +145,8 @@ Modio::LogLevel ToModio(EModioLogLevel UnrealLogLevel) return Modio::LogLevel::Trace; case EModioLogLevel::Warning: return Modio::LogLevel::Warning; + case EModioLogLevel::Detailed: + return Modio::LogLevel::Detailed; } checkf(false, TEXT("Missed a case in ToModio(EModioLogLevel UnrealLogLevel)")); @@ -391,3 +398,43 @@ EModioModChangeType ToUnreal(const Modio::UserSubscriptionList::ChangeType& In) return EModioModChangeType::Removed; } } + +EModioLanguage ToUnreal(const Modio::Language& In) +{ + switch (In) + { + case Modio::Language::English: + return EModioLanguage::English; + case Modio::Language::Bulgarian: + return EModioLanguage::Bulgarian; + case Modio::Language::French: + return EModioLanguage::French; + case Modio::Language::German: + return EModioLanguage::German; + case Modio::Language::Italian: + return EModioLanguage::Italian; + case Modio::Language::Polish: + return EModioLanguage::Polish; + case Modio::Language::Portuguese: + return EModioLanguage::Portuguese; + case Modio::Language::Hungarian: + return EModioLanguage::Hungarian; + case Modio::Language::Japanese: + return EModioLanguage::Japanese; + case Modio::Language::Korean: + return EModioLanguage::Korean; + case Modio::Language::Russian: + return EModioLanguage::Russian; + case Modio::Language::Spanish: + return EModioLanguage::Spanish; + case Modio::Language::Thai: + return EModioLanguage::Thai; + case Modio::Language::ChineseSimplified: + return EModioLanguage::ChineseSimplified; + case Modio::Language::ChineseTraditional: + return EModioLanguage::ChineseTraditional; + } + + checkf(false, TEXT("Missed a case in ToUnreal(Modio::Language Language)")); + return EModioLanguage::English; +} diff --git a/Source/Modio/Private/Internal/ModioConvert.h b/Source/Modio/Private/Internal/ModioConvert.h index 1815ae0..5427e00 100644 --- a/Source/Modio/Private/Internal/ModioConvert.h +++ b/Source/Modio/Private/Internal/ModioConvert.h @@ -28,6 +28,7 @@ uint64 ToUnreal(std::size_t Value); FString ToUnreal(const std::string& String); FDateTime ToUnrealDateTime(std::int64_t UnixTimestamp); FText ToUnrealText(const std::string& String); +FString ToUnrealString(EModioLanguage Language); struct FModioModID ToUnreal(Modio::ModID Value); struct FModioFileMetadataID ToUnreal(Modio::FileMetadataID Value); @@ -49,6 +50,7 @@ struct FModioGameStats ToUnreal(const Modio::GameStats& In); EModioModfilePlatform ToUnreal(const Modio::ModfilePlatform& In); struct FModioGamePlatform ToUnreal(const Modio::GamePlatform& In); EModioModChangeType ToUnreal(const Modio::UserSubscriptionList::ChangeType& In); +EModioLanguage ToUnreal(const Modio::Language& In); std::string ToModio(const FString& String); std::vector ToModio(const TArray& StringArray); diff --git a/Source/Modio/Private/Libraries/ModioErrorCodeLibrary.cpp b/Source/Modio/Private/Libraries/ModioErrorCodeLibrary.cpp index b2c6e88..8f73ab6 100644 --- a/Source/Modio/Private/Libraries/ModioErrorCodeLibrary.cpp +++ b/Source/Modio/Private/Libraries/ModioErrorCodeLibrary.cpp @@ -1,11 +1,11 @@ -/* +/* * Copyright (C) 2021 mod.io Pty Ltd. - * + * * This file is part of the mod.io UE4 Plugin. - * - * Distributed under the MIT License. (See accompanying file LICENSE or + * + * Distributed under the MIT License. (See accompanying file LICENSE or * view online at ) - * + * */ #include "Libraries/ModioErrorCodeLibrary.h" @@ -15,11 +15,22 @@ bool UModioErrorCodeLibrary::IsError(const FModioErrorCode& Error) return Error; } +bool UModioErrorCodeLibrary::IsErrorAsExec(const FModioErrorCode& Error) +{ + return IsError(Error); +} + FString UModioErrorCodeLibrary::GetMessage(const FModioErrorCode& Error) { return Error.GetErrorMessage(); } + +FModioErrorCode UModioErrorCodeLibrary::ReconstructError(int32 Value, int32 Category) +{ + return FModioErrorCode(Value, Category); +} + int32 UModioErrorCodeLibrary::GetValue(const FModioErrorCode& Error) { return Error.GetValue(); diff --git a/Source/Modio/Private/Libraries/ModioFilterParamsLibrary.cpp b/Source/Modio/Private/Libraries/ModioFilterParamsLibrary.cpp index 119a6d6..a806ee0 100644 --- a/Source/Modio/Private/Libraries/ModioFilterParamsLibrary.cpp +++ b/Source/Modio/Private/Libraries/ModioFilterParamsLibrary.cpp @@ -15,7 +15,8 @@ FModioFilterParams& UModioFilterParamsLibrary::MatchingAuthor(FModioFilterParams return Filter.MatchingAuthor(ID); } -FModioFilterParams& UModioFilterParamsLibrary::MatchingAuthors(FModioFilterParams& Filter, const TArray& IDs) +FModioFilterParams& UModioFilterParamsLibrary::MatchingAuthors(FModioFilterParams& Filter, + const TArray& IDs) { return Filter.MatchingAuthors(IDs); } @@ -91,4 +92,10 @@ FModioFilterParams& UModioFilterParamsLibrary::DisallowMatureContent(FModioFilte FModioFilterParams& UModioFilterParamsLibrary::WithMatureContentFlags(FModioFilterParams& Filter, int32 ByMaturity) { return Filter.WithMatureContentFlags(static_cast(ByMaturity)); +} + +FModioFilterParams& UModioFilterParamsLibrary::RevenueType(FModioFilterParams& Filter, + EModioRevenueFilterType RevenueType) +{ + return Filter.RevenueType(RevenueType); } \ No newline at end of file diff --git a/Source/Modio/Private/Libraries/ModioModDependenciesLibrary.cpp b/Source/Modio/Private/Libraries/ModioModDependenciesLibrary.cpp index 8f1b784..d98f9c0 100644 --- a/Source/Modio/Private/Libraries/ModioModDependenciesLibrary.cpp +++ b/Source/Modio/Private/Libraries/ModioModDependenciesLibrary.cpp @@ -15,8 +15,17 @@ const TArray& UModioModDependenciesLibrary::GetDependencies return DependencyList.InternalList; } -const FModioPagedResult& UModioModDependenciesLibrary::GetPagedResult( - const FModioModDependencyList& DependencyList) +const FModioPagedResult& UModioModDependenciesLibrary::GetPagedResult(const FModioModDependencyList& DependencyList) { return DependencyList.PagedResult; } + +const int64& UModioModDependenciesLibrary::GetTotalFilesize(const FModioModDependencyList& DependencyList) +{ + return DependencyList.TotalFilesize; +} + +const int64& UModioModDependenciesLibrary::GetTotalFilesizeUncompressed(const FModioModDependencyList& DependencyList) +{ + return DependencyList.TotalFilesizeUncompressed; +} \ No newline at end of file diff --git a/Source/Modio/Private/Libraries/ModioOptionalLibrary.cpp b/Source/Modio/Private/Libraries/ModioOptionalLibrary.cpp index 42e17e8..7624aa9 100644 --- a/Source/Modio/Private/Libraries/ModioOptionalLibrary.cpp +++ b/Source/Modio/Private/Libraries/ModioOptionalLibrary.cpp @@ -157,3 +157,21 @@ bool UModioOptionalLibrary::GetValue_ModioOptionalModID(const struct FModioOptio { return GetValueInternal(OptionalID, ID); } + +bool UModioOptionalLibrary::IsSet_ModioOptionalUInt64(const struct FModioOptionalUInt64& OptionalInt) +{ + return IsSetInternal(OptionalInt); +} + +bool UModioOptionalLibrary::GetValue_ModioOptionalUInt64(const struct FModioOptionalUInt64& OptionalInt, + FModioUnsigned64& UnderlyingInt) +{ + // FModioOptionalUInt64 uses TOptional internally rather than FModioUnsigned64, so we're not using the + // GetValueInternal() template function here + if (OptionalInt.Internal.IsSet()) + { + UnderlyingInt = FModioUnsigned64(OptionalInt.Internal.GetValue()); + return true; + } + return false; +} \ No newline at end of file diff --git a/Source/Modio/Private/Libraries/ModioSDKLibrary.cpp b/Source/Modio/Private/Libraries/ModioSDKLibrary.cpp index 2ee0b8d..f2a836f 100644 --- a/Source/Modio/Private/Libraries/ModioSDKLibrary.cpp +++ b/Source/Modio/Private/Libraries/ModioSDKLibrary.cpp @@ -13,6 +13,7 @@ #include "Internal/Convert/InitializeOptions.h" #include "Modio.h" #include "ModioSettings.h" +#include "Internal/ModioConvert.h" FModioGameID UModioSDKLibrary::GetProjectGameId() @@ -38,6 +39,7 @@ FModioInitializeOptions UModioSDKLibrary::GetProjectInitializeOptions() Options.ApiKey = FModioApiKey(Settings->ApiKey); Options.GameEnvironment = Settings->Environment; Options.GameId = FModioGameID(Settings->GameId); + Options.PortalInUse = Settings->DefaultPortal; Options.bUseBackgroundThread = Settings->bUseBackgroundThread; return Options; @@ -51,6 +53,7 @@ FModioInitializeOptions UModioSDKLibrary::GetProjectInitializeOptionsForSessionI Options.ApiKey = FModioApiKey(Settings->ApiKey); Options.GameEnvironment = Settings->Environment; Options.GameId = FModioGameID(Settings->GameId); + Options.PortalInUse = Settings->DefaultPortal; Options.LocalSessionIdentifier = SessionId; Options.bUseBackgroundThread = Settings->bUseBackgroundThread; @@ -117,10 +120,11 @@ FText UModioSDKLibrary::Filesize_ToString(int64 FileSize, int32 MinDecimals/* = FormatRules.MaximumFractionalDigits = MaxDecimals; FormatRules.MinimumIntegralDigits = 1; - Args.Add(TEXT("FileSize"), FText::AsNumber(InNewUnit, &FormatRules)); - Args.Add(TEXT("UnitName"), bIncludeUnitName ? FText::FromString(ToString(Unit)) : FText::GetEmpty()); - - return FText::Format(FTextFormat::FromString(TEXT("{FileSize}{UnitName}")), Args); + Args.Add("Number", FText::AsNumber(InNewUnit, &FormatRules)); + Args.Add("Unit", bIncludeUnitName ? FText::FromString(ToString(Unit)) : FText::GetEmpty()); + FText FormatString = FText::FromString(TEXT("{Number}{Unit}")); + FText::FindText(FTextKey("Internationalization"), FTextKey("ComputerMemoryFormatting"), FormatString) ; + return FText::Format(FormatString, Args); } bool UModioSDKLibrary::IsValidEmailAddressFormat(const FString& String) @@ -270,3 +274,20 @@ FString UModioSDKLibrary::GetDefaultSessionIdWindows() return FString(TEXT("")); #endif } + +FString UModioSDKLibrary::GetLanguageCodeString(EModioLanguage Language) +{ + return ToUnrealString(Language); +} + +EModioLanguage UModioSDKLibrary::GetLanguageCodeFromString(FString LanguageCode) +{ + for (EModioLanguage Language : TEnumRange()) + { + if (ToUnrealString(Language) == LanguageCode) + { + return Language; + } + } + return EModioLanguage::English; +} diff --git a/Source/Modio/Private/ModioSettings.cpp b/Source/Modio/Private/ModioSettings.cpp index 6e86bc5..6158aa9 100644 --- a/Source/Modio/Private/ModioSettings.cpp +++ b/Source/Modio/Private/ModioSettings.cpp @@ -17,7 +17,10 @@ #include "UnrealEdMisc.h" #endif -UModioSettings::UModioSettings() : LogLevel(EModioLogLevel::Info) {} +UModioSettings::UModioSettings() + : LogLevel(EModioLogLevel::Info), + LocalizationStringTable("/Modio/Data/ST_ModioStaticLocData.ST_ModioStaticLocData") +{} #if WITH_EDITOR void UModioSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) diff --git a/Source/Modio/Private/ModioSubsystem.cpp b/Source/Modio/Private/ModioSubsystem.cpp index 1ddfde6..4d42939 100644 --- a/Source/Modio/Private/ModioSubsystem.cpp +++ b/Source/Modio/Private/ModioSubsystem.cpp @@ -30,8 +30,8 @@ #include "Internal/Convert/ModManagementEvent.h" #include "Internal/Convert/ModProgressInfo.h" #include "Internal/Convert/ModTagInfo.h" -#include "Internal/Convert/ModTagOptions.h" #include "Internal/Convert/ModTagLocalization.h" +#include "Internal/Convert/ModTagOptions.h" #include "Internal/Convert/Rating.h" #include "Internal/Convert/ReportParams.h" #include "Internal/Convert/Terms.h" @@ -41,13 +41,14 @@ #include "Internal/ModioConvert.h" #include "Kismet/BlueprintFunctionLibrary.h" #include "ModioSettings.h" +#include "Libraries/ModioSDKLibrary.h" #include "ProfilingDebugging/CpuProfilerTrace.h" #include template TMap ToUnreal(std::map& OriginalMap); -template +template TMap ToUnreal(std::map&& OriginalMap) { return ToUnreal(OriginalMap); @@ -62,7 +63,8 @@ Dest ToBP(Source Original); FModioBackgroundThread::FModioBackgroundThread(UModioSubsystem* ModioSubsystem) { CurrentModioSubsystem = ModioSubsystem; - CurrentRunningThread = TUniquePtr(FRunnableThread::Create(this, TEXT("ModioBackgroundThread"), 0U, EThreadPriority::TPri_Normal)); + CurrentRunningThread = TUniquePtr( + FRunnableThread::Create(this, TEXT("ModioBackgroundThread"), 0U, EThreadPriority::TPri_Normal)); } FModioBackgroundThread::~FModioBackgroundThread() @@ -237,39 +239,37 @@ void UModioSubsystem::ListAllModsAsync(const FModioFilterParams& Filter, FOnList }); } -MODIO_API void UModioSubsystem::ListUserGamesAsync(const FModioFilterParams& Filter, FOnListUserGamesDelegateFast Callback) -{ - Modio::ListUserGamesAsync(ToModio(Filter), - [Callback](Modio::ErrorCode ec, Modio::Optional Result) { - AsyncTask(ENamedThreads::GameThread, ([Callback, ec, Result]() { - TRACE_CPUPROFILER_EVENT_SCOPE(TEXT("Callback")); - Callback.ExecuteIfBound(ec, ToUnrealOptional(Result)); - })); - }); -} - -void UModioSubsystem::SubscribeToModAsync(FModioModID ModToSubscribeTo, FOnErrorOnlyDelegateFast OnSubscribeComplete) +MODIO_API void UModioSubsystem::ListUserGamesAsync(const FModioFilterParams& Filter, + FOnListUserGamesDelegateFast Callback) { - SubscribeToModAsync(ModToSubscribeTo, false, MoveTemp(OnSubscribeComplete)); + Modio::ListUserGamesAsync( + ToModio(Filter), [Callback](Modio::ErrorCode ec, Modio::Optional Result) { + AsyncTask(ENamedThreads::GameThread, ([Callback, ec, Result]() { + TRACE_CPUPROFILER_EVENT_SCOPE(TEXT("Callback")); + Callback.ExecuteIfBound(ec, ToUnrealOptional(Result)); + })); + }); } -void UModioSubsystem::SubscribeToModAsync(FModioModID ModToSubscribeTo, bool IncludeDependencies, FOnErrorOnlyDelegateFast OnSubscribeComplete) +void UModioSubsystem::SubscribeToModAsync(FModioModID ModToSubscribeTo, bool IncludeDependencies, + FOnErrorOnlyDelegateFast OnSubscribeComplete) { - Modio::SubscribeToModAsync(ToModio(ModToSubscribeTo), IncludeDependencies, [WeakThis = TWeakObjectPtr(this), - OnSubscribeComplete](Modio::ErrorCode ec) { - if (!WeakThis.IsValid()) - { - return; - } - AsyncTask(ENamedThreads::GameThread, ([WeakThis, OnSubscribeComplete, ec]() { - if (WeakThis.IsValid()) - { - TRACE_CPUPROFILER_EVENT_SCOPE(TEXT("Callback")); - WeakThis->InvalidateUserSubscriptionCache(); - OnSubscribeComplete.ExecuteIfBound(ToUnreal(ec)); - } - })); - }); + Modio::SubscribeToModAsync( + ToModio(ModToSubscribeTo), IncludeDependencies, + [WeakThis = TWeakObjectPtr(this), OnSubscribeComplete](Modio::ErrorCode ec) { + if (!WeakThis.IsValid()) + { + return; + } + AsyncTask(ENamedThreads::GameThread, ([WeakThis, OnSubscribeComplete, ec]() { + if (WeakThis.IsValid()) + { + TRACE_CPUPROFILER_EVENT_SCOPE(TEXT("Callback")); + WeakThis->InvalidateUserSubscriptionCache(); + OnSubscribeComplete.ExecuteIfBound(ToUnreal(ec)); + } + })); + }); } void UModioSubsystem::UnsubscribeFromModAsync(FModioModID ModToUnsubscribeFrom, @@ -314,19 +314,28 @@ void UModioSubsystem::FetchExternalUpdatesAsync(FOnErrorOnlyDelegateFast OnFetch void UModioSubsystem::PreviewExternalUpdatesAsync(FOnPreviewExternalUpdatesDelegateFast OnPreviewDone) { Modio::PreviewExternalUpdatesAsync( - [WeakThis = TWeakObjectPtr(this), OnPreviewDone](Modio::ErrorCode ec, std::map PreviewMap) { + [WeakThis = TWeakObjectPtr(this), OnPreviewDone]( + Modio::ErrorCode ec, std::map PreviewMap) { if (!WeakThis.IsValid()) { return; } - AsyncTask(ENamedThreads::GameThread, ([WeakThis, OnPreviewDone, ec, PreviewMap = MoveTemp(PreviewMap)]() mutable { + AsyncTask(ENamedThreads::GameThread, + ([WeakThis, OnPreviewDone, ec, PreviewMap = MoveTemp(PreviewMap)]() mutable { if (WeakThis.IsValid()) { TRACE_CPUPROFILER_EVENT_SCOPE(TEXT("Callback")); WeakThis->InvalidateUserSubscriptionCache(); - TOptional Result(ToUnreal(PreviewMap)); - OnPreviewDone.ExecuteIfBound(ToUnreal(ec), Result); + if (ec) + { + OnPreviewDone.ExecuteIfBound(ToUnreal(ec), {}); + } + else + { + FModioModChangeMap Result {ToUnreal(PreviewMap)}; + OnPreviewDone.ExecuteIfBound(ToUnreal(ec), Result); + } } })); }); @@ -359,15 +368,17 @@ void UModioSubsystem::K2_ListAllModsAsync(const FModioFilterParams& Filter, FOnL })); } -MODIO_API void UModioSubsystem::K2_ListUserGamesAsync(const FModioFilterParams& Filter, FOnListUserGamesDelegate Callback) +MODIO_API void UModioSubsystem::K2_ListUserGamesAsync(const FModioFilterParams& Filter, + FOnListUserGamesDelegate Callback) { ListUserGamesAsync(Filter, FOnListUserGamesDelegateFast::CreateLambda( - [Callback](FModioErrorCode ec, TOptional GameList) { + [Callback](FModioErrorCode ec, TOptional GameList) { Callback.ExecuteIfBound(ec, ToBP(GameList)); - })); + })); } -void UModioSubsystem::K2_SubscribeToModAsync(FModioModID ModToSubscribeTo, bool IncludeDependencies, FOnErrorOnlyDelegate OnSubscribeComplete) +void UModioSubsystem::K2_SubscribeToModAsync(FModioModID ModToSubscribeTo, bool IncludeDependencies, + FOnErrorOnlyDelegate OnSubscribeComplete) { SubscribeToModAsync(ModToSubscribeTo, IncludeDependencies, FOnErrorOnlyDelegateFast::CreateLambda( @@ -391,10 +402,9 @@ void UModioSubsystem::K2_FetchExternalUpdatesAsync(FOnErrorOnlyDelegate OnFetchD void UModioSubsystem::K2_PreviewExternalUpdatesAsync(FOnPreviewExternalUpdatesDelegate OnPreviewDone) { - PreviewExternalUpdatesAsync( - FOnPreviewExternalUpdatesDelegateFast::CreateLambda([this, OnPreviewDone](FModioErrorCode ec, TOptional PreviewMap) - { - OnPreviewDone.ExecuteIfBound(ec, ToBP(PreviewMap)); + PreviewExternalUpdatesAsync(FOnPreviewExternalUpdatesDelegateFast::CreateLambda( + [this, OnPreviewDone](FModioErrorCode ec, TOptional PreviewMap) { + OnPreviewDone.ExecuteIfBound(ec, ToBP(PreviewMap)); })); } @@ -596,7 +606,8 @@ void UModioSubsystem::GetModMediaAsync(FModioModID ModId, EModioGallerySize Gall FOnGetMediaDelegateFast Callback) { const TTuple ModIdSizeIndexTuple = MakeTuple(ModId, GallerySize, Index); - if (FOnGetMediaMulticastDelegateFast* MulticastCallbackPtr = PendingModMediaGalleryRequests.Find(ModIdSizeIndexTuple)) + if (FOnGetMediaMulticastDelegateFast* MulticastCallbackPtr = + PendingModMediaGalleryRequests.Find(ModIdSizeIndexTuple)) { MulticastCallbackPtr->Add(Callback); return; @@ -605,7 +616,7 @@ void UModioSubsystem::GetModMediaAsync(FModioModID ModId, EModioGallerySize Gall Modio::GetModMediaAsync( ToModio(ModId), ToModio(GallerySize), Index, [WeakThis = TWeakObjectPtr(this), ModIdSizeIndexTuple](Modio::ErrorCode ec, - Modio::Optional Path) { + Modio::Optional Path) { if (!WeakThis.IsValid()) { return; @@ -816,18 +827,18 @@ void UModioSubsystem::K2_AuthenticateUserExternalAsync(const FModioAuthenticatio void UModioSubsystem::GetTermsOfUseAsync(FOnGetTermsOfUseDelegateFast Callback) { - Modio::GetTermsOfUseAsync( [Callback](Modio::ErrorCode ec, Modio::Optional Terms) { + Modio::GetTermsOfUseAsync([Callback](Modio::ErrorCode ec, Modio::Optional Terms) { AsyncTask(ENamedThreads::GameThread, ([Callback, ec, Terms]() { Callback.ExecuteIfBound(ec, ToUnrealOptional(Terms)); })); }); } -void UModioSubsystem::K2_GetTermsOfUseAsync( FOnGetTermsOfUseDelegate Callback) +void UModioSubsystem::K2_GetTermsOfUseAsync(FOnGetTermsOfUseDelegate Callback) { - GetTermsOfUseAsync(FOnGetTermsOfUseDelegateFast::CreateLambda( - [Callback](FModioErrorCode ec, TOptional Terms) { - Callback.ExecuteIfBound(ec, ToBP(Terms)); - })); + GetTermsOfUseAsync( + FOnGetTermsOfUseDelegateFast::CreateLambda([Callback](FModioErrorCode ec, TOptional Terms) { + Callback.ExecuteIfBound(ec, ToBP(Terms)); + })); } void UModioSubsystem::SetLanguage(EModioLanguage Locale) @@ -840,6 +851,16 @@ void UModioSubsystem::K2_SetLanguage(EModioLanguage Locale) SetLanguage(Locale); } +EModioLanguage UModioSubsystem::GetLanguage() +{ + return ToUnreal(Modio::GetLanguage()); +} + +EModioLanguage UModioSubsystem::K2_GetLanguage() +{ + return GetLanguage(); +} + void UModioSubsystem::ClearUserDataAsync(FOnErrorOnlyDelegateFast Callback) { Modio::ClearUserDataAsync([Callback](Modio::ErrorCode ec) { @@ -978,20 +999,19 @@ TArray ToUnreal(const std::vector& Or return Result; } -void UModioSubsystem::GetModDependenciesAsync(FModioModID ModID, FOnGetModDependenciesDelegateFast Callback) -{ - GetModDependenciesAsync(ModID, false, MoveTemp(Callback)); -} - -void UModioSubsystem::GetModDependenciesAsync(FModioModID ModID, bool Recursive, FOnGetModDependenciesDelegateFast Callback) +void UModioSubsystem::GetModDependenciesAsync(FModioModID ModID, bool Recursive, + FOnGetModDependenciesDelegateFast Callback) { Modio::GetModDependenciesAsync( - ToModio(ModID), Recursive, [Callback](Modio::ErrorCode ec, Modio::Optional Dependencies) { + ToModio(ModID), Recursive, + [Callback](Modio::ErrorCode ec, Modio::Optional Dependencies) { if (Dependencies) { FModioModDependencyList Out; Out.InternalList = ToUnreal(Dependencies->GetRawList()); Out.PagedResult = FModioPagedResult(Dependencies.value()); + Out.TotalFilesize = Dependencies.value().TotalFilesize; + Out.TotalFilesizeUncompressed = Dependencies.value().TotalFilesizeUncompressed; AsyncTask(ENamedThreads::GameThread, ([Callback, ec, Out]() { Callback.ExecuteIfBound(ec, Out); })); } else @@ -1006,13 +1026,15 @@ FModioModCreationHandle UModioSubsystem::GetModCreationHandle() return ToUnreal(Modio::GetModCreationHandle()); } -void UModioSubsystem::K2_GetModDependenciesAsync(FModioModID ModID, bool Recursive, FOnGetModDependenciesDelegate Callback) +void UModioSubsystem::K2_GetModDependenciesAsync(FModioModID ModID, bool Recursive, + FOnGetModDependenciesDelegate Callback) { - GetModDependenciesAsync(ModID, Recursive, FOnGetModDependenciesDelegateFast::CreateLambda( - [Callback](FModioErrorCode ec, TOptional Dependencies) { - Callback.ExecuteIfBound( - ec, FModioOptionalModDependencyList(MoveTempIfPossible(Dependencies))); - })); + GetModDependenciesAsync(ModID, Recursive, + FOnGetModDependenciesDelegateFast::CreateLambda( + [Callback](FModioErrorCode ec, TOptional Dependencies) { + Callback.ExecuteIfBound( + ec, FModioOptionalModDependencyList(MoveTempIfPossible(Dependencies))); + })); } void UModioSubsystem::SubmitNewModFileForMod(FModioModID Mod, FModioCreateModFileParams Params) @@ -1208,7 +1230,6 @@ TMap UModioSubsystem::QueryTempModSet() return ToUnreal(Modio::QueryTempModSet()); } - FModioErrorCode UModioSubsystem::K2_InitTempModSet(TArray ModIds) { return InitTempModSet(ModIds); @@ -1236,16 +1257,7 @@ TMap UModioSubsystem::K2_QueryTempModSet( EModioLanguage UModioSubsystem::ConvertLanguageCodeToModio(FString LanguageCode) { - if (LanguageMap.Contains(LanguageCode)) - { - return LanguageMap[LanguageCode]; - } - else - { - UE_LOG(LogModio, Log, TEXT("Language code %s does not correspond to a valid EModioLanguage value"), - *LanguageCode); - return EModioLanguage::English; - } + return UModioSDKLibrary::GetLanguageCodeFromString(LanguageCode); } void UModioSubsystem::FetchUserPurchasesAsync(FOnFetchUserPurchasesDelegateFast Callback) @@ -1257,76 +1269,71 @@ void UModioSubsystem::FetchUserPurchasesAsync(FOnFetchUserPurchasesDelegateFast void UModioSubsystem::K2_FetchUserPurchasesAsync(FOnFetchUserPurchasesDelegate Callback) { - FetchUserPurchasesAsync( - FOnFetchUserPurchasesDelegateFast::CreateLambda([Callback](FModioErrorCode ec) { - Callback.ExecuteIfBound(ec); - })); + FetchUserPurchasesAsync(FOnFetchUserPurchasesDelegateFast::CreateLambda( + [Callback](FModioErrorCode ec) { Callback.ExecuteIfBound(ec); })); } void UModioSubsystem::GetUserWalletBalanceAsync(FOnGetUserWalletBalanceDelegateFast Callback) { - Modio::GetUserWalletBalanceAsync([Callback](Modio::ErrorCode ec, Modio::Optional WalletBalance) { + Modio::GetUserWalletBalanceAsync([Callback](Modio::ErrorCode ec, Modio::Optional WalletBalance) { AsyncTask(ENamedThreads::GameThread, ([Callback, ec, WalletBalance]() { if (WalletBalance.has_value()) { - Callback.ExecuteIfBound(ec, static_cast(WalletBalance.value())); - } else + Callback.ExecuteIfBound(ec, static_cast(WalletBalance.value())); + } + else { - Callback.ExecuteIfBound(ec, {}); + Callback.ExecuteIfBound(ec, {}); } - - })); + })); }); } void UModioSubsystem::K2_GetUserWalletBalanceAsync(FOnGetUserWalletBalanceDelegate Callback) { GetUserWalletBalanceAsync(FOnGetUserWalletBalanceDelegateFast::CreateLambda( - [Callback](FModioErrorCode ec, TOptional WalletBalance) { Callback.ExecuteIfBound(ec, ToBP(WalletBalance));})); + [Callback](FModioErrorCode ec, TOptional WalletBalance) { + Callback.ExecuteIfBound(ec, ToBP(WalletBalance)); + })); } - TMap UModioSubsystem::QueryUserPurchasedMods() { return ToUnreal(Modio::QueryUserPurchasedMods()); } - -void UModioSubsystem::PurchaseModAsync(FModioModID ModID, uint64_t ExpectedPrice, FOnPurchaseModDelegateFast Callback) +void UModioSubsystem::PurchaseModAsync(FModioModID ModID, uint64 ExpectedPrice, FOnPurchaseModDelegateFast Callback) { - Modio::PurchaseModAsync(ToModio(ModID), ExpectedPrice, [Callback](Modio::ErrorCode ec, Modio::Optional TransactionRecord) { - AsyncTask(ENamedThreads::GameThread, ([Callback, ec, TransactionRecord]() { - Callback.ExecuteIfBound(ec, ToUnrealOptional(TransactionRecord)); - })); - }); + Modio::PurchaseModAsync( + ToModio(ModID), ExpectedPrice, + [Callback](Modio::ErrorCode ec, Modio::Optional TransactionRecord) { + AsyncTask(ENamedThreads::GameThread, ([Callback, ec, TransactionRecord]() { + Callback.ExecuteIfBound(ec, ToUnrealOptional(TransactionRecord)); + })); + }); } void UModioSubsystem::K2_PurchaseModAsync(FModioModID ModID, FModioUnsigned64 ExpectedPrice, FOnPurchaseModDelegate Callback) { - PurchaseModAsync( - ModID, ExpectedPrice.Underlying, - FOnPurchaseModDelegateFast::CreateLambda( - [Callback](FModioErrorCode ec, TOptional TransactionRecord) { + PurchaseModAsync(ModID, ExpectedPrice.Underlying, + FOnPurchaseModDelegateFast::CreateLambda( + [Callback](FModioErrorCode ec, TOptional TransactionRecord) { Callback.ExecuteIfBound(ec, ToBP(TransactionRecord)); - })); + })); } -void UModioSubsystem::GetUserDerivedTokenAsync(FOnGetUserDerivedTokenDelegateFast Callback) +void UModioSubsystem::GetUserDelegationTokenAsync(FOnGetUserDelegationTokenDelegateFast Callback) { - Modio::GetUserDerivedTokenAsync( - [Callback](Modio::ErrorCode ec, std::string Token) { - AsyncTask(ENamedThreads::GameThread, ([Callback, ec, Token]() { - Callback.ExecuteIfBound(ec, ToUnreal(Token)); - })); - }); + Modio::GetUserDelegationTokenAsync([Callback](Modio::ErrorCode ec, std::string Token) { + AsyncTask(ENamedThreads::GameThread, + ([Callback, ec, Token]() { Callback.ExecuteIfBound(ec, ToUnreal(Token)); })); + }); } -void UModioSubsystem::K2_GetUserDerivedTokenAsync(FOnGetUserDerivedTokenDelegate Callback) +void UModioSubsystem::K2_GetUserDelegationTokenAsync(FOnGetUserDelegationTokenDelegate Callback) { - GetUserDerivedTokenAsync(FOnGetUserDerivedTokenDelegateFast::CreateLambda( - [Callback](FModioErrorCode ec, FString Token) { - Callback.ExecuteIfBound(ec, Token); - })); + GetUserDelegationTokenAsync(FOnGetUserDelegationTokenDelegateFast::CreateLambda( + [Callback](FModioErrorCode ec, FString Token) { Callback.ExecuteIfBound(ec, Token); })); } /// File scope implementations diff --git a/Source/Modio/Private/Types/ModioErrorCode.cpp b/Source/Modio/Private/Types/ModioErrorCode.cpp index bc8af53..2450af4 100644 --- a/Source/Modio/Private/Types/ModioErrorCode.cpp +++ b/Source/Modio/Private/Types/ModioErrorCode.cpp @@ -1,11 +1,11 @@ -/* +/* * Copyright (C) 2021 mod.io Pty Ltd. - * + * * This file is part of the mod.io UE4 Plugin. - * - * Distributed under the MIT License. (See accompanying file LICENSE or + * + * Distributed under the MIT License. (See accompanying file LICENSE or * view online at ) - * + * */ #include "Types/ModioErrorCode.h" @@ -16,26 +16,31 @@ FModioErrorCode::FModioErrorCode(Modio::ErrorCode ec) InternalError = MakeUnique(ec); } - FModioErrorCode::FModioErrorCode() - { - InternalError = MakeUnique(); - } +FModioErrorCode::FModioErrorCode() +{ + InternalError = MakeUnique(); +} - FModioErrorCode::FModioErrorCode(const FModioErrorCode& Other) - { - InternalError = MakeUnique(Other.GetRawErrorCode()); - } +FModioErrorCode::FModioErrorCode(const FModioErrorCode& Other) +{ + InternalError = MakeUnique(Other.GetRawErrorCode()); +} - FModioErrorCode& FModioErrorCode::operator=(const FModioErrorCode& ec) +FModioErrorCode::FModioErrorCode(int32 Value, int32 CategoryID) { - InternalError = MakeUnique(ec.GetRawErrorCode()); + InternalError = MakeUnique(Value, Modio::Detail::GetModioErrorCategoryByID(CategoryID)); +} + +FModioErrorCode& FModioErrorCode::operator=(const FModioErrorCode& ec) +{ + InternalError = MakeUnique(ec.GetRawErrorCode()); return *this; } - FModioErrorCode::~FModioErrorCode() - { - InternalError.Reset(); - } +FModioErrorCode::~FModioErrorCode() +{ + InternalError.Reset(); +} FModioErrorCode::operator bool() const { @@ -47,6 +52,11 @@ int FModioErrorCode::GetValue() const return InternalError->value(); } +FString FModioErrorCode::GetCategoryString() const +{ + return FString(InternalError->category().name()); +} + Modio::ErrorCode FModioErrorCode::GetRawErrorCode() const { return *InternalError; @@ -64,3 +74,20 @@ FString FModioErrorCode::GetErrorMessage() const } } +FModioErrorCode FModioErrorCode::SystemError() +{ + static FModioErrorCode ec = FModioErrorCode(Modio::make_error_code(Modio::SystemError::UnknownSystemError)); + return ec; +} + +int32 FModioErrorCode::GetCategoryID() +{ + if (InternalError) + { + return Modio::Detail::ModioErrorCategoryID(InternalError->category()); + } + else + { + return -1; + } +} diff --git a/Source/Modio/Private/Types/ModioFilterParamsUImpl.cpp b/Source/Modio/Private/Types/ModioFilterParamsUImpl.cpp index 2c96827..df73492 100644 --- a/Source/Modio/Private/Types/ModioFilterParamsUImpl.cpp +++ b/Source/Modio/Private/Types/ModioFilterParamsUImpl.cpp @@ -139,4 +139,10 @@ FModioFilterParams& FModioFilterParams::WithMatureContentFlags(EModioMaturityFla { Maturity = ByMaturity; return *this; -} \ No newline at end of file +} + +FModioFilterParams& FModioFilterParams::RevenueType(EModioRevenueFilterType RevenueFilter) +{ + Revenue = RevenueFilter; + return *this; +} diff --git a/Source/Modio/Private/Types/ModioModDependencyListUImpl.cpp b/Source/Modio/Private/Types/ModioModDependencyListUImpl.cpp index e34be5d..fd53bf5 100644 --- a/Source/Modio/Private/Types/ModioModDependencyListUImpl.cpp +++ b/Source/Modio/Private/Types/ModioModDependencyListUImpl.cpp @@ -14,11 +14,3 @@ FModioOptionalModDependencyList::FModioOptionalModDependencyList(TOptional&& ModDependencies) : Internal(MoveTemp(ModDependencies)) {} - -FModioMapPreview::FModioMapPreview(PreviewMapDef&& ModPreview) - : Internal(MoveTemp(ModPreview)) -{} - -FModioOptionalMapPreview::FModioOptionalMapPreview(TOptional&& MapPreview) -: Internal(MoveTemp(MapPreview)) -{} diff --git a/Source/Modio/Public/Libraries/ModioErrorCodeLibrary.h b/Source/Modio/Public/Libraries/ModioErrorCodeLibrary.h index adb9ae6..eae6a3d 100644 --- a/Source/Modio/Public/Libraries/ModioErrorCodeLibrary.h +++ b/Source/Modio/Public/Libraries/ModioErrorCodeLibrary.h @@ -29,6 +29,16 @@ class MODIO_API UModioErrorCodeLibrary : public UBlueprintFunctionLibrary UFUNCTION(BlueprintPure, Category = "mod.io|Utilities|Error", meta = (CompactNodeTitle = "Error", BlueprintAutocast)) static bool IsError(const FModioErrorCode& Error); + /** + * Checks if a error code contains a error + * @param Error - + * @return true if the error code is a error + */ + UFUNCTION(BlueprintCallable, Category = "mod.io|Utilities|Error", + meta = (DisplayName = "IsError", ExpandBoolAsExecs = "ReturnValue")) + static bool IsErrorAsExec(const FModioErrorCode& Error); + + /** * Get underlying error code * @param Error - @@ -44,4 +54,14 @@ class MODIO_API UModioErrorCodeLibrary : public UBlueprintFunctionLibrary */ UFUNCTION(BlueprintPure, Category = "mod.io|Utilities|Error") static FString GetMessage(const FModioErrorCode& Error); + + /** + * Helper method to reconstruct a mod.io error passed via code that cannot reference mod.io types + * @param Value The numeric value of the code + * @param Category The category ID (populated by native code) + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Utilities|Error") + static FModioErrorCode ReconstructError(int32 Value, int32 Category); + + }; diff --git a/Source/Modio/Public/Libraries/ModioFilterParamsLibrary.h b/Source/Modio/Public/Libraries/ModioFilterParamsLibrary.h index 9f1bca5..115ebd5 100644 --- a/Source/Modio/Public/Libraries/ModioFilterParamsLibrary.h +++ b/Source/Modio/Public/Libraries/ModioFilterParamsLibrary.h @@ -177,5 +177,15 @@ class MODIO_API UModioFilterParamsLibrary : public UBlueprintFunctionLibrary * @return *this */ UFUNCTION(BlueprintPure, Category = "mod.io|Utilities|Filter") - static FModioFilterParams& WithMatureContentFlags(UPARAM(ref) FModioFilterParams& Filter, UPARAM(meta = (Bitmask, BitmaskEnum = EModioMaturityFlags)) int32 ByMaturity); + static FModioFilterParams& WithMatureContentFlags(UPARAM(ref) FModioFilterParams& Filter, + UPARAM(meta = (Bitmask, BitmaskEnum = EModioMaturityFlags)) + int32 ByMaturity); + + /** + * @brief Indicates results should be filtered by revenue type (free, paid, both) + * @param RevenueType Revenue type to filter by + * @return *this + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Utilities|Filter") + static FModioFilterParams& RevenueType(UPARAM(ref) FModioFilterParams& Filter, EModioRevenueFilterType RevenueType); }; diff --git a/Source/Modio/Public/Libraries/ModioModDependenciesLibrary.h b/Source/Modio/Public/Libraries/ModioModDependenciesLibrary.h index e517b12..7b50293 100644 --- a/Source/Modio/Public/Libraries/ModioModDependenciesLibrary.h +++ b/Source/Modio/Public/Libraries/ModioModDependenciesLibrary.h @@ -23,17 +23,33 @@ class MODIO_API UModioModDependenciesLibrary : public UBlueprintFunctionLibrary /** * Get the tags in a mod tag options list - * @param ModTags + * @param DependencyList * @return */ UFUNCTION(BlueprintPure, Category = "mod.io|Utilities") - static const TArray& GetDependencies(const FModioModDependencyList& ModTags); + static const TArray& GetDependencies(const FModioModDependencyList& DependencyList); /** * Get the paged result that contains information of the data returned - * @param ModTags + * @param DependencyList * @return */ UFUNCTION(BlueprintPure, Category = "mod.io|Utilities") - static const FModioPagedResult& GetPagedResult(const FModioModDependencyList& ModTags); + static const FModioPagedResult& GetPagedResult(const FModioModDependencyList& DependencyList); + + /** + * Get the total size of all the dependency files in bytes. + * @param DependencyList + * @return + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Utilities") + static const int64& GetTotalFilesize(const FModioModDependencyList& DependencyList); + + /** + * Get the total Size of the uncompressed dependency files in bytes + * @param DependencyList + * @return + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Utilities") + static const int64& GetTotalFilesizeUncompressed(const FModioModDependencyList& DependencyList); }; diff --git a/Source/Modio/Public/Libraries/ModioModTagOptionsLibrary.h b/Source/Modio/Public/Libraries/ModioModTagOptionsLibrary.h index e97085d..ea0823a 100644 --- a/Source/Modio/Public/Libraries/ModioModTagOptionsLibrary.h +++ b/Source/Modio/Public/Libraries/ModioModTagOptionsLibrary.h @@ -1,11 +1,11 @@ -/* +/* * Copyright (C) 2021 mod.io Pty Ltd. - * + * * This file is part of the mod.io UE4 Plugin. - * - * Distributed under the MIT License. (See accompanying file LICENSE or + * + * Distributed under the MIT License. (See accompanying file LICENSE or * view online at ) - * + * */ #pragma once @@ -15,15 +15,14 @@ #include "ModioModTagOptionsLibrary.generated.h" - UCLASS() class MODIO_API UModioModTagOptionsLibrary : public UBlueprintFunctionLibrary { GENERATED_BODY() - +public: /** * Get the tags in a mod tag options list - * @param ModTags + * @param ModTags * @return */ UFUNCTION(BlueprintPure, Category = "mod.io|Utilities") diff --git a/Source/Modio/Public/Libraries/ModioOptionalLibrary.h b/Source/Modio/Public/Libraries/ModioOptionalLibrary.h index 6beb960..2cdf5ce 100644 --- a/Source/Modio/Public/Libraries/ModioOptionalLibrary.h +++ b/Source/Modio/Public/Libraries/ModioOptionalLibrary.h @@ -19,6 +19,7 @@ #include "Types/ModioModProgressInfo.h" #include "Types/ModioModTagOptions.h" #include "Types/ModioTerms.h" +#include "Types/ModioUnsigned64.h" #include "ModioOptionalLibrary.generated.h" @@ -49,7 +50,7 @@ class MODIO_API UModioOptionalLibrary : public UBlueprintFunctionLibrary static bool GetValue_ModioOptionalModInfoList(const struct FModioOptionalModInfoList& OptionalModInfoList, struct FModioModInfoList& ModInfoList); - /** + /** * Check if the Game info list has a valid value * * @param OptionalGameInfoList - The optional to check @@ -69,7 +70,7 @@ class MODIO_API UModioOptionalLibrary : public UBlueprintFunctionLibrary UFUNCTION(BlueprintPure, Category = "mod.io|Utilities|Optional", DisplayName = "GetValue (ModioOptionalGameInfoList)") static bool GetValue_ModioOptionalGameInfoList(const struct FModioOptionalGameInfoList& OptionalGameInfoList, - struct FModioGameInfoList& GameInfoList); + struct FModioGameInfoList& GameInfoList); /** * Check if the mod info has a valid value @@ -262,4 +263,25 @@ class MODIO_API UModioOptionalLibrary : public UBlueprintFunctionLibrary */ UFUNCTION(BlueprintPure, Category = "mod.io|Utilities|Optional", DisplayName = "GetValue (ModioOptionalID)") static bool GetValue_ModioOptionalModID(const struct FModioOptionalModID& OptionalID, struct FModioModID& ID); + + /** + * Check if the FModioUnsigned64 has a valid value + * + * @param OptionalInt - The optional to check + * @return true if it has a value set + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Utilities|Optional", + meta = (DisplayName = "IsSet (ModioOptionalUInt64)", CompactNodeTitle = "IsSet")) + static bool IsSet_ModioOptionalUInt64(const struct FModioOptionalUInt64& OptionalInt); + + /** + * Get the FModioUnsigned64 from the optional if it's set + * + * @param OptionalInt - if this returned false, then this will be defaulted + * @param UnderlyingInt - the underlying value + * @return true if the optional has a value set + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Utilities|Optional", DisplayName = "GetValue (ModioOptionalUInt64)") + static bool GetValue_ModioOptionalUInt64(const struct FModioOptionalUInt64& OptionalInt, + FModioUnsigned64& UnderlyingInt); }; diff --git a/Source/Modio/Public/Libraries/ModioSDKLibrary.h b/Source/Modio/Public/Libraries/ModioSDKLibrary.h index 71a9fb3..f72c55f 100644 --- a/Source/Modio/Public/Libraries/ModioSDKLibrary.h +++ b/Source/Modio/Public/Libraries/ModioSDKLibrary.h @@ -16,28 +16,6 @@ #include "ModioSDKLibrary.generated.h" -/** -* Enumerator with the possible memory measurement units -**/ -UENUM(BlueprintType) -enum EFileSizeUnit -{ - /** Will take the largest one that becomes a number larger than 1 (i.e, 1300mb becomes 1.3gb) **/ - Largest = 0, - - /** A single byte **/ - B = 1, - - /** Kilo bytes **/ - KB = 1024, - - /** Mega bytes **/ - MB = 1024 * 1024, - - /** Giga bytes **/ - GB = 1024 * 1024 * 1024 -}; - UCLASS(MinimalAPI) class UModioSDKLibrary : public UBlueprintFunctionLibrary { @@ -168,4 +146,20 @@ class UModioSDKLibrary : public UBlueprintFunctionLibrary */ UFUNCTION(BlueprintPure, Category = "mod.io|Utilities") static MODIO_API FString GetDefaultSessionIdWindows(); + + /** + * @brief Get language code string. This can be used for localization purposes + * @param Language The language code to convert to string + * @return The language code as a string (e.g. "en", "fr", "de") + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Utilities") + static MODIO_API FString GetLanguageCodeString(EModioLanguage Language); + + /** + * @brief Get language code enum from string in ISO 639-1 format. This can be used for localization purposes + * @param LanguageCode The language code as a string (e.g. "en", "fr", "de") + * @return The language code as an enum + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Utilities") + static MODIO_API EModioLanguage GetLanguageCodeFromString(FString LanguageCode); }; diff --git a/Source/Modio/Public/Loc/ModioEnumLocalizationHelpers.h b/Source/Modio/Public/Loc/ModioEnumLocalizationHelpers.h new file mode 100644 index 0000000..52150bb --- /dev/null +++ b/Source/Modio/Public/Loc/ModioEnumLocalizationHelpers.h @@ -0,0 +1,145 @@ +#pragma once + +#include "Internationalization/StringTable.h" +#include "Internationalization/StringTableCore.h" +#include "Internationalization/StringTableRegistry.h" +#include "Internationalization/Text.h" +#include "ModioSettings.h" +#include "Types/ModioCommonTypes.h" +#include "Types/ModioUnsigned64.h" +#include "UObject/Class.h" +#include "UObject/NameTypes.h" + +#include "ModioEnumLocalizationHelpers.generated.h" + +namespace ModioUI +{ + template + void RegisterEnumAsLocalizable(FStringTableRef TargetTable) + { + UEnum* EnumReflectionData = StaticEnum(); + + int32 NumEnumEntries = EnumReflectionData->NumEnums() - 1; // Don't count the automatically added _MAX entry + for (int32 CurrentEntryIndex = 0; CurrentEntryIndex < NumEnumEntries; CurrentEntryIndex++) + { + FName NameStr = EnumReflectionData->GetNameByIndex(CurrentEntryIndex); + + FText DisplayString = EnumReflectionData->GetDisplayNameTextByIndex(CurrentEntryIndex); + TargetTable->SetSourceString(NameStr.ToString(), DisplayString.ToString()); + } + } + template + void RegisterCustomEnumValueLocalization(FStringTableRef TargetTable, EnumType EnumValue, FString SourceString) + { + UEnum* EnumReflectionData = StaticEnum(); + + FName EnumEntryNameStr = EnumReflectionData->GetNameByValue(static_cast(EnumValue)); + TargetTable->SetSourceString(EnumEntryNameStr.ToString(), SourceString); + }; +}; // namespace ModioUI + +UCLASS() +class MODIO_API UModioUIEnumLocalizationLibrary : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() +public: + // I'd prefer to do this such that you can pass in the enum value rather than the name but don't really want to deal + // with a whole custom K2Node to properly support generic enum values + + /// @brief Returns the string table FText for a given enum value's FName - *Only works with enums registered via + /// ModioUI::RegisterEnumAsLocalizable* + /// @param EnumName The Name from a given enum value + /// @return localized Text for the specified enum value, or dummy FText if not found + UFUNCTION(BlueprintCallable, BlueprintPure, Category = "mod.io|UI|Localization") + static FText GetLocalizedTextForEnumByName(const FName& EnumName) + { + if (const UModioSettings* PluginSettings = GetDefault()) + { + UStringTable* ModioStringTableAsset = Cast(PluginSettings->LocalizationStringTable.TryLoad()); + + if (ModioStringTableAsset) + { + auto StaticLocDataTable = ModioStringTableAsset->GetMutableStringTable(); + return FText::FromStringTable(ModioStringTableAsset->GetStringTableId(), EnumName.ToString()); + } + } + return FText::FromName(EnumName); + } + + /** + * Converts a Unsigned64 filesize to a human readable string with the appropriate unit + * + * @param FileSize - Filesize in bytes + * @param MaxDecimals - Maximum amount of decimals to display of the filesize + * @param Unit - If Largest, then it tries to display the size in the largest unit that will have a integral + * part > 0, else it displays the filesize in the specified unit + * @return A text formatted from your specifications + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Text", + meta = (DisplayName = "FileSizeToText (Unsigned64)", CompactNodeTitle = "FileSizeUnsigned64>Text")) + static FText FileSizeUnsigned64_ToText(FModioUnsigned64 FileSize, int32 MinDecimals = 0, int32 MaxDecimals = 2, + EFileSizeUnit Unit = EFileSizeUnit::Largest, bool bIncludeUnitName = true) + { + static const int32 KB = 1024; + static const int32 MB = 1024 * 1024; + static const int32 GB = 1024 * 1024 * 1024; + + if (Unit == EFileSizeUnit::Largest) + { + Unit = EFileSizeUnit::B; + if (FileSize.Underlying > KB) + { + Unit = EFileSizeUnit::KB; + } + if (FileSize.Underlying > MB) + { + Unit = EFileSizeUnit::MB; + } + if (FileSize.Underlying > GB) + { + Unit = EFileSizeUnit::GB; + } + } + + double InNewUnit = (double) FileSize / static_cast(Unit); + + FFormatNamedArguments Args; + + FNumberFormattingOptions FormatRules; + FormatRules.MinimumFractionalDigits = MinDecimals; + FormatRules.MaximumFractionalDigits = MaxDecimals; + FormatRules.MinimumIntegralDigits = 1; + + Args.Add(TEXT("FileSize"), FText::AsNumber(InNewUnit, &FormatRules)); + Args.Add(TEXT("UnitName"), + bIncludeUnitName ? GetLocalizedTextForEnumByName(StaticEnum()->GetNameByValue(Unit)) + : FText::GetEmpty()); + + return FText::Format(FTextFormat::FromString(TEXT("{FileSize}{UnitName}")), Args); + } +}; + +UCLASS() +class MODIO_API UModioUILocalizationLibrary : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() +public: + /// @brief Returns the string table FText for a given string key + /// @param StringKey The key to look up in the table + /// @return localized Text for the specified key, or StringKey if not found + UFUNCTION(BlueprintCallable, BlueprintPure, Category = "mod.io|UI|Localization") + static FText GetLocalizedTextFromDefaultTableByKey(const FString& StringKey) + { + if (const UModioSettings* PluginSettings = GetDefault()) + { + UStringTable* ModioStringTableAsset = Cast(PluginSettings->LocalizationStringTable.TryLoad()); + + if (ModioStringTableAsset) + { + auto StaticLocDataTable = ModioStringTableAsset->GetMutableStringTable(); + return FText::FromStringTable(ModioStringTableAsset->GetStringTableId(), StringKey); + } + } + return FText::FromString(StringKey); + } +}; \ No newline at end of file diff --git a/Source/Modio/Public/ModioSettings.h b/Source/Modio/Public/ModioSettings.h index a954764..5f25f51 100644 --- a/Source/Modio/Public/ModioSettings.h +++ b/Source/Modio/Public/ModioSettings.h @@ -11,6 +11,7 @@ #pragma once #include "Types/ModioCommonTypes.h" +#include "Types/ModioFilterParams.h" #include "Types/ModioInitializeOptions.h" #include "ModioSettings.generated.h" @@ -50,6 +51,46 @@ class MODIO_API UModioSettings : public UObject UPROPERTY(EditDefaultsOnly, config, Category = "Project") bool bUseBackgroundThread = false; + // TODO: These properties probably should go into ModioUISettings instead + + /** + * The maximum number of reattempts the Mod Menu will make on any network operation + */ + UPROPERTY(EditDefaultsOnly, config, Category = "Network") + int32 GlobalRetryLimit = 3; + + /** + * The string table asset which stores localization data for the plugin (user-facing strings for enums, etc) + */ + UPROPERTY(EditDefaultsOnly, config, Category = "Localization", meta = (MetaClass = StringTable)) + FSoftObjectPath LocalizationStringTable; + + /** + * Named sets of filter parameters for use in the default PresetFilterSelector UI component + */ + UPROPERTY(EditDefaultsOnly, config, Category = "UI Configuration") + TArray PresetNamedFilters; + + /** + * If enabled, default implementations of Monetization-related UI components will be visible and interactable in mod.io UI templates + */ + UPROPERTY(EditDefaultsOnly, config, Category = "Feature Flags", meta=(DisplayName="Enable Monetization widgets in UI")) + bool bEnableMonetizationFeature; + + /** + * If enabled, the UUGCSubsystem can manage mod enabled/disable state, if a valid IModEnabledStateProvider has been set via SetUGCEnabledStateProvider so you can persist the state appropriately + * If this is disabled, enable/disable widgets in the UI will be hidden + */ + UPROPERTY(EditDefaultsOnly, config, Category = "Feature Flags", meta = (DisplayName = "Enable Mod Enable/Disable support")) + bool bEnableModEnableDisableFeature; + + /** + * If enabled, widgets in mod.io UI templates will allow users to attempt to downvote mods. If downvoting is not enabled on the mod.io dashboards such votes will not be recorded + */ + UPROPERTY(EditDefaultsOnly, config, Category = "Feature Flags", meta=(DisplayName="Enable Mod Downvoting in UI")) + bool bEnableModDownvoteFeature; + + private: #if WITH_EDITOR void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; diff --git a/Source/Modio/Public/ModioSubsystem.h b/Source/Modio/Public/ModioSubsystem.h index 100421b..564c7df 100644 --- a/Source/Modio/Public/ModioSubsystem.h +++ b/Source/Modio/Public/ModioSubsystem.h @@ -31,6 +31,7 @@ #include "Types/ModioGameInfoList.h" #include "Types/ModioImageWrapper.h" #include "Types/ModioInitializeOptions.h" +#include "Types/ModioModChangeMap.h" #include "Types/ModioModCollectionEntry.h" #include "Types/ModioModCreationHandle.h" #include "Types/ModioModDependencyList.h" @@ -65,12 +66,11 @@ DECLARE_DELEGATE_TwoParams(FOnGetModDependenciesDelegateFast, FModioErrorCode, T DECLARE_DELEGATE_TwoParams(FOnSubmitNewModDelegateFast, FModioErrorCode, TOptional); DECLARE_DELEGATE_TwoParams(FOnMuteUsersDelegateFast, FModioErrorCode, TOptional); DECLARE_DELEGATE_TwoParams(FOnListUserCreatedModsDelegateFast, FModioErrorCode, TOptional); -DECLARE_DELEGATE_TwoParams(FOnPreviewExternalUpdatesDelegateFast, FModioErrorCode, TOptional); -DECLARE_DELEGATE_TwoParams(FOnPurchaseModDelegateFast, FModioErrorCode, TOptional) -DECLARE_DELEGATE_TwoParams(FOnGetUserWalletBalanceDelegateFast, FModioErrorCode, TOptional); +DECLARE_DELEGATE_TwoParams(FOnPreviewExternalUpdatesDelegateFast, FModioErrorCode, TOptional); +DECLARE_DELEGATE_TwoParams(FOnPurchaseModDelegateFast, FModioErrorCode, TOptional); +DECLARE_DELEGATE_TwoParams(FOnGetUserWalletBalanceDelegateFast, FModioErrorCode, TOptional); DECLARE_DELEGATE_OneParam(FOnFetchUserPurchasesDelegateFast, FModioErrorCode); -DECLARE_DELEGATE_TwoParams(FOnGetUserDerivedTokenDelegateFast, FModioErrorCode, FString); - +DECLARE_DELEGATE_TwoParams(FOnGetUserDelegationTokenDelegateFast, FModioErrorCode, FString); DECLARE_DELEGATE_RetVal(EModioLanguage, FGetCurrentLanguageDelegate); // Blueprint version of delegates @@ -109,15 +109,17 @@ DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnListUserCreatedModsDelegate, FModioErrorCo FModioOptionalModInfoList, Result); DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnPreviewExternalUpdatesDelegate, FModioErrorCode, ErrorCode, - FModioOptionalMapPreview, ModioPreviewMap); + FModioOptionalModChangeMap, ModioPreviewMap); -DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnPurchaseModDelegate, FModioErrorCode, ErrorCode, FModioOptionalTransactionRecord, Transaction); +DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnPurchaseModDelegate, FModioErrorCode, ErrorCode, FModioOptionalTransactionRecord, + Transaction); -DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnGetUserWalletBalanceDelegate, FModioErrorCode, ErrorCode, FModioOptionalUInt64, WalletBalance); +DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnGetUserWalletBalanceDelegate, FModioErrorCode, ErrorCode, FModioOptionalUInt64, + WalletBalance); DECLARE_DYNAMIC_DELEGATE_OneParam(FOnFetchUserPurchasesDelegate, FModioErrorCode, ErrorCode); -DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnGetUserDerivedTokenDelegate, FModioErrorCode, ErrorCode, FString, Token); +DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnGetUserDelegationTokenDelegate, FModioErrorCode, ErrorCode, FString, Token); class UModioSubsystem; @@ -238,24 +240,6 @@ class UModioSubsystem : public UEngineSubsystem UFUNCTION(BlueprintCallable, Category = "mod.io") MODIO_API TArray GetLastValidationError(); - /** - * @brief Sends a request to the mod.io server to add the specified mod to the user's list of subscriptions, and - * marks the mod for local installation by the SDK - * @param ModToSubscribeTo Mod ID of the mod requiring a subscription. - * @param OnSubscribeComplete Callback invoked when the subscription request is completed. - * @requires initialized-sdk - * @requires authenticated-user - * @requires no-rate-limiting - * @errorcategory NetworkError|Couldn't connect to mod.io servers - * @errorcategory SDKNotInitialized|SDK not initialized - * @errorcategory EntityNotFoundError|Specified mod does not exist or was deleted - * @errorcategory UserNotAuthenticatedError|No authenticated user - * @errorcategory InvalidArgsError|The supplied mod ID is invalid - * @deprecated 2024.4 Call SubscribeToModAsync() and specify if mod dependencies should be included. - **/ - UE_DEPRECATED(5.1, "Deprecated as of 2024.4. Call SubscribeToModAsync(FModioModID, bool, FOnErrorOnlyDelegateFast) and specify if recursive dependency subscription is desired.") - MODIO_API void SubscribeToModAsync(FModioModID ModToSubscribeTo, FOnErrorOnlyDelegateFast OnSubscribeComplete); - /** * @brief Sends a request to the mod.io server to add the specified mod to the user's list of subscriptions, and * marks the mod for local installation by the SDK @@ -534,23 +518,8 @@ class UModioSubsystem : public UEngineSubsystem /** * @brief For a given Mod ID, fetches a list of any mods that the creator has marked as dependencies * @param ModID The mod to retrieve dependencies for - * @param Callback Callback providing a status code and an optional ModTagOptions object containing the available - * tags - * @requires initialized-sdk - * @requires no-rate-limiting - * @errorcategory NetworkError|Couldn't connect to mod.io servers - * @errorcategory SDKNotInitialized|SDK not initialized - * @errorcategory InvalidArgsError|The supplied mod ID is invalid - * @experimental - * @deprecated 2024.4 Call GetModDependenciesAsync() and specify if recursion is desired. - **/ - UE_DEPRECATED(5.1, "Deprecated as of 2024.4. Call GetModDependenciesAsync(FModioModID, bool, FOnErrorOnlyDelegateFast) and specify if recursive dependency resolution is desired.") - MODIO_API void GetModDependenciesAsync(FModioModID ModID, FOnGetModDependenciesDelegateFast Callback); - - /** - * @brief For a given Mod ID, fetches a list of any mods that the creator has marked as dependencies - * @param ModID The mod to retrieve dependencies for - * @param Recursive Include child dependencies in a recursive manner. \r\n NOTE: Recursion supports a maximum depth of 5. + * @param Recursive Include child dependencies in a recursive manner. \r\n NOTE: Recursion supports a maximum depth + *of 5. * @param Callback Callback providing a status code and an optional ModTagOptions object containing the available * tags * @requires initialized-sdk @@ -560,7 +529,8 @@ class UModioSubsystem : public UEngineSubsystem * @errorcategory InvalidArgsError|The supplied mod ID is invalid * @experimental **/ - MODIO_API void GetModDependenciesAsync(FModioModID ModID, bool Recursive, FOnGetModDependenciesDelegateFast Callback); + MODIO_API void GetModDependenciesAsync(FModioModID ModID, bool Recursive, + FOnGetModDependenciesDelegateFast Callback); /** * @brief Gets a new mod handle for use with SubmitNewModAsync. @@ -702,10 +672,17 @@ class UModioSubsystem : public UEngineSubsystem /** * @docpublic * @brief Set language to get corresponding data from the server - * @param EModioLanguage to set + * @param Locale Language to set **/ MODIO_API void SetLanguage(EModioLanguage Locale); + /** + * @docpublic + * @brief Get the currently applied language + * @return Current language + **/ + MODIO_API EModioLanguage GetLanguage(); + /** * @brief De-authenticates the current mod.io user for the current session, and clears all user-specific data * stored on the current device. Any subscribed mods that are installed but do not have other local users @@ -727,14 +704,15 @@ class UModioSubsystem : public UEngineSubsystem * @docpublic * @brief Purchases a mod for the current player * @param ModID ID of the mod to purchase - * @param ExpectedPrice The price the user is expected to pay for the mod, generally ModInfo.Price. This ensures that - * there is consistency between the displayed price and the price in the backend. If there is a mismatch, the purchase will fail. + * @param ExpectedPrice The price the user is expected to pay for the mod, generally ModInfo.Price. This ensures + *that there is consistency between the displayed price and the price in the backend. If there is a mismatch, the + *purchase will fail. * @param Callback Callback invoked with purchase information once the purchase is completed. * @requires initialized-sdk * @requires authenticated-user * @requires no-rate-limiting **/ - MODIO_API void PurchaseModAsync(FModioModID ModID, uint64_t ExpectedPrice, FOnPurchaseModDelegateFast Callback); + MODIO_API void PurchaseModAsync(FModioModID ModID, uint64 ExpectedPrice, FOnPurchaseModDelegateFast Callback); /** * @docpublic @@ -761,13 +739,13 @@ class UModioSubsystem : public UEngineSubsystem /** * @docpublic - * @brief Get a UserDerivedToken that can be used for S2S service calls + * @brief Get a UserDelegationToken that can be used for S2S service calls. * @param Callback Callback invoked once the call has been completed. * @requires initialized-sdk * @requires authenticated-user * @requires no-rate-limiting **/ - MODIO_API void GetUserDerivedTokenAsync(FOnGetUserDerivedTokenDelegateFast Callback); + MODIO_API void GetUserDelegationTokenAsync(FOnGetUserDelegationTokenDelegateFast Callback); /** * @docpublic @@ -780,8 +758,6 @@ class UModioSubsystem : public UEngineSubsystem UFUNCTION(BlueprintPure, Category = "mod.io|Monetization") MODIO_API TMap QueryUserPurchasedMods(); - - private: TMap PendingUserMediaRequests; @@ -936,7 +912,6 @@ class UModioSubsystem : public UEngineSubsystem */ MODIO_API FModioErrorCode InitTempModSet(TArray ModIds); - /** * @brief Add mods to a Temp Mod Set, install every temp mod given in the param if they are not already subbed. * @param TArray of ModID to install as temp mod @@ -950,9 +925,9 @@ class UModioSubsystem : public UEngineSubsystem */ MODIO_API FModioErrorCode AddToTempModSet(TArray ModIds); - /** - * @brief Remove mods from a Temp Mod Set, uninstall every temp mod given in the param if they are not already subbed. + * @brief Remove mods from a Temp Mod Set, uninstall every temp mod given in the param if they are not already + * subbed. * @param TArray of ModID to install as temp mod * @return Error code indicating the status of the TempModSet. Will be empty if it was successful * @requires initialized-sdk @@ -964,7 +939,6 @@ class UModioSubsystem : public UEngineSubsystem */ MODIO_API FModioErrorCode RemoveFromTempModSet(TArray ModIds); - /** * @brief Uninstall every temp mod. * @return Error code indicating the status of the TempModSet. Will be empty if it was successful @@ -977,10 +951,9 @@ class UModioSubsystem : public UEngineSubsystem */ MODIO_API FModioErrorCode CloseTempModSet(); - /** * @brief Query every System and Temp Mod in TempModSet - * @return TMap using Mod IDs as keys and ModCollectionEntry objects providing information about mods + * @return TMap using Mod IDs as keys and ModCollectionEntry objects providing information about mods * in TempModSet */ MODIO_API TMap QueryTempModSet(); @@ -1031,7 +1004,6 @@ class UModioSubsystem : public UEngineSubsystem MODIO_API void K2_InitializeAsync(const FModioInitializeOptions& InitializeOptions, FOnErrorOnlyDelegate OnInitComplete); - /** * @brief Sends a request to the mod.io server to add the specified mod to the user's list of subscriptions, and * marks the mod for local installation by the SDK @@ -1277,7 +1249,8 @@ class UModioSubsystem : public UEngineSubsystem * @experimental **/ UFUNCTION(BlueprintCallable, DisplayName = "GetModDependenciesAsync", Category = "mod.io|Mods") - MODIO_API void K2_GetModDependenciesAsync(FModioModID ModID, bool Recursive, FOnGetModDependenciesDelegate Callback); + MODIO_API void K2_GetModDependenciesAsync(FModioModID ModID, bool Recursive, + FOnGetModDependenciesDelegate Callback); /** * @brief Begins email authentication for the current session by requesting a one-time code be sent to the @@ -1360,11 +1333,19 @@ class UModioSubsystem : public UEngineSubsystem /** * @docpublic * @brief Set language to get corresponding data from the server - * @param EModioLanguage to set + * @param Locale Language to set **/ UFUNCTION(BlueprintCallable, DisplayName = "SetLanguage", Category = "mod.io") MODIO_API void K2_SetLanguage(EModioLanguage Locale); + /** + * @docpublic + * @brief Get the currently applied language + * @return Current language + **/ + UFUNCTION(BlueprintCallable, DisplayName = "GetLanguage", Category = "mod.io") + MODIO_API EModioLanguage K2_GetLanguage(); + /** * @brief De-authenticates the current mod.io user for the current session, and clears all user-specific data * stored on the current device. Any subscribed mods that are installed but do not have other local users @@ -1581,7 +1562,6 @@ class UModioSubsystem : public UEngineSubsystem UFUNCTION(BlueprintCallable, DisplayName = "GetDefaultModInstallationDirectory", Category = "mod.io|Mods") static MODIO_API FString K2_GetDefaultModInstallationDirectory(FModioGameID GameID); - /** * @brief Install every temp mod given in the param if they are not already subbed. * @param TArray of ModID to install as temp mod @@ -1662,14 +1642,14 @@ class UModioSubsystem : public UEngineSubsystem /** * @docpublic - * @brief Get a User Derived Token that can be used for S2S service calls + * @brief Get a User Delegation Token that can be used for S2S service calls * @param Callback Callback invoked with purchase information once the purchase is completed. * @requires initialized-sdk * @requires authenticated-user * @requires no-rate-limiting **/ - UFUNCTION(BlueprintCallable, DisplayName = "GetUserDerivedTokenAsync", Category = "mod.io|Monetization") - MODIO_API void K2_GetUserDerivedTokenAsync(FOnGetUserDerivedTokenDelegate Callback); + UFUNCTION(BlueprintCallable, DisplayName = "GetUserDelegationTokenAsync", Category = "mod.io|Monetization") + MODIO_API void K2_GetUserDelegationTokenAsync(FOnGetUserDelegationTokenDelegate Callback); /** * @docpublic @@ -1702,6 +1682,8 @@ class UModioSubsystem : public UEngineSubsystem * @brief Converts a two letter ISO 639-1 language code to the corresponding EModioLanguage value. Defaults to * English if the specified code is not a valid EModioLanguage value. * @param LanguageCode The two letter ISO 639-1 language code to convert + * @deprecated 2024.7 Use UModioSDKLibrary::GetLanguageCodeFromString instead */ + UE_DEPRECATED(5.1, "Deprecated as of 2024.7. Use UModioSDKLibrary::GetLanguageCodeFromString instead") MODIO_API EModioLanguage ConvertLanguageCodeToModio(FString LanguageCode); }; diff --git a/Source/Modio/Public/Types/ModioCommonTypes.h b/Source/Modio/Public/Types/ModioCommonTypes.h index 9b30f42..504fc73 100644 --- a/Source/Modio/Public/Types/ModioCommonTypes.h +++ b/Source/Modio/Public/Types/ModioCommonTypes.h @@ -10,6 +10,7 @@ #pragma once #include "Misc/Crc.h" +#include "Misc/EnumRange.h" #include "ModioCommonTypes.generated.h" @@ -155,14 +156,17 @@ enum class EModioLogLevel : uint8 /** Detailed low-level debugging output. Not intended for general use **/ Trace = 0, + /* Detailed but not low-level. Generally useful for some mid-level information for debugging. */ + Detailed = 1, + /** Informational output containing status messages **/ - Info = 1, + Info = 2, /** Warnings about incorrect plugin usage, timeouts **/ - Warning = 2, + Warning = 3, /** Only errors **/ - Error = 3 + Error = 4 }; /** @@ -185,8 +189,10 @@ enum class EModioLanguage : uint8 Spanish, Thai, ChineseSimplified, - ChineseTraditional + ChineseTraditional, + Count UMETA(Hidden) }; +ENUM_RANGE_BY_COUNT(EModioLanguage, EModioLanguage::Count); UENUM(BlueprintType) enum class EModioModChangeType : uint8 @@ -353,7 +359,7 @@ struct MODIO_API FModioOptionalUInt64 /** * Stored optional uint64 **/ - TOptional Internal; + TOptional Internal; }; @@ -813,4 +819,24 @@ struct MODIO_API FModioEntitlementParams TMap ExtendedParameters; }; -#pragma endregion +/** + * Enumerator with the possible memory measurement units + **/ +UENUM(BlueprintType) +enum EFileSizeUnit +{ + /** Will take the largest one that becomes a number larger than 1 (i.e, 1300mb becomes 1.3gb) **/ + Largest = 0, + + /** A single byte **/ + B = 1, + + /** Kilo bytes **/ + KB = 1024, + + /** Mega bytes **/ + MB = 1024 * 1024, + + /** Giga bytes **/ + GB = 1024 * 1024 * 1024 +}; diff --git a/Source/Modio/Public/Types/ModioErrorCode.h b/Source/Modio/Public/Types/ModioErrorCode.h index 9e989bd..bfec194 100644 --- a/Source/Modio/Public/Types/ModioErrorCode.h +++ b/Source/Modio/Public/Types/ModioErrorCode.h @@ -30,6 +30,7 @@ struct MODIO_API FModioErrorCode FModioErrorCode(); FModioErrorCode(const FModioErrorCode& Other); FModioErrorCode(Modio::ErrorCode ec); + FModioErrorCode(int32 Value, int32 CategoryID); FModioErrorCode& operator=(const FModioErrorCode& ec); ~FModioErrorCode(); /** return true if this error code is a error */ @@ -37,12 +38,18 @@ struct MODIO_API FModioErrorCode /** Get the error code */ int GetValue() const; + FString GetCategoryString() const; Modio::ErrorCode GetRawErrorCode() const; /** Get a human readable message from the error code */ FString GetErrorMessage() const; - -private: + + static FModioErrorCode SystemError(); + + int32 GetCategoryID() ; + + private: TUniquePtr InternalError; + }; diff --git a/Source/Modio/Public/Types/ModioFileMetadata.h b/Source/Modio/Public/Types/ModioFileMetadata.h index 299c123..041f8ff 100644 --- a/Source/Modio/Public/Types/ModioFileMetadata.h +++ b/Source/Modio/Public/Types/ModioFileMetadata.h @@ -68,6 +68,10 @@ struct MODIO_API FModioFileMetadata UPROPERTY(BlueprintReadOnly, EditInstanceOnly, Category = "FileMetadata|File") int64 Filesize {}; + /** @brief Total size of all files in the mod after installation. */ + UPROPERTY(BlueprintReadOnly, EditInstanceOnly, Category = "FileMetadata|File") + int64 FilesizeUncompressed {}; + /** @brief Filename including extension. */ UPROPERTY(BlueprintReadOnly, EditInstanceOnly, Category = "FileMetadata|File") FString Filename; diff --git a/Source/Modio/Public/Types/ModioFilterParams.h b/Source/Modio/Public/Types/ModioFilterParams.h index 4a07f20..24bee9d 100644 --- a/Source/Modio/Public/Types/ModioFilterParams.h +++ b/Source/Modio/Public/Types/ModioFilterParams.h @@ -1,24 +1,22 @@ -/* +/* * Copyright (C) 2021 mod.io Pty Ltd. - * + * * This file is part of the mod.io UE4 Plugin. - * - * Distributed under the MIT License. (See accompanying file LICENSE or + * + * Distributed under the MIT License. (See accompanying file LICENSE or * view online at ) - * + * */ #pragma once -#include "Types/ModioCommonTypes.h" +#include "Kismet/BlueprintFunctionLibrary.h" #include "Misc/DateTime.h" - -#include "ModioModInfo.h" +#include "Types/ModioCommonTypes.h" +#include "Types/ModioModInfo.h" #include "ModioFilterParams.generated.h" - - /// Forward declaration of SDK type for declaration of conversion function below namespace Modio { @@ -35,7 +33,8 @@ enum class EModioSortFieldType : uint8 Rating, /** use mod rating */ DateMarkedLive, /** use date mod was marked live */ DateUpdated, /** use date mod was last updated */ - DownloadsTotal /** use downloads total */ + DownloadsTotal, /** use downloads total */ + Alphabetical /** use mod name */ }; /// @brief Enum indicating which direction sorting should be applied @@ -50,8 +49,8 @@ enum class EModioSortDirection : uint8 UENUM(BlueprintType) enum class EModioRevenueFilterType : uint8 { - Free = 0, /** Return only free mods */ - Paid = 1, /** Return only paid mods */ + Free = 0, /** Return only free mods */ + Paid = 1, /** Return only paid mods */ FreeAndPaid = 2 /** Return both free and paid mods */ }; @@ -185,7 +184,7 @@ struct MODIO_API FModioFilterParams * @return *this */ FModioFilterParams& RevenueType(EModioRevenueFilterType RevenueFilter); - + /** * @brief Indicates results should exclude all mods which contain mature content * @return *this @@ -207,8 +206,7 @@ struct MODIO_API FModioFilterParams FString ToString() const; public: - - friend class Modio::FilterParams ToModio(const FModioFilterParams& In ); + friend class Modio::FilterParams ToModio(const FModioFilterParams& In); EModioSortDirection Direction = EModioSortDirection::Ascending; EModioSortFieldType SortField = EModioSortFieldType::ID; @@ -227,3 +225,53 @@ struct MODIO_API FModioFilterParams int64 Index = 0; int64 Count = 100; }; + +/** + * Helper struct for named preset filter parameters + */ +USTRUCT(BlueprintType) +struct MODIO_API FModioPresetFilterParams +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "FModioPresetFilterParams") + FText PresetName; + + UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "FModioPresetFilterParams") + TArray Tags; + + UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "FModioPresetFilterParams") + TArray ExcludedTags; + + UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "FModioPresetFilterParams") + EModioSortDirection Direction; + + UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "FModioPresetFilterParams") + EModioSortFieldType SortField; + + UPROPERTY(BlueprintReadWrite, EditDefaultsOnly, Category = "FModioPresetFilterParams") + int64 Count = 20; + + FModioFilterParams ToFilterParams() const + { + return FModioFilterParams() + .WithTags(Tags) + .WithoutTags(ExcludedTags) + .SortBy(SortField, Direction) + .IndexedResults(0, Count); + } +}; + +UCLASS() +class MODIO_API UModioPresetFilterParamsLibrary : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +protected: + // Compiles a preset filter into a concrete set of filter parameters that can be passed to the mod.io plugin + UFUNCTION(BlueprintCallable, Category = "mod.io|Filter Params") + static FModioFilterParams ToFilterParams(const FModioPresetFilterParams& Preset) + { + return Preset.ToFilterParams(); + } +}; \ No newline at end of file diff --git a/Source/Modio/Public/Types/ModioModChangeMap.h b/Source/Modio/Public/Types/ModioModChangeMap.h new file mode 100644 index 0000000..e9ee39a --- /dev/null +++ b/Source/Modio/Public/Types/ModioModChangeMap.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2021 mod.io Pty Ltd. + * + * This file is part of the mod.io UE4 Plugin. + * + * Distributed under the MIT License. (See accompanying file LICENSE or + * view online at ) + * + */ + +#pragma once +#include "CoreMinimal.h" +#include "Misc/Optional.h" +#include "Types/ModioCommonTypes.h" + +#include "ModioModChangeMap.generated.h" + +USTRUCT(BlueprintType) +struct MODIO_API FModioModChangeMap +{ + GENERATED_BODY(); + + UPROPERTY(BlueprintReadOnly, Category = "mod.io|ModChangeMap") + TMap Changes; +}; + +/** + * Strong type struct to wrap a ModDependencyList data as an optional value + **/ +USTRUCT(BlueprintType) +struct MODIO_API FModioOptionalModChangeMap +{ + GENERATED_BODY() + + /** + * Default constructor without parameters + **/ + FModioOptionalModChangeMap() = default; + + /** + * Convenience constructor that has a list of mod dependencies + * @param ModDependencies An optional value that contains mod dependencies + **/ + FModioOptionalModChangeMap(TOptional&& ModDependencies) : Internal(MoveTemp(Internal)) {} + + /** + * Stored optional ModioModDependencyList + **/ + TOptional Internal; +}; diff --git a/Source/Modio/Public/Types/ModioModDependencyList.h b/Source/Modio/Public/Types/ModioModDependencyList.h index 4f91416..a5fd950 100644 --- a/Source/Modio/Public/Types/ModioModDependencyList.h +++ b/Source/Modio/Public/Types/ModioModDependencyList.h @@ -11,8 +11,10 @@ #pragma once #include "CoreMinimal.h" #include "Types/ModioCommonTypes.h" +#include "Types/ModioFileMetadata.h" +#include "Types/ModioModInfo.h" +#include "Types/ModioLogo.h" #include "Types/ModioPagedResult.h" -#include "Types/ModioModProgressInfo.h" #include "Containers/UnrealString.h" #include "Misc/Optional.h" @@ -40,6 +42,49 @@ struct MODIO_API FModioModDependency **/ UPROPERTY(BlueprintReadOnly, Category = "mod.io|ModDependency") FString ModName; + + /** + * Unix timestamp of the date the mod was registered + **/ + UPROPERTY(BlueprintReadOnly, Category = "mod.io|ModDependency") + FDateTime DateAdded = 0; + + /** + * Unix timestamp of the date the mod was updated + **/ + UPROPERTY(BlueprintReadOnly, Category = "mod.io|ModDependency") + FDateTime DateUpdated = 0; + + /** + * The level at which this dependency sits. When greater than zero (0), it means that this dependency relies + * on additional dependencies. + **/ + UPROPERTY(BlueprintReadOnly, Category = "mod.io|ModDependency") + uint8 DependencyDepth = 0; + + /** + * Media data related to the mod logo + **/ + UPROPERTY(BlueprintReadOnly, Category = "mod.io|ModDependency") + FModioLogo Logo; + + /** + * Information about the mod's most recent public release + **/ + UPROPERTY(BlueprintReadOnly, Category = "mod.io|ModDependency") + FModioFileMetadata FileInfo; + + /** + * The current ModStatus on the server: Accepted, NotAccepted, or Deleted. + **/ + UPROPERTY(BlueprintReadOnly, Category = "mod.io|ModDependency") + EModioModServerSideStatus Status = EModioModServerSideStatus::NotAccepted; + + /** + * The visibility status of the mod, default to Public + **/ + UPROPERTY(BlueprintReadOnly, Category = "mod.io|ModDependency") + EModioObjectVisibilityFlags Visibility = EModioObjectVisibilityFlags::Public; }; @@ -63,6 +108,19 @@ struct MODIO_API FModioModDependencyList **/ UPROPERTY(BlueprintReadOnly, Category = "mod.io|ModDependencyList") TArray InternalList; + + + /** + * Total size of all the dependency files in bytes. + */ + UPROPERTY(BlueprintReadOnly, Category = "mod.io|ModDependencyList") + int64 TotalFilesize {}; + + /** + * Total Size of the uncompressed dependency files in bytes. + */ + UPROPERTY(BlueprintReadOnly, Category = "mod.io|ModDependencyList") + int64 TotalFilesizeUncompressed {}; }; /** @@ -89,53 +147,3 @@ struct MODIO_API FModioOptionalModDependencyList **/ TOptional Internal; }; - -/** - * Strong type struct to wrap a PreviewMap data as a map value - **/ -USTRUCT(BlueprintType) -struct MODIO_API FModioMapPreview -{ - GENERATED_BODY() - - /** - * Default constructor without parameters - **/ - FModioMapPreview() = default; - - /** - * Convenience constructor that has a map of ModID and Mod changes - * @param ModPreviewMap Key/value pairs that contains mod changes - **/ - FModioMapPreview(PreviewMapDef&& ModPreview); - - /** - * Stored map preview - **/ - PreviewMapDef Internal; -}; - -/** - * Strong type struct to wrap a MapPreview data as an optional value - **/ -USTRUCT(BlueprintType) -struct MODIO_API FModioOptionalMapPreview -{ - GENERATED_BODY() - - /** - * Default constructor without parameters - **/ - FModioOptionalMapPreview() = default; - - /** - * Convenience constructor that has a map of ModID and Mod changes - * @param ModPreview An optional value that contains mod preview - **/ - FModioOptionalMapPreview(TOptional&& ModPreview); - - /** - * Stored optional FModioMapPreview - **/ - TOptional Internal; -}; \ No newline at end of file diff --git a/Source/Modio/Public/Types/ModioModProgressInfo.h b/Source/Modio/Public/Types/ModioModProgressInfo.h index 4b9ff23..98cac43 100644 --- a/Source/Modio/Public/Types/ModioModProgressInfo.h +++ b/Source/Modio/Public/Types/ModioModProgressInfo.h @@ -38,40 +38,8 @@ struct MODIO_API FModioModProgressInfo { GENERATED_BODY() -#if WITH_EDITORONLY_DATA - /** - * Constructs a mock FModioModProgressInfo with dummy values. Only intended for use in editor previews, eg UMG - * editor - */ - FModioModProgressInfo static ConstructPreviewProgressInfo(EModioModProgressState CurrentState, uint64_t Current, - uint64_t Total) - { - FModioModProgressInfo Out {}; - switch (CurrentState) - { - case EModioModProgressState::Compressing: - Out.CompressCurrent = Current; - Out.CompressTotal = Total; - break; - case EModioModProgressState::Downloading: - Out.DownloadCurrent = Current; - Out.DownloadTotal = Total; - break; - case EModioModProgressState::Uploading: - Out.UploadCurrent = Current; - Out.UploadTotal = Total; - break; - case EModioModProgressState::Extracting: - Out.ExtractCurrent = Current; - Out.ExtractTotal = Total; - break; - default: - break; - } - Out.CurrentState = CurrentState; - return Out; - } -#endif + friend class UModioUIEditorPreviewDataLibrary; + /** * The mod ID of the mod being processed **/ diff --git a/Source/Modio/Public/Types/ModioReportParams.h b/Source/Modio/Public/Types/ModioReportParams.h index 9d22337..5c065c0 100644 --- a/Source/Modio/Public/Types/ModioReportParams.h +++ b/Source/Modio/Public/Types/ModioReportParams.h @@ -9,6 +9,7 @@ */ #pragma once +#include "Misc/EnumRange.h" #include "ModioReportParams.generated.h" @@ -45,8 +46,9 @@ enum class EModioReportType : uint8 FalseInformation = 6, /** Other type of mod report **/ - Other = 7 + Other = 7 }; +ENUM_RANGE_BY_FIRST_AND_LAST(EModioReportType, EModioReportType::Generic, EModioReportType::Other); /** * Struct type to store the parameters used to report a mod diff --git a/Source/Modio/Public/Types/ModioTerms.h b/Source/Modio/Public/Types/ModioTerms.h index 192c851..464ff22 100644 --- a/Source/Modio/Public/Types/ModioTerms.h +++ b/Source/Modio/Public/Types/ModioTerms.h @@ -67,6 +67,7 @@ struct MODIO_API FModioTerms FModioLink ManageLink; /** @brief The plaintext version of the mod.io terms of use */ + UPROPERTY(BlueprintReadOnly,Category="Terms|Links") FString TermsText; }; diff --git a/Source/Modio/Public/Types/ModioUnsigned64.h b/Source/Modio/Public/Types/ModioUnsigned64.h index d78d15f..d79fa13 100644 --- a/Source/Modio/Public/Types/ModioUnsigned64.h +++ b/Source/Modio/Public/Types/ModioUnsigned64.h @@ -11,6 +11,7 @@ #pragma once #include "Kismet/BlueprintFunctionLibrary.h" +#include "Kismet/KismetTextLibrary.h" #include "ModioUnsigned64.generated.h" @@ -141,6 +142,14 @@ class MODIO_API UModioUnsigned64Library : public UBlueprintFunctionLibrary return LHS != RHS; } + UFUNCTION(BlueprintPure, BlueprintCallable, Category = "mod.io|Unsigned64", + meta = (CompactNodeTitle = "> 0", Keywords = "> greater than 0 zero", + DisplayName = "ModioUnsigned64 > 0")) + static bool GreaterThanZero(const FModioUnsigned64& In) + { + return In.Underlying > 0; + } + UFUNCTION(BlueprintPure, BlueprintCallable, Category = "mod.io|Unsigned64", meta = (CompactNodeTitle = ">", Keywords = "> greater than", DisplayName = "ModioUnsigned64 > ModioUnsigned64")) @@ -222,4 +231,11 @@ class MODIO_API UModioUnsigned64Library : public UBlueprintFunctionLibrary { return float(In.Underlying); } + + UFUNCTION(BlueprintPure, BlueprintCallable, Category = "mod.io|Unsigned64", + meta = (DisplayName = "To Text (ModioUnsigned64)", BlueprintAutocast)) + static FText Conv_FModioUnsigned64ToText(const FModioUnsigned64& In) + { + return UKismetTextLibrary::Conv_Int64ToText(In.Underlying); + } }; \ No newline at end of file diff --git a/Source/Modio/Public/Types/ModioUser.h b/Source/Modio/Public/Types/ModioUser.h index 778b800..a866754 100644 --- a/Source/Modio/Public/Types/ModioUser.h +++ b/Source/Modio/Public/Types/ModioUser.h @@ -35,31 +35,31 @@ struct MODIO_API FModioUser /** * User's unique ID **/ - UPROPERTY(BlueprintReadOnly, Category = "User") + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category = "User") FModioUserID UserId; /** * Name chosen by the user **/ - UPROPERTY(BlueprintReadOnly, Category = "User") + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category = "User") FString Username; /** * Unix timestamp the last time the user was online **/ - UPROPERTY(BlueprintReadOnly, Category = "User") + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category = "User") FDateTime DateOnline; /** * URL of the user's mod.io profile **/ - UPROPERTY(BlueprintReadOnly, Category = "User") + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category = "User") FString ProfileUrl; /** * Display name of this User for the given Portal, if their account is linked **/ - UPROPERTY(BlueprintReadOnly, Category = "User") + UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category = "User") FString DisplayNamePortal; }; diff --git a/Source/ModioEditor/Private/ModioEditor.cpp b/Source/ModioEditor/Private/ModioEditor.cpp index ae77cdb..9bcdce6 100644 --- a/Source/ModioEditor/Private/ModioEditor.cpp +++ b/Source/ModioEditor/Private/ModioEditor.cpp @@ -122,7 +122,7 @@ void FModioEditor::DisplayGettingStarted() void FModioEditor::PluginButtonClicked() { - FModioInitializeOptions InitializeOptions = UModioSDKLibrary::GetProjectInitializeOptionsForSessionId(FString("1234")); + FModioInitializeOptions InitializeOptions = UModioSDKLibrary::GetProjectInitializeOptionsForSessionId(FString("ModioUnrealEditor")); if (InitializeOptions.GameId.ToString().Equals("InvalidGameID") || InitializeOptions.ApiKey.ToString().Equals("InvalidApiKey")) { const FText Title = FText::FromString("mod.io"); diff --git a/Source/ModioEditor/Private/ModioUpdateStaticLocDataCommandlet.cpp b/Source/ModioEditor/Private/ModioUpdateStaticLocDataCommandlet.cpp new file mode 100644 index 0000000..143bf6f --- /dev/null +++ b/Source/ModioEditor/Private/ModioUpdateStaticLocDataCommandlet.cpp @@ -0,0 +1,109 @@ +// Copyright Blackbird Interactive. All rights reserved. + +#include "ModioUpdateStaticLocDataCommandlet.h" + +#if WITH_EDITOR + + #include "AssetRegistry/AssetRegistryModule.h" + #include "Internationalization/StringTable.h" + #include "Internationalization/StringTableCore.h" + #include "FileHelpers.h" + #include "Loc/ModioEnumLocalizationHelpers.h" + #include "ModioErrorCondition.h" + #include "ModioSettings.h" + #include "Types/ModioFilterParams.h" + #include "Types/ModioModCollectionEntry.h" + #include "Types/ModioModManagementEvent.h" + #include "Types/ModioModProgressInfo.h" + #include "Types/ModioReportParams.h" + +DEFINE_LOG_CATEGORY_STATIC(LogModioUpdateStaticLocDataCommandlet, All, All); + +UModioUpdateStaticLocDataCommandlet::UModioUpdateStaticLocDataCommandlet() +{ + IsClient = false; + IsEditor = true; + IsServer = false; + LogToConsole = true; + + HelpDescription = TEXT("Commandlet updating static localization data for the mod.io plugin."); +} + +int UModioUpdateStaticLocDataCommandlet::Main(const FString& Params) +{ + // Parse command line + TArray Tokens; + TArray Switches; + TMap ParamVals; + UCommandlet::ParseCommandLine(*Params, Tokens, Switches, ParamVals); + if (const UModioSettings* PluginSettings = GetDefault()) + { + if (UObject* MaybeStringTable = PluginSettings->LocalizationStringTable.TryLoad()) + { + UStringTable* StringTableObject = Cast(MaybeStringTable); + if (!StringTableObject) + { + UE_LOG(LogModioUpdateStaticLocDataCommandlet, Display, + TEXT("Could not resolve string table for static localization data. Is " + "UModioSettings::LocalizationStringTable configured correctly?")); + return -1; + } + FStringTableRef StaticLocDataTable = StringTableObject->GetMutableStringTable(); + + ModioUI::RegisterEnumAsLocalizable(StaticLocDataTable); + ModioUI::RegisterEnumAsLocalizable(StaticLocDataTable); + ModioUI::RegisterEnumAsLocalizable(StaticLocDataTable); + ModioUI::RegisterEnumAsLocalizable(StaticLocDataTable); + ModioUI::RegisterEnumAsLocalizable(StaticLocDataTable); + ModioUI::RegisterEnumAsLocalizable(StaticLocDataTable); + ModioUI::RegisterEnumAsLocalizable(StaticLocDataTable); + + // Localize Error Conditions so they can be displayed to end-users in the UI + // Error conditions are code-generated by the SDK so they need manual display string overrides + + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::NoError, "No Error"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::NetworkError, + "Network Error"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::ConfigurationError, + "Configuration Error"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::InvalidArgsError, + "Invalid Parameter"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::FilesystemError, + "Filesystem Error"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::InternalError, + "System Error"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::ApiErrorRefSuccess, + "No Error"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::EntityNotFoundError, + "Item not found"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::UserTermsOfUseError, + "Terms of Use not accepted"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::SubmitReportError, + "Report submission error"); + ModioUI::RegisterCustomEnumValueLocalization( + StaticLocDataTable, EModioErrorCondition::UserNotAuthenticatedError, "Authentication failure"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::SystemError, + "System Error"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::OperationCanceled, + "Canceled"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::RateLimited, + "Rate Limit hit"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::ModBeingProcessed, + "Mod is being processed"); + ModioUI::RegisterCustomEnumValueLocalization(StaticLocDataTable, EModioErrorCondition::InsufficientSpace, + "Insufficient space"); + ModioUI::RegisterCustomEnumValueLocalization( + StaticLocDataTable, EModioErrorCondition::InsufficientPermissions, "Access denied"); + + if (UEditorLoadingAndSavingUtils::SavePackages({StringTableObject->GetPackage()}, + false)) + { + UE_LOG(LogModioUpdateStaticLocDataCommandlet, Display, + TEXT("String table updated successfully with static localization data.")); + } + } + } + return 0; +} + +#endif diff --git a/Source/ModioEditor/Private/Widgets/SModioEditorGameInfoWidget.cpp b/Source/ModioEditor/Private/Widgets/SModioEditorGameInfoWidget.cpp index 0798bbf..aac4a72 100644 --- a/Source/ModioEditor/Private/Widgets/SModioEditorGameInfoWidget.cpp +++ b/Source/ModioEditor/Private/Widgets/SModioEditorGameInfoWidget.cpp @@ -32,7 +32,7 @@ void SModioEditorGameInfoWidget::LoadModioSubsystem() { FModioInitializeOptions InitializeOptions = - UModioSDKLibrary::GetProjectInitializeOptionsForSessionId(FString("2345")); + UModioSDKLibrary::GetProjectInitializeOptionsForSessionId(FString("ModioUnrealEditor")); if (GEngine) { diff --git a/Source/ModioEditor/Private/Widgets/SModioEditorUserGamesList.cpp b/Source/ModioEditor/Private/Widgets/SModioEditorUserGamesList.cpp index 997dbd5..4f8b282 100644 --- a/Source/ModioEditor/Private/Widgets/SModioEditorUserGamesList.cpp +++ b/Source/ModioEditor/Private/Widgets/SModioEditorUserGamesList.cpp @@ -51,7 +51,7 @@ void SModioEditorUserGamesList::Tick(const FGeometry& AllottedGeometry, const do void SModioEditorUserGamesList::LoadModioSubsystem() { FModioInitializeOptions InitializeOptions = - UModioSDKLibrary::GetProjectInitializeOptionsForSessionId(FString("1234")); + UModioSDKLibrary::GetProjectInitializeOptionsForSessionId(FString("ModioUnrealEditor")); if (GEngine) { diff --git a/Source/ModioEditor/Private/Widgets/SModioEditorWindowCompoundWidget.cpp b/Source/ModioEditor/Private/Widgets/SModioEditorWindowCompoundWidget.cpp index f0a2b0d..9fabbae 100644 --- a/Source/ModioEditor/Private/Widgets/SModioEditorWindowCompoundWidget.cpp +++ b/Source/ModioEditor/Private/Widgets/SModioEditorWindowCompoundWidget.cpp @@ -137,7 +137,7 @@ void SModioEditorWindowCompoundWidget::LoadResources() void SModioEditorWindowCompoundWidget::LoadModioSubsystem() { - FModioInitializeOptions InitializeOptions = UModioSDKLibrary::GetProjectInitializeOptionsForSessionId(FString("1234")); + FModioInitializeOptions InitializeOptions = UModioSDKLibrary::GetProjectInitializeOptionsForSessionId(FString("ModioUnrealEditor")); if (GEngine) { diff --git a/Source/ModioEditor/Public/ModioUpdateStaticLocDataCommandlet.h b/Source/ModioEditor/Public/ModioUpdateStaticLocDataCommandlet.h new file mode 100644 index 0000000..4494416 --- /dev/null +++ b/Source/ModioEditor/Public/ModioUpdateStaticLocDataCommandlet.h @@ -0,0 +1,20 @@ +#pragma once + +#include "Commandlets/Commandlet.h" +#include "CoreMinimal.h" + +#include "ModioUpdateStaticLocDataCommandlet.generated.h" + +/** + * Updates the string table specified in the mod.io Plugin Settings page with static localization data for displaying enums, error codes, etc + * Invoke like "UnrealEditor-cmd.exe" -Run=ModioEditor.ModioUpdateStaticLocData + */ +UCLASS() +class MODIOEDITOR_API UModioUpdateStaticLocDataCommandlet : public UCommandlet +{ + GENERATED_BODY() +#if WITH_EDITOR + UModioUpdateStaticLocDataCommandlet(); + virtual int Main(const FString& Params) override; +#endif +}; diff --git a/Source/ModioUI/Private/UI/Foundation/Utilities/ModOperationTracker/ModioCommonModOperationTrackerWidget.cpp b/Source/ModioUI/Private/UI/Foundation/Utilities/ModOperationTracker/ModioCommonModOperationTrackerWidget.cpp index 1ec2edc..38c90ac 100644 --- a/Source/ModioUI/Private/UI/Foundation/Utilities/ModOperationTracker/ModioCommonModOperationTrackerWidget.cpp +++ b/Source/ModioUI/Private/UI/Foundation/Utilities/ModOperationTracker/ModioCommonModOperationTrackerWidget.cpp @@ -274,14 +274,6 @@ void UModioCommonModOperationTrackerWidget::Tick(float DeltaTime) void UModioCommonModOperationTrackerWidget::SynchronizeProperties() { Super::SynchronizeProperties(); - -#if WITH_EDITOR - if (IsDesignTime()) - { - FModioModProgressInfo PreviewProgressInfo = FModioModProgressInfo::ConstructPreviewProgressInfo(PreviewProgressState, PreviewCurrent, PreviewTotal); - UpdateProgress(PreviewProgressInfo); - } -#endif } void UModioCommonModOperationTrackerWidget::UpdateProgress(const FModioModProgressInfo& ProgressInfo)

    AToZ

    ZToA

    SizeOnDisk

    ImageFirst

    RecentlyUpdated

    TextFirst