roavatar-renderer 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -415,6 +415,7 @@ export declare interface AvatarInventory_Result {
415
415
  };
416
416
  availabilityStatus: string;
417
417
  acquisitionTime: string;
418
+ headShape?: string;
418
419
  outfitDetail?: {
419
420
  assets: {
420
421
  id: number;
@@ -1408,6 +1409,7 @@ export declare interface Look_Result {
1408
1409
  id: number;
1409
1410
  isIncluded: boolean;
1410
1411
  supportsHeadshapes?: boolean;
1412
+ meta?: AssetMetaJson;
1411
1413
  }[];
1412
1414
  bundleType: number | null;
1413
1415
  collectibleItemId: string;
@@ -1764,6 +1766,7 @@ export declare class Outfit {
1764
1766
  isOrderUsed(order: number, self?: Asset): boolean;
1765
1767
  getNextOrder(order: number): number;
1766
1768
  addAssetId(assetId: number, auth: Authentication): Promise<boolean>;
1769
+ addAssetIdEconomy(assetId: number): Promise<boolean>;
1767
1770
  addBundleId(bundleId: number): Promise<boolean>;
1768
1771
  getAssetId(assetId: number): Asset | undefined;
1769
1772
  fromLook(look: Look_Result["look"], auth: Authentication): Promise<boolean>;
package/dist/index.js CHANGED
@@ -27346,6 +27346,9 @@ const animNamesR15 = {
27346
27346
  ],
27347
27347
  toollunge: [
27348
27348
  { id: "http://www.roblox.com/asset/?id=522638767", weight: 10 }
27349
+ ],
27350
+ mood: [
27351
+ { id: "http://www.roblox.com/asset/?id=14366558676", weight: 10 }
27349
27352
  ]
27350
27353
  /*wave: [
27351
27354
  { id: "http://www.roblox.com/asset/?id=507770239", weight: 10 }
@@ -31617,7 +31620,23 @@ class Outfit {
31617
31620
  return false;
31618
31621
  }
31619
31622
  const assetDetails = assetDetailsResponse;
31620
- this.addAsset(assetId, assetDetails.data[0].assetType, assetDetails.data[0].name, assetDetails.data[0].supportsHeadShapes);
31623
+ if (assetDetails.data.length > 0) {
31624
+ this.addAsset(assetId, assetDetails.data[0].assetType, assetDetails.data[0].name, assetDetails.data[0].supportsHeadShapes);
31625
+ } else {
31626
+ return this.addAssetIdEconomy(assetId);
31627
+ }
31628
+ return true;
31629
+ }
31630
+ async addAssetIdEconomy(assetId) {
31631
+ const assetDetailsResponse = await API.Economy.GetAssetDetails(assetId);
31632
+ if (assetDetailsResponse.status !== 200) {
31633
+ return false;
31634
+ }
31635
+ const assetDetails = await assetDetailsResponse.json();
31636
+ if (assetDetails.errors) {
31637
+ return false;
31638
+ }
31639
+ this.addAsset(assetId, assetDetails.AssetTypeId, assetDetails.Name);
31621
31640
  return true;
31622
31641
  }
31623
31642
  async addBundleId(bundleId) {
@@ -31665,8 +31684,18 @@ class Outfit {
31665
31684
  this.addAsset(item.id, item.assetType, item.name);
31666
31685
  } else if (item.itemType === "Bundle") {
31667
31686
  const assetsList = [];
31687
+ const assetMetaList = [];
31688
+ const assetIdList = [];
31668
31689
  for (const asset of item.assetsInBundle) {
31669
- assetsList.push({ itemType: "Asset", id: asset.id });
31690
+ if (asset.isIncluded) {
31691
+ assetsList.push({ itemType: "Asset", id: asset.id });
31692
+ if (asset.meta) {
31693
+ assetMetaList.push(asset.meta);
31694
+ } else {
31695
+ assetMetaList.push(void 0);
31696
+ }
31697
+ assetIdList.push(asset.id);
31698
+ }
31670
31699
  }
31671
31700
  const assetDetails = await API.Catalog.GetItemDetails(auth, assetsList);
31672
31701
  if (assetDetails instanceof Response) {
@@ -31674,6 +31703,15 @@ class Outfit {
31674
31703
  } else {
31675
31704
  for (const assetDetail of assetDetails.data) {
31676
31705
  this.addAsset(assetDetail.id, assetDetail.assetType, assetDetail.name, assetDetail.supportsHeadShapes);
31706
+ const index = assetIdList.indexOf(assetDetail.id);
31707
+ const meta = assetMetaList[index];
31708
+ if (meta) {
31709
+ const addedAsset = this.getAssetId(assetDetail.id);
31710
+ if (addedAsset) {
31711
+ addedAsset.meta = new AssetMeta();
31712
+ addedAsset.meta.fromJson(meta);
31713
+ }
31714
+ }
31677
31715
  }
31678
31716
  }
31679
31717
  }
@@ -31799,6 +31837,17 @@ class Outfit {
31799
31837
  for (const assetDetail of assetDetails.data) {
31800
31838
  this.addAsset(assetDetail.id, assetDetail.assetType, assetDetail.name, assetDetail.supportsHeadShapes);
31801
31839
  }
31840
+ for (const asset of assetsToAdd) {
31841
+ const assetId = asset.id;
31842
+ if (assetId && !this.getAssetId(assetId)) {
31843
+ assetPromises.push(new Promise((resolve) => {
31844
+ this.addAssetIdEconomy(assetId).then(() => {
31845
+ resolve(void 0);
31846
+ });
31847
+ }));
31848
+ }
31849
+ }
31850
+ await Promise.all(assetPromises);
31802
31851
  for (const assetToAdd of assetsToAdd) {
31803
31852
  let asset = void 0;
31804
31853
  for (const assetIn of this.assets) {
@@ -31810,7 +31859,6 @@ class Outfit {
31810
31859
  asset.meta = assetToAdd.meta;
31811
31860
  }
31812
31861
  }
31813
- await Promise.all(assetPromises);
31814
31862
  this.fixOrders();
31815
31863
  return this;
31816
31864
  }
@@ -32106,6 +32154,7 @@ const CategoryDictionary = {
32106
32154
  },
32107
32155
  "Head": {
32108
32156
  "Dynamic Heads": new SortInfo([new ItemSort(2, "Outfit")]),
32157
+ "Adjustment": new SpecialInfo("HeadAdjustment"),
32109
32158
  "Heads": new SortInfo([new ItemSort(17)], "inventory"),
32110
32159
  "Faces": new SortInfo([new ItemSort(18)], "inventory")
32111
32160
  },
@@ -35367,7 +35416,7 @@ const API = {
35367
35416
  });
35368
35417
  }
35369
35418
  for (const thumbnailInfo of ThumbnailsToBatch) {
35370
- if (thumbnailInfo.id === id && thumbnailInfo.type === type && thumbnailInfo.size === size2) {
35419
+ if (requestIdFromThumbnailInfo(thumbnailInfo) === requestIdFromThumbnailInfo(thisThumbnailInfo)) {
35371
35420
  return new Promise((resolve) => {
35372
35421
  thumbnailInfo.resolves.push(resolve);
35373
35422
  });
@@ -59584,22 +59633,17 @@ class AnimatorWrapper extends InstanceWrapper {
59584
59633
  for (const track of this.data.animationTracks.values()) {
59585
59634
  if (!this.data.moodTracks.includes(track)) continue;
59586
59635
  const looped = track.tick(addTime);
59587
- if (this.data.currentAnimationTrack === track && looped && this.data.currentAnimation) {
59588
- this._switchAnimation(this.data.currentAnimation);
59636
+ if (this.data.currentMoodAnimationTrack === track && looped && this.data.currentMoodAnimation) {
59637
+ this._switchMoodAnimation(this.data.currentMoodAnimation);
59589
59638
  }
59590
59639
  }
59591
59640
  for (const track of this.data.animationTracks.values()) {
59592
59641
  if (!this.data.toolTracks.includes(track)) continue;
59593
59642
  const looped = track.tick(addTime);
59594
- if (this.data.currentAnimationTrack === track && looped && this.data.currentAnimation) {
59595
- this._switchAnimation(this.data.currentAnimation);
59643
+ if (this.data.currentToolAnimationTrack === track && looped && this.data.currentToolAnimation) {
59644
+ this._switchToolAnimation(this.data.currentToolAnimation);
59596
59645
  }
59597
59646
  }
59598
- const hasMood = this.data.currentMoodAnimation && this.data.currentMoodAnimation.length > 0;
59599
- const isEmote = this.data.currentAnimation?.startsWith("emote.");
59600
- if (!hasMood && !isEmote) {
59601
- this.restPose(false, true);
59602
- }
59603
59647
  const rig = this.instance.parent?.parent;
59604
59648
  if (rig) {
59605
59649
  const descedants = rig.GetDescendants();
@@ -62395,11 +62439,6 @@ class OutfitRenderer {
62395
62439
  animatorW.playAnimation(name2);
62396
62440
  });
62397
62441
  }
62398
- if (this.outfit.containsAssetType("MoodAnimation") && !name2.startsWith("emote.")) {
62399
- animatorW.playAnimation("mood", "mood");
62400
- } else {
62401
- animatorW.stopMoodAnimation();
62402
- }
62403
62442
  }
62404
62443
  }
62405
62444
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roavatar-renderer",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "A renderer for Roblox avatars, used by the RoAvatar extension.",
5
5
  "author": "steinan",
6
6
  "type": "module",