adventskalender/shared/js/lock.js aktualisiert
This commit is contained in:
@@ -165,18 +165,24 @@ 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
|
||||
if (DEV_MODE) {
|
||||
const sim = getSimulatedDay();
|
||||
if (sim !== null) {
|
||||
return parseInt(day, 10) <= sim;
|
||||
}
|
||||
// Wenn kein Sim-Tag gesetzt → normale Tageslogik verwenden
|
||||
return _checkDoorUnlocked(day);
|
||||
}
|
||||
const unlocked = (() => {
|
||||
if (DEV_MODE) {
|
||||
const sim = getSimulatedDay();
|
||||
if (sim !== null) {
|
||||
return parseInt(day, 10) <= sim;
|
||||
}
|
||||
// Wenn kein Sim-Tag gesetzt → normale Tageslogik verwenden
|
||||
return _checkDoorUnlocked(day);
|
||||
}
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user