stop error
var currentPassageId = 'EA3'
//STOP AT BUTTON
function showNextMessage() {
const currentMessageElem = document.getElementById(`message${window.currentMessage}`);
/*if (currentMessageElem && currentMessageElem.classList.contains('user-message4') && !isChoiceMade) {
return;
}*/
const next = document.getElementById(`message${window.currentMessage + 1}`);
if (next) {
next.style.display = 'flex';
setTimeout(() => {
next.classList.add('visible');
next.scrollIntoView({ behavior: 'smooth' });
}, 50);
window.currentMessage += 1;
//play audio here
var voiceId = next.getAttribute('voiceId');
if (voiceId) {
playMusic(`./ressources/sounds/${currentPassageId}${voiceId}.mp3`, "voice");
}
}
}
//BUTTON CHOICE
/*var isChoiceMade = false;
function Option1() {
document.getElementById("message13").style.display = "none";
isChoiceMade = true;
showNextMessage();
isChoiceMade = false;
}*/
//NEXT BLOC
function nextBloc(event) {
event.stopPropagation();
console.log("nextBloc function called");
SugarCube.Engine.play("1SE");
nextPartOfDay(); //▮▮▮
modVariable("add", "girl_stat", "elfie.trust", 4);
}