adventskalender/shared/js/lock.js aktualisiert

This commit is contained in:
2025-11-05 21:35:13 +00:00
parent 55584d092f
commit 95bf370c5c

View File

@@ -165,7 +165,7 @@ function createDevConsole() {
// GLOBALER Export für door-open.js // GLOBALER Export für door-open.js
// =============================== // ===============================
window.isDoorUnlocked = function (day) { window.isDoorUnlocked = function (day) {
// wenn wir im dev sind UND es einen simulierten Tag gibt → den nehmen const unlocked = (() => {
if (DEV_MODE) { if (DEV_MODE) {
const sim = getSimulatedDay(); const sim = getSimulatedDay();
if (sim !== null) { if (sim !== null) {
@@ -174,9 +174,15 @@ window.isDoorUnlocked = function (day) {
// Wenn kein Sim-Tag gesetzt → normale Tageslogik verwenden // Wenn kein Sim-Tag gesetzt → normale Tageslogik verwenden
return _checkDoorUnlocked(day); return _checkDoorUnlocked(day);
} }
// sonst normale Prüfung
return _checkDoorUnlocked(day); return _checkDoorUnlocked(day);
})();
// Wenn gesperrt, Popup anzeigen (falls vorhanden)
if (!unlocked && typeof window.showLockedPopup === "function") {
window.showLockedPopup(day);
}
return unlocked;
}; };
// Dev-Konsole nur anzeigen, wenn ?dev // Dev-Konsole nur anzeigen, wenn ?dev