@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/EMBED.md +105 -8
- package/dist/SkinViewer.d.ts.map +1 -1
- package/dist/SkinViewer.js +2 -1
- package/dist/SkinViewer.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/item.d.ts +2 -1
- package/dist/item.d.ts.map +1 -1
- package/dist/item.js +45 -5
- package/dist/item.js.map +1 -1
- package/dist/protocol.d.ts +29 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/state.d.ts +6 -2
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +88 -7
- package/dist/state.js.map +1 -1
- package/dist/types.d.ts +105 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +12 -2
- package/dist/types.js.map +1 -1
- package/dist/weapons.d.ts +7 -4
- package/dist/weapons.d.ts.map +1 -1
- package/dist/weapons.js +17 -2
- package/dist/weapons.js.map +1 -1
- package/package.json +2 -2
- package/src/SkinViewer.tsx +2 -1
- package/src/index.ts +10 -3
- package/src/item.ts +48 -5
- package/src/protocol.ts +28 -2
- package/src/state.ts +97 -6
- package/src/types.ts +139 -7
- package/src/weapons.ts +18 -3
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
|
|
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
|
|
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',
|