guögu
This commit is contained in:
parent
b8ce014f6b
commit
5b5af5a286
@ -113,18 +113,19 @@ document.querySelectorAll(".qm-popup-close").forEach((btn) => {
|
|||||||
overlay.addEventListener("click", closeAllPopups);
|
overlay.addEventListener("click", closeAllPopups);
|
||||||
|
|
||||||
function closeAllPopups() {
|
function closeAllPopups() {
|
||||||
// Booster läuft noch → Schließen komplett sperren
|
// Nur sperren wenn Slot gerade dreht
|
||||||
if (window.__boosterLocked) return;
|
if (window.__boosterLocked) return;
|
||||||
|
|
||||||
document.querySelectorAll(".qm-popup").forEach((p) => {
|
document.querySelectorAll(".qm-popup").forEach((p) => {
|
||||||
p.classList.remove("active");
|
p.classList.remove("active");
|
||||||
});
|
});
|
||||||
overlay.classList.remove("active");
|
overlay.classList.remove("active");
|
||||||
|
window.__boosterLocked = false; // Sicherheits-Reset
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener("keydown", (e) => {
|
document.addEventListener("keydown", (e) => {
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
// Booster läuft noch → ESC blockieren
|
// Nur sperren wenn Slot gerade dreht
|
||||||
if (window.__boosterLocked) {
|
if (window.__boosterLocked) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@ -176,29 +176,20 @@ export async function loadEvents() {
|
|||||||
overlay.addEventListener("click", e => { if (e.target === overlay) overlay.classList.remove("active"); });
|
overlay.addEventListener("click", e => { if (e.target === overlay) overlay.classList.remove("active"); });
|
||||||
|
|
||||||
body.querySelector("#booster-back-btn").addEventListener("click", () => {
|
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 = "";
|
eventsGrid.style.display = "";
|
||||||
boosterUi.style.display = "none";
|
boosterUi.style.display = "none";
|
||||||
clearAllIntervals();
|
clearAllIntervals();
|
||||||
isSpinning = false;
|
isSpinning = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener("keydown", e => {
|
// KEIN document.addEventListener("keydown") hier –
|
||||||
if (e.key === "Escape") {
|
// ESC wird zentral in quickmenu.js behandelt (verhindert Listener-Stapelung)
|
||||||
// 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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/* ── Booster Zustand ── */
|
/* ── Booster Zustand ── */
|
||||||
let allCards = [];
|
let allCards = [];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user