Skip to content

Commit ffd4bdb

Browse files
Add vehicle images to variants and paintjobs
1 parent 4b27d99 commit ffd4bdb

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

web/src/pages/reference/ID_Lists/Vehicle_Paintjobs.astro

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import SeeAlsoSection from '@src/components/SeeAlsoSection.astro';
66
77
import { Code } from '@astrojs/starlight/components';
88
9+
import { Image } from 'astro:assets';
10+
import { getAssetImagePath } from '@src/utils/general';
11+
912
const paintjobsById = {
1013
536: { vehicleName: "Blade", paintjobs: [0,1,2] },
1114
575: { vehicleName: "Broadway", paintjobs: [0,1] },
@@ -41,17 +44,23 @@ luaTable += `\n}\n`;
4144
<table>
4245
<thead>
4346
<tr>
44-
<th>Vehicle Name</th>
45-
<th>Vehicle ID</th>
47+
<th>Vehicle</th>
48+
<th>Name</th>
49+
<th>ID</th>
4650
<th>Paintjobs</th>
4751
</tr>
4852
</thead>
4953
<tbody>
5054
{Object.entries(paintjobsById).map(([id, { vehicleName, paintjobs }]) => (
5155
<tr>
56+
<td><a href={`/reference/ID_Lists/Vehicles#${vehicleName}`}><Image
57+
src={getAssetImagePath(`Vehicles/${id}.png`)}
58+
alt={vehicleName}
59+
class="vehicle-image"
60+
/></a></td>
5261
<td>{vehicleName}</td>
5362
<td>{id}</td>
54-
<td>{paintjobs.join(', ')}</td>
63+
<td><code>{paintjobs.join(', ')}</code></td>
5564
</tr>
5665
))}
5766
</tbody>
@@ -66,3 +75,10 @@ luaTable += `\n}\n`;
6675
'reference:ID_Lists',
6776
])} currentId='' />
6877
</StarlightPage>
78+
79+
<style>
80+
.vehicle-image {
81+
width: 80px;
82+
height: auto;
83+
}
84+
</style>

web/src/pages/reference/ID_Lists/Vehicle_Variants.astro

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import SeeAlsoSection from '@src/components/SeeAlsoSection.astro';
66
77
import { Code } from '@astrojs/starlight/components';
88
9+
import { Image } from 'astro:assets';
10+
import { getAssetImagePath } from '@src/utils/general';
11+
912
const variantsById = {
1013
416: { vehicleName: "Ambulance", variants: "Numbers: 0 = 37, 1 = 71" },
1114
424: { vehicleName: "BF Injection", variants: "Body: 0 = Side Panels" },
@@ -143,17 +146,23 @@ const luaTable = `local vehicleVariantsByModel = {
143146
<table>
144147
<thead>
145148
<tr>
146-
<th>Vehicle Name</th>
147-
<th>Vehicle ID</th>
149+
<th>Vehicle</th>
150+
<th>Name</th>
151+
<th>ID</th>
148152
<th>Variants</th>
149153
</tr>
150154
</thead>
151155
<tbody>
152156
{Object.entries(variantsById).map(([id, { vehicleName, variants }]) => (
153157
<tr>
158+
<td><a href={`/reference/ID_Lists/Vehicles#${vehicleName}`}><Image
159+
src={getAssetImagePath(`Vehicles/${id}.png`)}
160+
alt={vehicleName}
161+
class="vehicle-image"
162+
/></a></td>
154163
<td>{vehicleName}</td>
155164
<td>{id}</td>
156-
<td>{variants}</td>
165+
<td><code>{variants}</code></td>
157166
</tr>
158167
))}
159168
</tbody>

web/src/pages/reference/ID_Lists/Vehicles.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ const vehicles = {
324324
<h4 class="vehicle-subcategory-title">{subcategory === 'Uncategorized' ? '' : subcategory}</h4>
325325
<div class="vehicle-list">
326326
{vehiclesList.map(vehicle => (
327-
<div class="vehicle-item">
327+
<div class="vehicle-item" id={vehicle.name}>
328328
<div class="vehicle-title">{vehicle.name} <code>{vehicle.id}</code></div>
329329
<a target="_blank" href={`http://gta.rockstarvision.com/vehicleviewer/#sa/${vehicle.id}`}>
330330
<Image

0 commit comments

Comments
 (0)