This commit is contained in:
cay 2026-04-07 06:47:18 +01:00
parent b8ce014f6b
commit 5b5af5a286
2 changed files with 11 additions and 19 deletions

View File

@ -113,18 +113,19 @@ document.querySelectorAll(".qm-popup-close").forEach((btn) => {
overlay.addEventListener("click", closeAllPopups);
function closeAllPopups() {
// Booster läuft noch → Schließen komplett sperren
// Nur sperren wenn Slot gerade dreht
if (window.__boosterLocked) return;
document.querySelectorAll(".qm-popup").forEach((p) => {
p.classList.remove("active");
});
overlay.classList.remove("active");
window.__boosterLocked = false; // Sicherheits-Reset
}
document.addEventListener("keydown", (e) => {
if (e.key === "Escape") {
// Booster läuft noch → ESC blockieren
// Nur sperren wenn Slot gerade dreht
if (window.__boosterLocked) {
e.stopPropagation();
e.preventDefault();

View File

@ -176,29 +176,20 @@ export async function loadEvents() {
overlay.addEventListener("click", e => { if (e.target === overlay) overlay.classList.remove("active"); });
body.querySelector("#booster-back-btn").addEventListener("click", () => {
if (isSpinning || !allRevealed) return; // ← gesperrt bis alle Karten enthüllt
// Gesperrt nur wenn Slot gerade läuft
if (isSpinning) return;
// Erlaubt wenn: Booster-Daily bereits erledigt ODER alle Karten enthüllt
const boosterCard = body.querySelector('.event-card[data-type="booster"]');
const boosterDone = boosterCard?.dataset.done === "true";
if (!allRevealed && !boosterDone) return;
eventsGrid.style.display = "";
boosterUi.style.display = "none";
clearAllIntervals();
isSpinning = false;
});
document.addEventListener("keydown", e => {
if (e.key === "Escape") {
// Booster aktiv & noch nicht fertig → ESC komplett blockieren
if (boosterUi.style.display !== "none" && (!allRevealed || isSpinning)) {
e.stopPropagation();
e.preventDefault();
return;
}
overlay.classList.remove("active");
if (!isSpinning && allRevealed) {
eventsGrid.style.display = "";
boosterUi.style.display = "none";
clearAllIntervals();
}
}
});
// KEIN document.addEventListener("keydown") hier
// ESC wird zentral in quickmenu.js behandelt (verhindert Listener-Stapelung)
/* ── Booster Zustand ── */
let allCards = [];