diff --git a/CHANGELOG.md b/CHANGELOG.md index 52c4d8c..70f0705 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,11 +3,17 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2.3.0] 2024-01-24 + +## Fixed + +- Fixed assetID type issue in the AvatarCreator by @harrisonhough in [#54](https://github.com/readyplayerme/rpm-unreal-sdk/pull/54) + ## [2.2.0] 2024-01-12 ## Added -- Added support for auto LODs for the avatars +- Added support for auto LODs for the avatars in [#52](https://github.com/readyplayerme/rpm-unreal-sdk/pull/52) ## Fixed diff --git a/Content/AvatarCreator/Blueprints/BI_RPM_NavigationSwitcher.uasset b/Content/AvatarCreator/Blueprints/BI_RPM_NavigationSwitcher.uasset index 8f69003..63da1dd 100644 Binary files a/Content/AvatarCreator/Blueprints/BI_RPM_NavigationSwitcher.uasset and b/Content/AvatarCreator/Blueprints/BI_RPM_NavigationSwitcher.uasset differ diff --git a/Content/AvatarCreator/Widgets/Editor/WBP_RPM_AssetUnlockView.uasset b/Content/AvatarCreator/Widgets/Editor/WBP_RPM_AssetUnlockView.uasset index 2532724..3914857 100644 Binary files a/Content/AvatarCreator/Widgets/Editor/WBP_RPM_AssetUnlockView.uasset and b/Content/AvatarCreator/Widgets/Editor/WBP_RPM_AssetUnlockView.uasset differ diff --git a/Content/AvatarCreator/Widgets/WBP_RPM_AvatarCreator.uasset b/Content/AvatarCreator/Widgets/WBP_RPM_AvatarCreator.uasset index d49e4b4..bf09b3d 100644 Binary files a/Content/AvatarCreator/Widgets/WBP_RPM_AvatarCreator.uasset and b/Content/AvatarCreator/Widgets/WBP_RPM_AvatarCreator.uasset differ diff --git a/ReadyPlayerMe.uplugin b/ReadyPlayerMe.uplugin index 4ea3012..410948e 100644 --- a/ReadyPlayerMe.uplugin +++ b/ReadyPlayerMe.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "2.2.0", + "VersionName": "2.3.0", "FriendlyName": "Ready Player Me", "Description": "Ready Player Me SDK", "Category": "Runtime", diff --git a/Source/RpmAvatarCreator/Private/Downloaders/RpmAvatarRequestHandler.cpp b/Source/RpmAvatarCreator/Private/Downloaders/RpmAvatarRequestHandler.cpp index 8905597..4a86443 100644 --- a/Source/RpmAvatarCreator/Private/Downloaders/RpmAvatarRequestHandler.cpp +++ b/Source/RpmAvatarCreator/Private/Downloaders/RpmAvatarRequestHandler.cpp @@ -84,7 +84,7 @@ void URpmAvatarRequestHandler::OnPrecompileCompleted(bool bSuccess) PrecompileRequest.Reset(); } -void URpmAvatarRequestHandler::UpdateAvatar(ERpmPartnerAssetType AssetType, int64 AssetId) +void URpmAvatarRequestHandler::UpdateAvatar(ERpmPartnerAssetType AssetType, const FString& AssetId) { AvatarProperties.Assets.FindOrAdd(AssetType) = AssetId; UpdateAvatar(FPayloadExtractor::MakeUpdatePayload(AssetType, AssetId)); diff --git a/Source/RpmAvatarCreator/Private/Downloaders/RpmAvatarRequestHandler.h b/Source/RpmAvatarCreator/Private/Downloaders/RpmAvatarRequestHandler.h index 2455912..7c419e2 100644 --- a/Source/RpmAvatarCreator/Private/Downloaders/RpmAvatarRequestHandler.h +++ b/Source/RpmAvatarCreator/Private/Downloaders/RpmAvatarRequestHandler.h @@ -23,7 +23,7 @@ class URpmAvatarRequestHandler : public UObject void Precompile(ERpmPartnerAssetType AssetType, const TArray& FilteredAssets); - void UpdateAvatar(ERpmPartnerAssetType AssetType, int64 AssetId); + void UpdateAvatar(ERpmPartnerAssetType AssetType, const FString& AssetId); void UpdateAvatar(ERpmPartnerAssetColor AssetColor, int32 ColorIndex); diff --git a/Source/RpmAvatarCreator/Private/Extractors/PartnerAssetExtractor.cpp b/Source/RpmAvatarCreator/Private/Extractors/PartnerAssetExtractor.cpp index 889f0c7..3224430 100644 --- a/Source/RpmAvatarCreator/Private/Extractors/PartnerAssetExtractor.cpp +++ b/Source/RpmAvatarCreator/Private/Extractors/PartnerAssetExtractor.cpp @@ -123,7 +123,7 @@ FAssetPaginationData FPartnerAssetExtractor::ExtractAssets(const FString& JsonSt } if (JsonObject->HasField(JSON_FIELD_ID)) { - Asset.Id = JsonObject->GetIntegerField(JSON_FIELD_ID); + Asset.Id = JsonObject->GetStringField(JSON_FIELD_ID); } if (JsonObject->HasTypedField(JSON_FIELD_NAME)) { diff --git a/Source/RpmAvatarCreator/Private/Extractors/PayloadExtractor.cpp b/Source/RpmAvatarCreator/Private/Extractors/PayloadExtractor.cpp index 0e173c0..c01891d 100644 --- a/Source/RpmAvatarCreator/Private/Extractors/PayloadExtractor.cpp +++ b/Source/RpmAvatarCreator/Private/Extractors/PayloadExtractor.cpp @@ -112,8 +112,7 @@ FRpmAvatarProperties FPayloadExtractor::ExtractPayload(const FString& JsonString const FString AssetStr = AssetsObject->GetStringField(Item.Value); if (!AssetStr.IsEmpty()) { - int64 AssetId = 0; - FDefaultValueHelper::ParseInt64(AssetsObject->GetStringField(Item.Value), AssetId); + FString AssetId = AssetsObject->GetStringField(Item.Value); AvatarProperties.Assets.Add(Item.Key, AssetId); } } @@ -154,11 +153,10 @@ FString FPayloadExtractor::MakeUpdatePayload(const TSharedPtr Asset return FDataJsonUtils::MakeDataPayload(DataObject); } -FString FPayloadExtractor::MakeUpdatePayload(ERpmPartnerAssetType AssetType, int64 AssetId) +FString FPayloadExtractor::MakeUpdatePayload(ERpmPartnerAssetType AssetType, const FString& AssetId) { const TSharedPtr AssetsObject = MakeShared(); - const FString AssetIdStr = AssetId != 0 ? FString::FromInt(AssetId) : ""; - AssetsObject->SetStringField(ASSET_TYPE_TO_STRING_MAP[AssetType], AssetIdStr); + AssetsObject->SetStringField(ASSET_TYPE_TO_STRING_MAP[AssetType], AssetId); if (AssetType == ERpmPartnerAssetType::Top || AssetType == ERpmPartnerAssetType::Bottom || AssetType == ERpmPartnerAssetType::Footwear) { AssetsObject->SetStringField(ASSET_TYPE_TO_STRING_MAP[ERpmPartnerAssetType::Outfit], ""); @@ -186,8 +184,7 @@ FString FPayloadExtractor::MakePrecompilePayload(ERpmPartnerAssetType Precompile { if (PrecompileAssetType == Asset.AssetType) { - const FString AssetStr = FString::Printf(TEXT("%lld"), Asset.Id); - PreloadAssetString.Add(MakeShared(AssetStr)); + PreloadAssetString.Add(MakeShared(Asset.Id)); } } const TSharedPtr DataObject = MakeShared(); diff --git a/Source/RpmAvatarCreator/Private/Extractors/PayloadExtractor.h b/Source/RpmAvatarCreator/Private/Extractors/PayloadExtractor.h index 23b5dcd..4bb224d 100644 --- a/Source/RpmAvatarCreator/Private/Extractors/PayloadExtractor.h +++ b/Source/RpmAvatarCreator/Private/Extractors/PayloadExtractor.h @@ -16,7 +16,7 @@ class FPayloadExtractor static FString MakeCreatePayload(const FRpmAvatarProperties& AvatarProperties); - static FString MakeUpdatePayload(ERpmPartnerAssetType AssetType, int64 AssetId); + static FString MakeUpdatePayload(ERpmPartnerAssetType AssetType, const FString& AssetId); static FString MakeUpdatePayload(ERpmPartnerAssetColor AssetColor, int32 ColorId); diff --git a/Source/RpmAvatarCreator/Private/RpmAvatarCreatorApi.cpp b/Source/RpmAvatarCreator/Private/RpmAvatarCreatorApi.cpp index 265865b..c52bc62 100644 --- a/Source/RpmAvatarCreator/Private/RpmAvatarCreatorApi.cpp +++ b/Source/RpmAvatarCreator/Private/RpmAvatarCreatorApi.cpp @@ -169,7 +169,7 @@ void URpmAvatarCreatorApi::DownloadUserAvatars(const FUserAvatarsDownloadComplet UserAvatarDownloader->DownloadUserAvatars(DownloadCompleted, Failed); } -void URpmAvatarCreatorApi::UpdateAvatarAsset(ERpmPartnerAssetType AssetType, int64 AssetId) +void URpmAvatarCreatorApi::UpdateAvatarAsset(ERpmPartnerAssetType AssetType, const FString& AssetId) { AvatarRequestHandler->UpdateAvatar(AssetType, AssetId); } diff --git a/Source/RpmAvatarCreator/Private/UI/RpmAvatarEditorUI.cpp b/Source/RpmAvatarCreator/Private/UI/RpmAvatarEditorUI.cpp index 0e645f7..60c0d78 100644 --- a/Source/RpmAvatarCreator/Private/UI/RpmAvatarEditorUI.cpp +++ b/Source/RpmAvatarCreator/Private/UI/RpmAvatarEditorUI.cpp @@ -63,7 +63,7 @@ void URpmAvatarEditorUI::OnUpdateLockedAssetsCompleted() const auto& SelectedAssets = AvatarCreatorApi->AvatarProperties.Assets; for (const auto& Asset : AvatarCreatorApi->GetFilteredPartnerAssets()) { - if (SelectedAssets.Contains(Asset.AssetType) && SelectedAssets[Asset.AssetType] == Asset.Id && Asset.bIsLocked) + if (SelectedAssets.Contains(Asset.AssetType) && SelectedAssets[Asset.AssetType].Equals(Asset.Id) && Asset.bIsLocked) { ContainsLockedAsset = true; break; @@ -193,7 +193,7 @@ bool URpmAvatarEditorUI::IsAssetSelected(const FRpmPartnerAsset& Asset) const { return AvatarCreatorApi->AvatarProperties.Assets[Asset.AssetType] == Asset.Id; } - return Asset.Id == 0; + return Asset.Id == "0"; } void URpmAvatarEditorUI::SetAssetSelectedPin(const FRpmPartnerAsset& Asset) diff --git a/Source/RpmAvatarCreator/Public/RpmAvatarCreatorApi.h b/Source/RpmAvatarCreator/Public/RpmAvatarCreatorApi.h index 1b2492b..76a3a72 100644 --- a/Source/RpmAvatarCreator/Public/RpmAvatarCreatorApi.h +++ b/Source/RpmAvatarCreator/Public/RpmAvatarCreatorApi.h @@ -43,7 +43,7 @@ class RPMAVATARCREATOR_API URpmAvatarCreatorApi : public UObject void PrepareEditor(const FAvatarEditorReady& EditorReady, const FAvatarCreatorFailed& Failed); UFUNCTION(BlueprintCallable, Category = "Ready Player Me", meta = (DisplayName = "Update Avatar Asset")) - void UpdateAvatarAsset(ERpmPartnerAssetType AssetType, int64 AssetId); + void UpdateAvatarAsset(ERpmPartnerAssetType AssetType, const FString& AssetId); UFUNCTION(BlueprintCallable, Category = "Ready Player Me", meta = (DisplayName = "Update Avatar Color")) void UpdateAvatarColor(ERpmPartnerAssetColor AssetColor, int32 ColorIndex); diff --git a/Source/RpmAvatarCreator/Public/RpmAvatarCreatorTypes.h b/Source/RpmAvatarCreator/Public/RpmAvatarCreatorTypes.h index 693081e..c9a51ad 100644 --- a/Source/RpmAvatarCreator/Public/RpmAvatarCreatorTypes.h +++ b/Source/RpmAvatarCreator/Public/RpmAvatarCreatorTypes.h @@ -99,7 +99,7 @@ struct FRpmPartnerAsset GENERATED_BODY() UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = "Ready Player Me") - int64 Id; + FString Id; UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = "Ready Player Me") FString Name; @@ -156,7 +156,7 @@ struct FRpmAvatarProperties TMap Colors; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Ready Player Me") - TMap Assets; + TMap Assets; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Ready Player Me") FString Base64Image;