Skip to content

Conversation

@jtoelli
Copy link
Contributor

@jtoelli jtoelli commented Jan 5, 2026

## Summary
Adds glove_skin as a new custom property to parse_ticks(), enabling extraction of glove skin names directly from demo files.

## Motivation
Currently, glove data fields (glove_paint_id, glove_paint_seed, glove_paint_float) are available, but there's no way to get the actual glove skin name (e.g., "Imperial Plaid", "Polygon"). This PR adds glove_skin to match the existing weapon_skin functionality.

## Changes

  • prop_controller.rs: Added GLOVE_SKIN constant (ID: 20000003)
  • maps.rs: Registered glove_skin in:
    • CUSTOM_PLAYER_PROP_IDS map
    • FRIENDLY_NAMES_MAPPING map
    • PropType enum mapping
  • collect_data.rs: Added find_glove_skin() function that performs PAINTKITS lookup
  • collect_data.rs: Added error variants for glove skin operations

## Usage Example

from demoparser2 import DemoParser

parser = DemoParser("demo.dem")
df = parser.parse_ticks(['glove_skin', 'glove_paint_id', 'glove_paint_seed'])

# Returns DataFrame with glove_skin column containing names like:
# "Imperial Plaid", "Polygon", "Amphibious", "Racing Green", etc.

## Testing
Tested on a cs2 replay and it worked for me :)

## Implementation Note
The glove_skin field performs a PAINTKITS lookup based on glove_paint_id. Users should check glove_item_idx > 0 in their code to distinguish between players actively wearing custom gloves versus those with default gloves (as players may have a paint_id in inventory without wearing custom gloves).

  - Add find_glove_skin() function to extract glove skin names from PAINTKITS
  - Add GLOVE_SKIN constant (ID: 20000003) to prop_controller
  - Register glove_skin in PropType map, FRIENDLY_NAMES_MAPPING, and CUSTOM_PLAYER_PROP_IDS
  - Add error variants: GloveSkinFloatConvertionError, GloveSkinIdxIncorrectVariant, GloveSkinNoSkinMapping

  This allows parse_ticks(['glove_skin']) to return actual glove skin names
  like 'Imperial Plaid', 'Polygon', 'Amphibious' etc., matching the existing
  weapon_skin functionality.
@LaihoE LaihoE merged commit 9d1ef2f into LaihoE:main Jan 6, 2026
8 checks passed
@LaihoE
Copy link
Owner

LaihoE commented Jan 6, 2026

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants