@skinhub/viewer 0.3.2 → 0.4.2

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/src/weapons.ts CHANGED
@@ -16,7 +16,10 @@
16
16
  * it is derived from the export itself (`data/skins.json`, `weapon.weapon_id` → `weapon.id`,
17
17
  * generated 2026-08-15, verified: 63 distinct defindexes, no defindex mapping to two DIFFERENT
18
18
  * weapons — the 20 knives each carry a second `sfui_wpnhud_*` alias for their vanilla row, which
19
- * `getWeaponModelPath` already resolves to the same model).
19
+ * `getWeaponModelPath` already resolves to the same model). Plus one hand-added row, the C4
20
+ * (49 -> `weapon_c4`, since CS2 1.41.8.2 put stickers on it): the 2026-08-15 `skins.json` the other
21
+ * 63 came from predates the 1.41.8.2 export and has no C4. From that export on it carries a vanilla
22
+ * `weapon_c4` row with `weapon_id: 49`, so the row is derivable like the rest - 64 rows in all.
20
23
  *
21
24
  * The alternative is fetching a 4.4 MB `skins.json` to answer "what is 7", which would make the
22
25
  * inspect-link path — the one the product exists for — cost four megabytes before the first frame.
@@ -33,7 +36,7 @@
33
36
  *
34
37
  * This is `skin.weapon.id` in `@skinhub/cdn`'s `skins.json` rows, verbatim — so
35
38
  * `<SkinViewer weapon={row.weapon.id} paintIndex={…} />` typechecks against a catalogue row with no
36
- * conversion. Type it into an editor and autocomplete lists all 71.
39
+ * conversion. Type it into an editor and autocomplete lists all 72.
37
40
  */
38
41
  export const WEAPON_IDS = [
39
42
  // Pistols
@@ -77,6 +80,8 @@ export const WEAPON_IDS = [
77
80
  'weapon_xm1014',
78
81
  // Other
79
82
  'weapon_taser',
83
+ // The C4 - no finish, but stickers, a charm and a name tag since CS2 1.41.8.2. See the defindex table.
84
+ 'weapon_c4',
80
85
  // Knives
81
86
  'weapon_bayonet',
82
87
  'weapon_knife_butterfly',
@@ -117,7 +122,7 @@ export type KnownWeaponId = (typeof WEAPON_IDS)[number]
117
122
  * `'weapon_ak47'`.
118
123
  *
119
124
  * The `(string & {})` arm is deliberate and is not a widening mistake: it keeps autocomplete listing
120
- * the 71 known ids while still ACCEPTING an id this build has never heard of, so a new weapon in a
125
+ * the 72 known ids while still ACCEPTING an id this build has never heard of, so a new weapon in a
121
126
  * fresh export renders the day it ships rather than the day the package is upgraded. An unknown id
122
127
  * that the asset export also does not know resolves to no model, which surfaces as `unknown-weapon`.
123
128
  */
@@ -161,6 +166,16 @@ export const WEAPON_ID_BY_DEFINDEX: Readonly<Record<number, KnownWeaponId>> = {
161
166
  38: 'weapon_scar20',
162
167
  39: 'weapon_sg556',
163
168
  40: 'weapon_ssg08',
169
+ /**
170
+ * THE ONE ROW ADDED BY HAND, because the `skins.json` this table was derived from predates the
171
+ * 1.41.8.2 export. From that export on, `skins.json` carries a vanilla C4 row (`weapon_id: 49`) and
172
+ * this row is derivable like the other 63. CS2 1.41.8.2 (2026-09-22) gave the `c4` prefab
173
+ * `weapon_supports_stickers`, so a stickered C4 is now a real item with an inspect link that says
174
+ * `defindex: 49` - and without this row it resolved to `unknown-weapon`. `weapon_c4` is the item
175
+ * definition's own `name` in `items_game.txt`, and the renderer's model table has carried it since
176
+ * the same update.
177
+ */
178
+ 49: 'weapon_c4',
164
179
  60: 'weapon_m4a1_silencer',
165
180
  61: 'weapon_usp_silencer',
166
181
  63: 'weapon_cz75a',