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
// ===============================
window.isDoorUnlocked = function (day) {
// wenn wir im dev sind UND es einen simulierten Tag gibt → den nehmen
const unlocked = (() => {
if (DEV_MODE) {
const sim = getSimulatedDay();
if (sim !== null) {
@@ -173,10 +173,16 @@ window.isDoorUnlocked = function (day) {
}
// Wenn kein Sim-Tag gesetzt → normale Tageslogik verwenden
return _checkDoorUnlocked(day);
}
// sonst normale Prüfung
}
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