diff --git a/Doc/documentation.html b/Doc/documentation.html index 6c26f6fc..9ef673f9 100644 --- a/Doc/documentation.html +++ b/Doc/documentation.html @@ -837,6 +837,7 @@

mod.io UE4 Plugin Documentation

  • GetModMediaAsync (Gallery Image)
  • GetModMediaAsync (Avatar)
  • GetModInfoAsync
  • +
  • GetModDependenciesAsync
  • FetchExternalUpdatesAsync
  • EnableModManagement
  • ClearUserDataAsync
  • @@ -874,6 +875,7 @@

    mod.io UE4 Plugin Documentation

  • ModioOptionalImage
  • ModioOptionalModTagOptions
  • ModioOptionalTerms
  • +
  • ModioOptionalModDependencyList
  • ModioAuthenticationParams
  • ModioEmailAuthCode
  • ModioEmailAddress
  • @@ -883,6 +885,8 @@

    mod.io UE4 Plugin Documentation

  • ModioImage
  • ModioInitializeOptions
  • ModioModCollectionEntry
  • +
  • ModioModDependencyList
  • +
  • ModioModDependency
  • ModioOptionalModProgressInfo
  • ModioModProgressInfo
  • ModioReportParams
  • @@ -2921,6 +2925,84 @@
    Error Values

    +

    GetModDependenciesAsync

    +
    +
    +nd img K2 GetModDependenciesAsync +
    +
    +
    +
    +
    void K2_GetModDependenciesAsync(FModioModID ModID, FOnGetModDependenciesDelegate Callback)
    +
    +
    +
    +

    For a given Mod ID, fetches a list of any mods that the creator has marked as dependencies

    +
    +
    + + + + + +
    +
    Note
    +
    +This function is part of an experimental feature and is subject to change. +
    +
    +
    Requirements
    +
    + +
    +
    Parameters
    + ++++ + + + + + + + + + + + + + + +

    Target

    Modio Subsystem Object Reference

    Mod ID

    The mod to retrieve dependencies for

    Callback

    Callback providing a status code and an optional ModTagOptions object containing the available tags

    +
    Error Values
    + ++++ + + + + + + + + + + +

    GenericError::SDKNotInitialized

    SDK not initialized

    NetworkError

    Couldn’t connect to mod.io servers

    +
    +
    +

    FetchExternalUpdatesAsync

    @@ -2935,7 +3017,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
    @@ -2969,7 +3051,7 @@

    EnableModManagement

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

    -
    Parameters
    +
    Parameters
    @@ -3003,7 +3085,7 @@

    ClearUserDataAsync

    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 subscribed will be uninstalled

    -
    Requirements
    +
    Requirements
    • @@ -3017,7 +3099,7 @@
      Requirements
    -
    Parameters
    +
    Parameters
    @@ -3034,7 +3116,7 @@
    Parameters
    -
    Error Values
    +
    Error Values
    @@ -3068,7 +3150,7 @@

    AuthenticateUserExternalAsync

    Uses platform-specific authentication to associate a Mod.io user account with the current platform user

    -
    Requirements
    +
    Requirements
    • @@ -3082,7 +3164,7 @@
      Requirements
    -
    Parameters
    +
    Parameters
    @@ -3107,7 +3189,7 @@
    Parameters
    -
    Error Values
    +
    Error Values
    @@ -3145,7 +3227,7 @@

    AuthenticateUserEmailAsync

    Completes email authentication for the current session by submitting the one-time code sent to the user’s email address

    -
    Requirements
    +
    Requirements
    • @@ -3159,7 +3241,7 @@
      Requirements
    -
    Parameters
    +
    Parameters
    @@ -3180,7 +3262,7 @@
    Parameters
    -
    Error Values
    +
    Error Values
    @@ -3218,7 +3300,7 @@

    Is Mod Management Busy

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

    -
    Parameters
    +
    Parameters
    @@ -3256,7 +3338,7 @@

    Get Last Validation Error

    If the last request to the mod.io servers returned a validation failure, this function returns extended information describing the fields that failed validation.

    -
    Requirements
    +
    Requirements
    • @@ -3264,7 +3346,7 @@
      Requirements
    -
    Parameters
    +
    Parameters
    @@ -3302,7 +3384,7 @@

    ForceUninstallModAsync

    Forcibly uninstalls a mod from the system. This is intended for use when a host application requires more room for a mod that the user wants to install, and as such will return an error if the current user is subscribed to the mod. To remove a mod the current user is subscribed to, use UnsubscribeFromModAsync.

    -
    Parameters
    +
    Parameters
    @@ -3323,7 +3405,7 @@
    Parameters
    -
    Error Values
    +
    Error Values
    @@ -3361,7 +3443,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
    @@ -3876,6 +3958,10 @@

    ModioOptionalTerms


    +

    ModioOptionalModDependencyList

    +
    +
    +

    ModioAuthenticationParams

    Simple struct to encapsulate data passed to external authentication systems

    @@ -4006,6 +4092,64 @@

    ModioModCollectionEntry


    +

    ModioModDependencyList

    +
    +

    Paged list of mod dependencies

    +
    +
    +
    + + + + +
    +
    Note
    +
    +This class is part of an experimental feature and is subject to change. +
    +
    +
    +
    +
    +

    ModioModDependency

    +
    +

    Minimal data about a mod which is a dependency of another mod

    +
    +
    + + + + + +
    +
    Note
    +
    +This class is part of an experimental feature and is subject to change. +
    +
    +

    Variables

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

    FModioModID

    ModID

    The ID of the dependency

    FString

    ModName

    The name of the dependency

    +
    +
    +

    ModioOptionalModProgressInfo


    @@ -4014,7 +4158,7 @@

    ModioModProgressInfo

    Class representing the progress of a mod installation or update

    -

    Variables

    +

    Variables

    @@ -4060,7 +4204,7 @@

    ModioTerms

    This struct contains strings that should be displayed to a user when displaying the terms of use and offering to create a mod.io account

    -

    Variables

    +

    Variables

    @@ -4104,7 +4248,7 @@

    Variables

    -

    Variables

    +

    Variables

    @@ -4144,7 +4288,7 @@

    ModioValidationError

    Wrapper struct containing information about a field validation error

    -

    Variables

    +

    Variables

    @@ -4186,7 +4330,7 @@

    Set Portal

    Changes the portal for the provided set of initialization options

    -

    Parameters

    +

    Parameters

    @@ -4228,7 +4372,7 @@

    Make Initialize Options

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

    -

    Parameters

    +

    Parameters

    @@ -4274,7 +4418,7 @@

    Make Game Id

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

    -

    Parameters

    +

    Parameters

    @@ -4308,7 +4452,7 @@

    Make Auth Params

    Creates an AuthenticationParams object

    -

    Parameters

    +

    Parameters

    @@ -4354,7 +4498,7 @@

    Make Api Key

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

    -

    Parameters

    +

    Parameters

    @@ -4385,7 +4529,7 @@

    Get Value

    int32 GetValue(FModioErrorCode Error)
    -

    Parameters

    +

    Parameters

    @@ -4420,7 +4564,7 @@

    Get Message

    FString GetMessage(FModioErrorCode Error)
    -

    Parameters

    +

    Parameters

    @@ -4455,7 +4599,7 @@

    Error Code Matches

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

    -

    Parameters

    +

    Parameters

    @@ -4497,7 +4641,7 @@

    List User Subscription Async

    Runs a filter over the user’s subscription list

    -

    Parameters

    +

    Parameters

    @@ -4612,7 +4756,7 @@

    Get Logo Size

    FVector2D GetLogoSize(UTexture* Logo, EModioLogoSize LogoSize)
    -

    Parameters

    +

    Parameters

    @@ -4651,7 +4795,7 @@

    Get Gallery Size

    FVector2D GetGallerySize(UTexture* GalleryImage, EModioGallerySize GallerySize)
    -

    Parameters

    +

    Parameters

    @@ -4690,7 +4834,7 @@

    Get Avatar Size

    FVector2D GetAvatarSize(UTexture* Avatar, EModioAvatarSize AvatarSize)
    -

    Parameters

    +

    Parameters

    @@ -4729,7 +4873,7 @@

    Get Path

    FString GetPath(FModioModCollectionEntry Entry)
    -

    Parameters

    +

    Parameters

    @@ -4764,7 +4908,7 @@

    Get Mod State

    EModioModState GetModState(FModioModCollectionEntry Entry)
    -

    Parameters

    +

    Parameters

    @@ -4799,7 +4943,7 @@

    Get Mod Profile

    FModioModInfo GetModProfile(FModioModCollectionEntry Entry)
    -

    Parameters

    +

    Parameters

    @@ -4834,7 +4978,7 @@

    Get ID

    FModioModID GetID(FModioModCollectionEntry Entry)
    -

    Parameters

    +

    Parameters

    @@ -4872,7 +5016,7 @@

    Get Percent (integer64/integer64)

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

    -

    Parameters

    +

    Parameters

    @@ -4907,7 +5051,7 @@

    Is Valid Security Code Format

    bool IsValidSecurityCodeFormat(FString String)
    -

    Parameters

    +

    Parameters

    @@ -4942,7 +5086,7 @@

    Is Valid Email Address Format

    bool IsValidEmailAddressFormat(FString String)
    -

    Parameters

    +

    Parameters

    @@ -5033,7 +5177,7 @@

    ToString (Filesize)

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

    Parameters

    +

    Parameters

    @@ -5759,7 +5903,7 @@

    Values

    diff --git a/Doc/img/nd_img_K2_GetModDependenciesAsync.png b/Doc/img/nd_img_K2_GetModDependenciesAsync.png new file mode 100644 index 00000000..938e9c25 Binary files /dev/null and b/Doc/img/nd_img_K2_GetModDependenciesAsync.png differ diff --git a/Source/Modio/GeneratedSource/SDKModMetadata.cpp b/Source/Modio/GeneratedSource/SDKModMetadata.cpp index 357bd6f9..a3e767d3 100644 --- a/Source/Modio/GeneratedSource/SDKModMetadata.cpp +++ b/Source/Modio/GeneratedSource/SDKModMetadata.cpp @@ -1,11 +1,11 @@ -/* +/* * Copyright (C) 2021 mod.io Pty Ltd. - * + * * This file is part of the mod.io SDK. - * - * 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 @@ -19,6 +19,7 @@ #include "modio/core/entities/ModioModInfo.h" #include "modio/core/entities/ModioModInfoList.h" #include "modio/core/entities/ModioModTagOptions.h" +#include "modio/detail/ops/mod/GetModDependenciesOp.h" #include "modio/detail/ops/mod/GetModDetailsOp.h" #include "modio/detail/ops/mod/GetModInfoOp.h" #include "modio/detail/ops/mod/GetModMediaAvatarOp.h" @@ -129,4 +130,17 @@ namespace Modio Modio::Detail::Services::GetGlobalContext().get_executor()); } } + + void GetModDependenciesAsync( + Modio::ModID ModID, + std::function Dependencies)> Callback) + { + if (Modio::Detail::RequireSDKIsInitialized(Callback) && Modio::Detail::RequireNotRateLimited(Callback)) + { + return asio::async_compose)>, + void(Modio::ErrorCode, Modio::Optional)>( + Modio::Detail::GetModDependenciesOp(ModID, Modio::Detail::SDKSessionData::CurrentGameID()), Callback, + Modio::Detail::Services::GetGlobalContext().get_executor()); + } + } } // namespace Modio diff --git a/Source/Modio/Private/Internal/Convert/ModDependency.h b/Source/Modio/Private/Internal/Convert/ModDependency.h new file mode 100644 index 00000000..0d32c027 --- /dev/null +++ b/Source/Modio/Private/Internal/Convert/ModDependency.h @@ -0,0 +1,10 @@ +#pragma once +#include "Internal/ModioConvert.h" + +FORCEINLINE FModioModDependency ToUnreal(const Modio::ModDependency& In) +{ + FModioModDependency Out; + Out.ModID = ToUnreal(In.ModID); + Out.ModName = ToUnreal(In.ModName); + return Out; +} \ No newline at end of file diff --git a/Source/Modio/Private/Libraries/ModioModDependenciesLibrary.cpp b/Source/Modio/Private/Libraries/ModioModDependenciesLibrary.cpp new file mode 100644 index 00000000..8f1b784e --- /dev/null +++ b/Source/Modio/Private/Libraries/ModioModDependenciesLibrary.cpp @@ -0,0 +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 + * view online at ) + * + */ + +#include "Libraries/ModioModDependenciesLibrary.h" + +const TArray& UModioModDependenciesLibrary::GetDependencies(const FModioModDependencyList& DependencyList) +{ + return DependencyList.InternalList; +} + +const FModioPagedResult& UModioModDependenciesLibrary::GetPagedResult( + const FModioModDependencyList& DependencyList) +{ + return DependencyList.PagedResult; +} diff --git a/Source/Modio/Private/Libraries/ModioOptionalLibrary.cpp b/Source/Modio/Private/Libraries/ModioOptionalLibrary.cpp index a78e95c2..aa96c8f3 100644 --- a/Source/Modio/Private/Libraries/ModioOptionalLibrary.cpp +++ b/Source/Modio/Private/Libraries/ModioOptionalLibrary.cpp @@ -1,17 +1,18 @@ -/* +/* * 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/ModioOptionalLibrary.h" #include "Types/ModioModInfoList.h" #include "Types/ModioModTagOptions.h" #include "Types/ModioUser.h" +#include "Types/ModioModDependencyList.h" template bool IsSetInternal(const BPOptionalType& Optional) @@ -104,8 +105,20 @@ bool UModioOptionalLibrary::IsSet_ModioOptionalTerms(const FModioOptionalTerms& return IsSetInternal(OptionalTerms); } - bool UModioOptionalLibrary::GetValue_ModioOptionalTerms(const FModioOptionalTerms& OptionalTerms, FModioTerms& Terms) { return GetValueInternal(OptionalTerms, Terms); } + +bool UModioOptionalLibrary::IsSet_ModioOptionalModDependencyList( + const struct FModioOptionalModDependencyList& OptionalDependencyList) +{ + return IsSetInternal(OptionalDependencyList); +} + +bool UModioOptionalLibrary::GetValue_ModioOptionalModDependencyList( + const struct FModioOptionalModDependencyList& OptionalDependencyList, + struct FModioModDependencyList& DependencyList) +{ + return GetValueInternal(OptionalDependencyList, DependencyList); +} diff --git a/Source/Modio/Private/ModioSubsystem.cpp b/Source/Modio/Private/ModioSubsystem.cpp index 272d9c3c..5f98fa05 100644 --- a/Source/Modio/Private/ModioSubsystem.cpp +++ b/Source/Modio/Private/ModioSubsystem.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 "ModioSubsystem.h" @@ -15,6 +15,7 @@ #include "Internal/Convert/FilterParams.h" #include "Internal/Convert/InitializeOptions.h" #include "Internal/Convert/ModCollectionEntry.h" +#include "Internal/Convert/ModDependency.h" #include "Internal/Convert/ModInfo.h" #include "Internal/Convert/ModInfoList.h" #include "Internal/Convert/ModManagementEvent.h" @@ -510,15 +511,13 @@ void UModioSubsystem::ForceUninstallModAsync(FModioModID ModToRemove, FOnErrorOn [Callback](FModioErrorCode ec) { Callback.ExecuteIfBound(ec); }); } -void UModioSubsystem::SubmitModRatingAsync(FModioModID Mod, EModioRating Rating, - FOnErrorOnlyDelegateFast Callback) +void UModioSubsystem::SubmitModRatingAsync(FModioModID Mod, EModioRating Rating, FOnErrorOnlyDelegateFast Callback) { Modio::SubmitModRatingAsync(ToModio(Mod), ToModio(Rating), [Callback](FModioErrorCode ec) { Callback.ExecuteIfBound(ec); }); } -void UModioSubsystem::K2_SubmitModRatingAsync(FModioModID Mod, EModioRating Rating, - FOnErrorOnlyDelegate Callback) +void UModioSubsystem::K2_SubmitModRatingAsync(FModioModID Mod, EModioRating Rating, FOnErrorOnlyDelegate Callback) { SubmitModRatingAsync(Mod, Rating, FOnErrorOnlyDelegateFast::CreateLambda([Callback](FModioErrorCode ec) { Callback.ExecuteIfBound(ec); @@ -534,7 +533,32 @@ void UModioSubsystem::K2_ReportContentAsync(FModioReportParams Report, FOnErrorO { ReportContentAsync(Report, FOnErrorOnlyDelegateFast::CreateLambda( [Callback](FModioErrorCode ec) { Callback.ExecuteIfBound(ec); })); +} +void UModioSubsystem::GetModDependenciesAsync(FModioModID ModID, FOnGetModDependenciesDelegateFast Callback) +{ + Modio::GetModDependenciesAsync( + ToModio(ModID), [Callback](Modio::ErrorCode ec, Modio::Optional Dependencies) { + if (Dependencies) + { + FModioModDependencyList Out; + Out.InternalList = ToUnreal(Dependencies->GetRawList()); + Out.PagedResult = FModioPagedResult(Dependencies.value()); + Callback.ExecuteIfBound(ec, Out); + } + else + { + Callback.ExecuteIfBound(ec, {}); + } + }); +} + +MODIO_API void UModioSubsystem::K2_GetModDependenciesAsync(FModioModID ModID, FOnGetModDependenciesDelegate Callback) +{ + GetModDependenciesAsync(ModID, FOnGetModDependenciesDelegateFast::CreateLambda( + [Callback](FModioErrorCode ec, TOptional Dependencies) { + Callback.ExecuteIfBound(ec, FModioOptionalModDependencyList(MoveTempIfPossible(Dependencies))); + })); } /// File scope implementations diff --git a/Source/Modio/Private/Types/ModioModDependencyListUImpl.cpp b/Source/Modio/Private/Types/ModioModDependencyListUImpl.cpp new file mode 100644 index 00000000..fd53bf52 --- /dev/null +++ b/Source/Modio/Private/Types/ModioModDependencyListUImpl.cpp @@ -0,0 +1,16 @@ +/* + * 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 ) + * + */ +#include "Templates/UnrealTemplate.h" +#include "Types/ModioModDependencyList.h" + + +FModioOptionalModDependencyList::FModioOptionalModDependencyList(TOptional&& ModDependencies) + : Internal(MoveTemp(ModDependencies)) +{} diff --git a/Source/Modio/Public/Libraries/ModioModDependenciesLibrary.h b/Source/Modio/Public/Libraries/ModioModDependenciesLibrary.h new file mode 100644 index 00000000..7b2839d4 --- /dev/null +++ b/Source/Modio/Public/Libraries/ModioModDependenciesLibrary.h @@ -0,0 +1,40 @@ +/* + * 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 "Kismet/BlueprintFunctionLibrary.h" +#include "Types/ModioModDependencyList.h" + +// clang-format off +#include "ModioModDependenciesLibrary.generated.h" +// clang-format on + +UCLASS() +class UModioModDependenciesLibrary : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + + /** + * Get the tags in a mod tag options list + * @param ModTags + * @return + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Utilities") + static const TArray& GetDependencies(const FModioModDependencyList& ModTags); + + /** + * Get the paged result that contains information of the data returned + * @param ModTags + * @return + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Utilities") + static const FModioPagedResult& GetPagedResult(const FModioModDependencyList& ModTags); +}; diff --git a/Source/Modio/Public/Libraries/ModioOptionalLibrary.h b/Source/Modio/Public/Libraries/ModioOptionalLibrary.h index f514d6dd..bc056f99 100644 --- a/Source/Modio/Public/Libraries/ModioOptionalLibrary.h +++ b/Source/Modio/Public/Libraries/ModioOptionalLibrary.h @@ -17,6 +17,7 @@ #include "Types/ModioModTagOptions.h" #include "Types/ModioTerms.h" #include "Types/ModioImage.h" +#include "Types/ModioModDependencyList.h" // clang-format off #include "ModioOptionalLibrary.generated.h" @@ -176,4 +177,28 @@ class UModioOptionalLibrary : public UBlueprintFunctionLibrary static bool GetValue_ModioOptionalTerms( const struct FModioOptionalTerms& OptionalTerms, struct FModioTerms& Terms); + + /** + * Check if the optional mod dependency list has a valid value + * + * @param OptionalDependencyList - The optional to check + * @return true if it has a value set + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Utilities|Optional", + meta = (DisplayName = "IsSet (ModioOptionalModDependencyList)", CompactNodeTitle = "IsSet")) + static bool IsSet_ModioOptionalModDependencyList( + const struct FModioOptionalModDependencyList& OptionalDependencyList); + + /** + * Get the dependency list from the optional if it's set + * + * @param OptionalDependencyList - + * @param DependencyList - if this returned false, then this will be defaulted + * @return true if the optional has a value set + */ + UFUNCTION(BlueprintPure, Category = "mod.io|Utilities|Optional", + DisplayName = "GetValue (ModioOptionalModDependencyList)") + static bool GetValue_ModioOptionalModDependencyList( + const struct FModioOptionalModDependencyList& OptionalDependencyList, + struct FModioModDependencyList& DependencyList); }; diff --git a/Source/Modio/Public/ModioSubsystem.h b/Source/Modio/Public/ModioSubsystem.h index 003e09f3..009b71e5 100644 --- a/Source/Modio/Public/ModioSubsystem.h +++ b/Source/Modio/Public/ModioSubsystem.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 @@ -19,6 +19,7 @@ #include "Types/ModioImage.h" #include "Types/ModioInitializeOptions.h" #include "Types/ModioModCollectionEntry.h" +#include "Types/ModioModDependencyList.h" #include "Types/ModioModInfo.h" #include "Types/ModioModInfoList.h" #include "Types/ModioModManagementEvent.h" @@ -40,6 +41,7 @@ DECLARE_DELEGATE_TwoParams(FOnGetModInfoDelegateFast, FModioErrorCode, TOptional DECLARE_DELEGATE_TwoParams(FOnGetMediaDelegateFast, FModioErrorCode, TOptional); DECLARE_DELEGATE_TwoParams(FOnGetModTagOptionsDelegateFast, FModioErrorCode, TOptional); DECLARE_DELEGATE_TwoParams(FOnGetTermsOfUseDelegateFast, FModioErrorCode, TOptional); +DECLARE_DELEGATE_TwoParams(FOnGetModDependenciesDelegateFast, FModioErrorCode, TOptional); // Blueprint version of delegates DECLARE_DYNAMIC_DELEGATE_OneParam(FOnErrorOnlyDelegate, FModioErrorCode, ErrorCode); @@ -51,6 +53,8 @@ DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnGetMediaDelegate, FModioErrorCode, ErrorCo DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnGetModTagOptionsDelegate, FModioErrorCode, ErrorCode, FModioOptionalModTagOptions, ModTagOptions); DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnGetTermsOfUseDelegate, FModioErrorCode, ErrorCode, FModioOptionalTerms, Terms); +DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnGetModDependenciesDelegate, FModioErrorCode, ErrorCode, + FModioOptionalModDependencyList, Dependencies); /** * @brief Thin wrapper around the mod.io SDK. This mostly wraps all the functions available in modio/ModioSDK.h that's @@ -318,6 +322,19 @@ class UModioSubsystem : public UEngineSubsystem **/ MODIO_API void GetModTagOptionsAsync(FOnGetModTagOptionsDelegateFast 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 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 + * @error GenericError::SDKNotInitialized|SDK not initialized + * @experimental + **/ + MODIO_API void GetModDependenciesAsync(FModioModID ModID, FOnGetModDependenciesDelegateFast Callback); + /** * @brief Begins email authentication for the current session by requesting a one-time code be sent to the * specified email address if it is associated with a Mod.io account @@ -397,7 +414,6 @@ class UModioSubsystem : public UEngineSubsystem **/ MODIO_API void GetUserMediaAsync(EModioAvatarSize AvatarSize, FOnGetMediaDelegateFast Callback); - /** * @brief Submits a rating for a mod on behalf of the current user. Submit a neutral rating to effectively clear a * rating already submitted by a user. Submitting other values will overwrite any existing rating submitted by this @@ -626,6 +642,20 @@ class UModioSubsystem : public UEngineSubsystem UFUNCTION(BlueprintCallable, DisplayName = "GetModTagOptionsAsync", Category = "mod.io|Mods") MODIO_API void K2_GetModTagOptionsAsync(FOnGetModTagOptionsDelegate 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 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 + * @error GenericError::SDKNotInitialized|SDK not initialized + * @experimental + **/ + UFUNCTION(BlueprintCallable, DisplayName = "GetModDependenciesAsync", Category = "mod.io|Mods") + MODIO_API void K2_GetModDependenciesAsync(FModioModID ModID, FOnGetModDependenciesDelegate Callback); + /** * @brief Begins email authentication for the current session by requesting a one-time code be sent to the * specified email address if it is associated with a Mod.io account diff --git a/Source/Modio/Public/Types/ModioModDependencyList.h b/Source/Modio/Public/Types/ModioModDependencyList.h new file mode 100644 index 00000000..9b58fce9 --- /dev/null +++ b/Source/Modio/Public/Types/ModioModDependencyList.h @@ -0,0 +1,70 @@ +/* + * 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 "Types/ModioCommonTypes.h" +#include "Types/ModioPagedResult.h" +#include "Containers/UnrealString.h" +#include "Misc/Optional.h" + +#include "ModioModDependencyList.generated.h" + +/** + * @brief Minimal data about a mod which is a dependency of another mod + * @experimental + */ +USTRUCT(BlueprintType) +struct FModioModDependency +{ + GENERATED_BODY(); + + /** + * @brief The ID of the dependency + */ + UPROPERTY(BlueprintReadOnly) + FModioModID ModID; + + /** + * @brief The name of the dependency + */ + UPROPERTY(BlueprintReadOnly) + FString ModName; +}; + + +/** + * @brief Paged list of mod dependencies + * @experimental + */ +USTRUCT(BlueprintType) +struct MODIO_API FModioModDependencyList +{ + GENERATED_BODY(); + + UPROPERTY() + FModioPagedResult PagedResult; + + UPROPERTY() + TArray InternalList; +}; + + + +USTRUCT(BlueprintType) +struct FModioOptionalModDependencyList +{ + GENERATED_BODY() + + FModioOptionalModDependencyList() = default; + FModioOptionalModDependencyList(TOptional&& ModDependencies); + + TOptional Internal; +}; diff --git a/Source/ThirdParty/NativeSDK b/Source/ThirdParty/NativeSDK index ffd57991..f53ef3b5 160000 --- a/Source/ThirdParty/NativeSDK +++ b/Source/ThirdParty/NativeSDK @@ -1 +1 @@ -Subproject commit ffd579911c3cb42b3fc8e73f68f5bdccc28a4e5e +Subproject commit f53ef3b5d15b8ddda3ae655673ba63915bae3c97