Skip to content

Commit

Permalink
fix: add extended urns for saving outfits (#6116)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorux0 authored Mar 6, 2024
1 parent 04c35fc commit 73c9e03
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ private void SetAllColors(Color eyesColor, Color hairColor, Color bodyColor)
private void UpdateAvatarModel(AvatarModel avatarModel)
{
view.UpdateAvatarPreview(avatarModel);
outfitsController.UpdateAvatarPreview(model.ToAvatarModel());
outfitsController.UpdateAvatarPreview(model.ToAvatarModel(extendedWearableUrns));
}

private void OnColorPickerToggled() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,25 @@ public record BackpackEditorHUDModel
public Color eyesColor;
public HashSet<string> forceRender = new ();

public AvatarModel ToAvatarModel()
public AvatarModel ToAvatarModel(Dictionary<string, string> extendedWearableUrns = null)
{
List<string> wearables;

if (extendedWearableUrns != null)
{
wearables = new List<string>();

foreach (string w in this.wearables.Keys)
wearables.Add(extendedWearableUrns.TryGetValue(w, out string extendedUrn)
? extendedUrn : w);
}
else
wearables = this.wearables.Keys.ToList();

return new AvatarModel
{
bodyShape = bodyShape.id,
wearables = wearables.Keys.ToList(),
wearables = wearables,
hairColor = hairColor,
skinColor = skinColor,
eyeColor = eyesColor,
Expand Down

0 comments on commit 73c9e03

Please sign in to comment.