@ianlucas/cs2-lib-inspect 2.0.0-rc.2 → 2.0.0-rc.4

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -63,7 +63,7 @@ function getEconomyItemPreviewData(item) {
63
63
  };
64
64
  }
65
65
  function getInventoryItemPreviewData(item) {
66
- const { nameTag, seed, statTrak, stickers } = item;
66
+ const { nameTag, seed, statTrak, stickers, patches } = item;
67
67
  const baseAttributes = getEconomyItemPreviewData(item);
68
68
  return {
69
69
  ...baseAttributes,
@@ -73,12 +73,19 @@ function getInventoryItemPreviewData(item) {
73
73
  paintseed: item.hasSeed() ? seed ?? CS2_MIN_SEED : undefined,
74
74
  paintwear: item.hasWear() ? floatToBytes(item.getWear()) : undefined,
75
75
  stickers: stickers !== undefined
76
- ? item.someStickers().map(([slot, { id, wear }]) => ({
76
+ ? item.someStickers().map(([slot, { id, wear, x, y }]) => ({
77
+ offsetX: x,
78
+ offsetY: y,
77
79
  slot,
78
80
  stickerId: item.economy.getById(id).index,
79
81
  wear: wear ?? CS2_MIN_STICKER_WEAR
80
82
  }))
81
- : baseAttributes.stickers
83
+ : patches !== undefined
84
+ ? item.somePatches().map(([slot, patchId]) => ({
85
+ slot,
86
+ stickerId: item.economy.getById(patchId).index
87
+ }))
88
+ : baseAttributes.stickers
82
89
  };
83
90
  }
84
91
  function generateHex(attributes) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ianlucas/cs2-lib-inspect",
3
- "version": "2.0.0-rc.2",
3
+ "version": "2.0.0-rc.4",
4
4
  "description": "A utility for creating inspect links for CS2 items",
5
5
  "license": "MIT",
6
6
  "repository": "ianlucas/cs2-lib-inspect",
@@ -18,7 +18,7 @@
18
18
  "crc-32": "^1.2.2"
19
19
  },
20
20
  "peerDependencies": {
21
- "@ianlucas/cs2-lib": "^5.0.0-rc.19"
21
+ "@ianlucas/cs2-lib": "^5.0.0-rc.24"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@protobuf-ts/plugin": "^2.9.3",