Skip to content

Commit

Permalink
2024.7
Browse files Browse the repository at this point in the history
Updates

* New Detailed logging level to strike a better balance between logging all file IO and including more detailed output from HTTP requests
* Static localization data based on Display Strings for enums is now included as a string table
* NativeSDK updated to 2024.7 release

Breaking Changes

* UserDerivedToken renamed to UserDelegationToken
  • Loading branch information
stephenwhittle committed Jul 31, 2024
1 parent 74b8977 commit 1792287
Show file tree
Hide file tree
Showing 92 changed files with 2,642 additions and 1,061 deletions.
5 changes: 4 additions & 1 deletion Config/Defaultmodio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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")
+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")

Binary file added Content/Data/ST_ModioStaticLocData.uasset
Binary file not shown.
Binary file added Content/ST_ModioStaticLocData.uasset
Binary file not shown.
2,067 changes: 1,412 additions & 655 deletions Doc/documentation.html

Large diffs are not rendered by default.

206 changes: 192 additions & 14 deletions Doc/getting-started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<K2_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 https://docs.mod.io/#targeting-a-portal[Portal]. You can get the default portal for the current platform using <<GetDefaultPortalForCurrentPlatform>> function.
When you are ready to initialize the plugin for the current user, you'll need to call <<K2_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 https://docs.mod.io/restapiref/#targeting-a-portal[Portal]. You can get the default portal for the current platform using <<GetDefaultPortalForCurrentPlatform>> function.
image::img/initasync_customoptions.png[]
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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<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
[%collapsible]
====
image::img/purchase_mod.png[]
====

.C++ Example
[%collapsible]
====
[source,cpp]
----
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
[%collapsible]
====
image::img/show_user_purchases.png[]
====

.C++ Example
[%collapsible]
====
[source,cpp]
----
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
[%collapsible]
====
image::img/get_user_delegation_token.png[]
====

.C++ Example
[%collapsible]
====
[source,cpp]
----
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
}
}
----
====
Binary file added Doc/img/get_user_delegation_token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/get_user_wallet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/nd_img_CreateNotificationParams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_FileSizeUnsigned64_ToText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_GetLanguageCodeFromString.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_GetLanguageCodeString.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_GetLocalizedTextForEnumByName.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/nd_img_GetLogoSize.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_GetPagedResult.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_GetTags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_GreaterThanZero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_IsErrorAsExec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/nd_img_K2_EnableModManagement.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/nd_img_K2_ForceUninstallModAsync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/nd_img_K2_GetGameInfoAsync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_K2_GetLanguage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_K2_GetUserDelegationTokenAsync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Doc/img/nd_img_K2_GetUserDerivedTokenAsync.png
Binary file not shown.
Binary file modified Doc/img/nd_img_K2_ListUserGamesAsync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/nd_img_K2_MuteUserAsync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/nd_img_K2_RemoveFromTempModSet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/nd_img_K2_ReportContentAsync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/nd_img_K2_SubmitModChangesFromMemoryAsync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/nd_img_MakeEntitlementParams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/nd_img_MakeFromComponents.png
Binary file modified Doc/img/nd_img_MakeInitializeOptions.png
Binary file added Doc/img/nd_img_ReconstructError.png
Binary file modified Doc/img/nd_img_RefreshListByFilter.png
Binary file modified Doc/img/nd_img_RegisterDynamicTab.png
Binary file modified Doc/img/nd_img_RoundNumberString.png
Binary file modified Doc/img/nd_img_SetFloatArg.png
Binary file modified Doc/img/nd_img_SetIntegerArg.png
Binary file modified Doc/img/nd_img_SetPortal.png
Binary file modified Doc/img/nd_img_SetRetryRequestedDelegate.png
Binary file modified Doc/img/nd_img_SetSessionIdentifier.png
Binary file modified Doc/img/nd_img_SetStringArg.png
Binary file modified Doc/img/nd_img_SetTextArg.png
Binary file modified Doc/img/nd_img_SetTrackingModID.png
Binary file modified Doc/img/nd_img_ShowSearchResults.png
Binary file added Doc/img/nd_img_ToFilterParams.png
Binary file added Doc/img/purchase_mod.png
Binary file added Doc/img/show_user_purchases.png
14 changes: 7 additions & 7 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Source/Modio/Modio.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Source/Modio/Private/Internal/Convert/FileMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions Source/Modio/Private/Internal/Convert/FilterParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions Source/Modio/Private/Internal/Convert/ModDependency.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
47 changes: 47 additions & 0 deletions Source/Modio/Private/Internal/ModioConvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down Expand Up @@ -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)"));
Expand Down Expand Up @@ -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;
}
2 changes: 2 additions & 0 deletions Source/Modio/Private/Internal/ModioConvert.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<std::string> ToModio(const TArray<FString>& StringArray);
Expand Down
Loading

0 comments on commit 1792287

Please sign in to comment.