Skip to content

Car Component UI Sprites (Weapons, Car Health, etc.) #20

@JJJohan

Description

@JJJohan

The point of this issue isn't to get completely functional components, but to at least draw their UI elements on screen.

I've managed to decipher the ETBL blocks in the vehicles. These serve two purposes based on their flag. They are either reference images with one or more coordinates on the image to indicate where things go, or alternatively they are spritesheet images which are cut up into multiple sub-sections.

An example of a reference image - ZSY_.MAP (the lines and text were added for illustration purposes)
reference

An example of a spritesheet - ZDUE.MAP:
spritesheet

The ETBL structure

ETBL Offset Name Example Value Description
0 Map filename zrad.map The texture that holds all the goods
13 ETBL Type 0 0 = spritesheet, 1 = reference image
17 ETBL Length 2 Amount of sprites/positions in map

The ETBL item structure

Offset Name Example Value Description
0 Item Name range_pos Name of sprite / reference position
16 X Offset 139 X pixel offset in map texture
20 Y Offset 4 Y pixel offset in map texture
24 Width 0 Sprite width (always 0 for reference pos)
28 Height 0 Sprite height (always 0 for reference pos)

What I'd like to get working for this issue:

  • [help wanted] Figure out how sprites are linked to items. For example, the '30cal MG' GDF weapon should be pointing at the 30cal_mg_on and 30cal_mg_off sprites, but I cannot find a reference to them anywhere, either by sprite index or by file name. In the Interstate 76 Gold Edition they ARE linked in the GDF by name (GDF is revision 8 instead of 7), unfortunately in the original game they are not - and I can't find them anywhere else!
  • Draw the weapon brackets and ammo digit sprites.
  • Draw the vehicle health sprites.
  • Draw selected gear arrow (just always assume car is in 'D' for now).

firstperson-reference

Stretch goal:

  • Draw compass
  • Draw UI when car itself is hidden (i.e. hitting F1 key twice in original game toggles car interior on/off but always shows weapons, radar, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions