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"); 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() { function renderAnswerSelectionPanel() {
npcs_ids.forEach(element => { npcs_ids.forEach(element => {
console.log(element); console.log(element);
@ -89,6 +98,7 @@ async function initGame(){
//initSock(); //initSock();
renderAnswerSelectionPanel(); renderAnswerSelectionPanel();
renderInterogation(); renderInterogation();
setListenerToInterrogationNextBtn();
showInterogation(); showInterogation();
} }

View File

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