Skip to content

Commit

Permalink
Merge branch 'release/v2.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonHough committed Jan 24, 2024
2 parents 57f9f9b + e1c1d5a commit 9145622
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 19 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Binary file modified Content/AvatarCreator/Blueprints/BI_RPM_NavigationSwitcher.uasset
Binary file not shown.
Binary file modified Content/AvatarCreator/Widgets/Editor/WBP_RPM_AssetUnlockView.uasset
Binary file not shown.
Binary file modified Content/AvatarCreator/Widgets/WBP_RPM_AvatarCreator.uasset
Binary file not shown.
2 changes: 1 addition & 1 deletion ReadyPlayerMe.uplugin
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class URpmAvatarRequestHandler : public UObject

void Precompile(ERpmPartnerAssetType AssetType, const TArray<FRpmPartnerAsset>& FilteredAssets);

void UpdateAvatar(ERpmPartnerAssetType AssetType, int64 AssetId);
void UpdateAvatar(ERpmPartnerAssetType AssetType, const FString& AssetId);

void UpdateAvatar(ERpmPartnerAssetColor AssetColor, int32 ColorIndex);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<EJson::String>(JSON_FIELD_NAME))
{
Expand Down
11 changes: 4 additions & 7 deletions Source/RpmAvatarCreator/Private/Extractors/PayloadExtractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -154,11 +153,10 @@ FString FPayloadExtractor::MakeUpdatePayload(const TSharedPtr<FJsonObject> Asset

return FDataJsonUtils::MakeDataPayload(DataObject);
}
FString FPayloadExtractor::MakeUpdatePayload(ERpmPartnerAssetType AssetType, int64 AssetId)
FString FPayloadExtractor::MakeUpdatePayload(ERpmPartnerAssetType AssetType, const FString& AssetId)
{
const TSharedPtr<FJsonObject> AssetsObject = MakeShared<FJsonObject>();
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], "");
Expand Down Expand Up @@ -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<FJsonValueString>(AssetStr));
PreloadAssetString.Add(MakeShared<FJsonValueString>(Asset.Id));
}
}
const TSharedPtr<FJsonObject> DataObject = MakeShared<FJsonObject>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion Source/RpmAvatarCreator/Private/RpmAvatarCreatorApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions Source/RpmAvatarCreator/Private/UI/RpmAvatarEditorUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Source/RpmAvatarCreator/Public/RpmAvatarCreatorApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions Source/RpmAvatarCreator/Public/RpmAvatarCreatorTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -156,7 +156,7 @@ struct FRpmAvatarProperties
TMap<ERpmPartnerAssetColor, int32> Colors;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Ready Player Me")
TMap<ERpmPartnerAssetType, int64> Assets;
TMap<ERpmPartnerAssetType, FString> Assets;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Ready Player Me")
FString Base64Image;
Expand Down

0 comments on commit 9145622

Please sign in to comment.