Compare commits
10 Commits
d6e7b75354
...
6535839402
| Author | SHA1 | Date | |
|---|---|---|---|
| 6535839402 | |||
| af68b6e7c8 | |||
| 0c60b0ca5b | |||
| 41964636f9 | |||
| 46b2b23373 | |||
| 55c7ded0f0 | |||
| c7b33907a3 | |||
| b22b717ab4 | |||
| 3018e3a05a | |||
| 81659adcf1 |
@ -28,6 +28,7 @@ files {
|
||||
'nui/script.js',
|
||||
'nui/vue.js',
|
||||
'nui/fonts/*.*',
|
||||
'nui/vehicle_images.js',
|
||||
'nui/images/*.*',
|
||||
'nui/images/logo/*.*',
|
||||
'nui/images/cars/*.*',
|
||||
|
||||
BIN
[core]/mercyv-garage/nui/images/cars/scorcher.png
Normal file
BIN
[core]/mercyv-garage/nui/images/cars/scorcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@ -314,7 +314,50 @@
|
||||
|
||||
</div><!-- /#app -->
|
||||
|
||||
<script src="vehicle_images.js"></script>
|
||||
<script>
|
||||
// ═══════════════════════════════════════════════════════════════
|
||||
// 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;
|
||||
}
|
||||
|
||||
</script>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -67,6 +67,15 @@ const app = new Vue({
|
||||
this.close();
|
||||
},
|
||||
|
||||
getVehicleImage(modelname, carimage) {
|
||||
if (typeof VehicleImages !== 'undefined') {
|
||||
return getVehicleImage(modelname, carimage);
|
||||
}
|
||||
var model = (modelname || '').toLowerCase().trim();
|
||||
var display = (carimage || '').toLowerCase().trim();
|
||||
return 'images/cars/' + (model || display || 'default') + '.png';
|
||||
},
|
||||
|
||||
parkFromPanel() {
|
||||
if (!this.selectedVehicle || !this.selectedVehicle.nearby) return;
|
||||
$.post(`https://${GetParentResourceName()}/parkFromPanel`, JSON.stringify({ plate: this.selectedVehicle.plate }));
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
[mercyv]
2
[mercyv]
@ -1 +1 @@
|
||||
Subproject commit fb58059168cf0013f488088909c6c805af3ddbfa
|
||||
Subproject commit 8ab63766763c990d41a5b38d4b21638ca45aff80
|
||||
Loading…
x
Reference in New Issue
Block a user