42 lines
2.1 KiB
JavaScript
42 lines
2.1 KiB
JavaScript
// ═══════════════════════════════════════════════════════════════
|
||
// MercyV Garage – Fahrzeugbilder Konfiguration
|
||
// Modellname → Bild-URL (lokal oder extern)
|
||
//
|
||
// Beispiele:
|
||
// 'police3': 'images/cars/police3.png' (lokale Datei)
|
||
// 'ambulance': 'https://example.com/amb.png' (externe URL)
|
||
// 'gbpolbisonhf': 'images/cars/gbpolbisonhf.png'
|
||
// ═══════════════════════════════════════════════════════════════
|
||
|
||
const VehicleImages = {
|
||
// ── Polizei ───────────────────────────────────────────────
|
||
'police': 'images/cars/police.png',
|
||
'police2': 'images/cars/police2.png',
|
||
'police3': 'images/cars/police3.png',
|
||
'police4': 'images/cars/police4.png',
|
||
'gbpolbisonhf': 'images/cars/gbpolbisonhf.png',
|
||
'gbpolbisonstx': 'images/cars/gbpolbisonstx.png',
|
||
|
||
// ── Ambulanz ──────────────────────────────────────────────
|
||
'ambulance': 'images/cars/ambulance.png',
|
||
'frogger': 'images/cars/frogger.png',
|
||
|
||
// ── Eigene Fahrzeuge (hier ergänzen) ──────────────────────
|
||
// 'meinauto': 'images/cars/meinauto.png',
|
||
};
|
||
|
||
// Standardbild wenn kein Eintrag gefunden
|
||
const DefaultVehicleImage = 'images/defaultimage.png';
|
||
|
||
/**
|
||
* Gibt die Bild-URL für ein Fahrzeugmodell zurück.
|
||
* Sucht zuerst nach dem Modellnamen, dann nach dem Anzeigenamen (displayName).
|
||
*/
|
||
function getVehicleImage(modelname, displayName) {
|
||
const model = (modelname || '').toLowerCase().trim();
|
||
const display = (displayName || '').toLowerCase().trim();
|
||
return VehicleImages[model]
|
||
|| VehicleImages[display]
|
||
|| DefaultVehicleImage;
|
||
}
|