2026-04-15 22:05:01 +02:00

42 lines
2.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ═══════════════════════════════════════════════════════════════
// 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;
}