Skip to content

Commit 73c9e03

Browse files
authored
fix: add extended urns for saving outfits (#6116)
1 parent 04c35fc commit 73c9e03

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/BackpackEditorHUDController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ private void SetAllColors(Color eyesColor, Color hairColor, Color bodyColor)
817817
private void UpdateAvatarModel(AvatarModel avatarModel)
818818
{
819819
view.UpdateAvatarPreview(avatarModel);
820-
outfitsController.UpdateAvatarPreview(model.ToAvatarModel());
820+
outfitsController.UpdateAvatarPreview(model.ToAvatarModel(extendedWearableUrns));
821821
}
822822

823823
private void OnColorPickerToggled() =>

unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BackpackEditorHUDV2/BackpackEditorHUDModel.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,25 @@ public record BackpackEditorHUDModel
1313
public Color eyesColor;
1414
public HashSet<string> forceRender = new ();
1515

16-
public AvatarModel ToAvatarModel()
16+
public AvatarModel ToAvatarModel(Dictionary<string, string> extendedWearableUrns = null)
1717
{
18+
List<string> wearables;
19+
20+
if (extendedWearableUrns != null)
21+
{
22+
wearables = new List<string>();
23+
24+
foreach (string w in this.wearables.Keys)
25+
wearables.Add(extendedWearableUrns.TryGetValue(w, out string extendedUrn)
26+
? extendedUrn : w);
27+
}
28+
else
29+
wearables = this.wearables.Keys.ToList();
30+
1831
return new AvatarModel
1932
{
2033
bodyShape = bodyShape.id,
21-
wearables = wearables.Keys.ToList(),
34+
wearables = wearables,
2235
hairColor = hairColor,
2336
skinColor = skinColor,
2437
eyeColor = eyesColor,

0 commit comments

Comments
 (0)