Änderung: Hinzufügung der Haus-Logik zur Taxi-Map

Änderungen:
- Integration des neuen Modells TaxiMapTileHouse zur Verwaltung von Häusern auf der Karte.
- Anpassung der TaxiMap- und TaxiMapService-Logik zur Unterstützung der Hausplatzierung und -verwaltung.
- Erweiterung der Benutzeroberfläche in TaxiToolsView.vue zur Erfassung und Anzeige von Hausinformationen.
- Implementierung von Methoden zur Speicherung und Aktualisierung von Hausdaten in der Datenbank.

Diese Anpassungen verbessern die Funktionalität und Benutzererfahrung im Taxi-Minispiel, indem sie eine detaillierte Verwaltung von Häusern auf der Karte ermöglichen.
This commit is contained in:
Torsten Schulz (local)
2025-09-18 14:27:14 +02:00
parent ab8e12cbcd
commit 7207274ab5
8 changed files with 290 additions and 13 deletions

View File

@@ -151,8 +151,18 @@
<h4>{{ $t('admin.taxiTools.mapEditor.extraElements') }}</h4>
<div class="panel-body">
<div v-if="allowedHouseCorners.length" class="corner-chooser">
<button v-for="pos in allowedHouseCorners" :key="pos" class="corner-btn" @click="confirmHouseCorner(pos)">
{{ pos.toUpperCase() }}
<button
v-for="pos in allowedHouseCorners"
:key="pos"
class="corner-btn"
:title="pos.toUpperCase()"
@click="confirmHouseCorner(pos)">
<div class="corner-preview">
<span class="q" :class="{ active: pos === 'lo' }"></span>
<span class="q" :class="{ active: pos === 'ro' }"></span>
<span class="q" :class="{ active: pos === 'lu' }"></span>
<span class="q" :class="{ active: pos === 'ru' }"></span>
</div>
</button>
</div>
<h5 v-if="pendingCorner" class="extra-subtitle">Haus</h5>
@@ -375,7 +385,9 @@ const HOUSE_TYPE_MATRIX = {
fuelvertical: { lo: ['right'], ro: [], lu: ['right'], ru: [] }
};
const DIRECTION_TO_ROTATION = { bottom: 0, right: 90, top: 180, left: 270 };
// Canvas-Rotation ist im Browser positiv im Uhrzeigersinn (y-Achse nach unten).
// Bild zeigt Tür unten (0°). Für "rechts" benötigen wir -90° (= 270°), für "links" +90°.
const DIRECTION_TO_ROTATION = { bottom: 0, right: 270, top: 180, left: 90 };
export default {
name: 'AdminTaxiToolsView',
@@ -1033,9 +1045,9 @@ export default {
doorClass(deg) {
switch (deg) {
case 0: return 'door-bottom';
case 90: return 'door-right';
case 90: return 'door-left';
case 180: return 'door-top';
case 270: return 'door-left';
case 270: return 'door-right';
default: return 'door-bottom';
}
},
@@ -1146,6 +1158,7 @@ export default {
meta: c.extraHouses ? { houses: { ...c.extraHouses } } : null
}));
const tileStreetNames = this.collectTileStreetNames();
const tileHouses = this.collectTileHouses();
const mapData = {
...this.mapForm,
width: this.boardWidth,
@@ -1153,7 +1166,8 @@ export default {
tileSize: 50,
mapTypeId: 1,
tiles,
tileStreetNames
tileStreetNames,
tileHouses
};
let savedMap;
@@ -1196,6 +1210,17 @@ export default {
return result;
},
collectTileHouses() {
const result = {};
for (const [key, cell] of Object.entries(this.boardCells)) {
if (!cell.tileType) continue;
if (cell.extraHouses && Object.keys(cell.extraHouses).length > 0) {
result[key] = { ...cell.extraHouses };
}
}
return result;
},
async deleteMap(mapId) {
if (confirm('Möchtest du diese Map wirklich löschen?')) {
try {