improvements Cyst_Kid
This commit is contained in:
@@ -276,10 +276,12 @@
|
||||
<div class="tool-grid">
|
||||
<button class="tool-btn" onclick="setSpecial('player')">🧑 Spieler-Start</button>
|
||||
<button class="tool-btn" onclick="setSpecial('ghost')">👻 Geist-Haus</button>
|
||||
<button class="tool-btn full" onclick="setSpecial('medSpawn')">💊 Med-Spawn</button>
|
||||
</div>
|
||||
<div class="legend" style="margin-top:8px">
|
||||
<span>Cyan ●</span> = Spielerstart<br>
|
||||
<span>Gold ●</span> = Geist-Startpos
|
||||
<span>Gold ●</span> = Geist-Startpos<br>
|
||||
<span>Pink ●</span> = Med-Spawnpunkt
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -349,6 +351,7 @@ let redoStack = [];
|
||||
// Player start and ghost house positions (mirroring constants)
|
||||
let playerStart = { c: PL0.c, r: PL0.r };
|
||||
let ghostHomes = PH.map(p => ({ c: p.c, r: p.r }));
|
||||
let medSpawns = (typeof MED_SPAWNS !== 'undefined') ? MED_SPAWNS.map(p => ({ c: p.c, r: p.r })) : [];
|
||||
|
||||
let selectedTile = 1; // currently selected tile id
|
||||
let currentTool = 'paint';
|
||||
@@ -477,6 +480,7 @@ function drawGrid() {
|
||||
// Special markers
|
||||
drawMarker(ctxG, playerStart.r, playerStart.c, '#00DDFF', '★');
|
||||
ghostHomes.forEach((gh, i) => drawMarker(ctxG, gh.r, gh.c, '#FFD700', (i + 1).toString()));
|
||||
medSpawns.forEach(sp => drawMarker(ctxG, sp.r, sp.c, '#EC4899', 'M'));
|
||||
updateDotCount();
|
||||
}
|
||||
|
||||
@@ -627,9 +631,9 @@ function setSpecial(mode) {
|
||||
specialMode = mode;
|
||||
ghostSetIndex = 0;
|
||||
document.getElementById('info-bar').textContent =
|
||||
mode === 'player'
|
||||
? 'Klick: Spieler-Startposition setzen'
|
||||
: 'Klick: Geist-Position 1 von 4 setzen';
|
||||
mode === 'player' ? 'Klick: Spieler-Startposition setzen' :
|
||||
mode === 'medSpawn' ? 'Klick: Med-Spawnpunkt hinzufügen / entfernen' :
|
||||
'Klick: Geist-Position 1 von 4 setzen';
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
@@ -691,6 +695,15 @@ cvOver.addEventListener('mousedown', e => {
|
||||
document.getElementById('info-bar').textContent =
|
||||
`Geist-Position ${ghostSetIndex + 1} von 4 setzen`;
|
||||
}
|
||||
} else if (specialMode === 'medSpawn') {
|
||||
const idx = medSpawns.findIndex(sp => sp.r === r && sp.c === c);
|
||||
if (idx >= 0) {
|
||||
medSpawns.splice(idx, 1);
|
||||
document.getElementById('info-bar').textContent = `Med-Spawn entfernt bei [${r}, ${c}] | Gesamt: ${medSpawns.length}`;
|
||||
} else {
|
||||
medSpawns.push({ r, c });
|
||||
document.getElementById('info-bar').textContent = `Med-Spawn gesetzt bei [${r}, ${c}] | Gesamt: ${medSpawns.length}`;
|
||||
}
|
||||
}
|
||||
drawGrid();
|
||||
return;
|
||||
@@ -832,6 +845,8 @@ function buildExportCode() {
|
||||
lines.push(`const PL0 = {c:${playerStart.c},r:${playerStart.r}};`);
|
||||
const ph = ghostHomes.map(g => `{c:${g.c},r:${g.r}}`).join(',');
|
||||
lines.push(`const PH = [${ph}];`);
|
||||
const ms = medSpawns.map(s => `{r:${s.r},c:${s.c}}`).join(',');
|
||||
lines.push(`const MED_SPAWNS = [${ms}];`);
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user