added listener to InterogationNextButton

This commit is contained in:
Djalim Simaila 2023-01-14 12:53:28 +01:00
parent 71aedd3854
commit 03ce844c6a
2 changed files with 17 additions and 10 deletions

View File

@ -16,6 +16,15 @@ function hideEmotionAndCulpritChoices(){
document.getElementsByClassName("emotion_and_culprit_choices")[0].classList.add("hidden");
}
function setListenerToInterrogationNextBtn(){
document.getElementById("interrogation_next_btn").addEventListener("click", showInterogationView)
}
function showInterogationView(){
hideInterogation();
showEmotionAndCulpritChoices();
}
function renderAnswerSelectionPanel() {
npcs_ids.forEach(element => {
console.log(element);
@ -89,6 +98,7 @@ async function initGame(){
//initSock();
renderAnswerSelectionPanel();
renderInterogation();
setListenerToInterrogationNextBtn();
showInterogation();
}

View File

@ -108,16 +108,6 @@ function areInputsValid(checkRoomCode) {
return true;
}
function startSoloGame() {
if (!areInputsValid(false)) {
return;
}
hideInvalidInputErrorMessage();
//TODO: code to start solo game
}
function createMultiPlayerRoom() {
if (!areInputsValid(false)) {
return;
@ -209,6 +199,13 @@ function changeTheme() {
}
async function startSoloGame(){
if (!areInputsValid(false)) {
return;
}
hideInvalidInputErrorMessage();
username = document.getElementById("game_username").value;
let data = {}
data["username"] = username;